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 <[email protected]> Cc: Corey Ashford <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: David Ahern <[email protected]> --- 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) SLsmg_set_char_set(0); } +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); -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

