summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorMilan Jurik <milan.jurik@xylab.cz>2012-02-25 00:14:04 -0800
committerMilan Jurik <milan.jurik@xylab.cz>2012-02-25 00:14:04 -0800
commitb54d0971a8fbfdfacbe9451070dd10e3a56a96ae (patch)
tree59f58a7ad0836064c847c15f43db1a3b014d07b9 /usr/src
parente21ea675c9d0030463bdeb69c83449de4b9fc0f3 (diff)
downloadillumos-joyent-b54d0971a8fbfdfacbe9451070dd10e3a56a96ae.tar.gz
2099 powertop output hangs under heavy load
Reviewed by: Garrett D'Amore <garrett@damore.org> Reviewed by: Dan McDonald <danmcd@nexenta.com> Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/powertop/common/powertop.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr/src/cmd/powertop/common/powertop.c b/usr/src/cmd/powertop/common/powertop.c
index c36c3a1d0a..3f54f45957 100644
--- a/usr/src/cmd/powertop/common/powertop.c
+++ b/usr/src/cmd/powertop/common/powertop.c
@@ -397,7 +397,8 @@ main(int argc, char **argv)
* specified an interval we skip this bit and keep it fixed.
*/
if (g_features & FEATURE_CSTATE && !PT_ON_TIME &&
- g_longest_cstate > 0) {
+ g_longest_cstate > 0 &&
+ g_cstate_info[g_longest_cstate].events > 0) {
double deep_idle_res = (((double)
g_cstate_info[g_longest_cstate].total_time/MICROSEC
/g_ncpus)/g_cstate_info[g_longest_cstate].events);