path: root/tools/perf/util/ui/browser.c
diff options
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-10-29 12:15:04 -0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-11-02 12:27:23 -0200
commit7b27509fc62686c53e9301560034e6b0b001174d (patch)
tree7b4fc36012d76d5319537df73fd5f7f50104b137 /tools/perf/util/ui/browser.c
parentperf tools: Fix a typo of command name as trace-cmd (diff)
perf hists browser: Warn about lost events
Just like the old perf top --tui and the --stdio version. But because we have the initial menu to choose which event to show in a session with multiple events we can see how many chunks were lost in each of the event types, clarifying which events are being affected the most. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-47yyqbubmjzch2chezmb21m6@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/ui/browser.c')
1 files changed, 17 insertions, 4 deletions
diff --git a/tools/perf/util/ui/browser.c b/tools/perf/util/ui/browser.c
index d2051be04f12..556829124b02 100644
--- a/tools/perf/util/ui/browser.c
+++ b/tools/perf/util/ui/browser.c
@@ -176,16 +176,29 @@ void ui_browser__handle_resize(struct ui_browser *browser)
-int ui_browser__warning(struct ui_browser *browser, const char *format, ...)
+int ui_browser__warning(struct ui_browser *browser, int timeout,
+ const char *format, ...)
va_list args;
- int key;
+ char *text;
+ int key = 0, err;
va_start(args, format);
- while ((key = __ui__warning("Warning!", format, args)) == K_RESIZE)
- ui_browser__handle_resize(browser);
+ err = vasprintf(&text, format, args);
+ if (err < 0) {
+ va_start(args, format);
+ ui_helpline__vpush(format, args);
+ va_end(args);
+ } else {
+ while ((key == ui__question_window("Warning!", text,
+ "Press any key...",
+ timeout)) == K_RESIZE)
+ ui_browser__handle_resize(browser);
+ free(text);
+ }
return key;