<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel/trace/trace_functions.c, branch v3.15-rc7</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: Do not try to recreated toplevel set_ftrace_* files</title>
<updated>2014-04-16T23:21:53+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2014-04-16T23:21:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5d6c97c55984b3b991400692f9e8568a702b93c0'/>
<id>5d6c97c55984b3b991400692f9e8568a702b93c0</id>
<content type='text'>
With the restructing of the function tracer working with instances, the
"top level" buffer is a bit special, as the function tracing is mapped
to the same set of filters. This is done by using a "global_ops" descriptor
and having the "set_ftrace_filter" and "set_ftrace_notrace" map to it.

When an instance is created, it creates the same files but its for the
local instance and not the global_ops.

The issues is that the local instance creation shares some code with
the global instance one and we end up trying to create th top level
"set_ftrace_*" files twice, and on boot up, we get an error like this:

 Could not create debugfs 'set_ftrace_filter' entry
 Could not create debugfs 'set_ftrace_notrace' entry

The reason they failed to be created was because they were created
twice, and the second time gives this error as you can not create the
same file twice.

Reported-by: Borislav Petkov &lt;bp@alien8.de&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With the restructing of the function tracer working with instances, the
"top level" buffer is a bit special, as the function tracing is mapped
to the same set of filters. This is done by using a "global_ops" descriptor
and having the "set_ftrace_filter" and "set_ftrace_notrace" map to it.

When an instance is created, it creates the same files but its for the
local instance and not the global_ops.

The issues is that the local instance creation shares some code with
the global instance one and we end up trying to create th top level
"set_ftrace_*" files twice, and on boot up, we get an error like this:

 Could not create debugfs 'set_ftrace_filter' entry
 Could not create debugfs 'set_ftrace_notrace' entry

The reason they failed to be created was because they were created
twice, and the second time gives this error as you can not create the
same file twice.

Reported-by: Borislav Petkov &lt;bp@alien8.de&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ftrace: Allow for function tracing instance to filter functions</title>
<updated>2014-02-20T17:29:07+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2014-01-10T21:17:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=591dffdade9f07692a7dd3ed16830ec24e901ece'/>
<id>591dffdade9f07692a7dd3ed16830ec24e901ece</id>
<content type='text'>
Create a "set_ftrace_filter" and "set_ftrace_notrace" files in the instance
directories to let users filter of functions to trace for the given instance.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Create a "set_ftrace_filter" and "set_ftrace_notrace" files in the instance
directories to let users filter of functions to trace for the given instance.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ftrace: Allow instances to use function tracing</title>
<updated>2014-02-20T17:13:18+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-11-08T01:08:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f20a580627f43e73e4e57cb37e3864080ca06088'/>
<id>f20a580627f43e73e4e57cb37e3864080ca06088</id>
<content type='text'>
Allow instances (sub-buffers) to enable function tracing.
Each instance will have its own function tracing capability.
For now, instances will not have function stack tracing, or will
they be able to pick and choose what functions they can trace.

Picking and choosing their own functions will come later.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow instances (sub-buffers) to enable function tracing.
Each instance will have its own function tracing capability.
For now, instances will not have function stack tracing, or will
they be able to pick and choose what functions they can trace.

Picking and choosing their own functions will come later.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Pass trace_array to set_flag callback</title>
<updated>2014-02-20T17:13:07+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2014-01-10T16:13:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8c1a49aedb73fb2f15aaa32ad9e2e1c4289f45cb'/>
<id>8c1a49aedb73fb2f15aaa32ad9e2e1c4289f45cb</id>
<content type='text'>
As options (flags) may affect instances instead of being global
the set_flag() callbacks need to receive the trace_array descriptor
of the instance they will be modifying.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As options (flags) may affect instances instead of being global
the set_flag() callbacks need to receive the trace_array descriptor
of the instance they will be modifying.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Add ref_data to function and fgraph tracer structs</title>
<updated>2013-07-19T01:31:31+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-07-18T18:41:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8f768993394a8c0d3801033c11fd86ce8c88dcac'/>
<id>8f768993394a8c0d3801033c11fd86ce8c88dcac</id>
<content type='text'>
The selftest for function and function graph tracers are defined as
__init, as they are only executed at boot up. The "tracer" structs
that are associated to those tracers are not setup as __init as they
are used after boot. To stop mismatch warnings, those structures
need to be annotated with __ref_data.

Currently, the tracer structures are defined to __read_mostly, as they
do not really change. But in the future they should be converted to
consts, but that will take a little work because they have a "next"
pointer that gets updated when they are registered. That will have to
wait till the next major release.

Link: http://lkml.kernel.org/r/1373596735.17876.84.camel@gandalf.local.home

Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Reported-by: Chen Gang &lt;gang.chen@asianux.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 selftest for function and function graph tracers are defined as
__init, as they are only executed at boot up. The "tracer" structs
that are associated to those tracers are not setup as __init as they
are used after boot. To stop mismatch warnings, those structures
need to be annotated with __ref_data.

Currently, the tracer structures are defined to __read_mostly, as they
do not really change. But in the future they should be converted to
consts, but that will take a little work because they have a "next"
pointer that gets updated when they are registered. That will have to
wait till the next major release.

Link: http://lkml.kernel.org/r/1373596735.17876.84.camel@gandalf.local.home

Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Reported-by: Chen Gang &lt;gang.chen@asianux.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Add function probe to trigger a ftrace dump of current CPU trace</title>
<updated>2013-06-11T22:38:48+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-04-30T23:00:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=90e3c03c3a09a7b176b3fe59d78f5d9755ac8e37'/>
<id>90e3c03c3a09a7b176b3fe59d78f5d9755ac8e37</id>
<content type='text'>
Add the "cpudump" command to have the current CPU ftrace buffer dumped
to console if a function is hit. This is useful when debugging a
tripple fault, where you have an idea of a function that is called
just before the tripple fault occurs, and can tell ftrace to dump its
content out to the console before it continues.

This differs from the "dump" command as it only dumps the content of
the ring buffer for the currently executing CPU, and does not show
the contents of the other CPUs.

Format is:

  &lt;function&gt;:cpudump

echo 'bad_address:cpudump' &gt; /debug/tracing/set_ftrace_filter

To remove this:

echo '!bad_address:cpudump' &gt; /debug/tracing/set_ftrace_filter

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add the "cpudump" command to have the current CPU ftrace buffer dumped
to console if a function is hit. This is useful when debugging a
tripple fault, where you have an idea of a function that is called
just before the tripple fault occurs, and can tell ftrace to dump its
content out to the console before it continues.

This differs from the "dump" command as it only dumps the content of
the ring buffer for the currently executing CPU, and does not show
the contents of the other CPUs.

Format is:

  &lt;function&gt;:cpudump

echo 'bad_address:cpudump' &gt; /debug/tracing/set_ftrace_filter

To remove this:

echo '!bad_address:cpudump' &gt; /debug/tracing/set_ftrace_filter

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Add function probe to trigger a ftrace dump to console</title>
<updated>2013-06-11T22:38:46+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-04-30T19:46:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ad71d889b88055e61e3970a6744a271a51a94f42'/>
<id>ad71d889b88055e61e3970a6744a271a51a94f42</id>
<content type='text'>
Add the "dump" command to have the ftrace buffer dumped to console if
a function is hit. This is useful when debugging a tripple fault,
where you have an idea of a function that is called just before the
tripple fault occurs, and can tell ftrace to dump its content out
to the console before it continues.

Format is:

  &lt;function&gt;:dump

echo 'bad_address:dump' &gt; /debug/tracing/set_ftrace_filter

To remove this:

echo '!bad_address:dump' &gt; /debug/tracing/set_ftrace_filter

Requested-by: Luis Claudio R. Goncalves &lt;lclaudio@uudg.org&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 the "dump" command to have the ftrace buffer dumped to console if
a function is hit. This is useful when debugging a tripple fault,
where you have an idea of a function that is called just before the
tripple fault occurs, and can tell ftrace to dump its content out
to the console before it continues.

Format is:

  &lt;function&gt;:dump

echo 'bad_address:dump' &gt; /debug/tracing/set_ftrace_filter

To remove this:

echo '!bad_address:dump' &gt; /debug/tracing/set_ftrace_filter

Requested-by: Luis Claudio R. Goncalves &lt;lclaudio@uudg.org&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Add function probe to trigger stack traces</title>
<updated>2013-03-15T04:36:05+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-03-13T14:17:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dd42cd3ea96d687f15525c4f14fa582702db223f'/>
<id>dd42cd3ea96d687f15525c4f14fa582702db223f</id>
<content type='text'>
Add a function probe that will cause a stack trace to be traced in
the ring buffer when the given function(s) are called.

format is:

 &lt;function&gt;:stacktrace[:&lt;count&gt;]

 echo 'schedule:stacktrace' &gt; /debug/tracing/set_ftrace_filter
 cat /debug/tracing/trace_pipe
     kworker/2:0-4329  [002] ...2  2933.558007: &lt;stack trace&gt;
 =&gt; kthread
 =&gt; ret_from_fork
          &lt;idle&gt;-0     [000] .N.2  2933.558019: &lt;stack trace&gt;
 =&gt; rest_init
 =&gt; start_kernel
 =&gt; x86_64_start_reservations
 =&gt; x86_64_start_kernel
     kworker/2:0-4329  [002] ...2  2933.558109: &lt;stack trace&gt;
 =&gt; kthread
 =&gt; ret_from_fork
[...]

This can be set to only trace a specific amount of times:

 echo 'schedule:stacktrace:3' &gt; /debug/tracing/set_ftrace_filter
 cat /debug/tracing/trace_pipe
           &lt;...&gt;-58    [003] ...2   841.801694: &lt;stack trace&gt;
 =&gt; kthread
 =&gt; ret_from_fork
          &lt;idle&gt;-0     [001] .N.2   841.801697: &lt;stack trace&gt;
 =&gt; start_secondary
           &lt;...&gt;-2059  [001] ...2   841.801736: &lt;stack trace&gt;
 =&gt; wait_for_common
 =&gt; wait_for_completion
 =&gt; flush_work
 =&gt; tty_flush_to_ldisc
 =&gt; input_available_p
 =&gt; n_tty_poll
 =&gt; tty_poll
 =&gt; do_select
 =&gt; core_sys_select
 =&gt; sys_select
 =&gt; system_call_fastpath

To remove these:

 echo '!schedule:stacktrace' &gt; /debug/tracing/set_ftrace_filter
 echo '!schedule:stacktrace:0' &gt; /debug/tracing/set_ftrace_filter

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a function probe that will cause a stack trace to be traced in
the ring buffer when the given function(s) are called.

format is:

 &lt;function&gt;:stacktrace[:&lt;count&gt;]

 echo 'schedule:stacktrace' &gt; /debug/tracing/set_ftrace_filter
 cat /debug/tracing/trace_pipe
     kworker/2:0-4329  [002] ...2  2933.558007: &lt;stack trace&gt;
 =&gt; kthread
 =&gt; ret_from_fork
          &lt;idle&gt;-0     [000] .N.2  2933.558019: &lt;stack trace&gt;
 =&gt; rest_init
 =&gt; start_kernel
 =&gt; x86_64_start_reservations
 =&gt; x86_64_start_kernel
     kworker/2:0-4329  [002] ...2  2933.558109: &lt;stack trace&gt;
 =&gt; kthread
 =&gt; ret_from_fork
[...]

This can be set to only trace a specific amount of times:

 echo 'schedule:stacktrace:3' &gt; /debug/tracing/set_ftrace_filter
 cat /debug/tracing/trace_pipe
           &lt;...&gt;-58    [003] ...2   841.801694: &lt;stack trace&gt;
 =&gt; kthread
 =&gt; ret_from_fork
          &lt;idle&gt;-0     [001] .N.2   841.801697: &lt;stack trace&gt;
 =&gt; start_secondary
           &lt;...&gt;-2059  [001] ...2   841.801736: &lt;stack trace&gt;
 =&gt; wait_for_common
 =&gt; wait_for_completion
 =&gt; flush_work
 =&gt; tty_flush_to_ldisc
 =&gt; input_available_p
 =&gt; n_tty_poll
 =&gt; tty_poll
 =&gt; do_select
 =&gt; core_sys_select
 =&gt; sys_select
 =&gt; system_call_fastpath

To remove these:

 echo '!schedule:stacktrace' &gt; /debug/tracing/set_ftrace_filter
 echo '!schedule:stacktrace:0' &gt; /debug/tracing/set_ftrace_filter

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ftrace: Separate unlimited probes from count limited probes</title>
<updated>2013-03-15T04:35:59+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-03-09T13:56:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8380d24860e9d1659ab22896b86d7fe591c424fa'/>
<id>8380d24860e9d1659ab22896b86d7fe591c424fa</id>
<content type='text'>
The function tracing probes that trigger traceon or traceoff can be
set to unlimited, or given a count of # of times to execute.

By separating these two types of probes, we can then use the dynamic
ftrace function filtering directly, and remove the brute force
"check if this function called is my probe" routines in ftrace.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function tracing probes that trigger traceon or traceoff can be
set to unlimited, or given a count of # of times to execute.

By separating these two types of probes, we can then use the dynamic
ftrace function filtering directly, and remove the brute force
"check if this function called is my probe" routines in ftrace.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Consolidate ftrace_trace_onoff_unreg() into callback</title>
<updated>2013-03-15T04:35:58+00:00</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-03-12T13:25:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8b8fa62c60e03a53c46324075a8dc25821741daa'/>
<id>8b8fa62c60e03a53c46324075a8dc25821741daa</id>
<content type='text'>
The only thing ftrace_trace_onoff_unreg() does is to do a strcmp()
against the cmd parameter to determine what op to unregister. But
this compare is also done after the location that this function is
called (and returns). By moving the check for '!' to unregister after
the strcmp(), the callback function itself can just do the unregister
and we can get rid of the helper function.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The only thing ftrace_trace_onoff_unreg() does is to do a strcmp()
against the cmd parameter to determine what op to unregister. But
this compare is also done after the location that this function is
called (and returns). By moving the check for '!' to unregister after
the strcmp(), the callback function itself can just do the unregister
and we can get rid of the helper function.

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