<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel/trace/trace_output.c, branch tegra-10.9.9</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_seq_printf() return value</title>
<updated>2009-10-24T09:07:50+00:00</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@redhat.com</email>
</author>
<published>2009-10-23T23:36:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3e69533b51930a7169235db2caf703884e6e3bbb'/>
<id>3e69533b51930a7169235db2caf703884e6e3bbb</id>
<content type='text'>
trace_seq_printf() return value is a little ambiguous. It
currently returns the length of the space available in the
buffer. printf usually returns the amount written. This is not
adequate here, because:

  trace_seq_printf(s, "");

is perfectly legal, and returning 0 would indicate that it
failed.

We can always see the amount written by looking at the before
and after values of s-&gt;len. This is not quite the same use as
printf. We only care if the string was successfully written to
the buffer or not.

Make trace_seq_printf() return 0 if the trace oversizes the
buffer's free space, 1 otherwise.

Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;20091023233646.631787612@goodmis.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
trace_seq_printf() return value is a little ambiguous. It
currently returns the length of the space available in the
buffer. printf usually returns the amount written. This is not
adequate here, because:

  trace_seq_printf(s, "");

is perfectly legal, and returning 0 would indicate that it
failed.

We can always see the amount written by looking at the before
and after values of s-&gt;len. This is not quite the same use as
printf. We only care if the string was successfully written to
the buffer or not.

Make trace_seq_printf() return 0 if the trace oversizes the
buffer's free space, 1 otherwise.

Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;20091023233646.631787612@goodmis.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: fix transposed numbers of lock_depth and preempt_count</title>
<updated>2009-10-07T18:05:04+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-09-27T11:02:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=829b876dfc94ea8be3a47e200d06f1f217bb104f'/>
<id>829b876dfc94ea8be3a47e200d06f1f217bb104f</id>
<content type='text'>
The lock_depth and preempt_count numbers in the latency format is
transposed.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The lock_depth and preempt_count numbers in the latency format is
transposed.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>trace: Fix missing assignment in trace_ctxwake_*</title>
<updated>2009-10-06T12:28:24+00:00</updated>
<author>
<name>Hiroshi Shimamoto</name>
<email>h-shimamoto@ct.jp.nec.com</email>
</author>
<published>2009-10-01T04:33:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b0f56f1a63b7b968e6feeeefeace24bc8e0a4a65'/>
<id>b0f56f1a63b7b968e6feeeefeace24bc8e0a4a65</id>
<content type='text'>
The state char variable S should be reassigned, if S == 0.

We are missing the state of the task that is going to sleep for the
context switch events (in the raw mode).

Fortunately the problem arises with the sched_switch/wake_up
tracers, not the sched trace events.

The formers are legacy now. But still, that was buggy.

Signed-off-by: Hiroshi Shimamoto &lt;h-shimamoto@ct.jp.nec.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;4AC43118.6050409@ct.jp.nec.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>
The state char variable S should be reassigned, if S == 0.

We are missing the state of the task that is going to sleep for the
context switch events (in the raw mode).

Fortunately the problem arises with the sched_switch/wake_up
tracers, not the sched trace events.

The formers are legacy now. But still, that was buggy.

Signed-off-by: Hiroshi Shimamoto &lt;h-shimamoto@ct.jp.nec.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;4AC43118.6050409@ct.jp.nec.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: consolidate code between trace_output.c and trace_function_graph.c</title>
<updated>2009-09-11T18:24:13+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-09-11T18:24:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f81c972d27c36729e65d4a815e3d7b782a540bad'/>
<id>f81c972d27c36729e65d4a815e3d7b782a540bad</id>
<content type='text'>
Both trace_output.c and trace_function_graph.c do basically the same
thing to handle the printing of the latency-format. This patch moves
the code into one function that both can use.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Both trace_output.c and trace_function_graph.c do basically the same
thing to handle the printing of the latency-format. This patch moves
the code into one function that both can use.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: add lock depth to entries</title>
<updated>2009-09-11T17:55:35+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-09-11T17:55:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=637e7e864103a7a68c1ce43ada27dfc25c0d113f'/>
<id>637e7e864103a7a68c1ce43ada27dfc25c0d113f</id>
<content type='text'>
This patch adds the lock depth of the big kernel lock to the generic
entry header. This way we can see the depth of the lock and help
in removing the BKL.

Example:

 #                  _------=&gt; CPU#
 #                 / _-----=&gt; irqs-off
 #                | / _----=&gt; need-resched
 #                || / _---=&gt; hardirq/softirq
 #                ||| / _--=&gt; preempt-depth
 #                |||| /_--=&gt; lock-depth
 #                |||||/     delay
 #  cmd     pid   |||||| time  |   caller
 #     \   /      ||||||   \   |   /
   &lt;idle&gt;-0       2.N..3 5902255250us+: lock_acquire: read rcu_read_lock
   &lt;idle&gt;-0       2.N..3 5902255253us+: lock_release: rcu_read_lock
   &lt;idle&gt;-0       2dN..3 5902255257us+: lock_acquire: xtime_lock
   &lt;idle&gt;-0       2dN..4 5902255259us : lock_acquire: clocksource_lock
   &lt;idle&gt;-0       2dN..4 5902255261us+: lock_release: clocksource_lock

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds the lock depth of the big kernel lock to the generic
entry header. This way we can see the depth of the lock and help
in removing the BKL.

Example:

 #                  _------=&gt; CPU#
 #                 / _-----=&gt; irqs-off
 #                | / _----=&gt; need-resched
 #                || / _---=&gt; hardirq/softirq
 #                ||| / _--=&gt; preempt-depth
 #                |||| /_--=&gt; lock-depth
 #                |||||/     delay
 #  cmd     pid   |||||| time  |   caller
 #     \   /      ||||||   \   |   /
   &lt;idle&gt;-0       2.N..3 5902255250us+: lock_acquire: read rcu_read_lock
   &lt;idle&gt;-0       2.N..3 5902255253us+: lock_release: rcu_read_lock
   &lt;idle&gt;-0       2dN..3 5902255257us+: lock_acquire: xtime_lock
   &lt;idle&gt;-0       2dN..4 5902255259us : lock_acquire: clocksource_lock
   &lt;idle&gt;-0       2dN..4 5902255261us+: lock_release: clocksource_lock

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: move tgid out of generic entry and into userstack</title>
<updated>2009-09-11T15:36:23+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-09-11T15:36:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=48659d31195bb76d688e99dabd816c5472fb1656'/>
<id>48659d31195bb76d688e99dabd816c5472fb1656</id>
<content type='text'>
The userstack trace required the recording of the tgid entry.
Unfortunately, it was added to the generic entry where it wasted
4 bytes of every entry and was only used by one entry.

This patch moves it out of the generic field and moves it into the
only user (userstack_entry).

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The userstack trace required the recording of the tgid entry.
Unfortunately, it was added to the generic entry where it wasted
4 bytes of every entry and was only used by one entry.

This patch moves it out of the generic field and moves it into the
only user (userstack_entry).

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<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>
</feed>
