hi, In the last revision Andrii suggested we could have the buffer provided by bpf_bprintf_prepare [1]. It's bit more changes but it looks like more compact solution. v3 changes: - added struct to hold return data in bpf_bprintf_prepare - fix bug in bpf_bprintf_cleanup - adjust printk helpers to use new bpf_bprintf_prepare data argument thanks, jirka [1] https://lore.kernel.org/bpf/Y5pgxd9+G2wHROlp@krava/T/#m4b256e9138cdb37cd4477571f32e47a960aad317 --- Jiri Olsa (3): bpf: Add struct for bin_args arg in bpf_bprintf_prepare bpf: Do cleanup in bpf_bprintf_cleanup only when needed bpf: Remove trace_printk_lock include/linux/bpf.h | 12 ++++++++++-- kernel/bpf/helpers.c | 67 +++++++++++++++++++++++++++++++++++++++---------------------------- kernel/bpf/verifier.c | 3 ++- kernel/trace/bpf_trace.c | 56 +++++++++++++++++++++++++++----------------------------- 4 files changed, 78 insertions(+), 60 deletions(-)