a short script for static function call tracing
Masami Hiramatsu
mhiramat@redhat.com
Thu May 8 21:53:00 GMT 2008
Hi,
Here is a short script for static function call tracing.
Note: currently, this may shows some(or many) false positives.
this is based on cscope, so before using, in kernel tree,
$ make cscope
and
$ ./trace_symbols a_symbol
For example)
$ ./trace_symbols relay_switch_subbuf
(output thousands of functions...)
To avoid tracing unneeded path, you can add IGNORE symbols
For example)
$ IGNORE="__mod_timer" ./trace_symbols relay_switch_subbuf
__mod_timer
BUG
BUG_ON
unlikely
likely
__acquires
__releases
__volatile__
__attribute__
asm
alternative
defined
__asm__
--- above symbols are ignored ---
relay_switch_subbuf is calling __mod_timer smp_mb subbuf_start unlikely waitqueue_active
smp_mb is calling barrier mb
barrier is calling __memory_barrier __volatile__
__memory_barrier is calling
mb is calling alternative
subbuf_start is calling
waitqueue_active is calling list_empty
list_empty is calling
Total: 7 symbols are called from relay_switch_subbuf
This means relay_switch_subbuf itself is a very simple function, but __mod_timer
may call many functions...
Thanks,
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: trace_symbols
URL: <http://sourceware.org/pipermail/systemtap/attachments/20080508/3915a5cc/attachment.ksh>
More information about the Systemtap
mailing list