diff options
author | Florent Revest <[email protected]> | 2021-04-19 17:52:40 +0200 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2021-04-19 15:27:36 -0700 |
commit | 7b15523a989b63927c2bb08e9b5b0bbc10b58bef (patch) | |
tree | d74e1482dfa030476a1666909b83f0da10a1757c /scripts/gdb/linux/timerlist.py | |
parent | fff13c4bb646ef849fd74ced87eef54340d28c21 (diff) |
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 <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'scripts/gdb/linux/timerlist.py')
0 files changed, 0 insertions, 0 deletions