eunomia-bpf / bpftime

Userspace eBPF runtime for fast Uprobe & Syscall hook & Extensions with LLVM JIT
https://eunomia.dev/bpftime/
MIT License
699 stars 70 forks source link

[BUG] All log from the runtime should go to trace_pipe #177

Open agentzh opened 6 months ago

agentzh commented 6 months ago

I've noticed that right after I run the bpftime attach PID command, the target process's output stream will immediately have the extra output lines like these:

[2024-01-27 14:54:25.459] [info] [bpftime_shm_internal.cpp:618] Global shm constructed. shm_open_type 1 for bpftime_maps_shm
[2024-01-27 14:54:25.459] [info] [agent.cpp:81] Initializing agent..
[2024-01-27 14:54:25][info][622046] Executable path: /home/agentzh/bpftime/example/malloc/victim
[2024-01-27 14:54:25][info][622046] Attached 0 uprobe programs to function 7f2706d3b220
[2024-01-27 14:54:25][info][622046] Attach successfully

It's very bad to pollute the target process's original output stream this way. I'd rather these debug messages go to the bpftime load process's stderr output stream instead.

agentzh commented 6 months ago

This is reproducible using the official example/malloc sample.

shivam-Purohit commented 5 months ago

@agentzh can i try this if its up for grabs?