From d3f5ea2aa3a3652d76570de5496103a9629df959 Mon Sep 17 00:00:00 2001 From: Adam Shapiro Date: Fri, 13 Oct 2023 09:44:20 -0400 Subject: [PATCH 1/3] Fixed missing column in event table if there are no software resets present. --- python/fusion_engine_client/analysis/analyzer.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/python/fusion_engine_client/analysis/analyzer.py b/python/fusion_engine_client/analysis/analyzer.py index 8a0ff7e7..4d8b7df6 100755 --- a/python/fusion_engine_client/analysis/analyzer.py +++ b/python/fusion_engine_client/analysis/analyzer.py @@ -2082,11 +2082,8 @@ def plot_events(self): return times_before_resets = self.extract_times_before_reset() - if (len(times_before_resets) > 0): - table_columns = ['Relative Time (s)', 'System Time (s)', 'Previous P1 Time (s)', 'Event', 'Flags', - 'Description'] - else: - table_columns = ['Relative Time (s)', 'System Time (s)', 'Event', 'Flags', 'Description'] + table_columns = ['Relative Time (s)', 'System Time (s)', 'Previous P1 Time (s)', 'Event', 'Flags', + 'Description'] rows = [] system_t0_ns = self.reader.get_system_t0_ns() From 9ea143bd292f3518cf149798f9e565888b933be2 Mon Sep 17 00:00:00 2001 From: Adam Shapiro Date: Fri, 13 Oct 2023 09:48:46 -0400 Subject: [PATCH 2/3] Include reset name in message repr() if recognized. --- .../fusion_engine_client/messages/control.py | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/python/fusion_engine_client/messages/control.py b/python/fusion_engine_client/messages/control.py index ff74389c..08fa3401 100644 --- a/python/fusion_engine_client/messages/control.py +++ b/python/fusion_engine_client/messages/control.py @@ -345,11 +345,36 @@ def calcsize(cls) -> int: def __repr__(self): result = super().__repr__()[:-1] - result += f', mask=0x{self.reset_mask:08X}]' + mask_text = f'0x{self.reset_mask:08X}' + name = self._get_known_mask_name(self.reset_mask) + if name is not None: + mask_text += f' ({name})' + result += f', mask={mask_text}]' return result def __str__(self): - return 'Reset Request [mask=0x%08x]' % self.reset_mask + mask_text = f'0x{self.reset_mask:08X}' + name = self._get_known_mask_name(self.reset_mask) + if name is not None: + mask_text += f' ({name})' + return f'Reset Request [mask={mask_text}]' + + @classmethod + def _get_known_mask_name(cls, mask) -> str: + if mask == cls.HOT_START: + return 'HOT_START' + elif mask == cls.WARM_START: + return 'WARM_START' + elif mask == cls.PVT_RESET: + return 'PVT_RESET' + elif mask == cls.COLD_START: + return 'COLD_START' + elif mask == cls.FACTORY_RESET: + return 'FACTORY_RESET' + elif mask & cls.DIAGNOSTIC_LOG_RESET: + return 'DIAGNOSTIC_LOG_RESET' + else: + return None class VersionInfoMessage(MessagePayload): From 6b0503e7e3950367cbc0d7cb212bc19da2d4952e Mon Sep 17 00:00:00 2001 From: Adam Shapiro Date: Fri, 13 Oct 2023 09:52:40 -0400 Subject: [PATCH 3/3] Formatting cleanup. --- python/fusion_engine_client/parsers/mixed_log_reader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/fusion_engine_client/parsers/mixed_log_reader.py b/python/fusion_engine_client/parsers/mixed_log_reader.py index b1497d82..e069e6a9 100644 --- a/python/fusion_engine_client/parsers/mixed_log_reader.py +++ b/python/fusion_engine_client/parsers/mixed_log_reader.py @@ -104,7 +104,8 @@ def __init__(self, input_file, warn_on_gaps: bool = False, show_progress: bool = self.max_bytes = max_bytes # Open the companion index file if one exists, otherwise index the file. - self._original_index = fast_indexer.fast_generate_index(input_path, force_reindex=ignore_index, save_index=save_index, max_bytes=max_bytes) + self._original_index = fast_indexer.fast_generate_index(input_path, force_reindex=ignore_index, + save_index=save_index, max_bytes=max_bytes) self.next_index_elem = 0 self.index = self._original_index[self.message_types][self.time_range] self.filtered_message_types = len(np.unique(self._original_index.type)) != \