<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel/trace/trace_functions_graph.c, branch v5.1-rc1</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: Put a margin between flags and duration for wakeup tracers</title>
<updated>2019-02-06T16:56:19+00:00</updated>
<author>
<name>Changbin Du</name>
<email>changbin.du@gmail.com</email>
</author>
<published>2019-01-01T15:46:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=afbab501c66bece057bc30656f71f856cd1b3baa'/>
<id>afbab501c66bece057bc30656f71f856cd1b3baa</id>
<content type='text'>
Don't mix context flags with function duration info.

Instead of this:

 # tracer: wakeup_rt
 #
 # wakeup_rt latency trace v1.1.5 on 5.0.0-rc1-test+
 # --------------------------------------------------------------------
 # latency: 177 us, #545/545, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8)
 #    -----------------
 #    | task: migration/0-11 (uid:0 nice:0 policy:1 rt_prio:99)
 #    -----------------
 #
 #                                       _-----=&gt; irqs-off
 #                                      / _----=&gt; need-resched
 #                                     | / _---=&gt; hardirq/softirq
 #                                     || / _--=&gt; preempt-depth
 #                                     ||| /
 #   REL TIME      CPU  TASK/PID       ||||  DURATION                  FUNCTION CALLS
 #      |          |     |    |        ||||   |   |                     |   |   |   |
         0 us |   0)    &lt;idle&gt;-0    |  dNh5              |  /*      0:120:R   + [000]    11:  0:R migration/0 */
         2 us |   0)    &lt;idle&gt;-0    |  dNh5  0.000 us    |            (null)();
         4 us |   0)    &lt;idle&gt;-0    |  dNh4              |  _raw_spin_unlock() {
         4 us |   0)    &lt;idle&gt;-0    |  dNh4  0.304 us    |    preempt_count_sub();
         5 us |   0)    &lt;idle&gt;-0    |  dNh3  1.063 us    |  }
         5 us |   0)    &lt;idle&gt;-0    |  dNh3  0.266 us    |  ttwu_stat();
         6 us |   0)    &lt;idle&gt;-0    |  dNh3              |  _raw_spin_unlock_irqrestore() {
         6 us |   0)    &lt;idle&gt;-0    |  dNh3  0.273 us    |    preempt_count_sub();
         6 us |   0)    &lt;idle&gt;-0    |  dNh2  0.818 us    |  }

Show this:

 # tracer: wakeup
 #
 # wakeup latency trace v1.1.5 on 4.20.0+
 # --------------------------------------------------------------------
 # latency: 593 us, #674/674, CPU#0 | (M:desktop VP:0, KP:0, SP:0 HP:0 #P:4)
 #    -----------------
 #    | task: kworker/0:1H-339 (uid:0 nice:-20 policy:0 rt_prio:0)
 #    -----------------
 #
 #                                      _-----=&gt; irqs-off
 #                                     / _----=&gt; need-resched
 #                                    | / _---=&gt; hardirq/softirq
 #                                    || / _--=&gt; preempt-depth
 #                                    ||| /
 #  REL TIME      CPU  TASK/PID       ||||     DURATION                  FUNCTION CALLS
 #     |          |     |    |        ||||      |   |                     |   |   |   |
        0 us |   0)    &lt;idle&gt;-0    |  dNs. |               |  /*      0:120:R   + [000]   339:100:R kworker/0:1H */
        3 us |   0)    &lt;idle&gt;-0    |  dNs. |   0.000 us    |            (null)();
       67 us |   0)    &lt;idle&gt;-0    |  dNs. |   0.721 us    |  ttwu_stat();
       69 us |   0)    &lt;idle&gt;-0    |  dNs. |   0.607 us    |  _raw_spin_unlock_irqrestore();
       71 us |   0)    &lt;idle&gt;-0    |  .Ns. |   0.598 us    |  _raw_spin_lock_irq();
       72 us |   0)    &lt;idle&gt;-0    |  .Ns. |   0.584 us    |  _raw_spin_lock_irq();
       73 us |   0)    &lt;idle&gt;-0    |  dNs. | + 11.118 us   |  __next_timer_interrupt();
       75 us |   0)    &lt;idle&gt;-0    |  dNs. |               |  call_timer_fn() {
       76 us |   0)    &lt;idle&gt;-0    |  dNs. |               |    delayed_work_timer_fn() {
       76 us |   0)    &lt;idle&gt;-0    |  dNs. |               |      __queue_work() {
       ...

Link: http://lkml.kernel.org/r/20190101154614.8887-4-changbin.du@gmail.com

Signed-off-by: Changbin Du &lt;changbin.du@gmail.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't mix context flags with function duration info.

Instead of this:

 # tracer: wakeup_rt
 #
 # wakeup_rt latency trace v1.1.5 on 5.0.0-rc1-test+
 # --------------------------------------------------------------------
 # latency: 177 us, #545/545, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8)
 #    -----------------
 #    | task: migration/0-11 (uid:0 nice:0 policy:1 rt_prio:99)
 #    -----------------
 #
 #                                       _-----=&gt; irqs-off
 #                                      / _----=&gt; need-resched
 #                                     | / _---=&gt; hardirq/softirq
 #                                     || / _--=&gt; preempt-depth
 #                                     ||| /
 #   REL TIME      CPU  TASK/PID       ||||  DURATION                  FUNCTION CALLS
 #      |          |     |    |        ||||   |   |                     |   |   |   |
         0 us |   0)    &lt;idle&gt;-0    |  dNh5              |  /*      0:120:R   + [000]    11:  0:R migration/0 */
         2 us |   0)    &lt;idle&gt;-0    |  dNh5  0.000 us    |            (null)();
         4 us |   0)    &lt;idle&gt;-0    |  dNh4              |  _raw_spin_unlock() {
         4 us |   0)    &lt;idle&gt;-0    |  dNh4  0.304 us    |    preempt_count_sub();
         5 us |   0)    &lt;idle&gt;-0    |  dNh3  1.063 us    |  }
         5 us |   0)    &lt;idle&gt;-0    |  dNh3  0.266 us    |  ttwu_stat();
         6 us |   0)    &lt;idle&gt;-0    |  dNh3              |  _raw_spin_unlock_irqrestore() {
         6 us |   0)    &lt;idle&gt;-0    |  dNh3  0.273 us    |    preempt_count_sub();
         6 us |   0)    &lt;idle&gt;-0    |  dNh2  0.818 us    |  }

Show this:

 # tracer: wakeup
 #
 # wakeup latency trace v1.1.5 on 4.20.0+
 # --------------------------------------------------------------------
 # latency: 593 us, #674/674, CPU#0 | (M:desktop VP:0, KP:0, SP:0 HP:0 #P:4)
 #    -----------------
 #    | task: kworker/0:1H-339 (uid:0 nice:-20 policy:0 rt_prio:0)
 #    -----------------
 #
 #                                      _-----=&gt; irqs-off
 #                                     / _----=&gt; need-resched
 #                                    | / _---=&gt; hardirq/softirq
 #                                    || / _--=&gt; preempt-depth
 #                                    ||| /
 #  REL TIME      CPU  TASK/PID       ||||     DURATION                  FUNCTION CALLS
 #     |          |     |    |        ||||      |   |                     |   |   |   |
        0 us |   0)    &lt;idle&gt;-0    |  dNs. |               |  /*      0:120:R   + [000]   339:100:R kworker/0:1H */
        3 us |   0)    &lt;idle&gt;-0    |  dNs. |   0.000 us    |            (null)();
       67 us |   0)    &lt;idle&gt;-0    |  dNs. |   0.721 us    |  ttwu_stat();
       69 us |   0)    &lt;idle&gt;-0    |  dNs. |   0.607 us    |  _raw_spin_unlock_irqrestore();
       71 us |   0)    &lt;idle&gt;-0    |  .Ns. |   0.598 us    |  _raw_spin_lock_irq();
       72 us |   0)    &lt;idle&gt;-0    |  .Ns. |   0.584 us    |  _raw_spin_lock_irq();
       73 us |   0)    &lt;idle&gt;-0    |  dNs. | + 11.118 us   |  __next_timer_interrupt();
       75 us |   0)    &lt;idle&gt;-0    |  dNs. |               |  call_timer_fn() {
       76 us |   0)    &lt;idle&gt;-0    |  dNs. |               |    delayed_work_timer_fn() {
       76 us |   0)    &lt;idle&gt;-0    |  dNs. |               |      __queue_work() {
       ...

Link: http://lkml.kernel.org/r/20190101154614.8887-4-changbin.du@gmail.com

Signed-off-by: Changbin Du &lt;changbin.du@gmail.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>function_graph: Support displaying relative timestamp</title>
<updated>2019-02-06T16:56:18+00:00</updated>
<author>
<name>Changbin Du</name>
<email>changbin.du@gmail.com</email>
</author>
<published>2019-01-01T15:46:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9acd8de69d107537a68d010c9149fa9d9aba91f4'/>
<id>9acd8de69d107537a68d010c9149fa9d9aba91f4</id>
<content type='text'>
When function_graph is used for latency tracers, relative timestamp
is more straightforward than absolute timestamp as function trace
does. This change adds relative timestamp support to function_graph
and applies to latency tracers (wakeup and irqsoff).

Instead of:

 # tracer: irqsoff
 #
 # irqsoff latency trace v1.1.5 on 5.0.0-rc1-test
 # --------------------------------------------------------------------
 # latency: 521 us, #1125/1125, CPU#2 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8)
 #    -----------------
 #    | task: swapper/2-0 (uid:0 nice:0 policy:0 rt_prio:0)
 #    -----------------
 #  =&gt; started at: __schedule
 #  =&gt; ended at:   _raw_spin_unlock_irq
 #
 #
 #                                       _-----=&gt; irqs-off
 #                                      / _----=&gt; need-resched
 #                                     | / _---=&gt; hardirq/softirq
 #                                     || / _--=&gt; preempt-depth
 #                                     ||| /
 #     TIME        CPU  TASK/PID       ||||  DURATION                  FUNCTION CALLS
 #      |          |     |    |        ||||   |   |                     |   |   |   |
   124.974306 |   2)  systemd-693   |  d..1  0.000 us    |  __schedule();
   124.974307 |   2)  systemd-693   |  d..1              |    rcu_note_context_switch() {
   124.974308 |   2)  systemd-693   |  d..1  0.487 us    |      rcu_preempt_deferred_qs();
   124.974309 |   2)  systemd-693   |  d..1  0.451 us    |      rcu_qs();
   124.974310 |   2)  systemd-693   |  d..1  2.301 us    |    }
[..]
   124.974826 |   2)    &lt;idle&gt;-0    |  d..2              |  finish_task_switch() {
   124.974826 |   2)    &lt;idle&gt;-0    |  d..2              |    _raw_spin_unlock_irq() {
   124.974827 |   2)    &lt;idle&gt;-0    |  d..2  0.000 us    |  _raw_spin_unlock_irq();
   124.974828 |   2)    &lt;idle&gt;-0    |  d..2  0.000 us    |  tracer_hardirqs_on();
   &lt;idle&gt;-0       2d..2  552us : &lt;stack trace&gt;
  =&gt; __schedule
  =&gt; schedule_idle
  =&gt; do_idle
  =&gt; cpu_startup_entry
  =&gt; start_secondary
  =&gt; secondary_startup_64

Show:

 # tracer: irqsoff
 #
 # irqsoff latency trace v1.1.5 on 5.0.0-rc1-test+
 # --------------------------------------------------------------------
 # latency: 511 us, #1053/1053, CPU#7 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8)
 #    -----------------
 #    | task: swapper/7-0 (uid:0 nice:0 policy:0 rt_prio:0)
 #    -----------------
 #  =&gt; started at: __schedule
 #  =&gt; ended at:   _raw_spin_unlock_irq
 #
 #
 #                                       _-----=&gt; irqs-off
 #                                      / _----=&gt; need-resched
 #                                     | / _---=&gt; hardirq/softirq
 #                                     || / _--=&gt; preempt-depth
 #                                     ||| /
 #   REL TIME      CPU  TASK/PID       ||||  DURATION                  FUNCTION CALLS
 #      |          |     |    |        ||||   |   |                     |   |   |   |
         0 us |   7)   sshd-1704    |  d..1  0.000 us    |  __schedule();
         1 us |   7)   sshd-1704    |  d..1              |    rcu_note_context_switch() {
         1 us |   7)   sshd-1704    |  d..1  0.611 us    |      rcu_preempt_deferred_qs();
         2 us |   7)   sshd-1704    |  d..1  0.484 us    |      rcu_qs();
         3 us |   7)   sshd-1704    |  d..1  2.599 us    |    }
[..]
       509 us |   7)    &lt;idle&gt;-0    |  d..2              |  finish_task_switch() {
       510 us |   7)    &lt;idle&gt;-0    |  d..2              |    _raw_spin_unlock_irq() {
       510 us |   7)    &lt;idle&gt;-0    |  d..2  0.000 us    |  _raw_spin_unlock_irq();
       512 us |   7)    &lt;idle&gt;-0    |  d..2  0.000 us    |  tracer_hardirqs_on();
   &lt;idle&gt;-0       7d..2  543us : &lt;stack trace&gt;
  =&gt; __schedule
  =&gt; schedule_idle
  =&gt; do_idle
  =&gt; cpu_startup_entry
  =&gt; start_secondary
  =&gt; secondary_startup_64

Link: http://lkml.kernel.org/r/20190101154614.8887-2-changbin.du@gmail.com

Signed-off-by: Changbin Du &lt;changbin.du@gmail.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When function_graph is used for latency tracers, relative timestamp
is more straightforward than absolute timestamp as function trace
does. This change adds relative timestamp support to function_graph
and applies to latency tracers (wakeup and irqsoff).

Instead of:

 # tracer: irqsoff
 #
 # irqsoff latency trace v1.1.5 on 5.0.0-rc1-test
 # --------------------------------------------------------------------
 # latency: 521 us, #1125/1125, CPU#2 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8)
 #    -----------------
 #    | task: swapper/2-0 (uid:0 nice:0 policy:0 rt_prio:0)
 #    -----------------
 #  =&gt; started at: __schedule
 #  =&gt; ended at:   _raw_spin_unlock_irq
 #
 #
 #                                       _-----=&gt; irqs-off
 #                                      / _----=&gt; need-resched
 #                                     | / _---=&gt; hardirq/softirq
 #                                     || / _--=&gt; preempt-depth
 #                                     ||| /
 #     TIME        CPU  TASK/PID       ||||  DURATION                  FUNCTION CALLS
 #      |          |     |    |        ||||   |   |                     |   |   |   |
   124.974306 |   2)  systemd-693   |  d..1  0.000 us    |  __schedule();
   124.974307 |   2)  systemd-693   |  d..1              |    rcu_note_context_switch() {
   124.974308 |   2)  systemd-693   |  d..1  0.487 us    |      rcu_preempt_deferred_qs();
   124.974309 |   2)  systemd-693   |  d..1  0.451 us    |      rcu_qs();
   124.974310 |   2)  systemd-693   |  d..1  2.301 us    |    }
[..]
   124.974826 |   2)    &lt;idle&gt;-0    |  d..2              |  finish_task_switch() {
   124.974826 |   2)    &lt;idle&gt;-0    |  d..2              |    _raw_spin_unlock_irq() {
   124.974827 |   2)    &lt;idle&gt;-0    |  d..2  0.000 us    |  _raw_spin_unlock_irq();
   124.974828 |   2)    &lt;idle&gt;-0    |  d..2  0.000 us    |  tracer_hardirqs_on();
   &lt;idle&gt;-0       2d..2  552us : &lt;stack trace&gt;
  =&gt; __schedule
  =&gt; schedule_idle
  =&gt; do_idle
  =&gt; cpu_startup_entry
  =&gt; start_secondary
  =&gt; secondary_startup_64

Show:

 # tracer: irqsoff
 #
 # irqsoff latency trace v1.1.5 on 5.0.0-rc1-test+
 # --------------------------------------------------------------------
 # latency: 511 us, #1053/1053, CPU#7 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8)
 #    -----------------
 #    | task: swapper/7-0 (uid:0 nice:0 policy:0 rt_prio:0)
 #    -----------------
 #  =&gt; started at: __schedule
 #  =&gt; ended at:   _raw_spin_unlock_irq
 #
 #
 #                                       _-----=&gt; irqs-off
 #                                      / _----=&gt; need-resched
 #                                     | / _---=&gt; hardirq/softirq
 #                                     || / _--=&gt; preempt-depth
 #                                     ||| /
 #   REL TIME      CPU  TASK/PID       ||||  DURATION                  FUNCTION CALLS
 #      |          |     |    |        ||||   |   |                     |   |   |   |
         0 us |   7)   sshd-1704    |  d..1  0.000 us    |  __schedule();
         1 us |   7)   sshd-1704    |  d..1              |    rcu_note_context_switch() {
         1 us |   7)   sshd-1704    |  d..1  0.611 us    |      rcu_preempt_deferred_qs();
         2 us |   7)   sshd-1704    |  d..1  0.484 us    |      rcu_qs();
         3 us |   7)   sshd-1704    |  d..1  2.599 us    |    }
[..]
       509 us |   7)    &lt;idle&gt;-0    |  d..2              |  finish_task_switch() {
       510 us |   7)    &lt;idle&gt;-0    |  d..2              |    _raw_spin_unlock_irq() {
       510 us |   7)    &lt;idle&gt;-0    |  d..2  0.000 us    |  _raw_spin_unlock_irq();
       512 us |   7)    &lt;idle&gt;-0    |  d..2  0.000 us    |  tracer_hardirqs_on();
   &lt;idle&gt;-0       7d..2  543us : &lt;stack trace&gt;
  =&gt; __schedule
  =&gt; schedule_idle
  =&gt; do_idle
  =&gt; cpu_startup_entry
  =&gt; start_secondary
  =&gt; secondary_startup_64

Link: http://lkml.kernel.org/r/20190101154614.8887-2-changbin.du@gmail.com

Signed-off-by: Changbin Du &lt;changbin.du@gmail.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>function_graph: Move ftrace_graph_ret_addr() to fgraph.c</title>
<updated>2018-12-09T01:54:07+00:00</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-11-18T23:36:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=76b42b63ed0d004961097d3a3cd979129d4afd26'/>
<id>76b42b63ed0d004961097d3a3cd979129d4afd26</id>
<content type='text'>
Move the function function_graph_ret_addr() to fgraph.c, as the management
of the curr_ret_stack is going to change, and all the accesses to ret_stack
needs to be done in fgraph.c.

Reviewed-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the function function_graph_ret_addr() to fgraph.c, as the management
of the curr_ret_stack is going to change, and all the accesses to ret_stack
needs to be done in fgraph.c.

Reviewed-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fgraph: Add new fgraph_ops structure to enable function graph hooks</title>
<updated>2018-12-09T01:54:07+00:00</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-11-15T19:06:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=688f7089d8851b1a81106f0c0b9b29181b2f2dc8'/>
<id>688f7089d8851b1a81106f0c0b9b29181b2f2dc8</id>
<content type='text'>
Currently the registering of function graph is to pass in a entry and return
function. We need to have a way to associate those functions together where
the entry can determine to run the return hook. Having a structure that
contains both functions will facilitate the process of converting the code
to be able to do such.

This is similar to the way function hooks are enabled (it passes in
ftrace_ops). Instead of passing in the functions to use, a single structure
is passed in to the registering function.

The unregister function is now passed in the fgraph_ops handle. When we
allow more than one callback to the function graph hooks, this will let the
system know which one to remove.

Reviewed-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently the registering of function graph is to pass in a entry and return
function. We need to have a way to associate those functions together where
the entry can determine to run the return hook. Having a structure that
contains both functions will facilitate the process of converting the code
to be able to do such.

This is similar to the way function hooks are enabled (it passes in
ftrace_ops). Instead of passing in the functions to use, a single structure
is passed in to the registering function.

The unregister function is now passed in the fgraph_ops handle. When we
allow more than one callback to the function graph hooks, this will let the
system know which one to remove.

Reviewed-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>function_graph: Do not expose the graph_time option when profiler is not configured</title>
<updated>2018-12-09T01:54:06+00:00</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-11-23T18:06:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c8dd0f45874547e6e77bab03d71feb16c4cb98a8'/>
<id>c8dd0f45874547e6e77bab03d71feb16c4cb98a8</id>
<content type='text'>
When the function profiler is not configured, the "graph_time" option is
meaningless, as the function profiler is the only thing that makes use of
it. Do not expose it if the profiler is not configured.

Link: http://lkml.kernel.org/r/20181123061133.GA195223@google.com

Reported-by: Joel Fernandes &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the function profiler is not configured, the "graph_time" option is
meaningless, as the function profiler is the only thing that makes use of
it. Do not expose it if the profiler is not configured.

Link: http://lkml.kernel.org/r/20181123061133.GA195223@google.com

Reported-by: Joel Fernandes &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>function_graph: Remove the use of FTRACE_NOTRACE_DEPTH</title>
<updated>2018-12-09T01:54:06+00:00</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-11-18T23:44:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=761efe8a94cfcd0a3dd90f2008411550f3520b63'/>
<id>761efe8a94cfcd0a3dd90f2008411550f3520b63</id>
<content type='text'>
The curr_ret_stack is no longer set to a negative value when a function is
not to be traced by the function graph tracer. Remove the usage of
FTRACE_NOTRACE_DEPTH, as it is no longer needed.

Reviewed-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The curr_ret_stack is no longer set to a negative value when a function is
not to be traced by the function graph tracer. Remove the usage of
FTRACE_NOTRACE_DEPTH, as it is no longer needed.

Reviewed-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fgraph: Have set_graph_notrace only affect function_graph tracer</title>
<updated>2018-11-30T04:38:34+00:00</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-11-14T18:14:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9cd2992f2d6c8df54c5b937d5d1f8a23b684cc1d'/>
<id>9cd2992f2d6c8df54c5b937d5d1f8a23b684cc1d</id>
<content type='text'>
In order to make the function graph infrastructure more generic, there can
not be code specific for the function_graph tracer in the generic code. This
includes the set_graph_notrace logic, that stops all graph calls when a
function in the set_graph_notrace is hit.

By using the trace_recursion mask, we can use a bit in the current
task_struct to implement the notrace code, and move the logic out of
fgraph.c and into trace_functions_graph.c and keeps it affecting only the
tracer and not all call graph callbacks.

Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Reviewed-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to make the function graph infrastructure more generic, there can
not be code specific for the function_graph tracer in the generic code. This
includes the set_graph_notrace logic, that stops all graph calls when a
function in the set_graph_notrace is hit.

By using the trace_recursion mask, we can use a bit in the current
task_struct to implement the notrace code, and move the logic out of
fgraph.c and into trace_functions_graph.c and keeps it affecting only the
tracer and not all call graph callbacks.

Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Reviewed-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fgraph: Create a fgraph.c file to store function graph infrastructure</title>
<updated>2018-11-30T04:38:34+00:00</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-11-12T20:21:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d864a3ca883095aa12575b84841ebd52b3d808fa'/>
<id>d864a3ca883095aa12575b84841ebd52b3d808fa</id>
<content type='text'>
As the function graph infrastructure can be used by thing other than
tracing, moving the code to its own file out of the trace_functions_graph.c
code makes more sense.

The fgraph.c file will only contain the infrastructure required to hook into
functions and their return code.

Reviewed-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As the function graph infrastructure can be used by thing other than
tracing, moving the code to its own file out of the trace_functions_graph.c
code makes more sense.

The fgraph.c file will only contain the infrastructure required to hook into
functions and their return code.

Reviewed-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Do not line wrap short line in function_graph_enter()</title>
<updated>2018-11-30T04:38:34+00:00</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-11-27T14:36:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c43ac4a5301986c015137bb89568979f9b3264ca'/>
<id>c43ac4a5301986c015137bb89568979f9b3264ca</id>
<content type='text'>
Commit 588ca1786f2dd ("function_graph: Use new curr_ret_depth to manage
depth instead of curr_ret_stack") removed a parameter from the call
ftrace_push_return_trace() that made it so that the entire call was under 80
characters, but it did not remove the line break. There's no reason to break
that line up, so make it a single line.

Link: http://lkml.kernel.org/r/20181122100322.GN2131@hirez.programming.kicks-ass.net

Reported-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 588ca1786f2dd ("function_graph: Use new curr_ret_depth to manage
depth instead of curr_ret_stack") removed a parameter from the call
ftrace_push_return_trace() that made it so that the entire call was under 80
characters, but it did not remove the line break. There's no reason to break
that line up, so make it a single line.

Link: http://lkml.kernel.org/r/20181122100322.GN2131@hirez.programming.kicks-ass.net

Reported-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing/fgraph: Fix set_graph_function from showing interrupts</title>
<updated>2018-11-30T03:09:00+00:00</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-11-29T13:50:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5cf99a0f3161bc3ae2391269d134d6bf7e26f00e'/>
<id>5cf99a0f3161bc3ae2391269d134d6bf7e26f00e</id>
<content type='text'>
The tracefs file set_graph_function is used to only function graph functions
that are listed in that file (or all functions if the file is empty). The
way this is implemented is that the function graph tracer looks at every
function, and if the current depth is zero and the function matches
something in the file then it will trace that function. When other functions
are called, the depth will be greater than zero (because the original
function will be at depth zero), and all functions will be traced where the
depth is greater than zero.

The issue is that when a function is first entered, and the handler that
checks this logic is called, the depth is set to zero. If an interrupt comes
in and a function in the interrupt handler is traced, its depth will be
greater than zero and it will automatically be traced, even if the original
function was not. But because the logic only looks at depth it may trace
interrupts when it should not be.

The recent design change of the function graph tracer to fix other bugs
caused the depth to be zero while the function graph callback handler is
being called for a longer time, widening the race of this happening. This
bug was actually there for a longer time, but because the race window was so
small it seldom happened. The Fixes tag below is for the commit that widen
the race window, because that commit belongs to a series that will also help
fix the original bug.

Cc: stable@kernel.org
Fixes: 39eb456dacb5 ("function_graph: Use new curr_ret_depth to manage depth instead of curr_ret_stack")
Reported-by: Joe Lawrence &lt;joe.lawrence@redhat.com&gt;
Tested-by: Joe Lawrence &lt;joe.lawrence@redhat.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The tracefs file set_graph_function is used to only function graph functions
that are listed in that file (or all functions if the file is empty). The
way this is implemented is that the function graph tracer looks at every
function, and if the current depth is zero and the function matches
something in the file then it will trace that function. When other functions
are called, the depth will be greater than zero (because the original
function will be at depth zero), and all functions will be traced where the
depth is greater than zero.

The issue is that when a function is first entered, and the handler that
checks this logic is called, the depth is set to zero. If an interrupt comes
in and a function in the interrupt handler is traced, its depth will be
greater than zero and it will automatically be traced, even if the original
function was not. But because the logic only looks at depth it may trace
interrupts when it should not be.

The recent design change of the function graph tracer to fix other bugs
caused the depth to be zero while the function graph callback handler is
being called for a longer time, widening the race of this happening. This
bug was actually there for a longer time, but because the race window was so
small it seldom happened. The Fixes tag below is for the commit that widen
the race window, because that commit belongs to a series that will also help
fix the original bug.

Cc: stable@kernel.org
Fixes: 39eb456dacb5 ("function_graph: Use new curr_ret_depth to manage depth instead of curr_ret_stack")
Reported-by: Joe Lawrence &lt;joe.lawrence@redhat.com&gt;
Tested-by: Joe Lawrence &lt;joe.lawrence@redhat.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
