<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/trace_selftest.c, branch v2.6.30</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.30</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.30'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2009-03-22T14:17:21Z</updated>
<entry>
<title>tracing: keep the tracing buffer after self-test failure</title>
<updated>2009-03-22T14:17:21Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-03-22T14:13:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0cf53ff62b3e9e491ff5e5f05b193fb6ce643047'/>
<id>urn:sha1:0cf53ff62b3e9e491ff5e5f05b193fb6ce643047</id>
<content type='text'>
Instead of using ftrace_dump_on_oops, it's far more convenient
to have the trace leading up to a self-test failure available
in /debug/tracing/trace.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;1237694675-23509-1-git-send-email-fweisbec@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/function-graph-tracer: prevent hangs during self-tests</title>
<updated>2009-03-22T13:06:40Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-03-22T04:04:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cf586b61f80229491127d3c57c06ed93c9f530d3'/>
<id>urn:sha1:cf586b61f80229491127d3c57c06ed93c9f530d3</id>
<content type='text'>
Impact: detect tracing related hangs

Sometimes, with some configs, the function graph tracer can make
the timer interrupt too much slow, hanging the kernel in an endless
loop of timer interrupts servicing.

As suggested by Ingo, this patch brings a watchdog which stops the
selftest after a defined number of functions traced, definitely
disabling this tracer.

For those who want to debug the cause of the function graph trace
hang, you can pass the ftrace_dump_on_oops kernel parameter to dump
the traces after this hang detection.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;1237694675-23509-1-git-send-email-fweisbec@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/ftrace: stop {irqs, preempt}soff tracers when tracing is stopped</title>
<updated>2009-03-18T09:12:38Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-03-17T21:38:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=490362003457f8d387f6f6e73e3a7efbf56c3314'/>
<id>urn:sha1:490362003457f8d387f6f6e73e3a7efbf56c3314</id>
<content type='text'>
Impact: fix a selftest warning

In some cases, it's possible to see the following warning on irqsoff
tracer selftest:

[    4.640003] Testing tracer irqsoff: &lt;4&gt;------------[ cut here ]------------
[    4.653562] WARNING: at kernel/trace/trace.c:458 update_max_tr_single+0x9a/0xc4()
[    4.660000] Hardware name: System Product Name
[    4.660000] Modules linked in:
[    4.660000] Pid: 301, comm: kstop/1 Not tainted 2.6.29-rc8-tip #35837
[    4.660000] Call Trace:
[    4.660000]  [&lt;4014b588&gt;] warn_slowpath+0x79/0x8f
[    4.660000]  [&lt;402d6949&gt;] ? put_dec+0x64/0x6b
[    4.660000]  [&lt;40162b56&gt;] ? getnstimeofday+0x58/0xdd
[    4.660000]  [&lt;40162210&gt;] ? clocksource_read+0x3/0xf
[    4.660000]  [&lt;4015eb44&gt;] ? ktime_set+0x8/0x34
[    4.660000]  [&lt;4014101a&gt;] ? balance_runtime+0x8/0x56
[    4.660000]  [&lt;405f6f11&gt;] ? _spin_lock+0x3/0x10
[    4.660000]  [&lt;4011f643&gt;] ? ftrace_call+0x5/0x8
[    4.660000]  [&lt;4015d0f1&gt;] ? task_cputime_zero+0x3/0x27
[    4.660000]  [&lt;40190ee7&gt;] ? cpupri_set+0x90/0xcb
[    4.660000]  [&lt;405f7208&gt;] ? _spin_lock_irqsave+0x22/0x34
[    4.660000]  [&lt;40190f12&gt;] ? cpupri_set+0xbb/0xcb
[    4.660000]  [&lt;405f7151&gt;] ? _spin_unlock_irqrestore+0x23/0x35
[    4.660000]  [&lt;4018493f&gt;] ? ring_buffer_reset_cpu+0x27/0x51
[    4.660000]  [&lt;405f7208&gt;] ? _spin_lock_irqsave+0x22/0x34
[    4.660000]  [&lt;40184962&gt;] ? ring_buffer_reset_cpu+0x4a/0x51
[    4.660000]  [&lt;405f7151&gt;] ? _spin_unlock_irqrestore+0x23/0x35
[    4.660000]  [&lt;4018cc29&gt;] ? trace_hardirqs_off+0x1a/0x1c
[    4.660000]  [&lt;405f7151&gt;] ? _spin_unlock_irqrestore+0x23/0x35
[    4.660000]  [&lt;40184962&gt;] ? ring_buffer_reset_cpu+0x4a/0x51
[    4.660000]  [&lt;401850f3&gt;] ? cpumask_next+0x15/0x18
[    4.660000]  [&lt;4018a41f&gt;] update_max_tr_single+0x9a/0xc4
[    4.660000]  [&lt;4014e5fe&gt;] ? exit_notify+0x16/0xf2
[    4.660000]  [&lt;4018cd13&gt;] check_critical_timing+0xcc/0x11e
[    4.660000]  [&lt;4014e5fe&gt;] ? exit_notify+0x16/0xf2
[    4.660000]  [&lt;4014e5fe&gt;] ? exit_notify+0x16/0xf2
[    4.660000]  [&lt;4018cdf1&gt;] stop_critical_timing+0x8c/0x9f
[    4.660000]  [&lt;4014e5c4&gt;] ? forget_original_parent+0xac/0xd0
[    4.660000]  [&lt;4018ce3a&gt;] trace_hardirqs_on+0x1a/0x1c
[    4.660000]  [&lt;4014e5c4&gt;] forget_original_parent+0xac/0xd0
[    4.660000]  [&lt;4014e5fe&gt;] exit_notify+0x16/0xf2
[    4.660000]  [&lt;4014e8a5&gt;] do_exit+0x1cb/0x225
[    4.660000]  [&lt;4015c72b&gt;] ? kthread+0x0/0x69
[    4.660000]  [&lt;4011f61d&gt;] kernel_thread_helper+0xd/0x10
[    4.660000] ---[ end trace a7919e7f17c0a725 ]---
[    4.660164] .. no entries found ..FAILED!

During the selftest of irqsoff tracer, we do that:

	/* disable interrupts for a bit */
	local_irq_disable();
	udelay(100);
	local_irq_enable();
	/* stop the tracing. */
	tracing_stop();
	/* check both trace buffers */
	ret = trace_test_buffer(tr, NULL);

If a callsite performs a new max delay with irqs off just after
tracing_stop, update_max_tr_single() -&gt; ring_buffer_swap_cpu()
will be called with the buffers disabled by tracing_stop(), hence
the warning, then ring_buffer_swap_cpu() return -EAGAIN and
update_max_tr_single() complains.

Fix it by also stopping the tracer before stopping the tracing globally.
A similar situation can happen with preemptoff and preemptirqsoff tracers
where we apply the same fix.

Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;1237325938-5240-1-git-send-email-fweisbec@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/ftrace: fix double calls to tracing_start()</title>
<updated>2009-03-16T08:13:18Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-03-15T23:32:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ac1d52d0b85854958c7e78c8006e39aadb6ce4b8'/>
<id>urn:sha1:ac1d52d0b85854958c7e78c8006e39aadb6ce4b8</id>
<content type='text'>
Impact: fix a warning during preemptirqsoff selftests

When the preemptirqsoff selftest fails, we see the following
warning:

[    6.050000] Testing tracer preemptirqsoff: .. no entries found ..
------------[ cut here ]------------
[    6.060000] WARNING: at kernel/trace/trace.c:688 tracing_start+0x67/0xd3()
[    6.060000] Modules linked in:
[    6.060000] Pid: 1, comm: swapper Tainted: G
[    6.060000] Call Trace:
[    6.060000]  [&lt;ffffffff802460ff&gt;] warn_slowpath+0xb1/0x100
[    6.060000]  [&lt;ffffffff802a8f5b&gt;] ? trace_preempt_on+0x35/0x4b
[    6.060000]  [&lt;ffffffff802a37fb&gt;] ? tracing_start+0x31/0xd3
[    6.060000]  [&lt;ffffffff802a37fb&gt;] ? tracing_start+0x31/0xd3
[    6.060000]  [&lt;ffffffff80271e0b&gt;] ? __lock_acquired+0xe6/0x1f2
[    6.060000]  [&lt;ffffffff802a37fb&gt;] ? tracing_start+0x31/0xd3
[    6.060000]  [&lt;ffffffff802a3831&gt;] tracing_start+0x67/0xd3
[    6.060000]  [&lt;ffffffff802a8ace&gt;] ? irqsoff_tracer_reset+0x2d/0x57
[    6.060000]  [&lt;ffffffff802a4d1c&gt;] trace_selftest_startup_preemptirqsoff+0x1c8/0x1f1
[    6.060000]  [&lt;ffffffff802a4798&gt;] register_tracer+0x12f/0x241
[    6.060000]  [&lt;ffffffff810250d0&gt;] ? init_irqsoff_tracer+0x0/0x53
[    6.060000]  [&lt;ffffffff8102510b&gt;] init_irqsoff_tracer+0x3b/0x53

This is because in fail case, the preemptirqsoff tracer selftest calls twice
the tracing_start() function:

int
trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *tr)
{
        if (!ret &amp;&amp; !count) {
                printk(KERN_CONT ".. no entries found ..");
                ret = -1;
                tracing_start(); &lt;-----
                goto out;
        }
        [...]
out:
        trace-&gt;reset(tr);
        tracing_start(); &lt;------
        tracing_max_latency = save_max;

        return ret;
}

Since it is well handled in the out path, we don't need the conditional one.

Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;1237159961-7447-1-git-send-email-fweisbec@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: use generic __stringify</title>
<updated>2009-03-10T04:35:05Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-03-09T20:00:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9cc26a261d43e5898287a1f5808132f8f05ceb1c'/>
<id>urn:sha1:9cc26a261d43e5898287a1f5808132f8f05ceb1c</id>
<content type='text'>
Impact: clean up

This removes the custom made STR(x) macros in the tracer and uses
the generic __stringify macro instead.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge branches 'tracing/blktrace', 'tracing/ftrace' and 'tracing/urgent' into tracing/core</title>
<updated>2009-02-19T09:20:17Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-02-19T09:20:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=40999096e8b9872199bf56ecd0c4d98397ccaf2f'/>
<id>urn:sha1:40999096e8b9872199bf56ecd0c4d98397ccaf2f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tracing: limit the number of loops the ring buffer self test can make</title>
<updated>2009-02-19T03:50:01Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-02-19T03:50:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4b3e3d228429c75d398f1aa24532e468d3220c49'/>
<id>urn:sha1:4b3e3d228429c75d398f1aa24532e468d3220c49</id>
<content type='text'>
Impact: prevent deadlock if ring buffer gets corrupted

This patch adds a paranoid check to make sure the ring buffer consumer
does not go into an infinite loop. Since the ring buffer has been set
to read only, the consumer should not loop for more than the ring buffer
size. A check is added to make sure the consumer does not loop more than
the ring buffer size.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
</entry>
<entry>
<title>tracing: disable tracing while testing ring buffer</title>
<updated>2009-02-19T03:04:01Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-02-18T23:33:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0c5119c1e655e0719a69601b1049acdd5ec1c125'/>
<id>urn:sha1:0c5119c1e655e0719a69601b1049acdd5ec1c125</id>
<content type='text'>
Impact: fix to prevent hard lockup on self tests

If one of the tracers are broken and is constantly filling the ring
buffer while the test of the ring buffer is running, it will hang
the box. The reason is that the test is a consumer that will not
stop till the ring buffer is empty. But if the tracer is broken and
is constantly producing input to the buffer, this test will never
end. The result is a lockup of the box.

This happened when KALLSYMS was not defined and the dynamic ftrace
test constantly filled the ring buffer, because the filter failed
and all functions were being traced. Something was being called
that constantly filled the buffer.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
</entry>
<entry>
<title>tracing: fix typing mistake in hint message and comments</title>
<updated>2009-02-17T17:38:24Z</updated>
<author>
<name>Wenji Huang</name>
<email>wenji.huang@oracle.com</email>
</author>
<published>2009-02-17T06:10:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=73d8b8bc4f24a97a406d09c8268ac019f4ac661e'/>
<id>urn:sha1:73d8b8bc4f24a97a406d09c8268ac019f4ac661e</id>
<content type='text'>
Impact: cleanup

Fix incorrect hint message in code and typos in comments.

Signed-off-by: Wenji Huang &lt;wenji.huang@oracle.com&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
</entry>
<entry>
<title>tracing: fix the return value of trace selftest</title>
<updated>2009-02-17T17:38:24Z</updated>
<author>
<name>Wenji Huang</name>
<email>wenji.huang@oracle.com</email>
</author>
<published>2009-02-17T06:09:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d2ef7c2f0f9ab48c25eafc0ebad0df5f7930420b'/>
<id>urn:sha1:d2ef7c2f0f9ab48c25eafc0ebad0df5f7930420b</id>
<content type='text'>
This patch is to fix the return value of trace_selftest_startup_sysprof
and trace_selftest_startup_branch on failure.

Signed-off-by: Wenji Huang &lt;wenji.huang@oracle.com&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
</entry>
</feed>
