dmesg2dot

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

dmesg2dot

Bruno Carnazzi
   Hi misc,

Here's a small awk script that convert OpenBSD dmesg into graphviz dot format.
Just for sharing and/or comments...

Best regards,

Bruno.

#!/usr/bin/awk -f

BEGIN { unknow=0; print "digraph dmesg {"; }
{ if ($2 == "at") {
    dev=$1; pdev=$3; desc=$0;
    sub(/:/, "", pdev);
    gsub(/"/, "\\\"", desc);
    if (dev == "\"unknown\"") { dev = "unknow" unknow++; }
    printf "\t%s [label=\"%s\"];\n\t%s -> %s;\n", dev, desc, pdev, dev;
    }
}
END { print "}" }