<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel/trace/trace.c, branch v2.6.39-rc2</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 irqoff selftest expanding max buffer</title>
<updated>2011-03-10T15:34:58+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-03-10T01:09:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4a0b1665db09cf2da9ad7d0f12da386373c10bfa'/>
<id>4a0b1665db09cf2da9ad7d0f12da386373c10bfa</id>
<content type='text'>
If the kernel command line declares a tracer "ftrace=sometracer" and
that tracer is either not defined or is enabled after irqsoff,
then the irqs off selftest will fail with the following error:

Testing tracer irqsoff:
------------[ cut here ]------------
WARNING: at /home/rostedt/work/autotest/nobackup/linux-test.git/kernel/trace/tra
ce.c:713 update_max_tr_single+0xfa/0x11b()
Hardware name:
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.38-rc8-test #1
Call Trace:
 [&lt;c0441d9d&gt;] ? warn_slowpath_common+0x65/0x7a
 [&lt;c049adb2&gt;] ? update_max_tr_single+0xfa/0x11b
 [&lt;c0441dc1&gt;] ? warn_slowpath_null+0xf/0x13
 [&lt;c049adb2&gt;] ? update_max_tr_single+0xfa/0x11b
 [&lt;c049e454&gt;] ? stop_critical_timing+0x154/0x204
 [&lt;c049b54b&gt;] ? trace_selftest_startup_irqsoff+0x5b/0xc1
 [&lt;c049b54b&gt;] ? trace_selftest_startup_irqsoff+0x5b/0xc1
 [&lt;c049b54b&gt;] ? trace_selftest_startup_irqsoff+0x5b/0xc1
 [&lt;c049e529&gt;] ? time_hardirqs_on+0x25/0x28
 [&lt;c0468bca&gt;] ? trace_hardirqs_on_caller+0x18/0x12f
 [&lt;c0468cec&gt;] ? trace_hardirqs_on+0xb/0xd
 [&lt;c049b54b&gt;] ? trace_selftest_startup_irqsoff+0x5b/0xc1
 [&lt;c049b6b8&gt;] ? register_tracer+0xf8/0x1a3
 [&lt;c14e93fe&gt;] ? init_irqsoff_tracer+0xd/0x11
 [&lt;c040115e&gt;] ? do_one_initcall+0x71/0x121
 [&lt;c14e93f1&gt;] ? init_irqsoff_tracer+0x0/0x11
 [&lt;c14ce3a9&gt;] ? kernel_init+0x13a/0x1b6
 [&lt;c14ce26f&gt;] ? kernel_init+0x0/0x1b6
 [&lt;c0403842&gt;] ? kernel_thread_helper+0x6/0x10
---[ end trace e93713a9d40cd06c ]---
.. no entries found ..FAILED!

What happens is the "ftrace=..." will expand the ring buffer to its
default size (from its minimum size) but it will not expand the
max ring buffer (the ring buffer to store maximum latencies).
When the irqsoff test runs, it will call the ring buffer swap routine
that checks if the max ring buffer is the same size as the normal
ring buffer, and will fail if it is not. This causes the test to fail.

The solution is to expand the max ring buffer before running the self
test if the max ring buffer is used by that tracer and the normal ring
buffer is expanded. The max ring buffer should be shrunk again after
the test is done to save space.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the kernel command line declares a tracer "ftrace=sometracer" and
that tracer is either not defined or is enabled after irqsoff,
then the irqs off selftest will fail with the following error:

Testing tracer irqsoff:
------------[ cut here ]------------
WARNING: at /home/rostedt/work/autotest/nobackup/linux-test.git/kernel/trace/tra
ce.c:713 update_max_tr_single+0xfa/0x11b()
Hardware name:
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.38-rc8-test #1
Call Trace:
 [&lt;c0441d9d&gt;] ? warn_slowpath_common+0x65/0x7a
 [&lt;c049adb2&gt;] ? update_max_tr_single+0xfa/0x11b
 [&lt;c0441dc1&gt;] ? warn_slowpath_null+0xf/0x13
 [&lt;c049adb2&gt;] ? update_max_tr_single+0xfa/0x11b
 [&lt;c049e454&gt;] ? stop_critical_timing+0x154/0x204
 [&lt;c049b54b&gt;] ? trace_selftest_startup_irqsoff+0x5b/0xc1
 [&lt;c049b54b&gt;] ? trace_selftest_startup_irqsoff+0x5b/0xc1
 [&lt;c049b54b&gt;] ? trace_selftest_startup_irqsoff+0x5b/0xc1
 [&lt;c049e529&gt;] ? time_hardirqs_on+0x25/0x28
 [&lt;c0468bca&gt;] ? trace_hardirqs_on_caller+0x18/0x12f
 [&lt;c0468cec&gt;] ? trace_hardirqs_on+0xb/0xd
 [&lt;c049b54b&gt;] ? trace_selftest_startup_irqsoff+0x5b/0xc1
 [&lt;c049b6b8&gt;] ? register_tracer+0xf8/0x1a3
 [&lt;c14e93fe&gt;] ? init_irqsoff_tracer+0xd/0x11
 [&lt;c040115e&gt;] ? do_one_initcall+0x71/0x121
 [&lt;c14e93f1&gt;] ? init_irqsoff_tracer+0x0/0x11
 [&lt;c14ce3a9&gt;] ? kernel_init+0x13a/0x1b6
 [&lt;c14ce26f&gt;] ? kernel_init+0x0/0x1b6
 [&lt;c0403842&gt;] ? kernel_thread_helper+0x6/0x10
---[ end trace e93713a9d40cd06c ]---
.. no entries found ..FAILED!

What happens is the "ftrace=..." will expand the ring buffer to its
default size (from its minimum size) but it will not expand the
max ring buffer (the ring buffer to store maximum latencies).
When the irqsoff test runs, it will call the ring buffer swap routine
that checks if the max ring buffer is the same size as the normal
ring buffer, and will fail if it is not. This causes the test to fail.

The solution is to expand the max ring buffer before running the self
test if the max ring buffer is used by that tracer and the normal ring
buffer is expanded. The max ring buffer should be shrunk again after
the test is done to save space.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Remove lock_depth from event entry</title>
<updated>2011-03-10T15:31:48+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-03-09T15:41:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e6e1e2593592a8f6f6380496655d8c6f67431266'/>
<id>e6e1e2593592a8f6f6380496655d8c6f67431266</id>
<content type='text'>
The lock_depth field in the event headers was added as a temporary
data point for help in removing the BKL. Now that the BKL is pretty
much been removed, we can remove this field.

This in turn changes the header from 12 bytes to 8 bytes,
removing the 4 byte buffer that gcc would insert if the first field
in the data load was 8 bytes in size.

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 field in the event headers was added as a temporary
data point for help in removing the BKL. Now that the BKL is pretty
much been removed, we can remove this field.

This in turn changes the header from 12 bytes to 8 bytes,
removing the 4 byte buffer that gcc would insert if the first field
in the data load was 8 bytes in size.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Add an 'overwrite' trace_option.</title>
<updated>2011-03-09T18:52:27+00:00</updated>
<author>
<name>David Sharp</name>
<email>dhsharp@google.com</email>
</author>
<published>2010-12-08T21:46:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=750912fa366312e9c5bc83eab352898a26750401'/>
<id>750912fa366312e9c5bc83eab352898a26750401</id>
<content type='text'>
Add an "overwrite" trace_option for ftrace to control whether the buffer should
be overwritten on overflow or not. The default remains to overwrite old events
when the buffer is full. This patch adds the option to instead discard newest
events when the buffer is full. This is useful to get a snapshot of traces just
after enabling traces. Dropping the current event is also a simpler code path.

Signed-off-by: David Sharp &lt;dhsharp@google.com&gt;
LKML-Reference: &lt;1291844807-15481-1-git-send-email-dhsharp@google.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>
Add an "overwrite" trace_option for ftrace to control whether the buffer should
be overwritten on overflow or not. The default remains to overwrite old events
when the buffer is full. This patch adds the option to instead discard newest
events when the buffer is full. This is useful to get a snapshot of traces just
after enabling traces. Dropping the current event is also a simpler code path.

Signed-off-by: David Sharp &lt;dhsharp@google.com&gt;
LKML-Reference: &lt;1291844807-15481-1-git-send-email-dhsharp@google.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Deprecate tracing_enabled for tracing_on</title>
<updated>2011-02-08T22:14:58+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-02-08T18:54:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6752ab4a9c30d5411b2dfdb251a3f1cb18aae487'/>
<id>6752ab4a9c30d5411b2dfdb251a3f1cb18aae487</id>
<content type='text'>
tracing_enabled should not be used, it is heavy weight and does not
do much in helping lower the overhead.

tracing_on should be used instead. Warn users to use tracing_on
when tracing_enabled is used as it will soon be removed from the
tracing directory.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tracing_enabled should not be used, it is heavy weight and does not
do much in helping lower the overhead.

tracing_on should be used instead. Warn users to use tracing_on
when tracing_enabled is used as it will soon be removed from the
tracing directory.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Fix preempt count leak</title>
<updated>2011-01-08T04:20:02+00:00</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2010-12-09T07:47:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1dbd1951f39e13da579ffe879cce19586d0462de'/>
<id>1dbd1951f39e13da579ffe879cce19586d0462de</id>
<content type='text'>
While running my ftrace stress test, this showed up:

BUG: sleeping function called from invalid context at mm/mmap.c:233
...
note: cat[3293] exited with preempt_count 1

The bug was introduced by commit 91e86e560d0b3ce4c5fc64fd2bbb99f856a30a4e
("tracing: Fix recursive user stack trace")

Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
LKML-Reference: &lt;4D0089AC.1020802@cn.fujitsu.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>
While running my ftrace stress test, this showed up:

BUG: sleeping function called from invalid context at mm/mmap.c:233
...
note: cat[3293] exited with preempt_count 1

The bug was introduced by commit 91e86e560d0b3ce4c5fc64fd2bbb99f856a30a4e
("tracing: Fix recursive user stack trace")

Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
LKML-Reference: &lt;4D0089AC.1020802@cn.fujitsu.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'tip/perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent</title>
<updated>2010-12-16T10:21:24+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2010-12-16T10:21:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d949750fed168b6553ca11ed19e4affd19d7a4d7'/>
<id>d949750fed168b6553ca11ed19e4affd19d7a4d7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Fix panic when lseek() called on "trace" opened for writing</title>
<updated>2010-11-30T17:18:17+00:00</updated>
<author>
<name>Slava Pestov</name>
<email>slavapestov@google.com</email>
</author>
<published>2010-11-24T23:13:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=364829b1263b44aa60383824e4c1289d83d78ca7'/>
<id>364829b1263b44aa60383824e4c1289d83d78ca7</id>
<content type='text'>
The file_ops struct for the "trace" special file defined llseek as seq_lseek().
However, if the file was opened for writing only, seq_open() was not called,
and the seek would dereference a null pointer, file-&gt;private_data.

This patch introduces a new wrapper for seq_lseek() which checks if the file
descriptor is opened for reading first. If not, it does nothing.

Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Slava Pestov &lt;slavapestov@google.com&gt;
LKML-Reference: &lt;1290640396-24179-1-git-send-email-slavapestov@google.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>
The file_ops struct for the "trace" special file defined llseek as seq_lseek().
However, if the file was opened for writing only, seq_open() was not called,
and the seek would dereference a null pointer, file-&gt;private_data.

This patch introduces a new wrapper for seq_lseek() which checks if the file
descriptor is opened for reading first. If not, it does nothing.

Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Slava Pestov &lt;slavapestov@google.com&gt;
LKML-Reference: &lt;1290640396-24179-1-git-send-email-slavapestov@google.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2010-11-26T22:28:17+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-11-26T22:28:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d2f30c73aba19be828c759edcd21140390cd06e4'/>
<id>d2f30c73aba19be828c759edcd21140390cd06e4</id>
<content type='text'>
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf symbols: Remove incorrect open-coded container_of()
  perf record: Handle restrictive permissions in /proc/{kallsyms,modules}
  x86/kprobes: Prevent kprobes to probe on save_args()
  irq_work: Drop cmpxchg() result
  perf: Fix owner-list vs exit
  x86, hw_nmi: Move backtrace_mask declaration under ARCH_HAS_NMI_WATCHDOG
  tracing: Fix recursive user stack trace
  perf,hw_breakpoint: Initialize hardware api earlier
  x86: Ignore trap bits on single step exceptions
  tracing: Force arch_local_irq_* notrace for paravirt
  tracing: Fix module use of trace_bprintk()
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf symbols: Remove incorrect open-coded container_of()
  perf record: Handle restrictive permissions in /proc/{kallsyms,modules}
  x86/kprobes: Prevent kprobes to probe on save_args()
  irq_work: Drop cmpxchg() result
  perf: Fix owner-list vs exit
  x86, hw_nmi: Move backtrace_mask declaration under ARCH_HAS_NMI_WATCHDOG
  tracing: Fix recursive user stack trace
  perf,hw_breakpoint: Initialize hardware api earlier
  x86: Ignore trap bits on single step exceptions
  tracing: Force arch_local_irq_* notrace for paravirt
  tracing: Fix module use of trace_bprintk()
</pre>
</div>
</content>
</entry>
<entry>
<title>BKL: remove extraneous #include &lt;smp_lock.h&gt;</title>
<updated>2010-11-17T16:59:32+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2010-11-17T15:26:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=451a3c24b0135bce54542009b5fde43846c7cf67'/>
<id>451a3c24b0135bce54542009b5fde43846c7cf67</id>
<content type='text'>
The big kernel lock has been removed from all these files at some point,
leaving only the #include.

Remove this too as a cleanup.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The big kernel lock has been removed from all these files at some point,
leaving only the #include.

Remove this too as a cleanup.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Fix recursive user stack trace</title>
<updated>2010-11-13T02:20:08+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2010-11-10T11:56:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=91e86e560d0b3ce4c5fc64fd2bbb99f856a30a4e'/>
<id>91e86e560d0b3ce4c5fc64fd2bbb99f856a30a4e</id>
<content type='text'>
The user stack trace can fault when examining the trace. Which
would call the do_page_fault handler, which would trace again,
which would do the user stack trace, which would fault and call
do_page_fault again ...

Thus this is causing a recursive bug. We need to have a recursion
detector here.

[ Resubmitted by Jiri Olsa ]

[ Eric Dumazet recommended using __this_cpu_* instead of __get_cpu_* ]

Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
LKML-Reference: &lt;1289390172-9730-3-git-send-email-jolsa@redhat.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>
The user stack trace can fault when examining the trace. Which
would call the do_page_fault handler, which would trace again,
which would do the user stack trace, which would fault and call
do_page_fault again ...

Thus this is causing a recursive bug. We need to have a recursion
detector here.

[ Resubmitted by Jiri Olsa ]

[ Eric Dumazet recommended using __this_cpu_* instead of __get_cpu_* ]

Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
LKML-Reference: &lt;1289390172-9730-3-git-send-email-jolsa@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
