diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-12-23 22:34:32 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-12-23 22:52:34 +0300 |
commit | 4c538044ee2d11299cc57ac1e92d343e1e83b847 (patch) | |
tree | 3dafd3d682e04385f8953267af981a8428d5c8da /tools/perf/scripts/python/task-analyzer.py | |
parent | 8d4826cc8a8aca01a3b5e95438dfc0eb3bd589ab (diff) | |
download | linux-4c538044ee2d11299cc57ac1e92d343e1e83b847.tar.xz |
vsprintf: don't make the 'binary' version pack small integer arguments
The strange vbin_printf / bstr_printf interface used to save one- and
two-byte printf numerical arguments into their packed format.
That's more than a bit strange since the argument buffer is supposed to
be an array of 'u32' words, and it's also very different from how the
source of the data (varargs) work - which always do the normal integer
type conversions, so 'char' and 'short' are always passed as int-sized
anyway.
This odd packing causes extra code complexity, and it really isn't worth
it, since the space savings are simply not there: it only happens for
formats like '%hd' (short) and '%hhd' (char), which are very rare
indeed.
In fact, the only other user of this interface seems to be the bpf
helper code (bpf_bprintf_prepare()), and Alexei points out that that
case doesn't support those truncated integer formatting options at all
in the first place.
As a result, bpf_bprintf_prepare() doesn't need any changes for this,
and TRACE_BPRINT uses 'vbin_printf()' -> 'bstr_printf()' for the
formatting and hopefully doesn't expose the odd packing any other way
(knock wood).
Link: https://lore.kernel.org/all/CAADnVQJy65oOubjxM-378O3wDfhuwg8TGa9hc-cTv6NmmUSykQ@mail.gmail.com/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions