Comments (5)
don't have a /sys in the container at all
I have /sys in my container but ther is no /sys/kernel/debug/tracing
.
-v /sys/fs/debug/tracing:/sys/fs/debug/tracing
throws an error of
Error: failed to create containerd task: failed to create shim: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/sys/kernel/debug/tracing" to rootfs at "/sys/kernel/debug/tracing": mkdir /run/containerd/io.containerd.runtime.v2.task/k8s.io/mycontainername/rootfs/sys/kernel/debug/tracing: no such file or directory: unknown
The final solution is use -v /sys/:/sys/
from ebpf.
Are you using master
of the library? We've recently added support for /sys/kernel/tracing
:
Lines 446 to 462 in 5ea5368
when I use eBPF and tracepoints in container, the volume mount might be changed, and is not /sys/kernel/debug/tracing, what can I do in this circumastance?
Do you have an example for this? Unless there is a good reason, the container runtime should make /sys available to you if you configure it correctly.
from ebpf.
Anyway, still, is there any reason to make the tracefs path fixed?
My approach in general is to not make something configurable unless necessary. From your SO question it seems like you don't have a /sys
in the container at all? If yes I'd argue that the correct fix is to change your container runtime config.
from ebpf.
Did some more searching, seems like this is a common problem that some container runtimes solve, others don't. Since you've found a workaround I'll close the issue.
from ebpf.
@lmb Thanks for reply and apologize for not checkingout to main branch. getTracefsPath
Do support for /sys/kernel/tracing
.
Do you have an example for this? Unless there is a good reason, the container runtime should make /sys available to you if you configure it correctly.
Anyway, still, is there any reason to make the tracefs path fixed? Check this question I asked today for my example. https://stackoverflow.com/questions/75808955/error-mounting-sys-kernel-debug-tracing-to-rootfs
In this situation I cannot see /sys/kernel/debug/tracing
in my container though I can make it as a volume mount for the whole /sys
. But another way might be mount it into container as /host-sys/
directory, and that's when I wanna pass this path into link package.
However, I've noticed that the recent cilium/ebpf uses generics based on go 1.18, and our project uses go 1.17 so it statys at cilium/ebpf v0.8.1 and maybe the solution for me has to be overwrite the /sys
in container by volumemount. :)
from ebpf.
Related Issues (20)
- Getting empty buffer from `PT_REGS_PARM2(ctx)` in the read, write sys calls HOT 1
- `LINUX_KERNEL_VERSION` has no register bounds HOT 4
- btf: CO-RE against kernel module fails with invalid relocation HOT 6
- Cilium eBPF is having bad perfromances during tests HOT 1
- ErrMapIncompatible should contain additional information HOT 6
- Add support for XDP frags in the elf_reader HOT 2
- LoadAndAssign not loading all XDP programs and program array map statically initialized not populated HOT 2
- MapInfo struct does not contain BTF information
- Map.Lookup: invalid argument
- map: reduce allocations when (un)marshaling keys and values HOT 3
- CO-RE pragma add lots of memory overhead HOT 10
- bpf2go: type *btf.Pointer: not supported HOT 1
- btf: make loading kernel BTF cheaper HOT 1
- Warn about non-supported flags in map specs HOT 2
- Need to make socket_filter.go platform agnostic HOT 1
- BatchLookupAndDelete is much slower than iterator HOT 5
- map: use batch lookups in Map.Iterate() HOT 3
- map: don't unmarshal unnecessary items on batch lookup HOT 1
- btf: CO-RE relocation is very slow on bpf-next HOT 10
- Weird error " FnSeqWrite for program type Tracing not supported" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ebpf.