linux/kernel/trace
Steven Rostedt 007c05d4d2 ftrace: move sched_switch enable after markers
We have two markers now that are enabled on sched_switch. One that records
the context switching and the other that records task wake ups. Currently
we enable the tracing first and then set the markers. This causes some
confusing traces:

# tracer: sched_switch
#
#           TASK-PID   CPU#    TIMESTAMP  FUNCTION
#              | |      |          |         |
       trace-cmd-3973  [00]   115.834817:   3973:120:R   +     3:  0:S
       trace-cmd-3973  [01]   115.834910:   3973:120:R   +     6:  0:S
       trace-cmd-3973  [02]   115.834910:   3973:120:R   +     9:  0:S
       trace-cmd-3973  [03]   115.834910:   3973:120:R   +    12:  0:S
       trace-cmd-3973  [02]   115.834910:   3973:120:R   +     9:  0:S
          <idle>-0     [02]   115.834910:      0:140:R ==>  3973:120:R

Here we see that trace-cmd with PID 3973 wakes up task 9 but the next line
shows the idle task doing a context switch to task 3973.

Enabling the tracing to _after_ the markers are set creates a much saner
output:

# tracer: sched_switch
#
#           TASK-PID   CPU#    TIMESTAMP  FUNCTION
#              | |      |          |         |
          <idle>-0     [02]  7922.634225:      0:140:R ==>  4790:120:R
       trace-cmd-4789  [03]  7922.634225:      0:140:R   +  4790:120:R

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Cc: Steven Rostedt <srostedt@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-11 15:49:18 +02:00
..
Kconfig ftrace: add have dynamic ftrace config for archs 2008-05-23 22:49:18 +02:00
Makefile ftrace: fix dynamic ftrace selftest 2008-05-23 21:13:23 +02:00
ftrace.c ftrace: prevent ftrace modifications while being kprobe'd, v2 2008-07-03 14:46:24 +02:00
trace.c ftrace: freeze kprobe'd records 2008-06-23 22:10:58 +02:00
trace.h ftrace: fix up cmdline recording 2008-05-26 22:51:49 +02:00
trace_functions.c ftrace: fix up cmdline recording 2008-05-26 22:51:49 +02:00
trace_irqsoff.c ftrace: remove printks from irqsoff trace 2008-05-26 22:51:27 +02:00
trace_sched_switch.c ftrace: move sched_switch enable after markers 2008-07-11 15:49:18 +02:00
trace_sched_wakeup.c ftrace: add function tracing to wake up tracing 2008-05-26 22:51:22 +02:00
trace_selftest.c ftrace: limit use of check pages 2008-05-26 22:39:45 +02:00
trace_selftest_dynamic.c ftrace: fix dynamic ftrace selftest 2008-05-23 21:13:23 +02:00