Re: [PATCH v6 bpf-next 0/9] bpf: implement variadic printk helper
From: Alexei Starovoitov <hidden>
Date: 2021-09-17 21:06:24
Also in:
bpf
From: Alexei Starovoitov <hidden>
Date: 2021-09-17 21:06:24
Also in:
bpf
On Fri, Sep 17, 2021 at 11:29 AM Dave Marchevsky [off-list ref] wrote:
This series introduces a new helper, bpf_trace_vprintk, which functions like bpf_trace_printk but supports > 3 arguments via a pseudo-vararg u64 array. The bpf_printk libbpf convenience macro is modified to use bpf_trace_vprintk when > 3 varargs are passed, otherwise the previous behavior - using bpf_trace_printk - is retained. Helper functions and macros added during the implementation of bpf_seq_printf and bpf_snprintf do most of the heavy lifting for bpf_trace_vprintk. There's no novel format string wrangling here. Usecase here is straightforward: Giving BPF program writers a more powerful printk will ease development of BPF programs, particularly during debugging and testing, where printk tends to be used. This feature was proposed by Andrii in libbpf mirror's issue tracker [1]. [1] https://github.com/libbpf/libbpf/issues/315 v5 -> v6: Rebase to pick up newly-added helper
Applied. Thanks!