• Peter Zijlstra's avatar
    perf: Fix exit() vs PERF_FORMAT_GROUP · 050735b0
    Peter Zijlstra authored
    Both Stephane and Corey reported that PERF_FORMAT_GROUP didn't
    work as expected if the task the counters were attached to quit
    before the read() call.
    
    The cause is that we unconditionally destroy the grouping when
    we remove counters from their context. Fix this by splitting off
    the group destroy from the list removal such that
    perf_event_remove_from_context() does not do this and change
    perf_event_release() to do so.
    Reported-by: default avatarCorey Ashford <cjashfor@linux.vnet.ibm.com>
    Reported-by: default avatarStephane Eranian <eranian@google.com>
    Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: <stable@kernel.org> # .34.x
    LKML-Reference: <1273571513.5605.3527.camel@twins>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    050735b0
perf_event.c 130 KB