summaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/hist.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2016-01-18 10:24:04 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-02-03 12:24:01 -0300
commitc0020efa079c5fc2388945ae7e856b362731442d (patch)
tree29170673551f9d6e058c1cf73ea3252de7af83f5 /tools/perf/ui/hist.c
parent97358084b91e94e5f8fcf0379f0430c0ea16bd3b (diff)
downloadlinux-stable-c0020efa079c5fc2388945ae7e856b362731442d.tar.gz
linux-stable-c0020efa079c5fc2388945ae7e856b362731442d.tar.bz2
linux-stable-c0020efa079c5fc2388945ae7e856b362731442d.zip
perf hists: Add 'hpp__equal' callback function
Adding 'hpp__equal' callback function to compare hpp output format entries. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1453109064-1026-7-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/hist.c')
-rw-r--r--tools/perf/ui/hist.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 71c8bb71a350..b543f4b7d7d3 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -371,6 +371,19 @@ static int64_t hpp__nop_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
return 0;
}
+static bool perf_hpp__is_hpp_entry(struct perf_hpp_fmt *a)
+{
+ return a->header == hpp__header_fn;
+}
+
+static bool hpp__equal(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b)
+{
+ if (!perf_hpp__is_hpp_entry(a) || !perf_hpp__is_hpp_entry(b))
+ return false;
+
+ return a->idx == b->idx;
+}
+
#define HPP__COLOR_PRINT_FNS(_name, _fn, _idx) \
{ \
.name = _name, \
@@ -382,6 +395,7 @@ static int64_t hpp__nop_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
.collapse = hpp__nop_cmp, \
.sort = hpp__sort_ ## _fn, \
.idx = PERF_HPP__ ## _idx, \
+ .equal = hpp__equal, \
}
#define HPP__COLOR_ACC_PRINT_FNS(_name, _fn, _idx) \
@@ -395,6 +409,7 @@ static int64_t hpp__nop_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
.collapse = hpp__nop_cmp, \
.sort = hpp__sort_ ## _fn, \
.idx = PERF_HPP__ ## _idx, \
+ .equal = hpp__equal, \
}
#define HPP__PRINT_FNS(_name, _fn, _idx) \
@@ -407,6 +422,7 @@ static int64_t hpp__nop_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
.collapse = hpp__nop_cmp, \
.sort = hpp__sort_ ## _fn, \
.idx = PERF_HPP__ ## _idx, \
+ .equal = hpp__equal, \
}
struct perf_hpp_fmt perf_hpp__format[] = {