summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_probe.h
diff options
context:
space:
mode:
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>2023-06-06 14:39:56 +0200
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>2023-06-06 14:39:56 +0200
commitfd26290ec89d4eae8570e027df3b8c519d285fd0 (patch)
treee76aefcd386e9270c620ff48c3c2b8676e3452db /kernel/trace/trace_probe.h
parenttracing/probes: Add $arg* meta argument for all function args (diff)
downloadlinux-fd26290ec89d4eae8570e027df3b8c519d285fd0.tar.xz
linux-fd26290ec89d4eae8570e027df3b8c519d285fd0.zip
tracing/probes: Add BTF retval type support
Check the target function has non-void retval type and set the correct fetch type if user doesn't specify it. If the function returns void, $retval is rejected as below; # echo 'f unregister_kprobes%return $retval' >> dynamic_events sh: write error: No such file or directory # cat error_log [ 37.488397] trace_fprobe: error: This function returns 'void' type Command: f unregister_kprobes%return $retval ^ Link: https://lore.kernel.org/all/168507476195.913472.16290308831790216609.stgit@mhiramat.roam.corp.google.com/ Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Diffstat (limited to 'kernel/trace/trace_probe.h')
-rw-r--r--kernel/trace/trace_probe.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
index e7fa2f2ed01c..01ea148723de 100644
--- a/kernel/trace/trace_probe.h
+++ b/kernel/trace/trace_probe.h
@@ -449,6 +449,7 @@ extern int traceprobe_define_arg_fields(struct trace_event_call *event_call,
C(BAD_EVENT_NAME, "Event name must follow the same rules as C identifiers"), \
C(EVENT_EXIST, "Given group/event name is already used by another event"), \
C(RETVAL_ON_PROBE, "$retval is not available on probe"), \
+ C(NO_RETVAL, "This function returns 'void' type"), \
C(BAD_STACK_NUM, "Invalid stack number"), \
C(BAD_ARG_NUM, "Invalid argument number"), \
C(BAD_VAR, "Invalid $-valiable specified"), \