Hey all,
I wrote a parser for the callgrind profiling format in Guile Scheme. I
did so because I wanted a more gprof-like output than callgrind_annotate
gives, and because the robots that control my brain told me to.
It's not perfect by any means; it only parses callgrind files with one
event, for example, and requires the "name compressed" format, as
valgrind --tool=callgrind emits. But I post it to these lists because it
might be useful code for someone to use.
It outputs data like this:
cumulative self total
percent percent calls file:function
17.81 15.94 4200
gc-card.c:scm_i_sweep_card[/opt/guile/lib/libguile.so.17.0.1]
1272.79 7.47 74218 eval.c:ceval[/opt/guile/lib/libguile.so.17.0.1]
7.13 7.13 491863 ???:pthread_getspecific[/lib/libpthread-2.5.so]
6.19 6.19 191068 ???:pthread_mutex_lock[/lib/libpthread-2.5.so]
7.23 6.08 227140
ports.c:scm_getc[/opt/guile/lib/libguile.so.17.0.1]
4.07 4.07 191067
???:__pthread_mutex_unlock_usercnt[/lib/libpthread-2.5.so]
51.90 3.98 71290
gc-mark.c:scm_gc_mark_dependencies[/opt/guile/lib/libguile.so.17.0.1]
55.57 3.56 272312
gc-mark.c:scm_gc_mark[/opt/guile/lib/libguile.so.17.0.1]
28.21 2.92 93130
strings.c:scm_i_string_writable_chars[/opt/guile/lib/libguile.so.17.0.1]
6.25 1.74 82043
pairs.c:scm_cons[/opt/guile/lib/libguile.so.17.0.1]
And so on. As you can see it does not detect cycles; that would be an
interesting extension, but I have not yet found a useful way of breaking
cycles in C-based interpreted languages, so I currently have no need to
implement it.
Enjoy,
Andy.
--
http://wingolog.org/
_______________________________________________
Guile-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/guile-user