-
Notifications
You must be signed in to change notification settings - Fork 299
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
bpf_printk doesn't create data on trace_pipe #75
Comments
Not really, but I've had cases when something in kernel "broke" w.r.t. trace_pipe and BPF program stopped emitting anything into it. Can you try rebooting and trying ./minimal again before you do anything else with the system? I also see
So maybe try mounting tracefs as well? |
Thanks for replying @anakryiko!
And the BPF program still doesn't write into The file stat is:
All files from debugfs looking normal (permissions): Already tried mounting debugfs and tracefs again, restarting the container etc... Any additional ideas? |
I have no idea, tbh. If you are trying it from inside the container, have you tried reading that file from outside any container? Also make sure that you don't have any other process opening this file, because I think trace_pipe doesn't support multiple readers reading it simultaneously. |
I see. I'm executing this by running "./minimal", and after I see the dots from the userspace application indicating the BPF program is running, I stop the processes (CTRL + C) and then run the cat command. Should I be checking for debug messages in a different way? |
you can run cat in parallel, but even if you run afterwards you should still see previous output. Do you have a chance to try this on some other system? It might be some (unknown to me) kernel config dependencies. Other than that, I'm not sure how to help you. |
This was simply a mistake in the eBPF program. Having the if statement:
With this initial declaration:
This causes the BPF program never to actually execute the Thanks again for your time @anakryiko ! |
This may causes by the pid namespace. I had the same problem in wsl microsoft/WSL#8461. The same as you are run the BPF program in the container, it pid namespace not is global namespace. Tansks @X-QIANG. |
I have the same problem in a host and reboot solved it. |
Make sure that
|
My minimal app executes correctly:
But when I cat the "/sys/kernel/debug/tracing/trace_pipe" file it looks empty:
I'm running a Ubuntu 22.04 LTS docker container on privileged mode.
This is how I have manually mounted my debugfs:
mount -t debugfs none /sys/kernel/debug
Am I missing anything? Appreciate your help.
The text was updated successfully, but these errors were encountered: