android_kernel_motorola_sm6225/kernel/trace
Steven Rostedt 38697053fa ftrace: preempt disable over interrupt disable
With the new ring buffer infrastructure in ftrace, I'm trying to make
ftrace a little more light weight.

This patch converts a lot of the local_irq_save/restore into
preempt_disable/enable.  The original preempt count in a lot of cases
has to be sent in as a parameter so that it can be recorded correctly.
Some places were recording it incorrectly before anyway.

This is also laying the ground work to make ftrace a little bit
more reentrant, and remove all locking. The function tracers must
still protect from reentrancy.

Note: All the function tracers must be careful when using preempt_disable.
  It must do the following:

  resched = need_resched();
  preempt_disable_notrace();
  [...]
  if (resched)
	preempt_enable_no_resched_notrace();
  else
	preempt_enable_notrace();

The reason is that if this function traces schedule() itself, the
preempt_enable_notrace() will cause a schedule, which will lead
us into a recursive failure.

If we needed to reschedule before calling preempt_disable, we
should have already scheduled. Since we did not, this is most
likely that we should not and are probably inside a schedule
function.

If resched was not set, we still need to catch the need resched
flag being set when preemption was off and the if case at the
end will catch that for us.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-10-14 10:39:09 +02:00
..
ftrace.c ftrace: warn on failure to disable mcount callers 2008-10-14 10:38:11 +02:00
Kconfig tracing: unified trace buffer 2008-10-14 10:38:54 +02:00
Makefile tracing: unified trace buffer 2008-10-14 10:38:54 +02:00
ring_buffer.c ring_buffer: allocate buffer page pointer 2008-10-14 10:39:08 +02:00
trace.c ftrace: preempt disable over interrupt disable 2008-10-14 10:39:09 +02:00
trace.h ftrace: preempt disable over interrupt disable 2008-10-14 10:39:09 +02:00
trace_boot.c ftrace: preempt disable over interrupt disable 2008-10-14 10:39:09 +02:00
trace_functions.c ftrace: make work with new ring buffer 2008-10-14 10:38:57 +02:00
trace_irqsoff.c ftrace: preempt disable over interrupt disable 2008-10-14 10:39:09 +02:00
trace_mmiotrace.c ftrace: preempt disable over interrupt disable 2008-10-14 10:39:09 +02:00
trace_nop.c ftrace: make work with new ring buffer 2008-10-14 10:38:57 +02:00
trace_sched_switch.c ftrace: preempt disable over interrupt disable 2008-10-14 10:39:09 +02:00
trace_sched_wakeup.c ftrace: preempt disable over interrupt disable 2008-10-14 10:39:09 +02:00
trace_selftest.c ftrace: make work with new ring buffer 2008-10-14 10:38:57 +02:00
trace_selftest_dynamic.c ftrace: fix dynamic ftrace selftest 2008-05-23 21:13:23 +02:00
trace_stack.c ftrace: stack trace add indexes 2008-10-14 10:36:28 +02:00
trace_sysprof.c ftrace: make work with new ring buffer 2008-10-14 10:38:57 +02:00