aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/hist.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2013-10-30 03:06:59 -0400
committerJiri Olsa <jolsa@kernel.org>2014-06-01 08:35:00 -0400
commit594dcbf3186e2e1e5c08fa21e8826b90d347f23f (patch)
tree04af47780d4cdc8b4cb205a554cd76bf834b3ba9 /tools/perf/util/hist.h
parentbe7f855a3eebe07f797b9e4a43bf59bab8ca3dbe (diff)
perf ui/hist: Add support to accumulated hist stat
Print accumulated stat of a hist entry if requested. To do that, add new HPP_PERCENT_ACC_FNS macro and generate a perf_hpp_fmt using it. The __hpp__sort_acc() function sorts entries by accumulated period value. When accumulated periods of two entries are same (i.e. single path callchain) put the caller above since accumulation tends to put callers on higher position for obvious reason. Also add "overhead_children" output field to be selected by user. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Tested-by: Arun Sharma <asharma@fb.com> Tested-by: Rodrigo Campos <rodrigo@sdfg.com.ar> Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/r/1401335910-16832-11-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf/util/hist.h')
-rw-r--r--tools/perf/util/hist.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 78409f95d012..efd73e489027 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -228,6 +228,7 @@ enum {
228 PERF_HPP__OVERHEAD_US, 228 PERF_HPP__OVERHEAD_US,
229 PERF_HPP__OVERHEAD_GUEST_SYS, 229 PERF_HPP__OVERHEAD_GUEST_SYS,
230 PERF_HPP__OVERHEAD_GUEST_US, 230 PERF_HPP__OVERHEAD_GUEST_US,
231 PERF_HPP__OVERHEAD_ACC,
231 PERF_HPP__SAMPLES, 232 PERF_HPP__SAMPLES,
232 PERF_HPP__PERIOD, 233 PERF_HPP__PERIOD,
233 234
@@ -254,6 +255,9 @@ typedef int (*hpp_snprint_fn)(struct perf_hpp *hpp, const char *fmt, ...);
254int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he, 255int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he,
255 hpp_field_fn get_field, const char *fmt, 256 hpp_field_fn get_field, const char *fmt,
256 hpp_snprint_fn print_fn, bool fmt_percent); 257 hpp_snprint_fn print_fn, bool fmt_percent);
258int __hpp__fmt_acc(struct perf_hpp *hpp, struct hist_entry *he,
259 hpp_field_fn get_field, const char *fmt,
260 hpp_snprint_fn print_fn, bool fmt_percent);
257 261
258static inline void advance_hpp(struct perf_hpp *hpp, int inc) 262static inline void advance_hpp(struct perf_hpp *hpp, int inc)
259{ 263{