[mdlug] [Request] (dis)recommendations for gcc function call sequence

Kristian Erik Hermansen kristian.hermansen at gmail.com
Tue Jan 29 04:05:49 EST 2008


On Jan 29, 2008 12:24 AM, Robert Meier <list1c30fe42 at bellsouth.net> wrote:
> C programmers,
>
> I am trying to map (i.e. determine) the history of function calls in c code.
> The compiler is gcc-2.96, with associated gdb, gprof, and most other tools.
> I can generally add any compile/link flags I need,
> but cannot practically spend the time to alter the source code.
>
> AFAIK, gprof, (gmon.out format) only collects a histogram (caller
> and duration) of calls, and discards the sequence of calls.
>
> What tools do you (dis)recommend?
> Is there a (set of) gcc options to record entry/exit of each function?

Have you heard of dtrace?  Not sure if it got ported to Linux yet.  If
not, check out SystemTap...
http://www.kristian-hermansen.com/wordpress/2008/01/24/dtrace-the-most-interesting-and-witty-tech-talk-i-have-ever-seen/

Of course, if you don't require local function tracing, then strace
and ltrace might get you most of the way there...at least in some
sense :-)
-- 
Kristian Erik Hermansen
"Know something about everything and everything about something."



More information about the mdlug mailing list