Bug 207605 - please support %ph/more %p format(s)
Summary: please support %ph/more %p format(s)
Status: RESOLVED CODE_FIX
Alias: None
Product: Tools
Classification: Unclassified
Component: Trace-cmd/Kernelshark (show other bugs)
Hardware: All Linux
: P1 enhancement
Assignee: Default virtual assignee for Trace-cmd and kernelshark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-06 12:53 UTC by Johannes Berg
Modified: 2020-07-08 00:31 UTC (History)
2 users (show)

See Also:
Kernel Version: N/A
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Johannes Berg 2020-05-06 12:53:10 UTC
I was trying to create an event with a __dynamic_array() where the small contents is printed with

  TP_printk("%*phN", __get_dynamic_array_len(x), __get_dynamic_array(x))

which works OK in the kernel, but trace-cmd just prints

  0x<userspaceaddr>hN


There are many many more kernel extensions to %p though, and only two (IPv4 and MAC addresses) seem to be supported right now.

See the kernel's lib/vsprintf.c, documentation is above the pointer() function.
Comment 1 Tzvetomir Stoyanov 2020-05-06 14:55:46 UTC
Hi Johannes,
I'm working on some trace-cmd optimizations related to parsing and printing these print formats, will look at lib/vsprintf.c documentation and how to improve trace-cmd to handle these cases.

Thanks for using trace-cmd and reporting this issue.
Comment 2 Tzvetomir Stoyanov 2020-05-08 13:20:26 UTC
Submitted a fix: https://patchwork.kernel.org/patch/11536179/
Comment 3 Johannes Berg 2020-05-08 17:22:46 UTC
Awesome, thanks!
Comment 4 Steven Rostedt 2020-07-08 00:31:18 UTC
Fixed by: 29885d7fbb55 ("trace-cmd: Add support for more printk format specifiers")

Note You need to log in before you can comment on or make changes to this bug.