[PATCH 10/22] perf tools: Add header callback into ui_browser_ops struct

From: Jiri Olsa
Date: Sun Feb 02 2014 - 16:46:54 EST

Adding header callback into 'struct ui_browser_ops',
the prototype is:
unsigned int (*header)(struct ui_browser *browser);

It's called before the refresh callback under the
same lock. It's going to be used for hist browser
to display column header.

Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Corey Ashford <cjashfor@xxxxxxxxxxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
tools/perf/ui/browser.c | 8 ++++++++
tools/perf/ui/browser.h | 1 +
2 files changed, 9 insertions(+)

diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c
index b0b651d..31bd6e8 100644
--- a/tools/perf/ui/browser.c
+++ b/tools/perf/ui/browser.c
@@ -303,11 +303,19 @@ static void ui_browser__scrollbar_set(struct ui_browser *browser)

+static void __ui_browser__header(struct ui_browser *browser)
+ if (browser->ops.header)
+ browser->ops.header(browser);
static int __ui_browser__refresh(struct ui_browser *browser)
int row;
int width = browser->width;

+ __ui_browser__header(browser);
row = browser->ops.refresh(browser);
ui_browser__set_color(browser, HE_COLORSET_NORMAL);

diff --git a/tools/perf/ui/browser.h b/tools/perf/ui/browser.h
index 5610176..73b17b7 100644
--- a/tools/perf/ui/browser.h
+++ b/tools/perf/ui/browser.h
@@ -16,6 +16,7 @@
struct ui_browser;

struct ui_browser_ops {
+ unsigned int (*header)(struct ui_browser *browser);
unsigned int (*refresh)(struct ui_browser *browser);
void (*write)(struct ui_browser *browser, void *entry, int row);
void (*seek)(struct ui_browser *browser, off_t offset, int whence);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/