I Need a Build Machine
January 17, 2006 6:22 am GeneralI think I need a faster build machine, especially for building our conglomerate SUNWgnome-base-libs package, which is a collection of glib, cairo, atk, pango, gtk+, libglade, libart_lgpl and libgnomecanvas. That’s probably cause for concern enough, but what’s really worrying is the time it takes to build all the API documentation [yeah, I should use –disable-gtk-doc, but that’s not the point]. With a simple script –
#!/usr/sbin/dtrace -s pid22909:libxml2.so::entry { @[probefunc] = count(); } tick-1sec { printa(@); cleara(); }
it basically aggregates how many times functions in libxml2.so are called for the process id that corresponds to the xsltproc which does the doc generation. It then prints the totals out each second. Some sample output is here, and here for functions in libxslt.so. At one point, it was doing a staggering 15,000 xmlXPathCompOpEval calls a second while building the index pages.
DTrace is nice to be able to waste away the hours rather than looking at the build output….and of course I have absolutely no idea how to interpret these numbers – unfortunately DTrace can’t really help there, or whether this is anyway significant. I just wanted to see what was going on and you’d probably need to start looking at how long you spend in each function with the following script –
#!/usr/sbin/dtrace -s pid6562:libxml2.so::entry { self->ts = timestamp; } pid6562:libxml2.so::return /self->ts !=0/ { @cnt[probefunc] = count(); @time[probefunc] = sum(timestamp - self->ts); } tick-1sec { printf("%30s %15s %15s\n", "FUNC", "TIMES RAN", "TOTAL TIME"); setopt("aggsortpos", "2"); printa("%30s %15@d %15@d\n", @cnt, @time); printf("\n"); }
Unfortunately I haven’t got a new enough build on my laptop to be able to run the script above. Next time.