<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel/trace/trace_output.c, branch v2.6.31-rc4</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: Fix trace_print_seq()</title>
<updated>2009-07-02T06:51:13+00:00</updated>
<author>
<name>Xiao Guangrong</name>
<email>xiaoguangrong@cn.fujitsu.com</email>
</author>
<published>2009-07-01T08:50:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e1af3aec3e2e7d21d4b3054323779d478c19d907'/>
<id>e1af3aec3e2e7d21d4b3054323779d478c19d907</id>
<content type='text'>
We will lose something if trace_seq-&gt;buffer[0] is 0, because the copy length
is calculated by strlen() in seq_puts(), so using seq_write() instead of
seq_puts().

There have a example:
after reboot:

 # echo kmemtrace &gt; current_tracer
 # echo 0 &gt; options/kmem_minimalistic
 # cat trace
 # tracer: kmemtrace
 #
 #

Nothing is exported, because the first byte of trace_seq-&gt;buffer[ ]
is KMEMTRACE_USER_ALLOC.

( the value of KMEMTRACE_USER_ALLOC is zero, seeing
  kmemtrace_print_alloc_user() in kernel/trace/kmemtrace.c)

Signed-off-by: Xiao Guangrong &lt;xiaoguangrong@cn.fujitsu.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Acked-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Acked-by: Eduard - Gabriel Munteanu &lt;eduard.munteanu@linux360.ro&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;4A4B2351.5010300@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We will lose something if trace_seq-&gt;buffer[0] is 0, because the copy length
is calculated by strlen() in seq_puts(), so using seq_write() instead of
seq_puts().

There have a example:
after reboot:

 # echo kmemtrace &gt; current_tracer
 # echo 0 &gt; options/kmem_minimalistic
 # cat trace
 # tracer: kmemtrace
 #
 #

Nothing is exported, because the first byte of trace_seq-&gt;buffer[ ]
is KMEMTRACE_USER_ALLOC.

( the value of KMEMTRACE_USER_ALLOC is zero, seeing
  kmemtrace_print_alloc_user() in kernel/trace/kmemtrace.c)

Signed-off-by: Xiao Guangrong &lt;xiaoguangrong@cn.fujitsu.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Acked-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Acked-by: Eduard - Gabriel Munteanu &lt;eduard.munteanu@linux360.ro&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;4A4B2351.5010300@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: add protection around module events unload</title>
<updated>2009-06-09T21:29:07+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-06-09T21:29:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=110bf2b764eb6026b868d84499263cb24b1bcc8d'/>
<id>110bf2b764eb6026b868d84499263cb24b1bcc8d</id>
<content type='text'>
When reading the trace buffer, there is a race that when a module
is unloaded it removes events that is stilled referenced in the buffers.
This patch adds the protection around the unloading of the events
from modules and the reading of the trace buffers.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When reading the trace buffer, there is a race that when a module
is unloaded it removes events that is stilled referenced in the buffers.
This patch adds the protection around the unloading of the events
from modules and the reading of the trace buffers.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: add trace_seq_vprint interface</title>
<updated>2009-06-09T19:17:32+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-06-08T23:09:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=725c624a58a10ef90a2ff889e122158fabf36147'/>
<id>725c624a58a10ef90a2ff889e122158fabf36147</id>
<content type='text'>
The code to update the print formats for events requires a vprintf
format in the trace_seq. This patch adds that interface.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code to update the print formats for events requires a vprintf
format in the trace_seq. This patch adds that interface.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: add annotation to what type of stack trace is recorded</title>
<updated>2009-06-03T15:10:44+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-06-03T15:10:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=563af16c30ede41eda2d614195d88e07f7c7103d'/>
<id>563af16c30ede41eda2d614195d88e07f7c7103d</id>
<content type='text'>
The current method of printing out a stack trace is to add a new line
and print out the trace:

    yum-updatesd-3120  [002]   573.691303:
 =&gt; do_softirq
 =&gt; irq_exit
 =&gt; smp_apic_timer_interrupt
 =&gt; apic_timer_interrupt

This looks a bit awkward, and if we have both stack and user stack traces
running, it would be nice to have a title to tell them apart, although
it is easy to tell by the output.

This patch adds an annotation to the start of the stack traces:

            init-1     [003]   929.304979: &lt;stack trace&gt;
 =&gt; user_path_at
 =&gt; vfs_fstatat
 =&gt; vfs_stat
 =&gt; sys_newstat
 =&gt; system_call_fastpath

             cat-3459  [002]  1016.824040: &lt;user stack trace&gt;
 =&gt;  &lt;0000003aae6c0250&gt;
 =&gt;  &lt;00007ffff4b06ae4&gt;
 =&gt;  &lt;69636172742f6775&gt;

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current method of printing out a stack trace is to add a new line
and print out the trace:

    yum-updatesd-3120  [002]   573.691303:
 =&gt; do_softirq
 =&gt; irq_exit
 =&gt; smp_apic_timer_interrupt
 =&gt; apic_timer_interrupt

This looks a bit awkward, and if we have both stack and user stack traces
running, it would be nice to have a title to tell them apart, although
it is easy to tell by the output.

This patch adds an annotation to the start of the stack traces:

            init-1     [003]   929.304979: &lt;stack trace&gt;
 =&gt; user_path_at
 =&gt; vfs_fstatat
 =&gt; vfs_stat
 =&gt; sys_newstat
 =&gt; system_call_fastpath

             cat-3459  [002]  1016.824040: &lt;user stack trace&gt;
 =&gt;  &lt;0000003aae6c0250&gt;
 =&gt;  &lt;00007ffff4b06ae4&gt;
 =&gt;  &lt;69636172742f6775&gt;

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: fix multiple use of __print_flags and __print_symbolic</title>
<updated>2009-06-03T14:29:48+00:00</updated>
<author>
<name>Steven Whitehouse</name>
<email>swhiteho@redhat.com</email>
</author>
<published>2009-06-03T13:52:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=56d8bd3f0b98972312cad683947ec90b21011199'/>
<id>56d8bd3f0b98972312cad683947ec90b21011199</id>
<content type='text'>
Here is an updated patch to include the extra call to
trace_seq_init() as requested. This is vs. the latest
-tip tree and fixes the use of multiple __print_flags
and __print_symbolic in a single tracer. Also tested
to ensure its working now:

mount.gfs2-2534  [000]   235.850587: gfs2_glock_queue: 8.7 glock 1:2 dequeue PR
mount.gfs2-2534  [000]   235.850591: gfs2_demote_rq: 8.7 glock 1:0 demote EX to NL flags:DI
mount.gfs2-2534  [000]   235.850591: gfs2_glock_queue: 8.7 glock 1:0 dequeue EX
glock_workqueue-2529  [000]   235.850666: gfs2_glock_state_change: 8.7 glock 1:0 state EX =&gt; NL tgt:NL dmt:NL flags:lDpI
glock_workqueue-2529  [000]   235.850672: gfs2_glock_put: 8.7 glock 1:0 state NL =&gt; IV flags:I

Signed-off-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;
LKML-Reference: &lt;1244037123.29604.603.camel@localhost.localdomain&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Here is an updated patch to include the extra call to
trace_seq_init() as requested. This is vs. the latest
-tip tree and fixes the use of multiple __print_flags
and __print_symbolic in a single tracer. Also tested
to ensure its working now:

mount.gfs2-2534  [000]   235.850587: gfs2_glock_queue: 8.7 glock 1:2 dequeue PR
mount.gfs2-2534  [000]   235.850591: gfs2_demote_rq: 8.7 glock 1:0 demote EX to NL flags:DI
mount.gfs2-2534  [000]   235.850591: gfs2_glock_queue: 8.7 glock 1:0 dequeue EX
glock_workqueue-2529  [000]   235.850666: gfs2_glock_state_change: 8.7 glock 1:0 state EX =&gt; NL tgt:NL dmt:NL flags:lDpI
glock_workqueue-2529  [000]   235.850672: gfs2_glock_put: 8.7 glock 1:0 state NL =&gt; IV flags:I

Signed-off-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;
LKML-Reference: &lt;1244037123.29604.603.camel@localhost.localdomain&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing/events: fix output format of user stack</title>
<updated>2009-06-03T14:25:30+00:00</updated>
<author>
<name>walimis</name>
<email>walimisdev@gmail.com</email>
</author>
<published>2009-06-03T08:01:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=048dc50c5e7eada19ebabbad70b7966d14283d41'/>
<id>048dc50c5e7eada19ebabbad70b7966d14283d41</id>
<content type='text'>
According to "events/ftrace/user_stack/format", fix the output of
user stack.

before fix:

  sh-1073  [000]    31.137561:  &lt;b7f274fe&gt; &lt;-  &lt;0804e33c&gt; &lt;-  &lt;080835c1&gt;

after fix:

  sh-1072  [000]    37.039329:
 =&gt;  &lt;b7f8a4fe&gt;
 =&gt;  &lt;0804e33c&gt;
 =&gt;  &lt;080835c1&gt;

Signed-off-by: walimis &lt;walimisdev@gmail.com&gt;
LKML-Reference: &lt;1244016090-7814-3-git-send-email-walimisdev@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to "events/ftrace/user_stack/format", fix the output of
user stack.

before fix:

  sh-1073  [000]    31.137561:  &lt;b7f274fe&gt; &lt;-  &lt;0804e33c&gt; &lt;-  &lt;080835c1&gt;

after fix:

  sh-1072  [000]    37.039329:
 =&gt;  &lt;b7f8a4fe&gt;
 =&gt;  &lt;0804e33c&gt;
 =&gt;  &lt;080835c1&gt;

Signed-off-by: walimis &lt;walimisdev@gmail.com&gt;
LKML-Reference: &lt;1244016090-7814-3-git-send-email-walimisdev@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing/events: fix output format of kernel stack</title>
<updated>2009-06-03T14:25:15+00:00</updated>
<author>
<name>walimis</name>
<email>walimisdev@gmail.com</email>
</author>
<published>2009-06-03T08:01:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f11b3f4e2932bfdcfc458ab8d1ece62724ceabfc'/>
<id>f11b3f4e2932bfdcfc458ab8d1ece62724ceabfc</id>
<content type='text'>
According to "events/ftrace/kernel_stack/format", output format of
kernel stack should use "=&gt;" instead of "&lt;=".

The second problem is that we shouldn't skip the first entry in the stack,
although it seems to be duplicated when used in the "function" tracer,
but events also use it. If we skip the first one, we will drop the topmost
entry of the stack.

The last problem is that if the last entry is ULONG_MAX(0xffffffff), we should
drop it, otherwise it will print a NULL name line.

before fix:

      sh-1072  [000]   26.957239: sched_process_fork: parent sh:1072 child sh:1073
      sh-1072  [000]   26.957262:
 &lt;= syscall_call
 &lt;=
      sh-1072  [000]   26.957744: sched_switch: task sh:1072 [120] (R) ==&gt; sh:1073 [120]
      sh-1072  [000]   26.957752:
 &lt;= preempt_schedule
 &lt;= wake_up_new_task
 &lt;= do_fork
 &lt;= sys_clone
 &lt;= syscall_call
 &lt;=

After fix:

      sh-1075  [000]    39.791848: sched_process_fork: parent sh:1075  child sh:1076
      sh-1075  [000]    39.791871:
 =&gt; sys_clone
 =&gt; syscall_call
      sh-1075  [000]    39.792713: sched_switch: task sh:1075 [120] (R) ==&gt; sh:1076 [120]
      sh-1075  [000]    39.792722:
 =&gt; schedule
 =&gt; preempt_schedule
 =&gt; wake_up_new_task
 =&gt; do_fork
 =&gt; sys_clone
 =&gt; syscall_call

Signed-off-by: walimis &lt;walimisdev@gmail.com&gt;
LKML-Reference: &lt;1244016090-7814-2-git-send-email-walimisdev@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to "events/ftrace/kernel_stack/format", output format of
kernel stack should use "=&gt;" instead of "&lt;=".

The second problem is that we shouldn't skip the first entry in the stack,
although it seems to be duplicated when used in the "function" tracer,
but events also use it. If we skip the first one, we will drop the topmost
entry of the stack.

The last problem is that if the last entry is ULONG_MAX(0xffffffff), we should
drop it, otherwise it will print a NULL name line.

before fix:

      sh-1072  [000]   26.957239: sched_process_fork: parent sh:1072 child sh:1073
      sh-1072  [000]   26.957262:
 &lt;= syscall_call
 &lt;=
      sh-1072  [000]   26.957744: sched_switch: task sh:1072 [120] (R) ==&gt; sh:1073 [120]
      sh-1072  [000]   26.957752:
 &lt;= preempt_schedule
 &lt;= wake_up_new_task
 &lt;= do_fork
 &lt;= sys_clone
 &lt;= syscall_call
 &lt;=

After fix:

      sh-1075  [000]    39.791848: sched_process_fork: parent sh:1075  child sh:1076
      sh-1075  [000]    39.791871:
 =&gt; sys_clone
 =&gt; syscall_call
      sh-1075  [000]    39.792713: sched_switch: task sh:1075 [120] (R) ==&gt; sh:1076 [120]
      sh-1075  [000]    39.792722:
 =&gt; schedule
 =&gt; preempt_schedule
 =&gt; wake_up_new_task
 =&gt; do_fork
 =&gt; sys_clone
 =&gt; syscall_call

Signed-off-by: walimis &lt;walimisdev@gmail.com&gt;
LKML-Reference: &lt;1244016090-7814-2-git-send-email-walimisdev@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: add exports to use __print_symbolic and __print_flags from a module</title>
<updated>2009-06-02T03:25:29+00:00</updated>
<author>
<name>Steven Whitehouse</name>
<email>swhiteho@redhat.com</email>
</author>
<published>2009-06-01T14:53:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ec081ddc3d90aab35bc0de19a358b964978837cf'/>
<id>ec081ddc3d90aab35bc0de19a358b964978837cf</id>
<content type='text'>
A patch to allow the use of __print_symbolic and __print_flags
from a module. This allows the current GFS2 tracing patch to
build.

Signed-off-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;
LKML-Reference: &lt;1243868015.29604.542.camel@localhost.localdomain&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A patch to allow the use of __print_symbolic and __print_flags
from a module. This allows the current GFS2 tracing patch to
build.

Signed-off-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;
LKML-Reference: &lt;1243868015.29604.542.camel@localhost.localdomain&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: add __print_symbolic to trace events</title>
<updated>2009-05-26T18:31:50+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-05-20T23:21:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0f4fc29dd68dfab9c6ddd5d087d34a5b6818cb00'/>
<id>0f4fc29dd68dfab9c6ddd5d087d34a5b6818cb00</id>
<content type='text'>
This patch adds __print_symbolic which is similar to __print_flags but
works for an enumeration type instead. That is, there is only a one to one
mapping between the values and the symbols. When a match is made, then
it is printed, otherwise the hex value is outputed.

[ Impact: add interface for showing symbol names in events ]

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds __print_symbolic which is similar to __print_flags but
works for an enumeration type instead. That is, there is only a one to one
mapping between the values and the symbols. When a match is made, then
it is printed, otherwise the hex value is outputed.

[ Impact: add interface for showing symbol names in events ]

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: add __print_flags for events</title>
<updated>2009-05-26T18:25:22+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-05-26T18:25:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=be74b73a57645cc253d881ab0c1014eb64b9cf22'/>
<id>be74b73a57645cc253d881ab0c1014eb64b9cf22</id>
<content type='text'>
Developers have been asking for the ability in the ftrace event tracer
to display names of bits in a flags variable.

Instead of printing out c2, it would be easier to read FOO|BAR|GOO,
assuming that FOO is bit 1, BAR is bit 6 and GOO is bit 7.

Some examples where this would be useful are the state flags in a context
switch, kmalloc flags, and even permision flags in accessing files.

[
  v2 changes include:

  Frederic Weisbecker's idea of using a mask instead of bits,
  thus we can output GFP_KERNEL instead of GPF_WAIT|GFP_IO|GFP_FS.

  Li Zefan's idea of allowing the caller of __print_flags to add their
  own delimiter (or no delimiter) where we can get for file permissions
  rwx instead of r|w|x.
]

[
  v3 changes:

   Christoph Hellwig's idea of using an array instead of va_args.
]

[ Impact: better displaying of flags in trace output ]

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Developers have been asking for the ability in the ftrace event tracer
to display names of bits in a flags variable.

Instead of printing out c2, it would be easier to read FOO|BAR|GOO,
assuming that FOO is bit 1, BAR is bit 6 and GOO is bit 7.

Some examples where this would be useful are the state flags in a context
switch, kmalloc flags, and even permision flags in accessing files.

[
  v2 changes include:

  Frederic Weisbecker's idea of using a mask instead of bits,
  thus we can output GFP_KERNEL instead of GPF_WAIT|GFP_IO|GFP_FS.

  Li Zefan's idea of allowing the caller of __print_flags to add their
  own delimiter (or no delimiter) where we can get for file permissions
  rwx instead of r|w|x.
]

[
  v3 changes:

   Christoph Hellwig's idea of using an array instead of va_args.
]

[ Impact: better displaying of flags in trace output ]

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
