tracing: Use flag buffer_disabled for irqsoff tracer
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Mon, 1 Jul 2013 19:58:24 +0000 (15:58 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Aug 2013 05:59:07 +0000 (22:59 -0700)
commit2fd821ee4dd784a940d6840ebc85ecc8d7b80744
tree17b3a3d247b7414252ce69c9781a0b254e3977aa
parente25d45868ca209a7d13772ed313a99ea0f9194d6
tracing: Use flag buffer_disabled for irqsoff tracer

commit 10246fa35d4ffdfe472185d4cbf9c2dfd9a9f023 upstream.

If the ring buffer is disabled and the irqsoff tracer records a trace it
will clear out its buffer and lose the data it had previously recorded.

Currently there's a callback when writing to the tracing_of file, but if
tracing is disabled via the function tracer trigger, it will not inform
the irqsoff tracer to stop recording.

By using the "mirror" flag (buffer_disabled) in the trace_array, that keeps
track of the status of the trace_array's buffer, it gives the irqsoff
tracer a fast way to know if it should record a new trace or not.
The flag may be a little behind the real state of the buffer, but it
should not affect the trace too much. It's more important for the irqsoff
tracer to be fast.

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace.c
kernel/trace/trace_irqsoff.c