<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/trace/define_trace.h, branch v3.12.14</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/include/trace/define_trace.h?h=v3.12.14</id>
<link rel='self' href='https://git.amat.us/linux/atom/include/trace/define_trace.h?h=v3.12.14'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-06-21T05:24:32Z</updated>
<entry>
<title>tracing: Add DEFINE_EVENT_FN() macro</title>
<updated>2013-06-21T05:24:32Z</updated>
<author>
<name>Steven Rostedt</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-06-20T15:44:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f5abaa1bfc3dbf26d19d3513f39279ca369f8d65'/>
<id>urn:sha1:f5abaa1bfc3dbf26d19d3513f39279ca369f8d65</id>
<content type='text'>
Each TRACE_EVENT() adds several helper functions. If two or more trace events
share the same structure and print format, they can also share most of these
helper functions and save a lot of space from duplicate code. This is why the
DECLARE_EVENT_CLASS() and DEFINE_EVENT() were created.

Some events require a trigger to be called at registering and unregistering of
the event and to do so they use TRACE_EVENT_FN().

If multiple events require a trigger, they currently have no choice but to use
TRACE_EVENT_FN() as there's no DEFINE_EVENT_FN() available. This unfortunately
causes a lot of wasted duplicate code created.

By adding a DEFINE_EVENT_FN(), these events can still use a
DECLARE_EVENT_CLASS() and then define their own triggers.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Link: http://lkml.kernel.org/r/51C3236C.8030508@hds.com
Signed-off-by: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>treewide: fix comment/printk/variable typos</title>
<updated>2012-09-01T17:33:05Z</updated>
<author>
<name>Anatol Pomozov</name>
<email>anatol.pomozov@gmail.com</email>
</author>
<published>2012-09-01T17:31:09Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4907cb7b193a4f91c1fd30cf679c035e3644c64d'/>
<id>urn:sha1:4907cb7b193a4f91c1fd30cf679c035e3644c64d</id>
<content type='text'>
Signed-off-by: Anatol Pomozov &lt;anatol.pomozov@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>Revert "tracing: Include module.h in define_trace.h"</title>
<updated>2011-10-31T23:32:35Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-09-18T17:36:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=67b84999b1a8b1af5625b1eabe92146c5eb42932'/>
<id>urn:sha1:67b84999b1a8b1af5625b1eabe92146c5eb42932</id>
<content type='text'>
This reverts commit 3a9f987b3141f086de27832514aad9f50a53f754.

With all the files that are real modules now having module.h
explicitly called out for inclusion, and no reliance on any
implicit presence of module.h assumed, we should no longer
need this workaround.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>tracing: Include module.h in define_trace.h</title>
<updated>2011-01-07T20:44:56Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-01-07T20:40:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3a9f987b3141f086de27832514aad9f50a53f754'/>
<id>urn:sha1:3a9f987b3141f086de27832514aad9f50a53f754</id>
<content type='text'>
While doing some developing, Peter Zijlstra and I have found
that if a CREATE_TRACE_POINTS include is done before module.h
is included, it can break the build.

We have been lucky so far that this has not broke the build
since module.h is included in almost everything.

Reported-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Add TRACE_EVENT_CONDITIONAL()</title>
<updated>2010-12-03T15:45:34Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2010-12-02T21:46:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=287050d390264402e11bea8b811859e42e8faa29'/>
<id>urn:sha1:287050d390264402e11bea8b811859e42e8faa29</id>
<content type='text'>
There are instances in the kernel that we only want to trace
a tracepoint when a certain condition is set. But we do not
want to test for that condition in the core kernel.
If we test for that condition before calling the tracepoin, then
we will be performing that test even when tracing is not enabled.
This is 99.99% of the time.

We currently can just filter out on that condition, but that happens
after we write to the trace buffer. We just wasted time writing to
the ring buffer for an event we never cared about.

This patch adds:

   TRACE_EVENT_CONDITION() and DEFINE_EVENT_CONDITION()

These have a new TP_CONDITION() argument that comes right after
the TP_ARGS().  This condition can use the parameters of TP_ARGS()
in the TRACE_EVENT() to determine if the tracepoint should be traced
or not. The TP_CONDITION() will be placed in a if (cond) trace;

For example, for the tracepoint sched_wakeup, it is useless to
trace a wakeup event where the caller never actually wakes
anything up (where success == 0). So adding:

	TP_CONDITION(success),

which uses the "success" parameter of the wakeup tracepoint
will have it only trace when we have successfully woken up a
task.

Acked-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Fix tracepoint.h DECLARE_TRACE() to allow more than one header</title>
<updated>2010-05-05T15:46:17Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2010-05-05T14:52:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2e26ca7150a4f2ab3e69471dfc65f131e7dd7a05'/>
<id>urn:sha1:2e26ca7150a4f2ab3e69471dfc65f131e7dd7a05</id>
<content type='text'>
When more than one header is included under CREATE_TRACE_POINTS
the DECLARE_TRACE() macro is not defined back to its original meaning
and the second include will fail to initialize the TRACE_EVENT()
and DECLARE_TRACE() correctly.

To fix this the tracepoint.h file moves the define of DECLARE_TRACE()
out of the #ifdef _LINUX_TRACEPOINT_H protection (just like the
define of the TRACE_EVENT()). This way the define_trace.h will undef
the DECLARE_TRACE() at the end and allow new headers to start
from scratch.

This patch also requires fixing the include/events/napi.h

It currently uses DECLARE_TRACE() and should be converted to a TRACE_EVENT()
format. But I'll leave that change to the authors of that file.
But since the napi.h file depends on using the CREATE_TRACE_POINTS
and does not define its own DEFINE_TRACE() it must use the define_trace.h
method instead.

Cc: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>events: Rename TRACE_EVENT_TEMPLATE() to DECLARE_EVENT_CLASS()</title>
<updated>2009-11-26T08:04:55Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-11-26T08:04:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=091ad3658e3c76c5fb05f65bfb64a0246f8f31b5'/>
<id>urn:sha1:091ad3658e3c76c5fb05f65bfb64a0246f8f31b5</id>
<content type='text'>
It is not quite obvious at first sight what TRACE_EVENT_TEMPLATE
does: does it define an event as well beyond defining a template?

To clarify this, rename it to DECLARE_EVENT_CLASS, which follows
the various 'DECLARE_*()' idioms we already have in the kernel:

  DECLARE_EVENT_CLASS(class)

    DEFINE_EVENT(class, event1)
    DEFINE_EVENT(class, event2)
    DEFINE_EVENT(class, event3)

To complete this logic we should also rename TRACE_EVENT() to:

  DEFINE_SINGLE_EVENT(single_event)

... but in a more quiet moment of the kernel cycle.

Cc: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;4B0E286A.2000405@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: Create new DEFINE_EVENT_PRINT</title>
<updated>2009-11-24T23:23:53Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-11-19T01:36:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e5bc9721684e9412f3e0465222f317c362a8ab47'/>
<id>urn:sha1:e5bc9721684e9412f3e0465222f317c362a8ab47</id>
<content type='text'>
After creating the TRACE_EVENT_TEMPLATE I started to look at other
trace points to see what duplication was made. I noticed that there
are several trace points where they are almost identical except for
the name and the output format. Since TRACE_EVENT_TEMPLATE was successful
in bringing down the size of trace events, I added a DEFINE_EVENT_PRINT.

DEFINE_EVENT_PRINT is used just like DEFINE_EVENT is. That is, the
DEFINE_EVENT_PRINT also uses a TRACE_EVENT_TEMPLATE, but it allows the
developer to overwrite the print format. If there are two or more
TRACE_EVENTS that are identical except for the name and print, then
they can be converted to use a TRACE_EVENT_TEMPLATE. Since the
TRACE_EVENT_TEMPLATE already does the print output, the first trace event
would have its print format held in the TRACE_EVENT_TEMPLATE and
be defined with a DEFINE_EVENT. The rest will use the DEFINE_EVENT_PRINT
and override the print format.

Converting the sched trace points to both DEFINE_EVENT and
DEFINE_EVENT_PRINT. Five were converted to DEFINE_EVENT and two were
converted to DEFINE_EVENT_PRINT.

I was able to get the following:

$ size kernel/sched.o-*
   text	   data	    bss	    dec	    hex	filename
  79299	   6776	   2520	  88595	  15a13	kernel/sched.o-notrace
 101941	  11896	   2584	 116421	  1c6c5	kernel/sched.o-templ
 104779	  11896	   2584	 119259	  1d1db	kernel/sched.o-trace

sched.o-notrace is the scheduler compiled with no trace points.
sched.o-templ is with the use of DEFINE_EVENT and DEFINE_EVENT_PRINT
sched.o-trace is the current trace events.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Create new TRACE_EVENT_TEMPLATE</title>
<updated>2009-11-24T22:52:11Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-11-19T01:27:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ff038f5c37c2070829004a0678372766c2b32180'/>
<id>urn:sha1:ff038f5c37c2070829004a0678372766c2b32180</id>
<content type='text'>
There are some places in the kernel that define several tracepoints and
they are all identical besides the name. The code to enable, disable and
record is created for every trace point even if most of the code is
identical.

This patch adds TRACE_EVENT_TEMPLATE that lets the developer create
a template TRACE_EVENT and create trace points with DEFINE_EVENT, which
is based off of a given template. Each trace point used by this
will share most of the code, and bring down the size of the kernel
when there are several duplicate events.

Usage is:

TRACE_EVENT_TEMPLATE(name, proto, args, tstruct, assign, print);

Which would be the same as defining a normal TRACE_EVENT.

To create the trace events that the trace points will use:

DEFINE_EVENT(template, name, proto, args) is done. The template
is the name of the TRACE_EVENT_TEMPLATE to use. The name is the
name of the trace point. The parameters proto and args must be the same
as the proto and args of the template. If they are not the same,
then a compile error will result. I tried hard removing this duplication
but the C preprocessor is not powerful enough (or my CPP magic
experience points is not at a high enough level) to not need them.

A lot of trace events are coming in with new XFS development. Most of
the trace points are identical except for the name. The following shows
the advantage of having TRACE_EVENT_TEMPLATE:

$ size fs/xfs/xfs.o.*
    text          data     bss     dec     hex filename
  452114          2788    3520  458422   6feb6 fs/xfs/xfs.o.old
  638482         38116    3744  680342   a6196 fs/xfs/xfs.o.template
  996954         38116    4480 1039550   fdcbe fs/xfs/xfs.o.trace

xfs.o.old is without any tracepoints.
xfs.o.template uses the new TRACE_EVENT_TEMPLATE.
xfs.o.trace uses the current TRACE_EVENT macros.

Requested-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Undef TRACE_EVENT_FN between trace events headers inclusion</title>
<updated>2009-08-27T16:32:54Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-08-27T16:17:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6c347d43eea29221a8ebab9ff9cbe7a00cddac98'/>
<id>urn:sha1:6c347d43eea29221a8ebab9ff9cbe7a00cddac98</id>
<content type='text'>
The recent commit:

	tracing/events: fix the include file dependencies

fixed a file dependency problem while including more than
one trace event header file.

This fix undefined TRACE_EVENT after an event header macro
preprocessing in order to make tracepoint.h able to correctly declare
the tracepoints necessary for the next event header file.

But now we also need to undefine TRACE_EVENT_FN at the end of an event
header file preprocessing for the same reason.

This fixes the following build error:

In file included from include/trace/events/napi.h:5,
                 from net/core/net-traces.c:28:
include/linux/tracepoint.h:285:1: warning: "TRACE_EVENT_FN" redefined
In file included from include/trace/define_trace.h:61,
                 from include/trace/events/skb.h:40,
                 from net/core/net-traces.c:27:
include/trace/ftrace.h:50:1: warning: this is the location of the previous definition
In file included from include/trace/events/napi.h:5,
                 from net/core/net-traces.c:28:
include/linux/tracepoint.h:285:1: warning: "TRACE_EVENT_FN" redefined
In file included from include/trace/define_trace.h:61,
                 from include/trace/events/skb.h:40,
                 from net/core/net-traces.c:27:
include/trace/ftrace.h:50:1: warning: this is the location of the previous definition

Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Xiao Guangrong &lt;xiaoguangrong@cn.fujitsu.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
LKML-Reference: &lt;20090827161732.GA7618@nowhere&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
