Re: [PATCH v2] perf trace: Format fields with hex specifiers in print_fmt as hexadecimal

Aaron Tomlin <[email protected]> Wed, 5 Aug 2026 14:53:01 -0400
Newsgroups org.kernel.vger.linux-perf-users,org.kernel.vger.linux-kernel
Message-ID <3iulqtbwakupwjjo3iksszlv5orvhssedya3mouw7ufxfdchlz@x3xqjtgmcwdo>
On Wed, Aug 05, 2026 at 11:28:16AM -0700, Namhyung Kim wrote:
> On Mon, 03 Aug 2026 08:48:45 -0400, Aaron Tomlin wrote:
> > 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.
> > 
> > [...]
> Applied to perf-tools-next, thanks!
> 
> Best regards,
> Namhyung

Thank you Namhyung!

-- 
Aaron Tomlin