libbpf / bpftool

Automated upstream mirror for bpftool stand-alone build.
Other
406 stars 72 forks source link

can't mount BPF file system to pin the object #89

Closed lysShub closed 1 year ago

lysShub commented 1 year ago
root@DESKTOP-H3MBKRR:/home/lys/work/bpf# sudo bpftool prog load hello.o tracepoint
Error: can't mount BPF file system to pin the object (tracepoint): mount --make-private . failed: Invalid argument

is bpftool bug?

qmonnet commented 1 year ago

I don't think so. It looks like you're trying to pin the program in your current working directory, and bpftool fails to mount it as a virtual BPF file system (which is expected).

You probably have a BPF file system mounted already, usually at /sys/fs/bpf/:

$ mount | grep bpf
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)

Try pinning there instead:

# bpftool prog load hello.o /sys/fs/bpf/tracepoint
qmonnet commented 1 year ago

Given that it's been close to three months and I suspect there's no bug, I'll close the issue. Let me know if the problem subsists.