-
- Downloads
tracing/probes: Support $argN in return probe (kprobe and fprobe)
Support accessing $argN in the return probe events. This will help users to record entry data in function return (exit) event for simplfing the function entry/exit information in one event, and record the result values (e.g. allocated object/initialized object) at function exit. For example, if we have a function `int init_foo(struct foo *obj, int param)` sometimes we want to check how `obj` is initialized. In such case, we can define a new return event like below; # echo 'r init_foo retval=$retval param=$arg2 field1=+0($arg1)' >> kprobe_events Thus it records the function parameter `param` and its result `obj->field1` (the dereference will be done in the function exit timing) value at once. This also support fprobe, BTF args and'$arg*'. So if CONFIG_DEBUG_INFO_BTF is enabled, we can trace both function parameters and the return value by following command. # echo 'f target_function%return $arg* $retval' >> dynamic_events Link: https://lore.kernel.org/all/170952365552.229804.224112990211602895.stgit@devnote2/ Signed-off-by:Masami Hiramatsu (Google) <mhiramat@kernel.org>
Showing
- kernel/trace/trace.c 1 addition, 0 deletionskernel/trace/trace.c
- kernel/trace/trace_eprobe.c 3 additions, 3 deletionskernel/trace/trace_eprobe.c
- kernel/trace/trace_fprobe.c 39 additions, 16 deletionskernel/trace/trace_fprobe.c
- kernel/trace/trace_kprobe.c 46 additions, 10 deletionskernel/trace/trace_kprobe.c
- kernel/trace/trace_probe.c 156 additions, 21 deletionskernel/trace/trace_probe.c
- kernel/trace/trace_probe.h 27 additions, 1 deletionkernel/trace/trace_probe.h
- kernel/trace/trace_probe_tmpl.h 5 additions, 5 deletionskernel/trace/trace_probe_tmpl.h
- kernel/trace/trace_uprobe.c 6 additions, 6 deletionskernel/trace/trace_uprobe.c
- tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc 4 additions, 0 deletions.../selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc
- tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc 2 additions, 0 deletions...ng/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
Loading
Please register or sign in to comment