diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2023-11-17 19:46:22 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-11-18 11:39:59 -0800 |
commit | 0f8dbdbc641b45a5fa31d497f9fc83ffe1174fa3 (patch) | |
tree | 61c1b84c3d0a9bf8c43a17438d126b24d53cbd8c /drivers/message | |
parent | 1db747d75b1dbe17bf4283ed87bd3b7a92010f34 (diff) |
bpf: smarter verifier log number printing logic
Instead of always printing numbers as either decimals (and in some
cases, like for "imm=%llx", in hexadecimals), decide the form based on
actual values. For numbers in a reasonably small range (currently,
[0, U16_MAX] for unsigned values, and [S16_MIN, S16_MAX] for signed ones),
emit them as decimals. In all other cases, even for signed values,
emit them in hexadecimals.
For large values hex form is often times way more useful: it's easier to
see an exact difference between 0xffffffff80000000 and 0xffffffff7fffffff,
than between 18446744071562067966 and 18446744071562067967, as one
particular example.
Small values representing small pointer offsets or application
constants, on the other hand, are way more useful to be represented in
decimal notation.
Adjust reg_bounds register state parsing logic to take into account this
change.
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20231118034623.3320920-8-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'drivers/message')
0 files changed, 0 insertions, 0 deletions