2014-04-03 06:37:05

by Du, ChangbinX

[permalink] [raw]
Subject: [HELP] How to use ftrace to learn how a function is ivoked?

Hi, All,
I have a question for ftrace usage. It is that if I have a function A, then I want to
know how function A is ivoked?
I know ftrace can show me what sub-functions that A called by below steps:
# echo function_graph > current_tracer
????# echo function_A > set_graph_function
# cat trace
Then a call stack will show what functions A has called. But sometimes I want to
know how A is called. Is there a method to do this? Please help me!

Regards and Thanks!
Du, Changbin

????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?


2014-04-03 07:05:07

by Li, Aubrey

[permalink] [raw]
Subject: Re: [HELP] How to use ftrace to learn how a function is ivoked?

On 2014/4/3 14:36, Du, ChangbinX wrote:
> Hi, All,
> I have a question for ftrace usage. It is that if I have a function A, then I want to
> know how function A is ivoked?
> I know ftrace can show me what sub-functions that A called by below steps:
> # echo function_graph > current_tracer
>   # echo function_A > set_graph_function
> # cat trace
> Then a call stack will show what functions A has called. But sometimes I want to
> know how A is called. Is there a method to do this? Please help me!

dump_stack(), kprobe, AFAIK.

Thanks,
-Aubrey