iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zfsslower wrongly tries to attach to non-existant zpl_read (regression of #1248)

seb314 opened this issue · comments

If zpl_read / zpl_write are not available, zfsslower fails to start with

cannot attach kprobe, probe entry may not exist
Traceback (most recent call last):
  File "/nix/store/3q9p3rp82vs05n7kgz6kj6fsy3ysis27-bcc-0.29.1/share/bcc/tools/.zfsslower-wrapped", line 275, in <module>
    b.attach_kprobe(event="zpl_read", fn_name="trace_rw_entry")
  File "/nix/store/3q9p3rp82vs05n7kgz6kj6fsy3ysis27-bcc-0.29.1/lib/python3.11/site-packages/bcc-0.29.1-py3.11.egg/bcc/__init__.py", line 855, in attach_kprobe
Exception: Failed to attach BPF program b'trace_rw_entry' to kprobe b'zpl_read', it's not traceable (either non-existing, inlined, or marked as "notrace")

I think this is a regression of #1248
The original fix #1324 assumed that BPF.get_kprobe_functions checks the given regex against any substring of the function name, but 2b203ea later changed get_kprobe_functions to do re.fullmatch instead.

I've run into this on a recent version of NixOS, and updating the regexes with a .* suffix appears to fix it. I'll create a PR with the fix.