summaryrefslogtreecommitdiff
path: root/tools/perf/util/hist.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2012-09-09 10:39:14 +0200
committerIngo Molnar <mingo@kernel.org>2012-09-09 10:39:14 +0200
commitd5cb2aef4fda355fbafe8db4f425b73ea94d2019 (patch)
treef6812e5248557bd16803f787e0cbc9d57ab60133 /tools/perf/util/hist.h
parentef34eb4da3eb62a1511592adf7c76d74faca0b14 (diff)
parent6c7f631261064762a8ba1ee34fc2b76d117ef3fa (diff)
downloadlinux-d5cb2aef4fda355fbafe8db4f425b73ea94d2019.tar.gz
linux-d5cb2aef4fda355fbafe8db4f425b73ea94d2019.tar.xz
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: * Don't pass const char pointers to basename, so that we can unconditionally use libgen.h and thus avoid ifdef BIONIC lines, from David Ahern * Fix assert/BUG_ON when NDEBUG is defined, from Irina Tirdea. * Refactor hist formatting so that it can be reused with the GTK browser, From Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/hist.h')
-rw-r--r--tools/perf/util/hist.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 2e650ffb7d23..4146f51124f0 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -115,6 +115,43 @@ bool hists__new_col_len(struct hists *self, enum hist_column col, u16 len);
void hists__reset_col_len(struct hists *hists);
void hists__calc_col_len(struct hists *hists, struct hist_entry *he);
+struct perf_hpp {
+ char *buf;
+ size_t size;
+ u64 total_period;
+ const char *sep;
+ long displacement;
+ void *ptr;
+};
+
+struct perf_hpp_fmt {
+ bool cond;
+ int (*header)(struct perf_hpp *hpp);
+ int (*width)(struct perf_hpp *hpp);
+ int (*color)(struct perf_hpp *hpp, struct hist_entry *he);
+ int (*entry)(struct perf_hpp *hpp, struct hist_entry *he);
+};
+
+extern struct perf_hpp_fmt perf_hpp__format[];
+
+enum {
+ PERF_HPP__OVERHEAD,
+ PERF_HPP__OVERHEAD_SYS,
+ PERF_HPP__OVERHEAD_US,
+ PERF_HPP__OVERHEAD_GUEST_SYS,
+ PERF_HPP__OVERHEAD_GUEST_US,
+ PERF_HPP__SAMPLES,
+ PERF_HPP__PERIOD,
+ PERF_HPP__DELTA,
+ PERF_HPP__DISPL,
+
+ PERF_HPP__MAX_INDEX
+};
+
+void perf_hpp__init(bool need_pair, bool show_displacement);
+int hist_entry__period_snprintf(struct perf_hpp *hpp, struct hist_entry *he,
+ bool color);
+
struct perf_evlist;
#ifdef NO_NEWT_SUPPORT