]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace: Add context level recursion bit checking
authorSteven Rostedt <srostedt@redhat.com>
Fri, 2 Nov 2012 21:17:59 +0000 (17:17 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 23 Jan 2013 04:38:00 +0000 (23:38 -0500)
commit194f2bd8a35a99e106dbb26bfb224bc7af58df20
tree450f3888c9f663298231a29d6a1e63269f815fd0
parent0df6e81f9fe313a03f47dd3ca68bd6c858010abf
ftrace: Add context level recursion bit checking

Currently for recursion checking in the function tracer, ftrace
tests a task_struct bit to determine if the function tracer had
recursed or not. If it has, then it will will return without going
further.

But this leads to races. If an interrupt came in after the bit
was set, the functions being traced would see that bit set and
think that the function tracer recursed on itself, and would return.

Instead add a bit for each context (normal, softirq, irq and nmi).

A check of which context the task is in is made before testing the
associated bit. Now if an interrupt preempts the function tracer
after the previous context has been set, the interrupt functions
can still be traced.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ftrace.c
kernel/trace/trace.h