diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-28 12:24:43 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-28 12:24:43 -0700 |
commit | 5904b3b81d25166e5e39b9727645bb47937618e3 (patch) | |
tree | 2a306f8b0cdea354b3ebc157623dededcf471091 /tools/perf/util/newt.c | |
parent | f3866db8f7534ba8bbb342bebcf5ede542035528 (diff) | |
parent | b70e4f0529c089b00d0a6da13106db4de1ada4c7 (diff) |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
tracing: Fix undeclared ENOSYS in include/linux/tracepoint.h
perf record: prevent kill(0, SIGTERM);
perf session: Remove threads from tree on PERF_RECORD_EXIT
perf/tracing: Fix regression of perf losing kprobe events
perf_events: Fix Intel Westmere event constraints
perf record: Don't call newt functions when not initialized
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) if (self != NULL) { int cols; + + if (use_browser <= 0) + return self; newtGetScreenSize(&cols, NULL); cols -= 4; newtCenteredWindow(cols, 1, title); @@ -67,14 +70,22 @@ out_free_self: void ui_progress__update(struct ui_progress *self, u64 curr) { + /* + * FIXME: We should have a per UI backend way of showing progress, + * stdio will just show a percentage as NN%, etc. + */ + if (use_browser <= 0) + return; newtScaleSet(self->scale, curr); newtRefresh(); } void ui_progress__delete(struct ui_progress *self) { - newtFormDestroy(self->form); - newtPopWindow(); + if (use_browser > 0) { + newtFormDestroy(self->form); + newtPopWindow(); + } free(self); } |