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

docker run fail,Error attaching fanotify #277

Closed
flyco2016 opened this issue Sep 22, 2023 · 3 comments
Closed

docker run fail,Error attaching fanotify #277

flyco2016 opened this issue Sep 22, 2023 · 3 comments

Comments

@flyco2016
Copy link

【env】
Ubuntu 18.04 server
【cmd】
docker run --rm -it --privileged -p 9435:9435 -v /ebpf_exporter/examples:/examples -v /sys/fs/cgroup:/sys/fs/cgroup:ro ebpf_exporter --config.dir=examples --config.names=biolatency
【result】
2023/09/22 09:14:08 Error attaching fanotify, using on-demand resolution instead: error calling fanotify_init: invalid argument
2023/09/22 09:14:08 Error attaching exporter: error creating module from "examples/biolatency.bpf.o" for config "biolatency": open examples/biolatency.bpf.o: no such file or directory

@bobrik
Copy link
Contributor

bobrik commented Sep 22, 2023

Fanotify is not an issue here, it falls back to the old on-demand mechanism.

This is an issue:

open examples/biolatency.bpf.o: no such file or directory

It looks like you didn't build examples before running:

make -C examples

@flyco2016
Copy link
Author

thanks a lot.

I try to build examples, but got an error:

root@vcs-node0:/ebpf_exporter# make -C examples
make: Entering directory '/ebpf_exporter/examples'
clang -mcpu=v3 -g -O2 -Wall -Werror -D__TARGET_ARCH_x86 -idirafter /usr/local/include -idirafter /usr/lib/llvm-6.0/lib/clang/6.0.0/include -idirafter /usr/include/x86_64-linux-gnu -idirafter /usr/include -I../include/x86 -c -target bpf shrinklat.bpf.c -o shrinklat.bpf.o
error: unknown target CPU 'v3'
Makefile:23: recipe for target 'shrinklat.bpf.o' failed
make: *** [shrinklat.bpf.o] Error 1
make: Leaving directory '/ebpf_exporter/examples'

@bobrik
Copy link
Contributor

bobrik commented Sep 25, 2023

Your clang 6.0 appears to be too old, which isn't surprising for Ubuntu 18.04. l don't think you'll have much success given your old environment, libbpf expects ubuntu 20.10 at least for BTF to work:

You can try removing -mcpu=v3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants