# HG changeset patch # User Milan Jurik # Date 1330157644 28800 # Node ID a726575d10f2900800e96d7616f50b1238b5b7d7 # Parent 97ffb0d8de5280d04b1e258c67087f33857b164f 2099 powertop output hangs under heavy load Reviewed by: Garrett D'Amore Reviewed by: Dan McDonald Approved by: Garrett D'Amore diff -r 97ffb0d8de52 -r a726575d10f2 usr/src/cmd/powertop/common/powertop.c --- a/usr/src/cmd/powertop/common/powertop.c Thu Feb 23 07:11:44 2012 +0400 +++ b/usr/src/cmd/powertop/common/powertop.c Sat Feb 25 00:14:04 2012 -0800 @@ -397,7 +397,8 @@ * 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);