diff options
author | Florent Revest <revest@chromium.org> | 2021-04-19 17:52:40 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-04-19 15:27:36 -0700 |
commit | 7b15523a989b63927c2bb08e9b5b0bbc10b58bef (patch) | |
tree | d74e1482dfa030476a1666909b83f0da10a1757c /tools/perf/scripts/python/export-to-postgresql.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 <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
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions