Skip to content

tracing/ftrace: ftrace_bprintk

Frederic Weisbecker lkml 1 version In review

Get series with b4
b4 am 20090224051618.GA5142@nowhere

Versions newest first

  1. v1 Latest3 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3add binary printfinclude/linux/string.h lib/Kconfig lib/vsprintf.c+452 -043 replies
2/3ftrace: infrastructure for supporting binary recordinclude/linux/ftrace.h kernel/trace/Kconfig kernel/trace/Makefile +4 more+240 -00 replies
3/3ftrace: add ftrace_bprintk()include/asm-generic/vmlinux.lds.h include/linux/ftrace.h include/linux/module.h +3 more+181 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] tracing/ftrace: ftrace_bprintk

Hi,

These three patches are part of a patchset posted by Lai Jiangshan in december 2008. They introduce a binary version of ftrace_printk() called ftrace_bprintk()

While having the same goal: print a generic message entry into the ring buffer, their approaches are very different.

- ftrace_printk() does the formatting job on tracing time, insert the whole resulting string into the ring buffer, and then the string is printed on output time without a lot of modifications.

- ftrace_bprintk() does no formatting on tracing time. Instead, it looks at the format string to find the types and the numbers of the arguments and directly stores them as-is into the ring-buffer. Then the format string is stored into the ring-buffer too, but only by its address, it is not copied. Then on output time only, the final string is formatted and sent to the user. This gives a result about as fast as a traditional tracer with fixed fields types, except that we can print random types and numbers of fields here.

The first patch adds the generic support for binary formatting. The second adds the support for binary print types on ftrace and the last introduces ftrace_bprintk() which supports safely the modules by listening on the module loading/unloading notifier to keep track of unwanted freed format strings.

Lai Jiangshan (3):
add binary printf
ftrace: infrastructure for supporting binary record
ftrace: add ftrace_bprintk()

 include/asm-generic/vmlinux.lds.h |    3 +
 include/linux/ftrace.h            |   25 ++
 include/linux/module.h            |    5 +
 include/linux/string.h            |    7 +
 kernel/module.c                   |    6 +
 kernel/trace/Kconfig              |    6 +
 kernel/trace/Makefile             |    1 +
 kernel/trace/trace.c              |   70 ++++++
 kernel/trace/trace.h              |   12 +
 kernel/trace/trace_bprintk.c      |  217 ++++++++++++++++++
 kernel/trace/trace_output.c       |   76 +++++++
 lib/Kconfig                       |    3 +
 lib/vsprintf.c                    |  442 +++++++++++++++++++++++++++++++++++++