Patch "perf sort: Fix segfault with basic block 'cycles' sort dimension" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
perf sort: Fix segfault with basic block 'cycles' sort dimension
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
perf-sort-fix-segfault-with-basic-block-cycles-sort-dimension.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Mon Mar 19 09:58:12 CET 2018
From: Changbin Du <[email protected]>
Date: Mon, 13 Mar 2017 16:31:48 +0800
Subject: perf sort: Fix segfault with basic block 'cycles' sort dimension
From: Changbin Du <[email protected]>
[ 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
--- tools/perf/util/sort.c | 5 +++++ 1 file changed, 5 insertions(+)
tools/perf/util/sort.c +5 -0
@@ -604,6 +604,9 @@ static int hist_entry__mispredict_snprinstatic int64_t sort__cycles_cmp (struct hist_entry *left,struct hist_entry *right) { +if (!left->branch_info || !right->branch_info) +return cmp_null (left->branch_info, right->branch_info); +return left->branch_info->flags.cycles - right->branch_info->flags.cycles; }
@@ -611,6 +614,8 @@ sort__cycles_cmp(struct hist_entry *leftstatic int hist_entry__cycles_snprintf (struct hist_entry *he,char *bf,size_t size,unsigned int width) { +if (!he->branch_info) +return scnprintf (bf, size,"%-.*s" , width,"N/A" );if (he->branch_info->flags.cycles ==0 )return repsep_snprintf (bf, size,"%-*s" , width,"-" ); return repsep_snprintf(bf, size, "%-*hd", width,
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/perf-sort-fix-segfault-with-basic-block-cycles-sort-dimension.patch