<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/ftrace.c, branch v3.4-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/trace/ftrace.c?h=v3.4-rc2</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/trace/ftrace.c?h=v3.4-rc2'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-03-13T19:07:37Z</updated>
<entry>
<title>ftrace: Fix function_graph for archs that test ftrace_trace_function</title>
<updated>2012-03-13T19:07:37Z</updated>
<author>
<name>Rajesh Bhagat</name>
<email>rajesh.lnx@gmail.com</email>
</author>
<published>2012-02-17T08:29:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=db6544e0075d192e5ad16eda8689c55fa9c6f8f4'/>
<id>urn:sha1:db6544e0075d192e5ad16eda8689c55fa9c6f8f4</id>
<content type='text'>
When CONFIG_DYNAMIC_FTRACE is not set, some archs (ARM) test
the variable function_trace_function to determine if it should
call the function tracer. If it is not set to ftrace_stub, then
it will call the function and return, and not call the function
graph tracer.

But some of these archs (ARM) do not have the assembly code
to test if function tracing is enabled or not (quick stop of tracing)
and it calls the helper routine ftrace_test_stop_func() instead.

If function tracer is enabled and then disabled, the variable
ftrace_trace_function is still set to the helper routine
ftrace_test_stop_func(), and not to ftrace_stub. This will
prevent the function graph tracer from ever running.

Output before patch
/debug/tracing # echo function &gt; current_tracer
/debug/tracing # echo function_graph &gt; current_tracer
/debug/tracing # cat trace

Output after patch
/debug/tracing # echo function &gt; current_tracer
/debug/tracing # echo function_graph &gt; current_tracer
/debug/tracing # cat trace
0) ! 253.375 us | } /* irq_enter */
0) | generic_handle_irq() {
0) | handle_fasteoi_irq() {
0) 9.208 us | _raw_spin_lock();
0) | handle_irq_event() {
0) | handle_irq_event_percpu() {

Signed-off-by: Rajesh Bhagat &lt;rajesh.lnx@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace, perf: Add filter support for function trace event</title>
<updated>2012-02-21T16:08:30Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@redhat.com</email>
</author>
<published>2012-02-15T14:51:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5500fa51199aee770ce53718853732600543619e'/>
<id>urn:sha1:5500fa51199aee770ce53718853732600543619e</id>
<content type='text'>
Adding support to filter function trace event via perf
interface. It is now possible to use filter interface
in the perf tool like:

  perf record -e ftrace:function --filter="(ip == mm_*)" ls

The filter syntax is restricted to the the 'ip' field only,
and following operators are accepted '==' '!=' '||', ending
up with the filter strings like:

  ip == f1[, ]f2 ... || ip != f3[, ]f4 ...

with comma ',' or space ' ' as a function separator. If the
space ' ' is used as a separator, the right side of the
assignment needs to be enclosed in double quotes '"', e.g.:

  perf record -e ftrace:function --filter '(ip == do_execve,sys_*,ext*)' ls
  perf record -e ftrace:function --filter '(ip == "do_execve,sys_*,ext*")' ls
  perf record -e ftrace:function --filter '(ip == "do_execve sys_* ext*")' ls

The '==' operator adds trace filter with same effect as would
be added via set_ftrace_filter file.

The '!=' operator adds trace filter with same effect as would
be added via set_ftrace_notrace file.

The right side of the '!=', '==' operators is list of functions
or regexp. to be added to filter separated by space.

The '||' operator is used for connecting multiple filter definitions
together. It is possible to have more than one '==' and '!='
operators within one filter string.

Link: http://lkml.kernel.org/r/1329317514-8131-8-git-send-email-jolsa@redhat.com

Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Add enable/disable ftrace_ops control interface</title>
<updated>2012-02-21T16:08:23Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@redhat.com</email>
</author>
<published>2012-02-15T14:51:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e248491ac283b516958ca9ab62c8e74b6718bca8'/>
<id>urn:sha1:e248491ac283b516958ca9ab62c8e74b6718bca8</id>
<content type='text'>
Adding a way to temporarily enable/disable ftrace_ops. The change
follows the same way as 'global' ftrace_ops are done.

Introducing 2 global ftrace_ops - control_ops and ftrace_control_list
which take over all ftrace_ops registered with FTRACE_OPS_FL_CONTROL
flag. In addition new per cpu flag called 'disabled' is also added to
ftrace_ops to provide the control information for each cpu.

When ftrace_ops with FTRACE_OPS_FL_CONTROL is registered, it is
set as disabled for all cpus.

The ftrace_control_list contains all the registered 'control' ftrace_ops.
The control_ops provides function which iterates ftrace_control_list
and does the check for 'disabled' flag on current cpu.

Adding 3 inline functions:
  ftrace_function_local_disable/ftrace_function_local_enable
  - enable/disable the ftrace_ops on current cpu
  ftrace_function_local_disabled
  - get disabled ftrace_ops::disabled value for current cpu

Link: http://lkml.kernel.org/r/1329317514-8131-2-git-send-email-jolsa@redhat.com

Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing/trivial: Use kcalloc instead of kzalloc to allocate array</title>
<updated>2012-02-13T18:48:11Z</updated>
<author>
<name>Thomas Meyer</name>
<email>thomas@m3y3r.de</email>
</author>
<published>2011-11-29T21:08:00Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=47b0edcb599ea6eb9ef16d3a08932a0e01485293'/>
<id>urn:sha1:47b0edcb599ea6eb9ef16d3a08932a0e01485293</id>
<content type='text'>
The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.

The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107

Link: http://lkml.kernel.org/r/1322600880.1534.347.camel@localhost.localdomain

Signed-off-by: Thomas Meyer &lt;thomas@m3y3r.de&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Change filter/notrace set functions to return exit code</title>
<updated>2012-02-03T14:48:18Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@redhat.com</email>
</author>
<published>2012-01-02T09:04:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ac483c446b67870444c9eeaf8325d3d2af9b91bc'/>
<id>urn:sha1:ac483c446b67870444c9eeaf8325d3d2af9b91bc</id>
<content type='text'>
Currently the ftrace_set_filter and ftrace_set_notrace functions
do not return any return code. So there's no way for ftrace_ops
user to tell wether the filter was correctly applied.

The set_ftrace_filter interface returns error in case the filter
did not match:

  # echo krava &gt; set_ftrace_filter
  bash: echo: write error: Invalid argument

Changing both ftrace_set_filter and ftrace_set_notrace functions
to return zero if the filter was applied correctly or -E* values
in case of error.

Link: http://lkml.kernel.org/r/1325495060-6402-2-git-send-email-jolsa@redhat.com

Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Allow access to the boot time function enabling</title>
<updated>2011-12-21T12:26:35Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-12-20T02:57:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2a85a37f168d2b4d74d493b578af4dc9032be92e'/>
<id>urn:sha1:2a85a37f168d2b4d74d493b578af4dc9032be92e</id>
<content type='text'>
Change set_ftrace_early_filter() to ftrace_set_early_filter()
and make it a global function. This will allow other subsystems
in the kernel to be able to enable function tracing at start
up and reuse the ftrace function parsing code.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Decouple hash items from showing filtered functions</title>
<updated>2011-12-21T12:25:24Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-12-19T20:21:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=69a3083c4a7df0322d97bb2b43a33cb12af8131a'/>
<id>urn:sha1:69a3083c4a7df0322d97bb2b43a33cb12af8131a</id>
<content type='text'>
The set_ftrace_filter shows "hashed" functions, which are functions
that are added with operations to them (like traceon and traceoff).

As other subsystems may be able to show what functions they are
using for function tracing, the hash items should no longer
be shown just because the FILTER flag is set. As they have nothing
to do with other subsystems filters.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Allow other users of function tracing to use the output listing</title>
<updated>2011-12-21T12:25:06Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-12-19T19:41:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fc13cb0ce45296f331263a6034aa1814203e1ac3'/>
<id>urn:sha1:fc13cb0ce45296f331263a6034aa1814203e1ac3</id>
<content type='text'>
The function tracer is set up to allow any other subsystem (like perf)
to use it. Ftrace already has a way to list what functions are enabled
by the global_ops. It would be very helpful to let other users of
the function tracer to be able to use the same code.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Create ftrace_hash_empty() helper routine</title>
<updated>2011-12-21T12:23:11Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-12-20T00:07:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=06a51d9307380c78bb5c92e68fc80ad2c7d7f890'/>
<id>urn:sha1:06a51d9307380c78bb5c92e68fc80ad2c7d7f890</id>
<content type='text'>
There are two types of hashes in the ftrace_ops; one type
is the filter_hash and the other is the notrace_hash. Either
one may be null, meaning it has no elements. But when elements
are added, the hash is allocated.

Throughout the code, a check needs to be made to see if a hash
exists or the hash has elements, but the check if the hash exists
is usually missing causing the possible "NULL pointer dereference bug".

Add a helper routine called "ftrace_hash_empty()" that returns
true if the hash doesn't exist or its count is zero. As they mean
the same thing.

Last-bug-reported-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Fix ftrace hash record update with notrace</title>
<updated>2011-12-21T12:21:43Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-12-19T23:44:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c842e975520f8ab09e293cc92f51a1f396251fd5'/>
<id>urn:sha1:c842e975520f8ab09e293cc92f51a1f396251fd5</id>
<content type='text'>
When disabling the "notrace" records, that means we want to trace them.
If the notrace_hash is zero, it means that we want to trace all
records. But to disable a zero notrace_hash means nothing.

The check for the notrace_hash count was incorrect with:

	if (hash &amp;&amp; !hash-&gt;count)
		return

With the correct comment above it that states that we do nothing
if the notrace_hash has zero count. But !hash also means that
the notrace hash has zero count. I think this was done to
protect against dereferencing NULL. But if !hash is true, then
we go through the following loop without doing a single thing.

Fix it to:

	if (!hash || !hash-&gt;count)
		return;

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