From a0088adcd651b8eb1a9ca9c7e6ebe1c2c5fb6273 Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Mon, 3 Mar 2014 10:14:04 +0900 Subject: perf ui/hists: Pass struct hpp to print functions Instead of the pointer to buffer and its size so that it can also get private argument passed along with hpp. This is a preparation of further change. Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: David Ahern Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1393809254-4480-4-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/hist.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/perf/util/hist.h') diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 97f924e..d51ed98 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h @@ -166,12 +166,18 @@ void perf_hpp__init(void); void perf_hpp__column_register(struct perf_hpp_fmt *format); void perf_hpp__column_enable(unsigned col); -typedef int (*hpp_snprint_fn)(char *buf, size_t size, const char *fmt, ...); +typedef int (*hpp_snprint_fn)(struct perf_hpp *hpp, const char *fmt, ...); int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he, u64 (*get_field)(struct hist_entry *), const char *fmt, hpp_snprint_fn print_fn, bool fmt_percent); +static inline void advance_hpp(struct perf_hpp *hpp, int inc) +{ + hpp->buf += inc; + hpp->size -= inc; +} + static inline size_t perf_hpp__use_color(void) { return !symbol_conf.field_sep; -- cgit v1.1