linux/tools/include/uapi
Florent Revest 7b15523a98 bpf: Add a bpf_snprintf helper
The implementation takes inspiration from the existing bpf_trace_printk
helper but there are a few differences:

To allow for a large number of format-specifiers, parameters are
provided in an array, like in bpf_seq_printf.

Because the output string takes two arguments and the array of
parameters also takes two arguments, the format string needs to fit in
one argument. Thankfully, ARG_PTR_TO_CONST_STR is guaranteed to point to
a zero-terminated read-only map so we don't need a format string length
arg.

Because the format-string is known at verification time, we also do
a first pass of format string validation in the verifier logic. This
makes debugging easier.

Signed-off-by: Florent Revest <revest@chromium.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210419155243.1632274-4-revest@chromium.org
2021-04-19 15:27:36 -07:00
..
asm tools: Fix off-by 1 relative directory includes 2020-03-06 08:36:46 -03:00
asm-generic fs: add mount_setattr() 2021-01-24 14:42:45 +01:00
drm tools headers UAPI: Sync drm/i915_drm.h with the kernel sources 2021-03-06 16:54:22 -03:00
linux bpf: Add a bpf_snprintf helper 2021-04-19 15:27:36 -07:00
sound tools include UAPI: Sync sound/asound.h copy 2020-02-12 11:04:23 -03:00