linux/kernel/trace
Frederic Weisbecker c4a8e8be2d trace: better manage the context info for events
Impact: make trace_event more convenient for tracers

All tracers (for the moment) that use the struct trace_event want to
have the context info printed before their own output: the pid/cmdline,
cpu, and timestamp.

But some other tracers that want to implement their trace_event
callbacks will not necessary need these information or they may want to
format them as they want.

This patch adds a new default-enabled trace option:
TRACE_ITER_CONTEXT_INFO When disabled through:

echo nocontext-info > /debugfs/tracing/trace_options

The pid, cpu and timestamps headers will not be printed.

IE with the sched_switch tracer with context-info (default):

     bash-2935 [001] 100.356561: 2935:120:S ==> [001]  0:140:R <idle>
   <idle>-0    [000] 100.412804:    0:140:R   + [000] 11:115:S events/0
   <idle>-0    [000] 100.412816:    0:140:R ==> [000] 11:115:R events/0
 events/0-11   [000] 100.412829:   11:115:S ==> [000]  0:140:R <idle>

Without context-info:

 2935:120:S ==> [001]  0:140:R <idle>
    0:140:R   + [000] 11:115:S events/0
    0:140:R ==> [000] 11:115:R events/0
   11:115:S ==> [000]  0:140:R <idle>

A tracer can disable it at runtime by clearing the bit
TRACE_ITER_CONTEXT_INFO in trace_flags.

The print routines were renamed to trace_print_context and
trace_print_lat_context, so that they can be used by tracers if they
want to use them for one of the trace_event callbacks.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-02-03 14:03:52 +01:00
..
Kconfig tracing: add a new workqueue tracer 2009-01-14 12:11:43 +01:00
Makefile tracing: add a new workqueue tracer 2009-01-14 12:11:43 +01:00
ftrace.c tracing/function-graph-tracer: fix a regression while suspend to disk 2009-01-21 15:21:30 +01:00
kmemtrace.c kmemtrace: fix printk formats, fix 2009-01-30 16:12:33 +01:00
ring_buffer.c Merge branches 'tracing/blktrace', 'tracing/kmemtrace' and 'tracing/urgent' into tracing/core 2009-01-27 14:30:57 +01:00
trace.c trace: better manage the context info for events 2009-02-03 14:03:52 +01:00
trace.h trace: better manage the context info for events 2009-02-03 14:03:52 +01:00
trace_boot.c Merge branches 'tracing/kmemtrace2' and 'tracing/ftrace' into tracing/urgent 2009-01-06 10:18:43 +01:00
trace_branch.c trace: Use tracing_reset_online_cpus in more places 2009-01-29 14:28:31 +01:00
trace_functions.c ftrace: remove static from function tracer functions 2009-01-16 12:17:58 +01:00
trace_functions_graph.c trace: Use tracing_reset_online_cpus in more places 2009-01-29 14:28:31 +01:00
trace_hw_branches.c x86, ftrace, hw-branch-tracer: change trace format 2009-01-20 13:04:16 +01:00
trace_irqsoff.c trace: remove internal irqsoff disabling for trace output 2009-01-23 11:10:36 +01:00
trace_mmiotrace.c trace: clean up format errors in calls to trace_seq_printf 2009-01-16 12:17:38 +01:00
trace_nop.c trace: Use tracing_reset_online_cpus in more places 2009-01-29 14:28:31 +01:00
trace_output.c trace: better manage the context info for events 2009-02-03 14:03:52 +01:00
trace_output.h trace: better manage the context info for events 2009-02-03 14:03:52 +01:00
trace_power.c Merge branches 'tracing/kmemtrace2' and 'tracing/ftrace' into tracing/urgent 2009-01-06 10:18:43 +01:00
trace_sched_switch.c sched, trace: update trace_sched_wakeup() 2008-12-25 13:10:21 +01:00
trace_sched_wakeup.c trace_sched_wakeup: Remove unused variable 2009-01-29 14:31:03 +01:00
trace_selftest.c tracing/selftest: remove TRACE_CONT reference 2008-12-29 15:07:47 +01:00
trace_selftest_dynamic.c ftrace: fix dynamic ftrace selftest 2008-05-23 21:13:23 +02:00
trace_stack.c trace: better use of stack_trace_enabled for boot up code 2008-12-18 12:56:56 +01:00
trace_stat.c tracing: trace_stat.c cleanup 2009-01-15 11:31:21 +01:00
trace_stat.h tracing/ftrace: separate events tracing and stats tracing engine 2009-01-14 12:11:37 +01:00
trace_sysprof.c cpumask: convert kernel trace functions 2009-01-01 10:12:22 +10:30
trace_workqueue.c trace_workqueue: use percpu data for workqueue stat 2009-01-20 13:06:59 +01:00