RFC rcu/tracing: Export the RCU tracepoint string pointers
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest4 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | rcu: Add const annotation to char * for RCU tracepoints and functionsinclude/ include/ kernel/ +6 more | +60 | 0 replies | |
| 2/4 | rcu: Simplify RCU_STATE_INITIALIZER() macrokernel/ kernel/ | +7 | 0 replies | |
| 3/4 | tracing: Add __tracepoint_string() to export string pointersinclude/ include/ kernel/ +1 more | +23 | 0 replies | |
| 4/4 | rcu: Have the RCU tracepoints use the tracepoint_string infrastructurekernel/ kernel/ | +64 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC][PATCH 0/4] rcu/tracing: Export the RCU tracepoint string pointers
This has been on my todo list for a while. I've been promising Paul to get a way to have his tracepoints work for user tools, and I finally got around to it :-)
As his tracepoints just save a pointer to a string in the ring buffer and have the output use that pointer with a "%s" printf field, which works great in the kernel and is fast and efficient, it sucks for tools that read the binary data from the kernel but has no access to the strings that those pointers point to.
The trace_printk() had a similar problem when Frederic Weisbecker optimized it to just save the pointer to the format string along with the parameters, but that was solved by exporting a table of pointers with the strings in the /sys/kernel/debug/tracing/printk_formats file.
I've done the same thing for tracepoints using a separate section but the same file. I needed a seperate section as the trace_printk() section is used to know if a trace_printk() was added to the kernel (they should never be added to Linus's tree, unless its for a strict debugging option). If a trace_printk() is used, several temporary buffers are allocated, which we don't want in normal use.
Now tracepoints get a section that has the pointers to the strings and this gets added to the printk_format file. Doing this means that none of the tools (perf or trace-cmd) require any changes as they already handle reading the printk_formats via the event_parse library.
-- Steve
Steven Rostedt (Red Hat) (4):
rcu: Add const annotation to char * for RCU tracepoints and functions
rcu: Simplify RCU_STATE_INITIALIZER() macro
tracing: Add __tracepoint_string() to export string pointers
rcu: Have the RCU tracepoints use the tracepoint_string infrastructure
----
include/asm-generic/vmlinux.lds.h | 7 ++- include/linux/ftrace_event.h | 7 +++ include/linux/rcupdate.h | 4 +- include/trace/events/rcu.h | 82 +++++++++++++++--------------- kernel/rcu.h | 2 +- kernel/rcupdate.c | 2 +- kernel/rcutiny_plugin.h | 2 +- kernel/rcutorture.c | 14 +++--- kernel/rcutree.c | 100 +++++++++++++++++++++---------------- kernel/rcutree.h | 2 +- kernel/rcutree_plugin.h | 44 ++++++++-------- kernel/trace/trace.h | 3 ++ kernel/trace/trace_printk.c | 7 +++ 13 files changed, 154 insertions(+), 122 deletions(-)