summaryrefslogtreecommitdiff
path: root/tools/perf/ui/hist.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2012-11-28 13:52:41 (GMT)
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-12-09 11:46:07 (GMT)
commitf4c8bae1920c459b7b9c12363d11e8a588862e42 (patch)
tree923d0b943153198760e473261480666ea36dca05 /tools/perf/ui/hist.c
parent05472daa4d8ab88a071bfcaa3bb47473e4071848 (diff)
downloadlinux-f4c8bae1920c459b7b9c12363d11e8a588862e42.tar.xz
perf diff: Change formula methods to work with pair directly
Changing formula methods to operate over hist entry and its pair directly. This makes the code more obvious and readable, instead of all time checking for pair being != NULL. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1354110769-2998-7-git-send-email-jolsa@redhat.com 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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 108e5ed..1785bab 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -389,10 +389,13 @@ static int hpp__width_formula(struct perf_hpp *hpp __maybe_unused)
static int hpp__entry_formula(struct perf_hpp *hpp, struct hist_entry *he)
{
+ struct hist_entry *pair = hist_entry__next_pair(he);
const char *fmt = symbol_conf.field_sep ? "%s" : "%-70s";
char buf[96] = " ";
- perf_diff__formula(buf, sizeof(buf), he);
+ if (pair)
+ perf_diff__formula(he, pair, buf, sizeof(buf));
+
return scnprintf(hpp->buf, hpp->size, fmt, buf);
}