Here are a few options that you may have depending on the version of the kernel you are in:
Systemtap is the perfect way to check out the examples that come with stap, you can have something ready with minimal changes.
Oprofile - if you use older kernel versions, stap gives better accuracy compared to oprofile.
debugfs with the trace stack option is good for debugging. To do this, you need to enable mounting debugfs depth mounting debugfs , and then echo 1 > /proc/sys/kernel/stack_tracer_enabled .
strace - if you want to determine the system calls called by the user space program and some performance numbers. use strace -fc <program name>
Hope this helps!
source share