Find all FMMS kernel TTGIR files in the dump directory and process them.
(dump_dir: str)
| 224 | |
| 225 | |
| 226 | def find_and_process_ttgir(dump_dir: str) -> None: |
| 227 | """Find all FMMS kernel TTGIR files in the dump directory and process them.""" |
| 228 | if not os.path.isdir(dump_dir): |
| 229 | print(f"Error: directory not found: {dump_dir}", file=sys.stderr) |
| 230 | sys.exit(1) |
| 231 | |
| 232 | ttgir_files = glob.glob(os.path.join(dump_dir, "**", "*.ttgir"), recursive=True) |
| 233 | if not ttgir_files: |
| 234 | print(f"No .ttgir files found in {dump_dir}", file=sys.stderr) |
| 235 | sys.exit(1) |
| 236 | |
| 237 | fmms_files = [f for f in ttgir_files if "fused_mm_sample" in os.path.basename(f)] |
| 238 | if not fmms_files: |
| 239 | print( |
| 240 | f"No fused_mm_sample*.ttgir files found in {dump_dir}. " |
| 241 | f"Found: {[os.path.basename(f) for f in ttgir_files]}", |
| 242 | file=sys.stderr, |
| 243 | ) |
| 244 | sys.exit(1) |
| 245 | |
| 246 | for ttgir_file in fmms_files: |
| 247 | try: |
| 248 | print(f"Processing {ttgir_file}...") |
| 249 | add_proton_records(ttgir_file) |
| 250 | except AssertionError as e: |
| 251 | print(f"Skipping {ttgir_file}: {e}") |
| 252 | except Exception as e: |
| 253 | print(f"Error processing {ttgir_file}: {e}") |
| 254 | raise |
| 255 | |
| 256 | |
| 257 | if __name__ == "__main__": |
no test coverage detected