Re: [PATCH] tools/perf probe: Print a hint if adding a probe fails

From: Naveen N. Rao
Date: Mon Jun 21 2021 - 05:40:47 EST


Hi Arnaldo,

Arnaldo Carvalho de Melo wrote:
Em Thu, Jun 10, 2021 at 07:29:26PM +0900, Masami Hiramatsu escreveu:
Hi Naveen,

On Thu, 10 Jun 2021 15:14:42 +0530
"Naveen N. Rao" <naveen.n.rao@xxxxxxxxxxxxxxxxxx> wrote:

> Adding a probe can fail in a few scenarios. perf already checks for the
> address in the kprobe blacklist. However, the address could still be a
> jump label, or have a BUG_ON(). In such cases, it isn't always evident
> why adding the probe failed. Add a hint so that the user knows how to
> proceed.
>
Thanks for the report.

Since now there is <tracefs>/error_log, if you see any errors in registering
probe-events, perf probe should dump the error_log for the hint message.
Also, kprobes should return the correct different error code for each
errors.

Was there any followup on this? I think we should do as Masami suggests,
Naveen, could you do it?

Thanks for checking. We have been discussing this on the kernel side of things here (sorry, missed copying you on that):
http://lkml.kernel.org/r/20210610085617.1590138-1-naveen.n.rao@xxxxxxxxxxxxxxxxxx

I will work on the related changes to perf after the kernel changes.


Thanks,
Naveen