Friday, January 26, 2018

Call Graph of User Program ( Running Program)


Call Graph of User Program ( Running Program)

There are so many tools for monitoring system call etc, but what if we want to see what function
written by us are called during execution.
GCC has one option
-finstrument-functions
which adds two functions  - 1 at enter and 2nd at exit.
Based on this no of tools has been made to ease this information.
Read https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html

http://www.logix.cz/michal/devel/CygProfiler/
http://ndevilla.free.fr/etrace/



if you dont want tool some crude method to so
1.https://balau82.wordpress.com/2010/10/06/trace-and-profile-function-calls-with-gcc/
2.https://linuxgazette.net/151/melinte.html
3.http://hacktalks.blogspot.in/2013/08/gcc-instrument-functions.html

Note: cygprofile is prefered by me as it can do running code profiling.

there is linux perf tool , but i dont like it output or its cryptic ( probably i have to explore more to
get it working properly).

For now sticking to cygprofile.



No comments:

Post a Comment

Featured Post

XDP - Getting Started with XDP (Linux)