1
0
Fork 0
alistair23-linux/tools/perf/ui/browsers
Wei Li 9ca67a4532 perf report TUI: Fix segmentation fault in perf_evsel__hists_browse()
[ Upstream commit d61cbb859b ]

The segmentation fault can be reproduced as following steps:

1) Executing perf report in tui.

2) Typing '/xxxxx' to filter the symbol to get nothing matched.

3) Pressing enter with no entry selected.

Then it will report a segmentation fault.

It is caused by the lack of check of browser->he_selection when
accessing it's member res_samples in perf_evsel__hists_browse().

These processes are meaningful for specified samples, so we can skip
these when nothing is selected.

Fixes: 4968ac8fb7 ("perf report: Implement browsing of individual samples")
Signed-off-by: Wei Li <liwei391@huawei.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Link: http://lore.kernel.org/lkml/20200612094322.39565-1-liwei391@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-07-16 08:16:38 +02:00
..
Build perf report: Implement browsing of individual samples 2019-03-11 16:33:19 -03:00
annotate.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
header.c perf tools: Remove debug.h from places where it is not needed 2019-09-20 09:19:20 -03:00
hists.c perf report TUI: Fix segmentation fault in perf_evsel__hists_browse() 2020-07-16 08:16:38 +02:00
hists.h perf hists browser: Pass annotation_options from tool to browser 2018-06-04 10:28:53 -03:00
map.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
map.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
res_sample.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
scripts.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00