mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-13 21:09:07 +08:00
bpf: Migrate bpf_stream_vprintk() to KF_IMPLICIT_ARGS
Implement bpf_stream_vprintk with an implicit bpf_prog_aux argument, and remote bpf_stream_vprintk_impl from the kernel. Update the selftests to use the new API with implicit argument. bpf_stream_vprintk macro is changed to use the new bpf_stream_vprintk kfunc, and the extern definition of bpf_stream_vprintk_impl is replaced accordingly. Reviewed-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev> Link: https://lore.kernel.org/r/20260120222638.3976562-11-ihor.solodrai@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
committed by
Andrii Nakryiko
parent
5d02120e10
commit
977b1f820c
@@ -315,8 +315,8 @@ enum libbpf_tristate {
|
||||
___param, sizeof(___param)); \
|
||||
})
|
||||
|
||||
extern int bpf_stream_vprintk_impl(int stream_id, const char *fmt__str, const void *args,
|
||||
__u32 len__sz, void *aux__prog) __weak __ksym;
|
||||
extern int bpf_stream_vprintk(int stream_id, const char *fmt__str, const void *args,
|
||||
__u32 len__sz) __weak __ksym;
|
||||
|
||||
#define bpf_stream_printk(stream_id, fmt, args...) \
|
||||
({ \
|
||||
@@ -328,7 +328,7 @@ extern int bpf_stream_vprintk_impl(int stream_id, const char *fmt__str, const vo
|
||||
___bpf_fill(___param, args); \
|
||||
_Pragma("GCC diagnostic pop") \
|
||||
\
|
||||
bpf_stream_vprintk_impl(stream_id, ___fmt, ___param, sizeof(___param), NULL); \
|
||||
bpf_stream_vprintk(stream_id, ___fmt, ___param, sizeof(___param)); \
|
||||
})
|
||||
|
||||
/* Use __bpf_printk when bpf_printk call has 3 or fewer fmt args
|
||||
|
||||
Reference in New Issue
Block a user