summaryrefslogtreecommitdiff
path: root/scripts/patch-kernel
diff options
context:
space:
mode:
authorAaron Tomlin <atomlin@atomlin.com>2026-08-03 08:48:45 -0400
committerNamhyung Kim <namhyung@kernel.org>2026-08-05 11:20:02 -0700
commit9dd7c82d462ee98b4b293a93b8fb3b6514e73820 (patch)
tree55d098ace5706c6417929d13354b157f35ff5476 /scripts/patch-kernel
parent00ab8057cc87de9011a69aff65f7cc8713053109 (diff)
downloadlinux-9dd7c82d462ee98b4b293a93b8fb3b6514e73820.tar.gz
linux-9dd7c82d462ee98b4b293a93b8fb3b6514e73820.zip
perf trace: Format fields with hex specifiers in print_fmt as hexadecimal
Currently, when a probe event is added using perf probe --add with a hexadecimal type cast (e.g., var:x64 and var:x32), the kernel traceprobe subsystem sets the field type to "u64" in the event's format file, yet generates a print format specifier of "var=0x%Lx" or "0x%x". By default, perf trace uses its internal beautifiers which only inspect field->type and field->flags. Because traceprobe events declare primitive integer field types ("u64") without a C pointer asterisk (i.e., "*"), perf trace defaults to printing the field's value as a decimal unsigned long ("%ld"), ignoring the hexadecimal intent. Introduce field_has_hex_fmt() to inspect the tracepoint's print_fmt format string. If a field's print format assignment uses hexadecimal specifiers (i.e., "=0x", "=%#", or "=%p"), assign SCA_PTR formatting so perf trace displays the value in hexadecimal by default without requiring --libtraceevent. For example: ❯ sudo ./perf probe --add 'enqueue_task_fair rq=rq:x64 p=p:x64 flags=flags:x32' Added new event: probe:enqueue_task_fair (on enqueue_task_fair with rq=rq:x64 p=p:x64 flags=flags:x32) You can now use it in all perf tools, such as: perf record -e probe:enqueue_task_fair -aR sleep 1 ❯ sudo ./perf trace --show-cpu --event probe:enqueue_task_fair --max-event 3 0.000 [000] :0/0 probe:enqueue_task_fair(rq: 0xffff8ac632233180, p: 0xffff8ac2c1240000, flags: 0x100009) 0.006 [004] :0/0 probe:enqueue_task_fair(rq: 0xffff8ac632433180, p: 0xffff8ac624cf8000, flags: 0x9) 0.069 [001] :0/0 probe:enqueue_task_fair(rq: 0xffff8ac6322b3180, p: 0xffff8ac4c4212c40, flags: 0x9) Signed-off-by: Aaron Tomlin <atomlin@atomlin.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'scripts/patch-kernel')
0 files changed, 0 insertions, 0 deletions