Re: [PATCH perf/core ] perf-probe: Check kprobes blacklist when adding new events

From: Arnaldo Carvalho de Melo
Date: Wed Feb 25 2015 - 16:50:21 EST


Em Thu, Feb 19, 2015 at 11:31:13PM +0900, Masami Hiramatsu escreveu:
> Recent linux kernel provides a blacklist of the functions which
> can not be probed. perf probe can now check this blacklist before
> setting new events and indicate better error message for users.
>
> Without this patch,
> ----
> # perf probe --add vmalloc_fault
> Added new event:
> Failed to write event: Invalid argument
> Error: Failed to add events.
> ----
> With this patch
> ----
> # perf probe --add vmalloc_fault
> Added new event:
> Warning: Skipped probing on blacklisted function: vmalloc_fault
> ----
>
> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx>
> Reported-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

Ok, I really need to use a newer kernel on this RHEL7 box, a 4.0-rc one,
as when trying this I saw no difference, but probably that is because it
didn't find the kprobes blacklist, tried inserting the probe and then
failed with the exact previous message...

A follow up patch could try to improve the situation by saying something
like:

"Failed to insert the probe, maybe this is a blacklisted function and
you're running an old kernel?

Please check the function definition, it should not be marked as, for
instance:

NOKPROBE_SYMBOL(vmalloc_fault);"

Anyway, applying your patch, clearly an improvement when the blacklist
is available.

Thanks,

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/