summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-11-11 22:08:07 -0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 10:36:57 -0200
commit18b552350515188a732db6ccdb81e9cefb8b58c9 (patch)
treeb72dd1ee805cfc7621c29f63761704b3e64dd2c2 /tools
parented80f5813fd6ecc6d74250681910a4214f699d4e (diff)
downloadlinux-18b552350515188a732db6ccdb81e9cefb8b58c9.tar.bz2
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@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-j7st3oyiotvfxqde2nc41kxb@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/ui/progress.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/ui/progress.c b/tools/perf/util/ui/progress.c
index 295e366b6311..13aa64e50e11 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;