linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 0/3] tracing/ftrace: ftrace_bprintk
Date: Tue, 24 Feb 2009 06:16:18 +0100	[thread overview]
Message-ID: <20090224051618.GA5142@nowhere> (raw)

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 +++++++++++++++++++++++++++++++++++++



             reply	other threads:[~2009-02-24  5:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24  5:16 Frederic Weisbecker [this message]
2009-02-24 17:17 ` [PATCH 0/3] tracing/ftrace: ftrace_bprintk Jason Baron
2009-02-24 17:25   ` Ingo Molnar
2009-02-24 17:39     ` Frederic Weisbecker
2009-02-24 17:46   ` Frederic Weisbecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090224051618.GA5142@nowhere \
    --to=fweisbec@gmail.com \
    --cc=acme@redhat.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).