Skip to content

Commit

Permalink
Output info for using diagnostics.p1log as profiling fallback.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Diamond committed Sep 23, 2023
1 parent bb59945 commit ebb7f04
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
14 changes: 14 additions & 0 deletions python/fusion_engine_client/analysis/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def __init__(self,

self.plots = {}
self.summary = ''
self.profiling_present = False

self._mapbox_token_missing = False

Expand Down Expand Up @@ -2070,6 +2071,7 @@ def plot_legacy_atlas_system_status_profiling(self):
if len(data.system_time) == 0:
self.logger.info('No system profiling data available. Skipping plot.')
return
self.profiling_present = True

time = data.system_time - self.system_t0

Expand Down Expand Up @@ -2124,6 +2126,7 @@ def plot_execution_stats_profiling(self):
if len(data.system_time_sec) == 0:
self.logger.info('No execution profiling stats data available. Skipping plot.')
return
self.profiling_present = True

# Read the last task name message to map IDs to names.
params = copy.deepcopy(self.params)
Expand Down Expand Up @@ -2412,6 +2415,7 @@ def plot_counter_profiling(self, device_uart):
if len(data.system_time_sec) == 0:
self.logger.info('No counter profiling stats data available. Skipping execution stats plot.')
return
self.profiling_present = True

# Read the last task name message to map IDs to names.
params = copy.deepcopy(self.params)
Expand Down Expand Up @@ -2506,6 +2510,7 @@ def plot_free_rtos_system_status_profiling(self):
if len(data.system_time_sec) == 0:
self.logger.info('No FreeRTOS system profiling data available. Skipping plot.')
return
self.profiling_present = True

# Read the last task name message to map IDs to names.
params = copy.deepcopy(self.params)
Expand Down Expand Up @@ -2573,6 +2578,7 @@ def plot_measurement_pipeline_profiling(self):
if len(data.system_time) == 0:
self.logger.info('No measurement profiling data available. Skipping plot.')
return
self.profiling_present = True

# Read the last pipeline definition message to map IDs to names.
params = copy.deepcopy(self.params)
Expand Down Expand Up @@ -2614,6 +2620,7 @@ def plot_execution_profiling(self):
if len(data.points) == 0:
self.logger.info('No execution profiling data available. Skipping code execution plot.')
return
self.profiling_present = True

# Read the last pipeline definition message to map IDs to names.
params = copy.deepcopy(self.params)
Expand Down Expand Up @@ -3309,6 +3316,13 @@ def main():
analyzer.plot_execution_profiling()
analyzer.plot_execution_stats_profiling()
analyzer.plot_counter_profiling(options.device_uart)
if not analyzer.profiling_present and options.original:
diag_path = os.path.join(os.path.dirname(input_path), 'diagnostics.p1log')
if os.path.exists(diag_path):
_logger.info('*' * 80 + '\n\n' +
f'No profiling available in {input_path}.\n'
f'use {diag_path} to generate plots with profiling.' +
'\n\n' + '*' * 80)
else:
if len(options.plot) == 0:
_logger.error('No plot names specified.')
Expand Down
5 changes: 3 additions & 2 deletions python/fusion_engine_client/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
# by extract_fusion_engine_log().
'input.p1log',
'fusion_engine.p1log',
# diagnostic log is giving priority for internal tools.
'output/diagnostics.p1log',
# Current Atlas produces `output/diagnostics.p1log` with profiling data as backup in case
# `output/fusion_engine.p1log` has profiling turned off. Specify it explicitly as the log argument to use it.
# 'output/diagnostics.p1log',
'output/fusion_engine.p1log',
# v- Mixed FE and other data files.
# Note that we prioritize the input.66.bin file over the others. For logs containing a single mixed serial
Expand Down

0 comments on commit ebb7f04

Please sign in to comment.