Skip to content

Commit 9c556b7

Browse files
rnavmhiramat
authored andcommitted
trace/kprobe: Display the actual notrace function when rejecting a probe
Trying to probe update_sd_lb_stats() using perf results in the below message in the kernel log: trace_kprobe: Could not probe notrace function _text This is because 'perf probe' specifies the kprobe location as an offset from '_text': $ sudo perf probe -D update_sd_lb_stats p:probe/update_sd_lb_stats _text+1830728 However, the error message is misleading and doesn't help convey the actual notrace function that is being probed. Fix this by looking up the actual function name that is being probed. With this fix, we now get the below message in the kernel log: trace_kprobe: Could not probe notrace function update_sd_lb_stats.constprop.0 Link: https://lore.kernel.org/all/20231214051702.1687300-1-naveen@kernel.org/ Signed-off-by: Naveen N Rao <naveen@kernel.org> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
1 parent a39b6ac commit 9c556b7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/trace/trace_kprobe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,8 @@ static int __register_trace_kprobe(struct trace_kprobe *tk)
487487
return -EINVAL;
488488

489489
if (within_notrace_func(tk)) {
490-
pr_warn("Could not probe notrace function %s\n",
491-
trace_kprobe_symbol(tk));
490+
pr_warn("Could not probe notrace function %ps\n",
491+
(void *)trace_kprobe_address(tk));
492492
return -EINVAL;
493493
}
494494

0 commit comments

Comments
 (0)