<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/include/linux/tracepoint.h, branch v2.6.30-rc5</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>tracing: remove funky whitespace in the trace code</title>
<updated>2009-03-10T18:13:14+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-03-10T18:10:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ef18012b248b47ec9a12c3a83ca5e99782d39c5d'/>
<id>ef18012b248b47ec9a12c3a83ca5e99782d39c5d</id>
<content type='text'>
Impact: clean up

There existed a lot of &lt;space&gt;&lt;tab&gt;'s in the tracing code. This
patch removes them.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Impact: clean up

There existed a lot of &lt;space&gt;&lt;tab&gt;'s in the tracing code. This
patch removes them.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: document TRACE_EVENT macro in tracepoint.h</title>
<updated>2009-03-10T16:58:51+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-03-10T16:58:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=823f9124fb2e33eeb624d139978a52089f8a02ae'/>
<id>823f9124fb2e33eeb624d139978a52089f8a02ae</id>
<content type='text'>
Impact: clean up / comments

Kosaki Motohiro asked about an explanation to the TRACE_EVENT macro.
Ingo Molnar replied with a nice description.

This patch takes the description that Ingo wrote (with some slight
modifications) and adds it to the tracepoint.h file.

Reported-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Impact: clean up / comments

Kosaki Motohiro asked about an explanation to the TRACE_EVENT macro.
Ingo Molnar replied with a nice description.

This patch takes the description that Ingo wrote (with some slight
modifications) and adds it to the tracepoint.h file.

Reported-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: flip the TP_printk and TP_fast_assign in the TRACE_EVENT macro</title>
<updated>2009-03-10T16:41:38+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-03-10T16:41:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=30a8fecc2d34f086df34fe2f2b926f080e002600'/>
<id>30a8fecc2d34f086df34fe2f2b926f080e002600</id>
<content type='text'>
Impact: clean up

In trying to stay consistant with the C style format in the TRACE_EVENT
macro, it makes more sense to do the printk after the assigning of
the variables.

Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Impact: clean up

In trying to stay consistant with the C style format in the TRACE_EVENT
macro, it makes more sense to do the printk after the assigning of
the variables.

Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: remove obsolete TRACE_EVENT_FORMAT macro</title>
<updated>2009-03-10T04:35:12+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-03-10T04:15:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=157587d7ac555458da9f682e3250135e468470a6'/>
<id>157587d7ac555458da9f682e3250135e468470a6</id>
<content type='text'>
Impact: clean up

The TRACE_EVENT_FORMAT macro is no longer used by trace points
and only the DECLARE_TRACE, TRACE_FORMAT or TRACE_EVENT macros should
be used by them. Although the TRACE_EVENT_FORMAT macro is still used
by the internal tracing utility, it should not be used in core
kernel code.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Impact: clean up

The TRACE_EVENT_FORMAT macro is no longer used by trace points
and only the DECLARE_TRACE, TRACE_FORMAT or TRACE_EVENT macros should
be used by them. Although the TRACE_EVENT_FORMAT macro is still used
by the internal tracing utility, it should not be used in core
kernel code.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: new format for specialized trace points</title>
<updated>2009-03-10T04:35:07+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-03-09T21:14:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=da4d03020c2af32f73e8bfbab0a66620d85bb9bb'/>
<id>da4d03020c2af32f73e8bfbab0a66620d85bb9bb</id>
<content type='text'>
Impact: clean up and enhancement

The TRACE_EVENT_FORMAT macro looks quite ugly and is limited in its
ability to save data as well as to print the record out. Working with
Ingo Molnar, we came up with a new format that is much more pleasing to
the eye of C developers. This new macro is more C style than the old
macro, and is more obvious to what it does.

Here's the example. The only updated macro in this patch is the
sched_switch trace point.

The old method looked like this:

 TRACE_EVENT_FORMAT(sched_switch,
        TP_PROTO(struct rq *rq, struct task_struct *prev,
                struct task_struct *next),
        TP_ARGS(rq, prev, next),
        TP_FMT("task %s:%d ==&gt; %s:%d",
              prev-&gt;comm, prev-&gt;pid, next-&gt;comm, next-&gt;pid),
        TRACE_STRUCT(
                TRACE_FIELD(pid_t, prev_pid, prev-&gt;pid)
                TRACE_FIELD(int, prev_prio, prev-&gt;prio)
                TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN],
                                    next_comm,
                                    TP_CMD(memcpy(TRACE_ENTRY-&gt;next_comm,
                                                 next-&gt;comm,
                                                 TASK_COMM_LEN)))
                TRACE_FIELD(pid_t, next_pid, next-&gt;pid)
                TRACE_FIELD(int, next_prio, next-&gt;prio)
        ),
        TP_RAW_FMT("prev %d:%d ==&gt; next %s:%d:%d")
        );

The above method is hard to read and requires two format fields.

The new method:

 /*
  * Tracepoint for task switches, performed by the scheduler:
  *
  * (NOTE: the 'rq' argument is not used by generic trace events,
  *        but used by the latency tracer plugin. )
  */
 TRACE_EVENT(sched_switch,

	TP_PROTO(struct rq *rq, struct task_struct *prev,
		 struct task_struct *next),

	TP_ARGS(rq, prev, next),

	TP_STRUCT__entry(
		__array(	char,	prev_comm,	TASK_COMM_LEN	)
		__field(	pid_t,	prev_pid			)
		__field(	int,	prev_prio			)
		__array(	char,	next_comm,	TASK_COMM_LEN	)
		__field(	pid_t,	next_pid			)
		__field(	int,	next_prio			)
	),

	TP_printk("task %s:%d [%d] ==&gt; %s:%d [%d]",
		__entry-&gt;prev_comm, __entry-&gt;prev_pid, __entry-&gt;prev_prio,
		__entry-&gt;next_comm, __entry-&gt;next_pid, __entry-&gt;next_prio),

	TP_fast_assign(
		memcpy(__entry-&gt;next_comm, next-&gt;comm, TASK_COMM_LEN);
		__entry-&gt;prev_pid	= prev-&gt;pid;
		__entry-&gt;prev_prio	= prev-&gt;prio;
		memcpy(__entry-&gt;prev_comm, prev-&gt;comm, TASK_COMM_LEN);
		__entry-&gt;next_pid	= next-&gt;pid;
		__entry-&gt;next_prio	= next-&gt;prio;
	)
 );

This macro is called TRACE_EVENT, it is broken up into 5 parts:

 TP_PROTO:        the proto type of the trace point
 TP_ARGS:         the arguments of the trace point
 TP_STRUCT_entry: the structure layout of the entry in the ring buffer
 TP_printk:       the printk format
 TP_fast_assign:  the method used to write the entry into the ring buffer

The structure is the definition of how the event will be saved in the
ring buffer. The printk is used by the internal tracing in case of
an oops, and the kernel needs to print out the format of the record
to the console. This the TP_printk gives a means to show the records
in a human readable format. It is also used to print out the data
from the trace file.

The TP_fast_assign is executed directly. It is basically like a C function,
where the __entry is the handle to the record.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Impact: clean up and enhancement

The TRACE_EVENT_FORMAT macro looks quite ugly and is limited in its
ability to save data as well as to print the record out. Working with
Ingo Molnar, we came up with a new format that is much more pleasing to
the eye of C developers. This new macro is more C style than the old
macro, and is more obvious to what it does.

Here's the example. The only updated macro in this patch is the
sched_switch trace point.

The old method looked like this:

 TRACE_EVENT_FORMAT(sched_switch,
        TP_PROTO(struct rq *rq, struct task_struct *prev,
                struct task_struct *next),
        TP_ARGS(rq, prev, next),
        TP_FMT("task %s:%d ==&gt; %s:%d",
              prev-&gt;comm, prev-&gt;pid, next-&gt;comm, next-&gt;pid),
        TRACE_STRUCT(
                TRACE_FIELD(pid_t, prev_pid, prev-&gt;pid)
                TRACE_FIELD(int, prev_prio, prev-&gt;prio)
                TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN],
                                    next_comm,
                                    TP_CMD(memcpy(TRACE_ENTRY-&gt;next_comm,
                                                 next-&gt;comm,
                                                 TASK_COMM_LEN)))
                TRACE_FIELD(pid_t, next_pid, next-&gt;pid)
                TRACE_FIELD(int, next_prio, next-&gt;prio)
        ),
        TP_RAW_FMT("prev %d:%d ==&gt; next %s:%d:%d")
        );

The above method is hard to read and requires two format fields.

The new method:

 /*
  * Tracepoint for task switches, performed by the scheduler:
  *
  * (NOTE: the 'rq' argument is not used by generic trace events,
  *        but used by the latency tracer plugin. )
  */
 TRACE_EVENT(sched_switch,

	TP_PROTO(struct rq *rq, struct task_struct *prev,
		 struct task_struct *next),

	TP_ARGS(rq, prev, next),

	TP_STRUCT__entry(
		__array(	char,	prev_comm,	TASK_COMM_LEN	)
		__field(	pid_t,	prev_pid			)
		__field(	int,	prev_prio			)
		__array(	char,	next_comm,	TASK_COMM_LEN	)
		__field(	pid_t,	next_pid			)
		__field(	int,	next_prio			)
	),

	TP_printk("task %s:%d [%d] ==&gt; %s:%d [%d]",
		__entry-&gt;prev_comm, __entry-&gt;prev_pid, __entry-&gt;prev_prio,
		__entry-&gt;next_comm, __entry-&gt;next_pid, __entry-&gt;next_prio),

	TP_fast_assign(
		memcpy(__entry-&gt;next_comm, next-&gt;comm, TASK_COMM_LEN);
		__entry-&gt;prev_pid	= prev-&gt;pid;
		__entry-&gt;prev_prio	= prev-&gt;prio;
		memcpy(__entry-&gt;prev_comm, prev-&gt;comm, TASK_COMM_LEN);
		__entry-&gt;next_pid	= next-&gt;pid;
		__entry-&gt;next_prio	= next-&gt;prio;
	)
 );

This macro is called TRACE_EVENT, it is broken up into 5 parts:

 TP_PROTO:        the proto type of the trace point
 TP_ARGS:         the arguments of the trace point
 TP_STRUCT_entry: the structure layout of the entry in the ring buffer
 TP_printk:       the printk format
 TP_fast_assign:  the method used to write the entry into the ring buffer

The structure is the definition of how the event will be saved in the
ring buffer. The printk is used by the internal tracing in case of
an oops, and the kernel needs to print out the format of the record
to the console. This the TP_printk gives a means to show the records
in a human readable format. It is also used to print out the data
from the trace file.

The TP_fast_assign is executed directly. It is basically like a C function,
where the __entry is the handle to the record.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: replace TP&lt;var&gt; with TP_&lt;var&gt;</title>
<updated>2009-03-10T04:35:04+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-03-09T19:47:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2939b0469d04ba9ac791aca9a81625d7eb50662b'/>
<id>2939b0469d04ba9ac791aca9a81625d7eb50662b</id>
<content type='text'>
Impact: clean up

The macros TPPROTO, TPARGS, TPFMT, TPRAWFMT, and TPCMD all look a bit
ugly. This patch adds an underscore to their names.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Impact: clean up

The macros TPPROTO, TPARGS, TPFMT, TPRAWFMT, and TPCMD all look a bit
ugly. This patch adds an underscore to their names.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: create the C style tracing for the sched subsystem</title>
<updated>2009-02-28T09:04:13+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-02-28T07:47:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=629928041c53771f9902753d50fef6b35f36d33d'/>
<id>629928041c53771f9902753d50fef6b35f36d33d</id>
<content type='text'>
This patch utilizes the TRACE_EVENT_FORMAT macro to enable the C style
faster tracing for the sched subsystem trace points.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch utilizes the TRACE_EVENT_FORMAT macro to enable the C style
faster tracing for the sched subsystem trace points.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: wrap arguments with PARAMS</title>
<updated>2009-02-26T02:44:26+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-02-25T20:54:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3cdfdf91fcc77cfc82592e2b5c2ab35abe819c41'/>
<id>3cdfdf91fcc77cfc82592e2b5c2ab35abe819c41</id>
<content type='text'>
Peter Zijlstra warned that TPPROTO and TPARGS might become something
other than a simple copy of itself. To prevent this from having
side effects in the TRACE_FORMAT macro in tracepoint.h, we add a
PARAMS() macro to be defined as just a wrapper.

Reported-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Peter Zijlstra warned that TPPROTO and TPARGS might become something
other than a simple copy of itself. To prevent this from having
side effects in the TRACE_FORMAT macro in tracepoint.h, we add a
PARAMS() macro to be defined as just a wrapper.

Reported-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: rename DEFINE_TRACE_FMT to just TRACE_FORMAT</title>
<updated>2009-02-26T02:44:22+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-02-25T20:49:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=eef62a6826b8ab530cefff5aa55c1661a209c803'/>
<id>eef62a6826b8ab530cefff5aa55c1661a209c803</id>
<content type='text'>
There's been a bit confusion to whether DEFINE/DECLARE_TRACE_FMT should
be a DEFINE or a DECLARE. Ingo Molnar suggested simply calling it
TRACE_FORMAT.

Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's been a bit confusion to whether DEFINE/DECLARE_TRACE_FMT should
be a DEFINE or a DECLARE. Ingo Molnar suggested simply calling it
TRACE_FORMAT.

Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: add DEFINE_TRACE_FMT to tracepoint.h</title>
<updated>2009-02-25T02:53:32+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-02-24T17:07:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7c37730cd31ddb2d3a1da142af9b18c29b8c433b'/>
<id>7c37730cd31ddb2d3a1da142af9b18c29b8c433b</id>
<content type='text'>
This patch creates a DEFINE_TRACE_FMT to map to DECLARE_TRACE.
This allows for the developers to place format strings and
args in with their tracepoint declaration. A tracer may now
override the DEFINE_TRACE_FMT macro and use it to record
a default format.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch creates a DEFINE_TRACE_FMT to map to DECLARE_TRACE.
This allows for the developers to place format strings and
args in with their tracepoint declaration. A tracer may now
override the DEFINE_TRACE_FMT macro and use it to record
a default format.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
