<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace, branch v3.0.5</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/trace?h=v3.0.5</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/trace?h=v3.0.5'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-08-05T04:58:38Z</updated>
<entry>
<title>tracing: Have "enable" file use refcounts like the "filter" file</title>
<updated>2011-08-05T04:58:38Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-07-05T18:32:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ff7b3dc6a634832a912445db8bffd18b05c15043'/>
<id>urn:sha1:ff7b3dc6a634832a912445db8bffd18b05c15043</id>
<content type='text'>
commit 40ee4dffff061399eb9358e0c8fcfbaf8de4c8fe upstream.

The "enable" file for the event system can be removed when a module
is unloaded and the event system only has events from that module.
As the event system nr_events count goes to zero, it may be freed
if its ref_count is also set to zero.

Like the "filter" file, the "enable" file may be opened by a task and
referenced later, after a module has been unloaded and the events for
that event system have been removed.

Although the "filter" file referenced the event system structure,
the "enable" file only references a pointer to the event system
name. Since the name is freed when the event system is removed,
it is possible that an access to the "enable" file may reference
a freed pointer.

Update the "enable" file to use the subsystem_open() routine that
the "filter" file uses, to keep a reference to the event system
structure while the "enable" file is opened.

Reported-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>tracing: Fix bug when reading system filters on module removal</title>
<updated>2011-08-05T04:58:38Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-07-05T15:36:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f35869d69b65ac9323a0d7ee13c062e1636d4a1b'/>
<id>urn:sha1:f35869d69b65ac9323a0d7ee13c062e1636d4a1b</id>
<content type='text'>
commit e9dbfae53eeb9fc3d4bb7da3df87fa9875f5da02 upstream.

The event system is freed when its nr_events is set to zero. This happens
when a module created an event system and then later the module is
removed. Modules may share systems, so the system is allocated when
it is created and freed when the modules are unloaded and all the
events under the system are removed (nr_events set to zero).

The problem arises when a task opened the "filter" file for the
system. If the module is unloaded and it removed the last event for
that system, the system structure is freed. If the task that opened
the filter file accesses the "filter" file after the system has
been freed, the system will access an invalid pointer.

By adding a ref_count, and using it to keep track of what
is using the event system, we can free it after all users
are finished with the event system.

Reported-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>tracing: Fix regression in printk_formats file</title>
<updated>2011-06-09T12:42:15Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-06-09T12:40:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=db5e7ecc4abc91b9f26f0c0d79ef88a51e987d90'/>
<id>urn:sha1:db5e7ecc4abc91b9f26f0c0d79ef88a51e987d90</id>
<content type='text'>
The fix to fix the printk_formats of modules broke the
printk_formats of trace_printks in the kernel.

The update of what to show via the seq_file was only updated
if the passed in fmt was NULL, which happens only on the first
iteration. The result was showing the first format every time
instead of iterating through the available formats.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Revert 8ab2b7efd ftrace: Remove unnecessary disabling of irqs</title>
<updated>2011-06-07T18:49:19Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-06-07T13:26:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a4f18ed11a4ddf327dd91cd19e237278600ad327'/>
<id>urn:sha1:a4f18ed11a4ddf327dd91cd19e237278600ad327</id>
<content type='text'>
Revert the commit that removed the disabling of interrupts around
the initial modifying of mcount callers to nops, and update the comment.

The original comment was outdated and stated that the interrupts were
being disabled to prevent kstop machine, which was required with the
old ftrace daemon, but was no longer the case.

What the comment failed to mention was that interrupts needed to be
disabled to keep interrupts from preempting the modifying of the code
and then executing the code that was partially modified.

Revert the commit and update the comment.

Reported-by: Richard W.M. Jones &lt;rjones@redhat.com&gt;
Tested-by: Richard W.M. Jones &lt;rjones@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>kprobes/trace: Fix kprobe selftest for gcc 4.6</title>
<updated>2011-06-07T18:47:36Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-06-07T02:35:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=265a5b7ee3eb21a4d0e53e17d59ba6eada91af39'/>
<id>urn:sha1:265a5b7ee3eb21a4d0e53e17d59ba6eada91af39</id>
<content type='text'>
With gcc 4.6, the self test kprobe function:

 kprobe_trace_selftest_target()

is optimized such that kallsyms does not list it. The kprobes
test uses this function to insert a probe and test it. But
it will fail the test if the function is not listed in kallsyms.

Adding a __used annotation keeps the symbol in the kallsyms table.

Suggested-by: David Daney &lt;ddaney@caviumnetworks.com&gt;
Cc: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Fix possible undefined return code</title>
<updated>2011-06-07T02:34:25Z</updated>
<author>
<name>GuoWen Li</name>
<email>guowen.li.linux@gmail.com</email>
</author>
<published>2011-06-01T11:18:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0aff1c0cef13b34c17e81a502336fad738151c37'/>
<id>urn:sha1:0aff1c0cef13b34c17e81a502336fad738151c37</id>
<content type='text'>
kernel/trace/ftrace.c: In function 'ftrace_regex_write.clone.15':
kernel/trace/ftrace.c:2743:6: warning: 'ret' may be used uninitialized in this
function

Signed-off-by: GuoWen Li &lt;guowen.li.linux@gmail.com&gt;
Link: http://lkml.kernel.org/r/201106011918.47939.guowen.li.linux@gmail.com
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Add internal recursive checks</title>
<updated>2011-05-26T02:13:49Z</updated>
<author>
<name>Steven Rostedt</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2011-05-25T18:27:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b1cff0ad1062621ae63cb6c5dc4165191fe2e9f1'/>
<id>urn:sha1:b1cff0ad1062621ae63cb6c5dc4165191fe2e9f1</id>
<content type='text'>
Witold reported a reboot caused by the selftests of the dynamic function
tracer. He sent me a config and I used ktest to do a config_bisect on it
(as my config did not cause the crash). It pointed out that the problem
config was CONFIG_PROVE_RCU.

What happened was that if multiple callbacks are attached to the
function tracer, we iterate a list of callbacks. Because the list is
managed by synchronize_sched() and preempt_disable, the access to the
pointers uses rcu_dereference_raw().

When PROVE_RCU is enabled, the rcu_dereference_raw() calls some
debugging functions, which happen to be traced. The tracing of the debug
function would then call rcu_dereference_raw() which would then call the
debug function and then... well you get the idea.

I first wrote two different patches to solve this bug.

1) add a __rcu_dereference_raw() that would not do any checks.
2) add notrace to the offending debug functions.

Both of these patches worked.

Talking with Paul McKenney on IRC, he suggested to add recursion
detection instead. This seemed to be a better solution, so I decided to
implement it. As the task_struct already has a trace_recursion to detect
recursion in the ring buffer, and that has a very small number it
allows, I decided to use that same variable to add flags that can detect
the recursion inside the infrastructure of the function tracer.

I plan to change it so that the task struct bit can be checked in
mcount, but as that requires changes to all archs, I will hold that off
to the next merge window.

Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Link: http://lkml.kernel.org/r/1306348063.1465.116.camel@gandalf.stny.rr.com
Reported-by: Witold Baryluk &lt;baryluk@smp.if.uj.edu.pl&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Add __print_symbolic_u64 to avoid warnings on 32bit machine</title>
<updated>2011-05-26T02:13:44Z</updated>
<author>
<name>liubo</name>
<email>liubo2009@cn.fujitsu.com</email>
</author>
<published>2011-04-19T01:35:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2fc1b6f0d0a719e1e2a30bf076a3a799feaf6af2'/>
<id>urn:sha1:2fc1b6f0d0a719e1e2a30bf076a3a799feaf6af2</id>
<content type='text'>
Filesystem, like Btrfs, has some "ULL" macros, and when these macros are passed
to tracepoints'__print_symbolic(), there will be 64-&gt;32 truncate WARNINGS during
compiling on 32bit box.

Signed-off-by: Liu Bo &lt;liubo2009@cn.fujitsu.com&gt;
Link: http://lkml.kernel.org/r/4DACE6E0.7000507@cn.fujitsu.com
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Set ops-&gt;flag to enabled even on static function tracing</title>
<updated>2011-05-26T02:13:42Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-05-23T19:33:49Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3b6cfdb1714a33ae4d2ca9fbc818a42cf7adee69'/>
<id>urn:sha1:3b6cfdb1714a33ae4d2ca9fbc818a42cf7adee69</id>
<content type='text'>
When dynamic ftrace is not configured, the ops-&gt;flags still needs
to have its FTRACE_OPS_FL_ENABLED bit set in ftrace_startup().

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Have event with function tracer check error return</title>
<updated>2011-05-26T02:13:39Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-05-23T19:27:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=17bb615ad4f8d2d2c0f02794d27d7f83e0009ef4'/>
<id>urn:sha1:17bb615ad4f8d2d2c0f02794d27d7f83e0009ef4</id>
<content type='text'>
The self tests for event tracer does not check if the function
tracing was successfully activated. It needs to before it continues
the tests, otherwise the wrong errors may be reported.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
