Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Failed to load BPF program b'trace_read_return': Permission denied #4051

Merged
merged 1 commit into from
Jun 16, 2022

Commits on Jun 16, 2022

  1. Fix: Failed to load BPF program b'trace_read_return': Permission denied

    ERROR:
    
     $ sudo ./xfsslower.py
     [...]
     80: (07) r4 += -104
     ; bpf_perf_event_output(ctx, bpf_pseudo_fd(1, -2), CUR_CPU_IDENTIFIER, &data, sizeof(data));
     81: (bf) r1 = r6
     82: (18) r3 = 0xffffffff
     84: (b7) r5 = 96
     85: (85) call bpf_perf_event_output#25
     invalid indirect read from stack R4 off -104+92 size 96
     processed 82 insns (limit 1000000) max_states_per_insn 0 total_states 4 peak_states 4 mark_read 3
    
     Traceback (most recent call last):
       File "/home/rongtao/Git/rtoax/bcc/tools/./xfsslower.py", line 271, in <module>
         b.attach_kretprobe(event="xfs_file_read_iter", fn_name="trace_read_return")
       File "/usr/lib/python3.9/site-packages/bcc/__init__.py", line 868, in attach_kretprobe
         fn = self.load_func(fn_name, BPF.KPROBE)
       File "/usr/lib/python3.9/site-packages/bcc/__init__.py", line 522, in load_func
         raise Exception("Failed to load BPF program %s: %s" %
     Exception: Failed to load BPF program b'trace_read_return': Permission denied
    
    Solve according to iovisor#2623
    Rtoax committed Jun 16, 2022
    Configuration menu
    Copy the full SHA
    4c9dfcb View commit details
    Browse the repository at this point in the history