Skip to content

Commit

Permalink
perf ui browser: Allow specifying message to show when no samples are…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
acmel committed Aug 20, 2019
1 parent 9b01611 commit 2284cf8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/perf/ui/browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ static int __ui_browser__refresh(struct ui_browser *browser)
SLsmg_fill_region(browser->y + row + browser->extra_title_lines, browser->x,
browser->rows - row, width, ' ');

if (browser->nr_entries == 0 && browser->no_samples_msg)
__ui__info_window(NULL, browser->no_samples_msg, NULL);
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions tools/perf/ui/browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct ui_browser {
void *priv;
const char *title;
char *helpline;
const char *no_samples_msg;
void (*refresh_dimensions)(struct ui_browser *browser);
unsigned int (*refresh)(struct ui_browser *browser);
void (*write)(struct ui_browser *browser, void *entry, int row);
Expand Down

0 comments on commit 2284cf8

Please sign in to comment.