Skip to content

Commit

Permalink
perf tui: Make ui__warning modal
Browse files Browse the repository at this point in the history
By taking the ui__lock so that no other screen updates take place while
waiting for the user.

That was happening when handling an invalid --vmlinux parameter in 'perf
top --tui', with the screen refresh routine repainting the screen and
removing the warning window.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Arnaldo Carvalho de Melo committed Mar 1, 2011
1 parent 3166fc8 commit a1ceb74
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/perf/util/ui/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "../debug.h"
#include "browser.h"
#include "helpline.h"
#include "ui.h"
#include "util.h"

static void newt_form__set_exit_keys(newtComponent self)
Expand Down Expand Up @@ -118,10 +119,12 @@ void ui__warning(const char *format, ...)
va_list args;

va_start(args, format);
if (use_browser > 0)
if (use_browser > 0) {
pthread_mutex_lock(&ui__lock);
newtWinMessagev((char *)warning_str, (char *)ok,
(char *)format, args);
else
pthread_mutex_unlock(&ui__lock);
} else
vfprintf(stderr, format, args);
va_end(args);
}

0 comments on commit a1ceb74

Please sign in to comment.