Skip to contentSkip to conversation

Howto make perf probe work

DISCUSSION OSDepend 3 participants 8 messages Mar 31, 2013 – Apr 4, 2013 1 message not in the archive

lore
Share & tools
lore

OSDepend

author
#0 lore raw

Hi all,
Is there any way to use perf probe to add new tracepoint like pagefault enter/exit?

When I type perf probe fault:10
I always get the error as follow:

Debuginfo-analysis is not supported.
Error: Failed to add events. (-38)

What exactly i miss to get the perf probe work correctly?

Best,
Chen

2013-04-01

zhengchen

#2 lore raw
In reply to a message not in the archive
Quoted 4 lines

HI,
Please enable kprobe_event config option in the kernel and build the same and boot the board using it. Then please try to add event using perf probe command

Thanks very much for your reply, and I already enable DEBUG_KPROBE_EVENT in kernel. I did success in "perf probe handle_mm_fault".

But when i want to to "perf probe" other Kernel symbol, such as do_page_fault.
I came across other problems:
Added new event:
Failed to write event: Invalid argument
Error: Failed to add events. (-1)
And when i type perf probe page_fault_entry:
Kernel symbol 'page_fault_entry' not found.
Error: Failed to add events. (-2)
Please notice that "do_page_fault" and "page_fault_entry" are all Kernel symbols, which canbe find in "/proc/kallsyms", but not recorgonized by perf (or even kprobe). Any idea for that?

Best,
Chen

Quoted 10 lines
Quoted 10 lines · OSDepend

Hi all,
Is there any way to use perf probe to add new tracepoint like pagefault enter/exit? When I type perf probe fault:10
I always get the error as follow:
Debuginfo-analysis is not supported.
Error: Failed to add events. (-38)
What exactly i miss to get the perf probe work correctly?
Best,
Chen

author
#3 lore raw
Quoted 4 lines

HI,
Please enable kprobe_event config option in the kernel and build the same and boot the board using it. Then please try to add event using perf probe command

Thanks very much for your reply, and I already enable DEBUG_KPROBE_EVENT in kernel. I did success in "perf probe handle_mm_fault".

But when i want to to "perf probe" other Kernel symbol, such as do_page_fault.
I came across other problems:
Added new event:
Failed to write event: Invalid argument
Error: Failed to add events. (-1)
And when i type perf probe page_fault_entry:
Kernel symbol 'page_fault_entry' not found.
Error: Failed to add events. (-2)
Please notice that "do_page_fault" and "page_fault_entry" are all Kernel symbols, which canbe find in "/proc/kallsyms", but not recorgonized by perf (or even kprobe). Any idea for that?

Best,
Chen

Quoted 10 lines
Quoted 10 lines · OSDepend

Hi all,
Is there any way to use perf probe to add new tracepoint like pagefault enter/exit? When I type perf probe fault:10
I always get the error as follow:
Debuginfo-analysis is not supported.
Error: Failed to add events. (-38)
What exactly i miss to get the perf probe work correctly?
Best,
Chen

#4 lore raw
Quoted 8 lines
Quoted 4 lines

HI,
Please enable kprobe_event config option in the kernel and build the same and boot the board using it. Then please try to add event using perf probe command

Thanks very much for your reply, and I already enable DEBUG_KPROBE_EVENT in kernel. I did success in "perf probe handle_mm_fault".

Quoted 10 lines

But when i want to to "perf probe" other Kernel symbol, such as do_page_fault.
I came across other problems:
Added new event:
Failed to write event: Invalid argument
Error: Failed to add events. (-1)
And when i type perf probe page_fault_entry:
Kernel symbol 'page_fault_entry' not found.
Error: Failed to add events. (-2)
Please notice that "do_page_fault" and "page_fault_entry" are all Kernel symbols, which canbe find in "/proc/kallsyms", but not recorgonized by perf (or even kprobe). Any idea for that?

For some reason, do_page_fault() is marked as __kprobe on some arch which means it cannot be probed.

Thanks,
Namhyung

author
#5 lore raw
In reply to OSDepend

Hi Kim,

Quoted 18 lines
Quoted 8 lines
Quoted 4 lines

HI,
Please enable kprobe_event config option in the kernel and build the same and boot the board using it. Then please try to add event using perf probe command

Thanks very much for your reply, and I already enable DEBUG_KPROBE_EVENT in kernel. I did success in "perf probe handle_mm_fault".

Quoted 10 lines

But when i want to to "perf probe" other Kernel symbol, such as do_page_fault.
I came across other problems:
Added new event:
Failed to write event: Invalid argument
Error: Failed to add events. (-1)
And when i type perf probe page_fault_entry:
Kernel symbol 'page_fault_entry' not found.
Error: Failed to add events. (-2)
Please notice that "do_page_fault" and "page_fault_entry" are all Kernel symbols, which canbe find in "/proc/kallsyms", but not recorgonized by perf (or even kprobe). Any idea for that?

Quoted 4 lines

For some reason, do_page_fault() is marked as __kprobe on some arch which means it cannot be probed.
Thanks,
Namhyung

My kernel is runing on X86_64 arch, is there any chance for me to get the do_page_fault() entry/exit work? Or How can i add a exit tracepoint for handle_mm_fault()? so I can calculate the latency of that fault handle function?

Best,
Chen

#6 lore raw

Hi,

On Tue, 2 Apr 2013 17:11:01 +0800,

Quoted 4 lines
Quoted 2 lines

For some reason, do_page_fault() is marked as __kprobe on some arch which means it cannot be probed.

My kernel is runing on X86_64 arch, is there any chance for me to get the do_page_fault() entry/exit work?

nope, AFAIK.

Quoted 1 line

Or How can i add a exit tracepoint for handle_mm_fault()? so I can calculate the latency of that fault handle function?

Try "perf probe -a entry=handle_mm_fault -a exit=handle_mm_fault%return"

Thanks,
Namhyung

author
#7 lore raw
In reply to OSDepend

Hi,

Quoted 3 lines
Quoted 1 line

Or How can i add a exit tracepoint for handle_mm_fault()? so I can calculate the latency of that fault handle function?

Try "perf probe -a entry=handle_mm_fault -a exit=handle_mm_fault%return"

That's works nicely for me!
Thanks a lot!!

Quoted 6 lines

On Tue, 2 Apr 2013 17:11:01 +0800,

Quoted 4 lines
Quoted 2 lines

For some reason, do_page_fault() is marked as __kprobe on some arch which means it cannot be probed.

My kernel is runing on X86_64 arch, is there any chance for me to get the do_page_fault() entry/exit work?

nope, AFAIK.

Is there any guide for us to decide which tracepoint (or other kernel symbol) canbe used, and which cannot? For some of the kallsyms cannot be used directly. Such as do_raw_spin_lock.
perf probe -a test=do_raw_spin_lock
Fatal: Kernel symbol 'do_raw_spin_lock' not found - probe not added.

Best,
Chen

#8 lore raw

Hi,

Quoted 10 lines · OSDepend
Quoted 6 lines · OSDepend
Quoted 4 lines
Quoted 2 lines

For some reason, do_page_fault() is marked as __kprobe on some arch which means it cannot be probed.

My kernel is runing on X86_64 arch, is there any chance for me to get the do_page_fault() entry/exit work?

nope, AFAIK.

Is there any guide for us to decide which tracepoint (or other kernel symbol) canbe used, and which cannot? For some of the kallsyms cannot be used directly. Such as do_raw_spin_lock.
perf probe -a test=do_raw_spin_lock
Fatal: Kernel symbol 'do_raw_spin_lock' not found - probe not added.

Hmm.. it seems not, currently.

Maybe we can change perf to output the symbol was not able to be probed after checking symbol address and it's between __kprobes_text_{start,end}.

I'll take a look at it later.

Thanks,
Namhyung