linux-stable/tools/testing/selftests/ftrace/test.d/dynevent
Masami Hiramatsu (Google) 25f00e40ce 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>
2024-03-07 00:27:34 +09:00
..
add_remove_btfarg.tc selftests/ftrace: Add BTF fields access testcases 2023-08-23 09:41:55 +09:00
add_remove_eprobe.tc selftests/ftrace: Add test case for GRP/ only input 2022-07-24 19:11:17 -04:00
add_remove_fprobe.tc selftests/ftrace: Add tracepoint probe test case 2023-06-06 21:39:56 +09:00
add_remove_kprobe.tc selftests/ftrace: Add test case for GRP/ only input 2022-07-24 19:11:17 -04:00
add_remove_synth.tc selftests/ftrace: Support ":README" suffix for requires 2020-06-16 10:42:47 -06:00
add_remove_tprobe.tc selftests/ftrace: Add tracepoint probe test case 2023-06-06 21:39:56 +09:00
clear_select_events.tc selftests/ftrace: Use $FUNCTION_FORK to reference kernel fork function 2020-10-27 16:44:18 -06:00
eprobes_syntax_errors.tc selftests/ftrace: Fix eprobe syntax test case to check filter support 2023-02-21 08:49:16 +09:00
fprobe_syntax_errors.tc tracing/probes: Support $argN in return probe (kprobe and fprobe) 2024-03-07 00:27:34 +09:00
generic_clear_event.tc selftests/ftrace: Use $FUNCTION_FORK to reference kernel fork function 2020-10-27 16:44:18 -06:00
test_duplicates.tc selftests/ftrace: fix dynamic_events dependency check 2022-10-18 14:27:23 -06:00
tprobe_syntax_errors.tc selftests/ftrace: Add tracepoint probe test case 2023-06-06 21:39:56 +09:00