[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-2f335a02b3c816e77e7df1d15b12e3bbb8f4c8f0@git.kernel.org>
Date: Fri, 5 Jun 2009 18:46:19 GMT
From: tip-bot for Frederic Weisbecker <fweisbec@...il.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, acme@...hat.com, paulus@...ba.org,
hpa@...or.com, mingo@...hat.com, a.p.zijlstra@...llo.nl,
efault@....de, fweisbec@...il.com, mtosatti@...hat.com,
tglx@...utronix.de, cjashfor@...ux.vnet.ibm.com, mingo@...e.hu
Subject: [tip:perfcounters/core] perf top: Fix zero or negative refresh delay
Commit-ID: 2f335a02b3c816e77e7df1d15b12e3bbb8f4c8f0
Gitweb: http://git.kernel.org/tip/2f335a02b3c816e77e7df1d15b12e3bbb8f4c8f0
Author: Frederic Weisbecker <fweisbec@...il.com>
AuthorDate: Fri, 5 Jun 2009 19:31:01 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 5 Jun 2009 20:42:53 +0200
perf top: Fix zero or negative refresh delay
If perf top is executed with a zero value for the refresh rate,
we get a division by zero exception while computing samples_per_sec.
Also a zero refresh rate is not possible, neither do we want to
accept negative values.
[ Impact: fix division by zero in perf top ]
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Mike Galbraith <efault@....de>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Corey Ashford <cjashfor@...ux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
LKML-Reference: <1244223061-5399-1-git-send-email-fweisbec@...il.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
Documentation/perf_counter/builtin-top.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/Documentation/perf_counter/builtin-top.c b/Documentation/perf_counter/builtin-top.c
index ff7e13c..b2f480b 100644
--- a/Documentation/perf_counter/builtin-top.c
+++ b/Documentation/perf_counter/builtin-top.c
@@ -693,6 +693,9 @@ int cmd_top(int argc, const char **argv, const char *prefix)
event_id[0] = 0;
}
+ if (delay_secs < 1)
+ delay_secs = 1;
+
for (counter = 0; counter < nr_counters; counter++) {
if (event_count[counter])
continue;
--
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