public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Ingo Molnar <mingo@kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [RFC][PATCH 0/4] rcu/tracing: Export the RCU tracepoint string pointers
Date: Fri, 12 Jul 2013 20:41:02 -0400	[thread overview]
Message-ID: <20130713004102.219523935@goodmis.org> (raw)

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(-)

             reply	other threads:[~2013-07-13  0:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-13  0:41 Steven Rostedt [this message]
2013-07-13  0:41 ` [RFC][PATCH 1/4] rcu: Add const annotation to char * for RCU tracepoints and functions Steven Rostedt
2013-07-13  0:41 ` [RFC][PATCH 2/4] rcu: Simplify RCU_STATE_INITIALIZER() macro Steven Rostedt
2013-07-13  0:41 ` [RFC][PATCH 3/4] tracing: Add __tracepoint_string() to export string pointers Steven Rostedt
2013-07-13  0:41 ` [RFC][PATCH 4/4] rcu: Have the RCU tracepoints use the tracepoint_string infrastructure Steven Rostedt

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=20130713004102.219523935@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    /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