iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.57k stars 3.88k forks source link

softirqs fails to run #851

Open rickysarraf opened 7 years ago

rickysarraf commented 7 years ago

When running softirqs, I run into the following exception.

This issue is seen on Debian, with Debian packaged bpfcc.

rs@learner:~$ sudo softirqs 
write(/sys/kernel/debug/tracing/kprobe_events, "p:kprobes/p_blk_iopoll_softirq blk_iopoll_softirq") failed: No such file or directory
c_void_p(None)
Traceback (most recent call last):
  File "/usr/sbin/softirqs", line 118, in <module>
    b.attach_kprobe(event=softirqfunc, fn_name="trace_start")
  File "/usr/lib/python2.7/dist-packages/bcc/__init__.py", line 419, in attach_kprobe
    raise Exception("Failed to attach BPF to kprobe")
Exception: Failed to attach BPF to kprobe
2016-12-12 / 18:08:38 ♒♒♒  ☹  => 1  
rrs@learner:~$ sudo ls -l /sys/kernel/debug/tracing/kprobe_events
-rw-r--r-- 1 root root 0 Dec 11 18:49 /sys/kernel/debug/tracing/kprobe_events
2016-12-12 / 18:09:04 ♒♒♒  ☺  
drzaeus77 commented 7 years ago

Looks like the symbol blk_iopoll_softirq is available only up until Linux 4.4. Per the comment at L#114, the list may need to be adjusted until this tool makes use of tracepoints.

brendangregg commented 7 years ago

Thanks @drzaeus77; yes, this should be rewritten to use tracepoints (which requires Linux 4.7), and the old version moved to tools/old.

pchaigno commented 7 years ago

Fixed in #1091.