From cda4f98e3695da8d52b61834d7f574b585ec0cd3 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 11 Jun 2010 10:18:06 +0200 Subject: [PATCH] --- yaml --- r: 200609 b: refs/heads/master c: 174787cb5144e5a45141ec7cb9d95ea29bbe22bb h: refs/heads/master i: 200607: fef3d5555a5c74eb2d283023dd6ae1cdcd812a36 v: v3 --- [refs] | 2 +- trunk/tools/perf/util/newt.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 6e6f6601a89d..fefeaf480689 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a8fb2608053547bc3152ea61a5ec7cdfce5d942c +refs/heads/master: 174787cb5144e5a45141ec7cb9d95ea29bbe22bb diff --git a/trunk/tools/perf/util/newt.c b/trunk/tools/perf/util/newt.c index cf182ca132fe..7537ca15900b 100644 --- a/trunk/tools/perf/util/newt.c +++ b/trunk/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 @@ struct ui_progress *ui_progress__new(const char *title, u64 total) 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); }