Kprobes: Difference between revisions

→Kernel configuration: add necessary FTRACE options
Line 9: Line 9:


==Working with kprobes==
==Working with kprobes==
List kernel functions suitable for probing with <tt>perf probe -L</tt>. Kprobes can be enabled either by writing a definition to
The primary means for working with kprobes from userspace is [[sysfs]] and the [[perf]] tool.
{|class="wikitable"
! Task !! sysfs !! perf
|-
| List enabled kprobes || <tt>cat /sys/kernel/debug/tracing/kprobe_events</tt> || <tt>perf probe -l</tt>
|-
| Enable kprobe || <tt>echo > /sys/kernel/debug/tracing/kprobe_events</tt>
|| <tt>perf probe -a</tt>
|}


===Kprobe definition===
===Kprobe definition===