Commit 61c7ff1e authored by Brendan Gregg's avatar Brendan Gregg

shorten syncsnoop example

parent 5853e72e
...@@ -16,12 +16,10 @@ from bcc import BPF ...@@ -16,12 +16,10 @@ from bcc import BPF
# load BPF program # load BPF program
b = BPF(text = """ b = BPF(text = """
int do_sync(void *ctx) { void kprobe__sys_sync(void *ctx) {
bpf_trace_printk("sync()\\n"); bpf_trace_printk("sync()\\n");
return 0;
}; };
""") """)
b.attach_kprobe(event="sys_sync", fn_name="do_sync")
# header # header
print("%-18s %s" % ("TIME(s)", "CALL")) print("%-18s %s" % ("TIME(s)", "CALL"))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment