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: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Mathieu Desnoyers <compudj@krystal.dyndns.org>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Li Zefan <lizf@cn.fujitsu.com>,
	Masami Hiramatsu <mhiramat@redhat.com>,
	Christoph Hellwig <hch@lst.de>
Subject: [PATCH 0/9 - v2][RFC] tracing: Lowering the footprint of TRACE_EVENTs
Date: Mon, 03 May 2010 23:40:45 -0400	[thread overview]
Message-ID: <20100504034045.085822814@goodmis.org> (raw)

[Version 2]

This is an RFC patch set that also affects kprobes and perf.

At the Linux Collaboration Summit, I talked with Mathieu and others about
lowering the footprint of trace events. I spent all of last week
trying to get the size as small as I could.

Currently, each TRACE_EVENT() macro adds 1 - 5K per tracepoint. I got various
results by adding a TRACE_EVENT() with the compiler, depending on
config options that did not seem related. The new tracepoint I added
would add between 1 and 5K, but I did not investigate enough to
see what the true size was.

What was consistent, was the DEFINE_EVENT(). Currently, it adds
a little over 700 bytes per DEFINE_EVENT().

This patch series does not seem to affect TRACE_EVENT() much (had
the same various sizes), but consistently brings DEFINE_EVENT()s
down from 700 bytes to 250 bytes per DEFINE_EVENT(). Since syscalls
use one "class" and are equivalent to DEFINE_EVENT() this can
be a significant savings.

With events and syscalls (82 events and 616 syscalls), before this
patch series, the size of vmlinux was: 16161794, and afterward: 16058182.

That is 103,612 bytes in savings! (over 100K)


Without tracing syscalls (82 events), it brought the size of vmlinux
down from 1591046 to 15999394.

22,071 bytes in savings.

This is just an RFC (for now), to get peoples opinions on the changes.
It does a bit of rewriting of the CPP macros, just to warning you ;-)

Changes in v2:

 o  Ported to latest tip/tracing/core

 o  Removed DECLARE_TRACE_DATA() and made DECLARE_TRACE() have
    the ability to pass a data parameter. This makes DECLARE_TRACE()
    not work with no args. A new DECLARE_TRACE_NOARGS() has been created
    that also allows data to be passed, but does is for tracepoint(void).

 o  Made the callbacks be "proto, void *data" and typecast the data
    within the function.


-- Steve

The code can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/rfc-1


Steven Rostedt (9):
      tracing: Create class struct for events
      tracing: Let tracepoints have data passed to tracepoint callbacks
      tracing: Remove per event trace registering
      tracing: Move fields from event to class structure
      tracing: Move raw_init from events to class
      tracing: Allow events to share their print functions
      tracing: Move print functions into event class
      tracing: Remove duplicate id information in event structure
      tracing: Combine event filter_active and enable into single flags field

----
 include/linux/ftrace_event.h           |   73 ++++++++---
 include/linux/syscalls.h               |   57 +++------
 include/linux/tracepoint.h             |   94 +++++++++++---
 include/trace/ftrace.h                 |  218 ++++++++++----------------------
 include/trace/syscall.h                |   10 +-
 kernel/trace/blktrace.c                |   13 ++-
 kernel/trace/kmemtrace.c               |   28 +++--
 kernel/trace/trace.c                   |    9 +-
 kernel/trace/trace.h                   |    5 +-
 kernel/trace/trace_event_perf.c        |   17 ++-
 kernel/trace/trace_events.c            |  131 ++++++++++++-------
 kernel/trace/trace_events_filter.c     |   28 +++--
 kernel/trace/trace_export.c            |   16 ++-
 kernel/trace/trace_functions_graph.c   |   13 ++-
 kernel/trace/trace_kprobe.c            |  104 +++++++++------
 kernel/trace/trace_output.c            |  137 ++++++++++++++-------
 kernel/trace/trace_output.h            |    2 +-
 kernel/trace/trace_syscalls.c          |  113 +++++++++++++++--
 kernel/tracepoint.c                    |   91 ++++++++------
 samples/tracepoints/tp-samples-trace.h |    4 +-
 20 files changed, 697 insertions(+), 466 deletions(-)

             reply	other threads:[~2010-05-04  3:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-04  3:40 Steven Rostedt [this message]
2010-05-04  3:40 ` [PATCH 1/9 - v2][RFC] tracing: Create class struct for events Steven Rostedt
2010-05-07  4:21   ` Frederic Weisbecker
2010-05-04  3:40 ` [PATCH 2/9 - v2][RFC] tracing: Let tracepoints have data passed to tracepoint callbacks Steven Rostedt
2010-05-07  3:52   ` Frederic Weisbecker
2010-05-07 14:09     ` Steven Rostedt
2010-05-07 18:06       ` Frederic Weisbecker
2010-05-07 19:10         ` Steven Rostedt
2010-05-04  3:40 ` [PATCH 3/9 - v2][RFC] tracing: Remove per event trace registering Steven Rostedt
2010-05-07  4:20   ` Frederic Weisbecker
2010-05-07 12:42     ` Steven Rostedt
2010-05-07 14:54     ` Mathieu Desnoyers
2010-05-07 15:12       ` Steven Rostedt
2010-05-07 15:31         ` Mathieu Desnoyers
2010-05-07 15:43           ` Steven Rostedt
2010-05-07 18:01       ` Frederic Weisbecker
2010-05-07 19:08         ` Steven Rostedt
2010-05-07 20:03           ` Frederic Weisbecker
2010-05-07 20:58           ` Mathieu Desnoyers
2010-05-07  8:20   ` Li Zefan
2010-05-07 12:59     ` Steven Rostedt
2010-05-04  3:40 ` [PATCH 4/9 - v2][RFC] tracing: Move fields from event to class structure Steven Rostedt
2010-05-07  4:49   ` Frederic Weisbecker
2010-05-07 12:57     ` Steven Rostedt
2010-05-04  3:40 ` [PATCH 5/9 - v2][RFC] tracing: Move raw_init from events to class Steven Rostedt
2010-05-04  3:40 ` [PATCH 6/9 - v2][RFC] tracing: Allow events to share their print functions Steven Rostedt
2010-05-04  3:40 ` [PATCH 7/9 - v2][RFC] tracing: Move print functions into event class Steven Rostedt
2010-05-04  3:40 ` [PATCH 8/9 - v2][RFC] tracing: Remove duplicate id information in event structure Steven Rostedt
2010-05-04  3:40 ` [PATCH 9/9 - v2][RFC] tracing: Combine event filter_active and enable into single flags field 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=20100504034045.085822814@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=compudj@krystal.dyndns.org \
    --cc=fweisbec@gmail.com \
    --cc=hch@lst.de \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mhiramat@redhat.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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