• Ravi Bangoria's avatar
    perf tools: Fix crash caused by accessing feat_ops[HEADER_LAST_FEATURE] · 92ead7ee
    Ravi Bangoria authored
    perf_event__process_feature() accesses feat_ops[HEADER_LAST_FEATURE]
    which is not defined and thus perf is crashing. HEADER_LAST_FEATURE is
    used as an end marker for the perf report but it's unused for perf
    script/annotate. Ignore HEADER_LAST_FEATURE for perf script/annotate,
    just like it is done in 'perf report'.
    
    Before:
      # perf record -o - ls | perf script
      <SNIP 'ls' output>
      Segmentation fault (core dumped)
      #
    
    After:
      # perf record -o - ls | perf script
      <SNIP 'ls' output>
      Segmentation fault (core dumped)
      ls 7031 4392.099856:  250000 cpu-clock:uhH:  7f5e0ce7cd60
      ls 7031 4392.100355:  250000 cpu-clock:uhH:  7f5e0c706ef7
      #
    Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@linux.ibm.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: David Carrillo-Cisneros <davidcc@google.com>
    Cc: Jin Yao <yao.jin@linux.intel.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Fixes: 57b5de46 ("perf report: Support forced leader feature in pipe mode")
    Link: http://lkml.kernel.org/r/20180625124220.6434-4-ravi.bangoria@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    92ead7ee
builtin-report.c 39 KB