diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-10-13 00:06:16 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-12-09 08:46:05 -0300 |
commit | 1240005e0d3a7e03c2fd05603fb01676e5a004f7 (patch) | |
tree | 055fb08fabe4c5d09c339dc2fb4ac63e741127a8 /tools/perf/util/hist.h | |
parent | 35d48ddfc0627443bd7ad2750a3f65d42cb742a0 (diff) | |
download | lwn-1240005e0d3a7e03c2fd05603fb01676e5a004f7.tar.gz lwn-1240005e0d3a7e03c2fd05603fb01676e5a004f7.zip |
perf hists: Introduce perf_hpp__list for period related columns
Adding perf_hpp__list list to register and contain all period related
columns the command is interested in.
This way we get rid of static array holding all possible columns and
enable commands to register their own columns.
It'll be handy for diff command in future to process and display data
for multiple files.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/n/tip-kiykge4igrcl7etmpmveto1h@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/hist.h')
-rw-r--r-- | tools/perf/util/hist.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 8b091a51e4a2..a935a60d521c 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h @@ -126,13 +126,19 @@ struct perf_hpp { }; 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); + + struct list_head list; }; +extern struct list_head perf_hpp__list; + +#define perf_hpp__for_each_format(format) \ + list_for_each_entry(format, &perf_hpp__list, list) + extern struct perf_hpp_fmt perf_hpp__format[]; enum { @@ -155,7 +161,8 @@ enum { }; void perf_hpp__init(void); -void perf_hpp__column_enable(unsigned col, bool enable); +void perf_hpp__column_register(struct perf_hpp_fmt *format); +void perf_hpp__column_enable(unsigned col); int hist_entry__period_snprintf(struct perf_hpp *hpp, struct hist_entry *he, bool color); |