4

I have had a ton of problems with SystemTap and am looking to test out ftrace. In specific, I am looking to monitor a function's arguments in real-time. I have read the ftrace documentation, but am having trouble piecing together the instructions to actually do this.

I would like to see something like this:

target_function(1, 0xABCD, 0xffff0000)

I assume I need to set set_ftrace_filter to the right traces, but after that how do I proceed? Please advise.

Farhan Yusufzai
  • 297
  • 6
  • 23
  • 1
    I don't know if Ftrace can do it by itself, but I have recently used Kprobe-based events with Ftrace to see the arguments of the particular called functions. See https://www.kernel.org/doc/Documentation/trace/kprobetrace.txt. You need to know how the arguments are passed to the function though (in which registers, etc.). This is usually doable. Hope this helps. – Eugene Dec 27 '17 at 19:56
  • For reference, `probe kernel.function("target_function") { println($$parms) }` would be the systemtap incantation to pretty-print the incoming parameters. This requires debugging information for the kernel, which is probably related to the problem Farhan had. – fche Aug 03 '18 at 23:25

0 Answers0