<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace, branch v3.4.31</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/trace?h=v3.4.31</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/trace?h=v3.4.31'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-01-28T04:47:42Z</updated>
<entry>
<title>ftrace: Be first to run code modification on modules</title>
<updated>2013-01-28T04:47:42Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2012-12-14T14:48:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f2a010040e2c368a76f7ea0ed6533f5779cb6b4b'/>
<id>urn:sha1:f2a010040e2c368a76f7ea0ed6533f5779cb6b4b</id>
<content type='text'>
commit c1bf08ac26e92122faab9f6c32ea8aba94612dae upstream.

If some other kernel subsystem has a module notifier, and adds a kprobe
to a ftrace mcount point (now that kprobes work on ftrace points),
when the ftrace notifier runs it will fail and disable ftrace, as well
as kprobes that are attached to ftrace points.

Here's the error:

 WARNING: at kernel/trace/ftrace.c:1618 ftrace_bug+0x239/0x280()
 Hardware name: Bochs
 Modules linked in: fat(+) stap_56d28a51b3fe546293ca0700b10bcb29__8059(F) nfsv4 auth_rpcgss nfs dns_resolver fscache xt_nat iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack lockd sunrpc ppdev parport_pc parport microcode virtio_net i2c_piix4 drm_kms_helper ttm drm i2c_core [last unloaded: bid_shared]
 Pid: 8068, comm: modprobe Tainted: GF            3.7.0-0.rc8.git0.1.fc19.x86_64 #1
 Call Trace:
  [&lt;ffffffff8105e70f&gt;] warn_slowpath_common+0x7f/0xc0
  [&lt;ffffffff81134106&gt;] ? __probe_kernel_read+0x46/0x70
  [&lt;ffffffffa0180000&gt;] ? 0xffffffffa017ffff
  [&lt;ffffffffa0180000&gt;] ? 0xffffffffa017ffff
  [&lt;ffffffff8105e76a&gt;] warn_slowpath_null+0x1a/0x20
  [&lt;ffffffff810fd189&gt;] ftrace_bug+0x239/0x280
  [&lt;ffffffff810fd626&gt;] ftrace_process_locs+0x376/0x520
  [&lt;ffffffff810fefb7&gt;] ftrace_module_notify+0x47/0x50
  [&lt;ffffffff8163912d&gt;] notifier_call_chain+0x4d/0x70
  [&lt;ffffffff810882f8&gt;] __blocking_notifier_call_chain+0x58/0x80
  [&lt;ffffffff81088336&gt;] blocking_notifier_call_chain+0x16/0x20
  [&lt;ffffffff810c2a23&gt;] sys_init_module+0x73/0x220
  [&lt;ffffffff8163d719&gt;] system_call_fastpath+0x16/0x1b
 ---[ end trace 9ef46351e53bbf80 ]---
 ftrace failed to modify [&lt;ffffffffa0180000&gt;] init_once+0x0/0x20 [fat]
  actual: cc:bb:d2:4b:e1

A kprobe was added to the init_once() function in the fat module on load.
But this happened before ftrace could have touched the code. As ftrace
didn't run yet, the kprobe system had no idea it was a ftrace point and
simply added a breakpoint to the code (0xcc in the cc:bb:d2:4b:e1).

Then when ftrace went to modify the location from a call to mcount/fentry
into a nop, it didn't see a call op, but instead it saw the breakpoint op
and not knowing what to do with it, ftrace shut itself down.

The solution is to simply give the ftrace module notifier the max priority.
This should have been done regardless, as the core code ftrace modification
also happens very early on in boot up. This makes the module modification
closer to core modification.

Link: http://lkml.kernel.org/r/20130107140333.593683061@goodmis.org

Acked-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Reported-by: Frank Ch. Eigler &lt;fche@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;

</content>
</entry>
<entry>
<title>ring-buffer: Fix race between integrity check and readers</title>
<updated>2013-01-17T16:50:51Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2012-11-30T03:31:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4d7981bfc21f7b6ef48f9a819d2c9969ad6eea71'/>
<id>urn:sha1:4d7981bfc21f7b6ef48f9a819d2c9969ad6eea71</id>
<content type='text'>
commit 9366c1ba13fbc41bdb57702e75ca4382f209c82f upstream.

The function rb_check_pages() was added to make sure the ring buffer's
pages were sane. This check is done when the ring buffer size is modified
as well as when the iterator is released (closing the "trace" file),
as that was considered a non fast path and a good place to do a sanity
check.

The problem is that the check does not have any locks around it.
If one process were to read the trace file, and another were to read
the raw binary file, the check could happen while the reader is reading
the file.

The issues with this is that the check requires to clear the HEAD page
before doing the full check and it restores it afterward. But readers
require the HEAD page to exist before it can read the buffer, otherwise
it gives a nasty warning and disables the buffer.

By adding the reader lock around the check, this keeps the race from
happening.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ftrace: Clear bits properly in reset_iter_read()</title>
<updated>2012-12-17T18:37:46Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2012-06-09T16:10:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=455d8953951baf0d38673b010100241e508b765c'/>
<id>urn:sha1:455d8953951baf0d38673b010100241e508b765c</id>
<content type='text'>
commit 70f77b3f7ec010ff9624c1f2e39a81babc9e2429 upstream.

There is a typo here where '&amp;' is used instead of '|' and it turns the
statement into a noop.  The original code is equivalent to:

	iter-&gt;flags &amp;= ~((1 &lt;&lt; 2) &amp; (1 &lt;&lt; 4));

Link: http://lkml.kernel.org/r/20120609161027.GD6488@elgon.mountain

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>splice: fix racy pipe-&gt;buffers uses</title>
<updated>2012-07-16T16:04:42Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-06-12T13:24:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2c07f25ea7800adb36cd8da9b58c4ecd3fc3d064'/>
<id>urn:sha1:2c07f25ea7800adb36cd8da9b58c4ecd3fc3d064</id>
<content type='text'>
commit 047fe3605235888f3ebcda0c728cb31937eadfe6 upstream.

Dave Jones reported a kernel BUG at mm/slub.c:3474! triggered
by splice_shrink_spd() called from vmsplice_to_pipe()

commit 35f3d14dbbc5 (pipe: add support for shrinking and growing pipes)
added capability to adjust pipe-&gt;buffers.

Problem is some paths don't hold pipe mutex and assume pipe-&gt;buffers
doesn't change for their duration.

Fix this by adding nr_pages_max field in struct splice_pipe_desc, and
use it in place of pipe-&gt;buffers where appropriate.

splice_shrink_spd() loses its struct pipe_inode_info argument.

Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Alexander Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Tom Herbert &lt;therbert@google.com&gt;
Tested-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
[bwh: Backported to 3.2:
 - Adjust context in vmsplice_to_pipe()
 - Update one more call to splice_shrink_spd(), from skb_splice_bits()]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tracing: change CPU ring buffer state from tracing_cpumask</title>
<updated>2012-07-16T16:04:40Z</updated>
<author>
<name>Vaibhav Nagarnaik</name>
<email>vnagarnaik@google.com</email>
</author>
<published>2012-05-04T01:59:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4943d9cb7d82218d196ccc034ecaf933298e7e95'/>
<id>urn:sha1:4943d9cb7d82218d196ccc034ecaf933298e7e95</id>
<content type='text'>
commit 71babb2705e2203a64c27ede13ae3508a0d2c16c upstream.

According to Documentation/trace/ftrace.txt:

tracing_cpumask:

        This is a mask that lets the user only trace
        on specified CPUS. The format is a hex string
        representing the CPUS.

The tracing_cpumask currently doesn't affect the tracing state of
per-CPU ring buffers.

This patch enables/disables CPU recording as its corresponding bit in
tracing_cpumask is set/unset.

Link: http://lkml.kernel.org/r/1336096792-25373-3-git-send-email-vnagarnaik@google.com

Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Laurent Chavey &lt;chavey@google.com&gt;
Cc: Justin Teravest &lt;teravest@google.com&gt;
Cc: David Sharp &lt;dhsharp@google.com&gt;
Signed-off-by: Vaibhav Nagarnaik &lt;vnagarnaik@google.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Have tracing_off() actually turn tracing off</title>
<updated>2012-06-22T18:36:55Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2012-06-06T23:50:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3993b24649773080897fde524ea2d9f311eba2aa'/>
<id>urn:sha1:3993b24649773080897fde524ea2d9f311eba2aa</id>
<content type='text'>
commit f2bf1f6f5f89d031245067512449fc889b2f4bb2 upstream.

A recent update to have tracing_on/off() only affect the ftrace ring
buffers instead of all ring buffers had a cut and paste error.
The tracing_off() did the exact same thing as tracing_on() and
would not actually turn off tracing. Unfortunately, tracing_off()
is more important to be working than tracing_on() as this is a key
development tool, as it lets the developer turn off tracing as soon
as a problem is discovered. It is also used by panic and oops code.

This bug also breaks the 'echo func:traceoff &gt; set_ftrace_filter'

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Do not enable function event with enable</title>
<updated>2012-05-10T19:55:43Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2012-05-10T19:55:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9b63776fa3ca96c4ecda76f6fa947b7b0add66ac'/>
<id>urn:sha1:9b63776fa3ca96c4ecda76f6fa947b7b0add66ac</id>
<content type='text'>
With the adding of function tracing event to perf, it caused a
side effect that produces the following warning when enabling all
events in ftrace:

 # echo 1 &gt; /sys/kernel/debug/tracing/events/enable

[console]
event trace: Could not enable event function

This is because when enabling all events via the debugfs system
it ignores events that do not have a -&gt;reg() function assigned.
This was to skip over the ftrace internal events (as they are
not TRACE_EVENTs). But as the ftrace function event now has
a -&gt;reg() function attached to it for use with perf, it is no
longer ignored.

Worse yet, this -&gt;reg() function is being called when it should
not be. It returns an error and causes the above warning to
be printed.

By adding a new event_call flag (TRACE_EVENT_FL_IGNORE_ENABLE)
and have all ftrace internel event structures have it set,
setting the events/enable will no longe try to incorrectly enable
the function event and does not warn.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Fix stacktrace of latency tracers (irqsoff and friends)</title>
<updated>2012-04-19T21:00:13Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2012-04-19T14:31:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=db4c75cbebd7e5910cd3bcb6790272fcc3042857'/>
<id>urn:sha1:db4c75cbebd7e5910cd3bcb6790272fcc3042857</id>
<content type='text'>
While debugging a latency with someone on IRC (mirage335) on #linux-rt (OFTC),
we discovered that the stacktrace output of the latency tracers
(preemptirqsoff) was empty.

This bug was caused by the creation of the dynamic length stack trace
again (like commit 12b5da3 "tracing: Fix ent_size in trace output" was).

This bug is caused by the latency tracers requiring the next event
to determine the time between the current event and the next. But by
grabbing the next event, the iter-&gt;ent_size is set to the next event
instead of the current one. As the stacktrace event is the last event,
this makes the ent_size zero and causes nothing to be printed for
the stack trace. The dynamic stacktrace uses the ent_size to determine
how much of the stack can be printed. The ent_size of zero means
no stack.

The simple fix is to save the iter-&gt;ent_size before finding the next event.

Note, mirage335 asked to remain anonymous from LKML and git, so I will
not add the Reported-by and Tested-by tags, even though he did report
the issue and tested the fix.

Cc: stable@vger.kernel.org # 3.1+
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Fix regression with tracing_on</title>
<updated>2012-04-16T19:41:28Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2012-04-16T19:41:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=348f0fc238efb441a28e7644c51f9fd3001b228a'/>
<id>urn:sha1:348f0fc238efb441a28e7644c51f9fd3001b228a</id>
<content type='text'>
The change to make tracing_on affect only the ftrace ring buffer, caused
a bug where it wont affect any ring buffer. The problem was that the buffer
of the trace_array was passed to the write function and not the trace array
itself.

The trace_array can change the buffer when running a latency tracer. If this
happens, then the buffer being disabled may not be the buffer currently used
by ftrace. This will cause the tracing_on file to become useless.

The simple fix is to pass the trace_array to the write function instead of
the buffer. Then the actual buffer may be changed.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Fix build breakage without CONFIG_PERF_EVENTS (again)</title>
<updated>2012-04-14T01:37:04Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@opensource.wolfsonmicro.com</email>
</author>
<published>2012-04-13T08:52:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6e48b550d1f5f1919e6500547ae14a73fbf66c7b'/>
<id>urn:sha1:6e48b550d1f5f1919e6500547ae14a73fbf66c7b</id>
<content type='text'>
Today's -next fails to link for me:

kernel/built-in.o:(.data+0x178e50): undefined reference to `perf_ftrace_event_register'

It looks like multiple fixes have been merged for the issue fixed by
commit fa73dc9 (tracing: Fix build breakage without CONFIG_PERF_EVENTS)
though I can't identify the other changes that have gone in at the
minute, it's possible that the changes which caused the breakage fixed
by the previous commit got dropped but the fix made it in.

Link: http://lkml.kernel.org/r/1334307179-21255-1-git-send-email-broonie@opensource.wolfsonmicro.com

Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
