diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-03-01 08:24:43 -0500 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-03-01 08:24:43 -0500 |
| commit | a1ceb741cf86ef433006379742db81c00b450bae (patch) | |
| tree | 8db2f94f1968a3640233d10481df4e68dbe15abb /tools/perf/util | |
| parent | 3166fc8fb6a2f52273d545e970297524e02c3e39 (diff) | |
perf tui: Make ui__warning modal
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>
Diffstat (limited to 'tools/perf/util')
| -rw-r--r-- | tools/perf/util/ui/util.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/ui/util.c b/tools/perf/util/ui/util.c index 7b5a8926624e..fdf1fc8f08bc 100644 --- a/tools/perf/util/ui/util.c +++ b/tools/perf/util/ui/util.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "../debug.h" | 9 | #include "../debug.h" |
| 10 | #include "browser.h" | 10 | #include "browser.h" |
| 11 | #include "helpline.h" | 11 | #include "helpline.h" |
| 12 | #include "ui.h" | ||
| 12 | #include "util.h" | 13 | #include "util.h" |
| 13 | 14 | ||
| 14 | static void newt_form__set_exit_keys(newtComponent self) | 15 | static void newt_form__set_exit_keys(newtComponent self) |
| @@ -118,10 +119,12 @@ void ui__warning(const char *format, ...) | |||
| 118 | va_list args; | 119 | va_list args; |
| 119 | 120 | ||
| 120 | va_start(args, format); | 121 | va_start(args, format); |
| 121 | if (use_browser > 0) | 122 | if (use_browser > 0) { |
| 123 | pthread_mutex_lock(&ui__lock); | ||
| 122 | newtWinMessagev((char *)warning_str, (char *)ok, | 124 | newtWinMessagev((char *)warning_str, (char *)ok, |
| 123 | (char *)format, args); | 125 | (char *)format, args); |
| 124 | else | 126 | pthread_mutex_unlock(&ui__lock); |
| 127 | } else | ||
| 125 | vfprintf(stderr, format, args); | 128 | vfprintf(stderr, format, args); |
| 126 | va_end(args); | 129 | va_end(args); |
| 127 | } | 130 | } |
