Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf ui browser: Allow specifying message to show when no samples are available to display

The 'perf top' tool will use that to avoid having a initial blank screen
while collecting the minimum number of samples to sort and display.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-89ciceg8cy4442he3t0jzo3f@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+3
+2
tools/perf/ui/browser.c
··· 347 347 SLsmg_fill_region(browser->y + row + browser->extra_title_lines, browser->x, 348 348 browser->rows - row, width, ' '); 349 349 350 + if (browser->nr_entries == 0 && browser->no_samples_msg) 351 + __ui__info_window(NULL, browser->no_samples_msg, NULL); 350 352 return 0; 351 353 } 352 354
+1
tools/perf/ui/browser.h
··· 23 23 void *priv; 24 24 const char *title; 25 25 char *helpline; 26 + const char *no_samples_msg; 26 27 void (*refresh_dimensions)(struct ui_browser *browser); 27 28 unsigned int (*refresh)(struct ui_browser *browser); 28 29 void (*write)(struct ui_browser *browser, void *entry, int row);