[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-j7st3oyiotvfxqde2nc41kxb@git.kernel.org>
Date: Mon, 5 Dec 2011 04:51:34 -0800
From: tip-bot for Arnaldo Carvalho de Melo <acme@...hat.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, eranian@...gle.com, paulus@...ba.org,
acme@...hat.com, hpa@...or.com, mingo@...hat.com,
peterz@...radead.org, efault@....de, fweisbec@...il.com,
dsahern@...il.com, tglx@...utronix.de
Subject: [tip:perf/core] perf ui progress: Fix divide by zero
Commit-ID: 18b552350515188a732db6ccdb81e9cefb8b58c9
Gitweb: http://git.kernel.org/tip/18b552350515188a732db6ccdb81e9cefb8b58c9
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Fri, 11 Nov 2011 22:08:07 -0200
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 28 Nov 2011 10:36:57 -0200
perf ui progress: Fix divide by zero
Happens in a perf.data file where one of the events had no samples.
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Mike Galbraith <efault@....de>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/n/tip-j7st3oyiotvfxqde2nc41kxb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/ui/progress.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/ui/progress.c b/tools/perf/util/ui/progress.c
index 295e366..13aa64e 100644
--- a/tools/perf/util/ui/progress.c
+++ b/tools/perf/util/ui/progress.c
@@ -14,6 +14,9 @@ void ui_progress__update(u64 curr, u64 total, const char *title)
if (use_browser <= 0)
return;
+ if (total == 0)
+ return;
+
ui__refresh_dimensions(true);
pthread_mutex_lock(&ui__lock);
y = SLtt_Screen_Rows / 2 - 2;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists