• Frederic Weisbecker's avatar
    tracing/syscalls: fix missing release of tracing · ac99c58c
    Frederic Weisbecker authored
    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: default avatarAndrew Morton <akpm@linux-foundation.org>
    Reported-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
    LKML-Reference: <1237151439-6755-1-git-send-email-fweisbec@gmail.com>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    ac99c58c
trace_syscalls.c 5.12 KB