diff options
Diffstat (limited to 'tools/perf/util/newt.c')
-rw-r--r-- | tools/perf/util/newt.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c index cf182ca132fe..7537ca15900b 100644 --- a/tools/perf/util/newt.c +++ b/tools/perf/util/newt.c | |||
@@ -43,6 +43,9 @@ struct ui_progress *ui_progress__new(const char *title, u64 total) | |||
43 | 43 | ||
44 | if (self != NULL) { | 44 | if (self != NULL) { |
45 | int cols; | 45 | int cols; |
46 | |||
47 | if (use_browser <= 0) | ||
48 | return self; | ||
46 | newtGetScreenSize(&cols, NULL); | 49 | newtGetScreenSize(&cols, NULL); |
47 | cols -= 4; | 50 | cols -= 4; |
48 | newtCenteredWindow(cols, 1, title); | 51 | newtCenteredWindow(cols, 1, title); |
@@ -67,14 +70,22 @@ out_free_self: | |||
67 | 70 | ||
68 | void ui_progress__update(struct ui_progress *self, u64 curr) | 71 | void ui_progress__update(struct ui_progress *self, u64 curr) |
69 | { | 72 | { |
73 | /* | ||
74 | * FIXME: We should have a per UI backend way of showing progress, | ||
75 | * stdio will just show a percentage as NN%, etc. | ||
76 | */ | ||
77 | if (use_browser <= 0) | ||
78 | return; | ||
70 | newtScaleSet(self->scale, curr); | 79 | newtScaleSet(self->scale, curr); |
71 | newtRefresh(); | 80 | newtRefresh(); |
72 | } | 81 | } |
73 | 82 | ||
74 | void ui_progress__delete(struct ui_progress *self) | 83 | void ui_progress__delete(struct ui_progress *self) |
75 | { | 84 | { |
76 | newtFormDestroy(self->form); | 85 | if (use_browser > 0) { |
77 | newtPopWindow(); | 86 | newtFormDestroy(self->form); |
87 | newtPopWindow(); | ||
88 | } | ||
78 | free(self); | 89 | free(self); |
79 | } | 90 | } |
80 | 91 | ||