#!/usr/bin/env python3 """ parse_strace.py - turn a raw strace log into "what did this ELF touch?" tables. Input : an strace log produced with at least strace -f -y -yy -s 256 -e trace=%file,%desc,%process,%network Output: a Markdown report on stdout (or -o FILE) plus optional CSVs. Written for python3.9 (RHEL 9 system python), stdlib only. """ import argparse import collections import csv import os import re import sys # ---------------------------------------------------------------- patterns -- # "1234 12345.678901 openat(AT_FDCWD, \"/etc/hosts\", O_RDONLY) = 3 <0.000012>" LINE_RE = re.compile( r"""^(?P\d+)\s+ # -f gives a pid column (?:(?P