• Ian Rogers's avatar
    perf stat: Clear evsel->reset_group for each stat run · bf515f02
    Ian Rogers authored
    If a weak group is broken then the reset_group flag remains set for
    the next run. Having reset_group set means the counter isn't created
    and ultimately a segfault.
    
    A simple reproduction of this is:
    
      # perf stat -r2 -e '{cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles}:W
    
    which will be added as a test in the next patch.
    
    Fixes: 4804e011
    
     ("perf stat: Use affinity for opening events")
    Reviewed-by: default avatarAndi Kleen <ak@linux.intel.com>
    Signed-off-by: default avatarIan Rogers <irogers@google.com>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Tested-by: default avatarXing Zhengjun <zhengjun.xing@linux.intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Erani...
    bf515f02
builtin-stat.c 70.1 KB