Skip to content

Commit

Permalink
fix: [crashlogs] unique entries in summary file
Browse files Browse the repository at this point in the history
  • Loading branch information
cvandeplas committed Nov 26, 2024
1 parent 9f352b3 commit 440febf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sysdiagnose/parsers/crashlogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def process_ips_lines(lines: list) -> dict:
def parse_summary_file(self, path: str) -> list | dict:
logger.info(f"Parsing summary file: {path}")
result = []
seen = set() # to ensure unique entries
with open(path, 'r') as f:
for line in f:
if not line.startswith('/'):
Expand All @@ -211,7 +212,11 @@ def parse_summary_file(self, path: str) -> list | dict:
'path': path,
'warning': 'Timezone may be wrong, parsed local time as same timezone as sysdiagnose creation time'
}
if entry['path'] in seen:
continue
seen.add(entry['path'])
result.append(entry)

return result

def split_thread_crashes_with_arm_thread_state(line) -> dict:
Expand Down

0 comments on commit 440febf

Please sign in to comment.