how to collect information regarding function calls in run time?

Pedro Terra Delboni terra0009 at gmail.com
Wed Apr 3 15:25:02 EDT 2019


Hello!

I have a question about profiling, please, let me know if this is not
the right mailing list to post these kind of questions.

Is there a way for me to record how many times each specific direct
call to a function happened?
I've seen ways of profiling the kernel that calculate how much time
the system spent in each function, but having a bit more information
related to calls would be really good.

I would like to know, for every function call that happens in run
time, who called it (it's for a project in my University).

I've also seen (I may be mistaken here) that by compiling the kernel
with perf, each function will start with a stub call which can be used
for profiling purposes.
I was thinking in using this stub to plug a function to dump
(somewhere) the return address before it's own (so I can collect the
info about where the call came from).
I wonder if changing every stub calls in all functions to dump its
return address wouldn't create too much of a latency impact to the
point of skewing the control flow of the execution,
or even making it nonviable.

Thanks in advance, any help would be great!
If this is not the right place to post this question, I would
appreciate if anyone could point me to the right place.

Thanks
Pedro



More information about the Kernelnewbies mailing list