summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
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);