Messages in this thread | | | Subject | Re: [PATCH 2/9] tracing: Convert some kmem events to DEFINE_EVENT | From | Steven Rostedt <> | Date | Thu, 26 Nov 2009 02:38:57 -0500 |
| |
On Thu, 2009-11-26 at 09:24 +0200, Pekka Enberg wrote:
> I have no idea what TRACE_EVENT_TEMPLATE is but the space savings are > convincing enough! I assume this is going into -tip?
TRACE_EVENT_TEMPLATE acts just like TRACE_EVENT but it does not create the trace point. It does create general functions described by the template. These are the functions to record data and how to print that data, and show its format to userspace.
DEFINE_EVENT is used to hook an actual trace point up with the functions created by the template.
There are a lot of events that are almost identical except for their names. Using TRACE_EVENT() itself will create the functions to record the data, print it, and show the format for each event, even though most of these events are identical except for the name.
Christoph Hellwig was killed by this, since he had hundreds of TRACE_EVENTS all with the same data. After converting it to the templates, he saved a hell of a lot of space.
-- Steve
| |