-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
[FEATURE] Add trace_pipe support for bpf_printk #157
Comments
I think the bpf_printk output should not be sent to the shm. We can use a name pipe. It can be similar like kernel /sys/kernel/debug/tracing/trace_pipe The cli can read the data from the pipe, and the pipe can also be shared between processes. |
And maybe all the log from bpftime runtime should also be sent to the name pipe for debug. |
+1. I hope the |
Hello, I am new to the code, and had a doubt after reading the issue comments and the code - Will the cli have a new option for reading the data from the pipe? |
Yes |
I think it is an interesting issue, and would love to explore more. Also, would the implementation of bpf_printk change, or will there be a new function to write in the tracepipe? |
bpf_printk should keep its current function, but we could use attach config (such as an option when invoking bpftime attach) to make bpf_printk output things to the pipe |
I read more on the issue and referring to: https://eunomia.dev/bpftime/documents/usage/#uprobe-and-uretprobe, bpf_printk's result is shown in the output of the target (victim) program a) when it is called with the start option, or b) when the attach option works on the PID. |
bpf_trace_printk (which is the function that bpf_printk internally calls), is a bpf helper implemented at bpftime/runtime/src/bpf_helper.cpp Line 43 in 103903b
In both |
The bpf_prink helper currently output the results to the target program. This is different from the kernel eBPF behavior and may break the target program.
We may need a feature that allow agent to send the output of bpf_printk to shm and buffer them, so that we could see logs using bpftime cli, or display them when using remote attach.
The text was updated successfully, but these errors were encountered: