From: Li Zefan <lizf@cn.fujitsu.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Mathieu Desnoyers <compudj@krystal.dyndns.org>,
Masami Hiramatsu <mhiramat@redhat.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Tom Zanussi <tzanussi@gmail.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH 05/13 v3] tracing: Move fields from event to class structure
Date: Tue, 18 May 2010 12:51:58 +0800 [thread overview]
Message-ID: <4BF21CEE.9080801@cn.fujitsu.com> (raw)
In-Reply-To: <20100514192914.920593596@goodmis.org>
Steven Rostedt wrote:
> From: Steven Rostedt <srostedt@redhat.com>
>
> Move the defined fields from the event to the class structure.
> Since the fields of the event are defined by the class they belong
> to, it makes sense to have the class hold the information instead
> of the individual events. The events of the same class would just
> hold duplicate information.
>
> After this change the size of the kernel dropped another 3K:
>
> text data bss dec hex filename
> 4913961 1088356 861512 6863829 68bbd5 vmlinux.orig
> 4900252 1057412 861512 6819176 680d68 vmlinux.regs
> 4900375 1053380 861512 6815267 67fe23 vmlinux.fields
>
It also saves memory allocated by trace_define_field(). :)
> Although the text increased, this was mainly due to the C files
> having to adapt to the change. This is a constant increase, where
> new tracepoints will not increase the Text. But the big drop is
> in the data size (as well as needed allocations to hold the fields).
> This will give even more savings as more tracepoints are created.
>
> Note, if just TRACE_EVENT()s are used and not DECLARE_EVENT_CLASS()
> with several DEFINE_EVENT()s, then the savings will be lost. But
> we are pushing developers to consolidate events with DEFINE_EVENT()
> so this should not be an issue.
>
> The kprobes define a unique class to every new event, but are dynamic
> so it should not be a issue.
>
> The syscalls however have a single class but the fields for the individual
> events are different. The syscalls use a metadata to define the
> fields. I moved the fields list from the event to the metadata and
> added a "get_fields()" function to the class. This function is used
> to find the fields. For normal events and kprobes, get_fields() just
> returns a pointer to the fields list_head in the class. For syscall
> events, it returns the fields list_head in the metadata for the event.
>
All syscall exit events have the same fields. I'll make a patch for this.
next prev parent reply other threads:[~2010-05-18 4:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-14 19:22 [PATCH 00/13 v3] [GIT PULL] tracing: shrinking trace events and updates Steven Rostedt
2010-05-14 19:22 ` [PATCH 01/13 v3] tracing: Create class struct for events Steven Rostedt
2010-05-14 19:22 ` [PATCH 02/13 v3] tracepoints: Add check trace callback type Steven Rostedt
2010-05-14 19:22 ` [PATCH 03/13 v3] tracing: Let tracepoints have data passed to tracepoint callbacks Steven Rostedt
2010-05-14 19:22 ` [PATCH 04/13 v3] tracing: Remove per event trace registering Steven Rostedt
2010-05-14 19:22 ` [PATCH 05/13 v3] tracing: Move fields from event to class structure Steven Rostedt
2010-05-18 4:51 ` Li Zefan [this message]
2010-05-14 19:22 ` [PATCH 06/13 v3] tracing: Move raw_init from events to class Steven Rostedt
2010-05-14 19:22 ` [PATCH 07/13 v3] tracing: Allow events to share their print functions Steven Rostedt
2010-05-14 19:22 ` [PATCH 08/13 v3] tracing: Move print functions into event class Steven Rostedt
2010-05-14 19:22 ` [PATCH 09/13 v3] tracing: Remove duplicate id information in event structure Steven Rostedt
2010-05-14 19:22 ` [PATCH 10/13 v3] tracing: Combine event filter_active and enable into single flags field Steven Rostedt
2010-05-14 19:22 ` [PATCH 11/13 v3] tracing: Fix function declarations if !CONFIG_STACKTRACE Steven Rostedt
2010-05-14 19:22 ` [PATCH 12/13 v3] ring-buffer: Add cached pages when freeing reader page Steven Rostedt
2010-05-14 22:26 ` Mathieu Desnoyers
2010-05-15 1:06 ` Steven Rostedt
2010-05-14 19:22 ` [PATCH 13/13 v3] tracing: Comment the use of event_mutex with trace event flags Steven Rostedt
2010-05-14 22:21 ` Mathieu Desnoyers
2010-05-15 0:44 ` 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=4BF21CEE.9080801@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=compudj@krystal.dyndns.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@redhat.com \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tzanussi@gmail.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