tracing/probes: Add BTF retval type support
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 6 Jun 2023 12:39:56 +0000 (21:39 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 6 Jun 2023 12:39:56 +0000 (21:39 +0900)
commitfd26290ec89d4eae8570e027df3b8c519d285fd0
treee76aefcd386e9270c620ff48c3c2b8676e3452db
parent18b1e870a49671745c31434b18bcfdd6f20cb6a1
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>
kernel/trace/trace_probe.c
kernel/trace/trace_probe.h