This is more like a request for comments/feedback: often times I find it useful to just print bpf debug information to trace_pipe rather than to the userspace stdout:
- it keeps the application output clean
- likewise, it keeps the eBPF logs separated from userspace junk
- there are no character limits
My proposal is to change the semantics of OTEL_EBPF_BPF_DEBUG so that:
default == true == 1 (fallback): current behaviour of printing to both trace_pipe and submitting the log messages to the userspace ring buffer
trace_pipe: only prints to trace pipe (skips the ring buffer)
In the trace_pipe case (and perhaps in every case, whatever is simpler), we should also aim to print the current function name or context, like we do for the userspace messages:
bpf_printk("%s: "fmt, __FUNCTION__, ##args);
caveat: limits the printk arguments back to 2 rather than 3 in certain kernels.
This is more like a request for comments/feedback: often times I find it useful to just print bpf debug information to
trace_piperather than to the userspace stdout:My proposal is to change the semantics of
OTEL_EBPF_BPF_DEBUGso that:default == true == 1 (fallback): current behaviour of printing to bothtrace_pipeand submitting the log messages to the userspace ring buffertrace_pipe: only prints to trace pipe (skips the ring buffer)In the
trace_pipecase (and perhaps in every case, whatever is simpler), we should also aim to print the current function name or context, like we do for the userspace messages:caveat: limits the printk arguments back to 2 rather than 3 in certain kernels.