lkml.org 
[lkml]   [2013]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf probe: Enhance error message on non-kprobeable functions
(2013/04/05 11:39), Namhyung Kim wrote:
> From: Namhyung Kim <namhyung.kim@lge.com>
>
> Some of kernel functions are not allowed to be used by kprobes for
> some reason, so they're marked as __kprobe on the source code and
> reside on ".kprobes.text" section.
>
> However normal users which only see /proc/kallsyms don't know about
> them and would get only general error message when tried to add a
> probe on such function.

Right,

>
> $ sudo ./perf probe do_page_fault
> Failed to find path of kernel module.
> Added new event:
> Failed to write event: Invalid argument
> Error: Failed to add events. (-1)
>
> This patch enhance it by checking the special kprobes section address
> and if to-be-probed function address is in the section, it would print
> like this:
>
> $ sudo ./perf probe do_page_fault
> Failed to find path of kernel module.
> Added new event:
> Failed to write event: kprobes is not allowed for this function.
> Error: Failed to add events. (-1)

Yeah, I agree that it is hard to know for perf probe users.
However, your implementation strongly depends on the current kernel,
I think we'd better export __kprobe_text_* as macros of symbol strings
in kprobes.h, and reuse it.
Or, export such no-probe symbols via /sys/kernel/debug/kprobes/noprobe_syms

Thank you,


--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com




\
 
 \ /
  Last update: 2013-04-05 11:01    [W:0.029 / U:1.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site