Re: [PATCH v11 tip 6/9] samples: bpf: simple non-portable kprobe filter example

From
Alexei Starovoitov <hidden>
Date
2015-03-30 01:00:01
Also in
lkml, netdev
Reply to
Jovi Zhangwei, 2015-03-30
On 3/29/15 5:34 PM, Jovi Zhangwei wrote:
quoted
+               snprintf(buf, sizeof(buf),
+                        "echo '%c:%s %s' >> /sys/kernel/debug/tracing/kprobe_events",
+                        is_kprobe ? 'p' : 'r', event, event);
+               err = system(buf);
Maybe we need to remember cleanup the kprobe_events in debugfs?
the real tracing tool should be cleaning it up. This is sample code.
I didn't want to overcomplicate it with a chain of ctrl-c handlers.
Notice patch 7 is simply doing signal(SIGINT, int_exit) and prints
histogram when process is terminated. The kprobe cleaning logic would
have interfere with this and overall would have made these samples
unnecessary complex.
Thread (12 messages) 12 messages, 2 authors, last reply 2015-03-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help