summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/block-info.c
diff options
context:
space:
mode:
authorJin Yao <yao.jin@linux.intel.com>2020-02-02 15:16:53 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-03-10 01:43:25 +0100
commita8a9f6dc0dbfc0f4f225987abec7eb688f4b2d7e (patch)
tree70fa2c339ec3426e7d893748e9c16a3f6ecfeae5 /tools/perf/util/block-info.c
parentperf block-info: Fix wrong block address comparison in block_info__cmp() (diff)
downloadlinux-a8a9f6dc0dbfc0f4f225987abec7eb688f4b2d7e.tar.xz
linux-a8a9f6dc0dbfc0f4f225987abec7eb688f4b2d7e.zip
perf diff: Use __block_info__cmp() to replace block_pair_cmp()
'perf diff' uses block_pair_cmp() to compare two blocks. But block_info__cmp() has the similar functionality and it's a bit more complete. This patch removes block_pair_cmp() and uses __block_info__cmp() instead. __block_info__cmp() is wrapped by block_info__cmp() and it doesn't receives a perf_hpp_fmt parameter. Signed-off-by: Jin Yao <yao.jin@linux.intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jin Yao <yao.jin@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20200202141655.32053-3-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/block-info.c')
-rw-r--r--tools/perf/util/block-info.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/util/block-info.c b/tools/perf/util/block-info.c
index 5b4214656e29..25f6422c548b 100644
--- a/tools/perf/util/block-info.c
+++ b/tools/perf/util/block-info.c
@@ -65,8 +65,7 @@ struct block_info *block_info__new(void)
return bi;
}
-int64_t block_info__cmp(struct perf_hpp_fmt *fmt __maybe_unused,
- struct hist_entry *left, struct hist_entry *right)
+int64_t __block_info__cmp(struct hist_entry *left, struct hist_entry *right)
{
struct block_info *bi_l = left->block_info;
struct block_info *bi_r = right->block_info;
@@ -91,6 +90,12 @@ int64_t block_info__cmp(struct perf_hpp_fmt *fmt __maybe_unused,
return (int64_t)(bi_r->end - bi_l->end);
}
+int64_t block_info__cmp(struct perf_hpp_fmt *fmt __maybe_unused,
+ struct hist_entry *left, struct hist_entry *right)
+{
+ return __block_info__cmp(left, right);
+}
+
static void init_block_info(struct block_info *bi, struct symbol *sym,
struct cyc_hist *ch, int offset,
u64 total_cycles)