diff options
| author | Steven Rostedt <[email protected]> | 2025-08-01 20:56:01 +0000 |
|---|---|---|
| committer | Steven Rostedt (Google) <[email protected]> | 2025-08-01 23:14:51 +0000 |
| commit | 3ca824369b71d4b441e1fdcdee8e66bcb05510a9 (patch) | |
| tree | 5334e3c5c023ab0da4972d6dbd81a93ffdd0704d /scripts/rustdoc_test_gen.rs | |
| parent | ring-buffer: Convert ring_buffer_write() to use guard(preempt_notrace) (diff) | |
| download | kernel-3ca824369b71d4b441e1fdcdee8e66bcb05510a9.tar.gz kernel-3ca824369b71d4b441e1fdcdee8e66bcb05510a9.zip | |
tracing: Have unsigned int function args displayed as hexadecimal
Most function arguments that are passed in as unsigned int or unsigned
long are better displayed as hexadecimal than normal integer. For example,
the functions:
static void __create_object(unsigned long ptr, size_t size,
int min_count, gfp_t gfp, unsigned int objflags);
static bool stack_access_ok(struct unwind_state *state, unsigned long _addr,
size_t len);
void __local_bh_disable_ip(unsigned long ip, unsigned int cnt);
Show up in the trace as:
__create_object(ptr=-131387050520576, size=4096, min_count=1, gfp=3264, objflags=0) <-kmem_cache_alloc_noprof
stack_access_ok(state=0xffffc9000233fc98, _addr=-60473102566256, len=8) <-unwind_next_frame
__local_bh_disable_ip(ip=-2127311112, cnt=256) <-handle_softirqs
Instead, by displaying unsigned as hexadecimal, they look more like this:
__create_object(ptr=0xffff8881028d2080, size=0x280, min_count=1, gfp=0x82820, objflags=0x0) <-kmem_cache_alloc_node_noprof
stack_access_ok(state=0xffffc90000003938, _addr=0xffffc90000003930, len=0x8) <-unwind_next_frame
__local_bh_disable_ip(ip=0xffffffff8133cef8, cnt=0x100) <-handle_softirqs
Which is much easier to understand as most unsigned longs are usually just
pointers. Even the "unsigned int cnt" in __local_bh_disable_ip() looks
better as hexadecimal as a lot of flags are passed as unsigned.
Changes since v2: https://lore.kernel.org/[email protected]
- Use btf_int_encoding() instead of open coding it (Martin KaFai Lau)
Cc: Masami Hiramatsu <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Douglas Raillard <[email protected]>
Cc: Martin KaFai Lau <[email protected]>
Link: https://lore.kernel.org/[email protected]
Acked-by: Yonghong Song <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>
Diffstat (limited to 'scripts/rustdoc_test_gen.rs')
0 files changed, 0 insertions, 0 deletions
