I'm in that situation with the Linux “perf tools”, which I'm trying to use in my research. I'm reasonably familiar with strace and ltrace, which trace system and library calls, respectively, but I don't really care about these: I just want to trace the “local” function calls so that I can get a handle on how perf works. That should be easy, right?
Mmm... no. It turns out that I'm not the first person to have this problem.
One of the suggestions on StackOverflow, from Johannes Schaub, is to use readelf to identify all the functions symbols, set breakpoints for all of them in gdb, and retrieve the last frame of the backtrace at each breakpoint. Nice idea. Horribly slow, but a nice idea.
So, since I've been using OpenGrok to browse the kernel tools source, so it would be nice to be able to integrate with it, like this:
OpenGrok with 'ftrace' |
Callgraph from 'ftrace' via GraphViz 'dot' |
It's horribly slow, it's hacky, but does what I need for the time being.
No comments:
Post a Comment