Skip to content

RFC trace_printk() using percpu buffers

Steven Rostedt lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3tracing: Do not allocate buffer for trace_markerkernel/trace/trace.c+83 -280 replies
2/3tracing: Add optional percpu buffers for trace_printk()Documentation/kernel-parameters.txt kernel/trace/trace.c kernel/trace/trace.h+187 -414 replies
3/3tracing: Add config to permanently have trace_printk() use percpukernel/trace/Kconfig kernel/trace/trace.c+54 -50 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by.

PatchPeter Zijlstra
1/3
2/3Requested-by
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3][RFC] trace_printk() using percpu buffers

Peter,

You had issues with the previous version of my trace_printk() code. I rewrote it to do the following.

By default, it still uses the single buffer protected by a spinlock and an atomic (for NMIs). The NMI case can cause dropped prints if the NMI happens while a trace_printk() is processing.

When trace_printk_percpu is enabled, either via the trace options or the kernel command line, then two sets of percpu buffers are made, one for normal and irqs (interrupts are still disabled), and the other is for NMIs. These can be added or removed at anytime.

The last patch adds a CONFIG_TRACE_PRINTK_PERCPU that makes trace_printk() permanently use two sets of per_cpu buffers, and these can not be removed. This will give the least amount of overhead for trace_printk() with the sacrifice of memory overhead. This is an option I could imagine you would just set and forget about.

Let me know your thoughts.

Thanks,

-- Steve

Steven Rostedt (3):
tracing: Do not allocate buffer for trace_marker
tracing: Add optional percpu buffers for trace_printk()
tracing: Add config to permanently have trace_printk() use percpu buffers

----

 Documentation/kernel-parameters.txt |   11 +
 kernel/trace/Kconfig                |   18 ++
 kernel/trace/trace.c                |  360 ++++++++++++++++++++++++++++-------
 kernel/trace/trace.h                |    1 +
 4 files changed, 320 insertions(+), 70 deletions(-)