tracing/syscalls: fix missing release of tracing
authorFrederic Weisbecker <fweisbec@gmail.com>
Sun, 15 Mar 2009 21:10:35 +0000 (22:10 +0100)
committerIngo Molnar <mingo@elte.hu>
Mon, 16 Mar 2009 08:13:15 +0000 (09:13 +0100)
commitac99c58c9e56967037382e31f865b72b10127965
tree703c5f043cb8067cca699b6c3b6a481430912dd5
parent7243f2145a9b06e5cf9a49fc9b8b9a4fff6fb42e
tracing/syscalls: fix missing release of tracing

Impact: fix 'stuck' syscall tracer

The syscall tracer uses a refcounter to enable several users
simultaneously.

But the refcounter did not behave correctly and always restored
its value to 0 after calling start_syscall_tracing(). Therefore,
stop_syscall_tracing() couldn't release correctly the tasks from
tracing.

Also the tracer forgot to reset the buffer when it is released.

Drop the pointless refcount decrement on start_syscall_tracing()
and reset the buffer when we release the tracer.

This fixes two reported issue:

- when we switch from syscall tracer to another tracer, syscall
  tracing continued.

- incorrect use of the refcount.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1237151439-6755-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/trace_syscalls.c