OSDN Git Service

perf sort: Fix segfault with basic block 'cycles' sort dimension
authorChangbin Du <changbin.du@intel.com>
Mon, 13 Mar 2017 08:31:48 +0000 (16:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Mar 2018 08:23:20 +0000 (09:23 +0100)
commitecabc4777cf0918eb5e0ad2e0842bb4b1faab59e
treea595019cfdbe7fdf5fd7b449f6c587084b3eb594
parent89aadbc66e41aee339979f5b86c8bd6354c6ceac
perf sort: Fix segfault with basic block 'cycles' sort dimension

[ Upstream commit 4b0b3aa6a2756e6115fdf275c521e4552a7082f3 ]

Skip the sample which doesn't have branch_info to avoid segmentation
fault:

The fault can be reproduced by:

  perf record -a
  perf report -F cycles

Signed-off-by: Changbin Du <changbin.du@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: 0e332f033a82 ("perf tools: Add support for cycles, weight branch_info field")
Link: http://lkml.kernel.org/r/20170313083148.23568-1-changbin.du@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/perf/util/sort.c