]> git.baikalelectronics.ru Git - kernel.git/commit
perf top: Fix wrong hottest instruction highlighted
authorHe Kuang <hekuang@huawei.com>
Sun, 20 Jan 2019 16:05:22 +0000 (00:05 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 21 Jan 2019 14:29:07 +0000 (11:29 -0300)
commit310235e129396d52e45136b2c6c57bb568b43e0a
treeaca3dd3b896c3881040bb1adfada5812f32cdb4f
parente72640884310fe44974e99c7fb209e6ec4fb745d
perf top: Fix wrong hottest instruction highlighted

The annotation line percentage is compared and inserted into the rbtree,
but the percent field of 'struct annotation_data' is an array, the
comparison result between them is the address difference.

This patch compares the right slot of percent array according to
opts->percent_type and makes things right.

The problem can be reproduced by pressing 'H' in perf top annotation view.
It should highlight the instruction line which has the highest sampling
percentage.

Signed-off-by: He Kuang <hekuang@huawei.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190120160523.4391-1-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/browsers/annotate.c