3 ms·
Found the script, so here it is for posterity! #!/bin/sh if [ -z "$1" ]; then echo "usage (in zsh): 'strace -f program -o logi; okular =(dot -Tp
by _flux 2y ago
Found the script, so here it is for posterity!
#!/bin/sh
if [ -z "$1" ]; then
echo "usage (in zsh): 'strace -f program -o logi; okular =(dot -Tpdf =($0 logi))'"
exit 0
fi
LOG=$1
echo 'digraph {'
echo 'rankdir="LR";'
sed 's/^\([0-9]*\) \(<... \)\?\(clone\|vfork\).*= \([0-9]*\)/\1 -> \4;/; t; d' "$LOG"
sed '/ENOENT/ d; s/^\([0-9]*\) execve("[^"]*\/\([^"]*\)".*/\1 [label="\1: \2"];/; t; d' "$LOG" | sort | uniq
sed '/ENOENT/ d; s/^\([0-9]*\) openat([^,]*, "\([^"]*\)", .*\(O_WRONLY\|O_RDWR\).*/\1 -> "\2"; "\2" [shape=rectangle];/; t; d' "$LOG" | sort | uniq
echo '}'
I imagine it makes a graph of executed programs along the files they created, perhaps it even works in some cases.