-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
uprobes in Kubernetes #1516
Comments
Do any uprobes work at all? Say, on libc or something? There is a known issue with uprobes and some container runtimes, I vaguely remember it having something to do with the overlay. I’m on mobile right now but could you see if there’s a prior issue here on bcc mentioning this? |
Right, overlayfs does not support uprobe at all.
For overlayfs, the "readpage" is not defined, and !shmem_mapping is true, so |
Close the issue as it is really a file-system issue. |
Is this still an issue with overlayfs? @yonghong-song |
The issue is fixed in 4.17 or 4.18 kernel, I forgot which exact version. |
@yonghong-song , would you be able to point to the overlayfs readpage fix ? I am trying to use uprobes on the system with kernel 4.15.x and overlayfs , was wondering what was the fix if I would be able to port it. |
The fix is https://lore.kernel.org/patchwork/patch/890633/. |
thanks a lot |
Hi, Maybe you (@yonghong-song @ggaurav10 @sergei-la ?) are aware about any similar problems in such situations with the newer version of kernel? I have a similar setup with a two Kubernetes containers, one is running an application, another "profiling" privileged container is attached to the host pid namespace. Everything is happening on linux kernel 4.19.43 on overlayfs2, which supposed to have the fix mentioned above (I've checked, the commit refers to 4.17). But in my case there are no errors, bcc creates a uprobe an attaches correctly, but do not catches any probe hits. In fact even if I create the same uprobe via perf I don't see probe hits in |
In kubernetes container, could you trace kernel function |
If I understand correctly, this function is defined as static, Is it even possible to trace it? E.g. when I'm trying to use ftrace for that (the same for kprobe_events):
|
You should be able to trace it. But in this case, I do get an error message
You could recompile your kernel with CONFIG_KPROBE_EVENTS_ON_NOTRACE and try again. |
Sorry for long delay.
Nope, unfortunately in this case it's not possible. I'll try to investigate more, since I've got an impression that something in the K8S configuration was changed, and then return if there will be any results. |
Here we use kernel 5.10.76, and find the same issue for containerized apps as @erthalion , bcc uprobe can be attached but not hitting. |
Even for me, epbf attaches to the container but none of the probes are called (in plain docker containers too) Is there any trick to making it work? Or can someone please help and explain the root cause of this issue? The issue is persisting in 5.15 Linux too Thanks! |
I have the same issue on kernel 6.2, Kubernetes installed with More specifically, I am trying to debug a process from the binary In other words, I can make it work roughly like this: ssh node
docker ps | grep -v POD # find out the relevant container ID from this
docker restart 2863e0cde365 A manually started container ( |
i am trying to run BCC tool ugc.py for node and java apps which are running in separate containers in kubernetes. The BCC tools are packaged in another privileged container which is running in same PID namespace as host, so they can see the running apps.
I am getting below error:
perf_event_open(/sys/kernel/debug/tracing/events/uprobes/p__usr_local_bin_node_0xf5a794_6052_bcc_12351/id): Input/output error
The offcputime tool runs properly though and I am able to generate the expected flamegraphs showing full stacks of the apps. The issue is seen only with uprobes.
Node is built with dtrace support, and both java and node apps are running with -XX:+PreserveFramePointer and --perf-basic-prof options respectively.
Value in the file /proc/sys/kernel/perf_event_paranoid is set to -1 (which allows all probes by all users).
The uprobe support is also enabled in the kernel (as is BPF support):
The symbol map files for both the apps are also present in /tmp/ of the BCC container.
This behaviour is seen on both 4.13.16-coreos-r1 and 4.12.10-coreos kernel versions.
Is there anything that I am missing here?
Thanks.
The text was updated successfully, but these errors were encountered: