diff options
author | Namhyung Kim <namhyung@kernel.org> | 2014-03-02 20:14:05 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-03-14 17:08:39 -0400 |
commit | 2f6d9009af1df0f7cba1fdfe012a089babd8c747 (patch) | |
tree | 2877d4532317b27036989960145581f42ab53779 /tools/perf/util | |
parent | a0088adcd651b8eb1a9ca9c7e6ebe1c2c5fb6273 (diff) |
perf ui/tui: Reuse generic __hpp__fmt() code
The __hpp__color_fmt used in the TUI code can be replace by the generic
code with small change in print_fn callback. And it also needs to move
callback function to the generic __hpp__fmt().
No functional changes intended.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1393809254-4480-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/hist.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index d51ed9898229..9e1cada45bb8 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -166,10 +166,12 @@ void perf_hpp__init(void); | |||
166 | void perf_hpp__column_register(struct perf_hpp_fmt *format); | 166 | void perf_hpp__column_register(struct perf_hpp_fmt *format); |
167 | void perf_hpp__column_enable(unsigned col); | 167 | void perf_hpp__column_enable(unsigned col); |
168 | 168 | ||
169 | typedef u64 (*hpp_field_fn)(struct hist_entry *he); | ||
170 | typedef int (*hpp_callback_fn)(struct perf_hpp *hpp, bool front); | ||
169 | typedef int (*hpp_snprint_fn)(struct perf_hpp *hpp, const char *fmt, ...); | 171 | typedef int (*hpp_snprint_fn)(struct perf_hpp *hpp, const char *fmt, ...); |
170 | 172 | ||
171 | int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he, | 173 | int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he, |
172 | u64 (*get_field)(struct hist_entry *), | 174 | hpp_field_fn get_field, hpp_callback_fn callback, |
173 | const char *fmt, hpp_snprint_fn print_fn, bool fmt_percent); | 175 | const char *fmt, hpp_snprint_fn print_fn, bool fmt_percent); |
174 | 176 | ||
175 | static inline void advance_hpp(struct perf_hpp *hpp, int inc) | 177 | static inline void advance_hpp(struct perf_hpp *hpp, int inc) |