turbostat.c (6dbd25a24599db07d88a805615bad1f4d48a5749) | turbostat.c (95149369c1c28b10f7318dfde54018ab107277d0) |
---|---|
1/* 2 * turbostat -- show CPU frequency and C-state residency 3 * on modern Intel turbo-capable processors. 4 * 5 * Copyright (c) 2013 Intel Corporation. 6 * Len Brown <len.brown@intel.com> 7 * 8 * This program is free software; you can redistribute it and/or modify it --- 1128 unchanged lines hidden (view full) --- 1137 * which should be more accurate than the derivation below. 1138 */ 1139 } else { 1140 /* 1141 * As counter collection is not atomic, 1142 * it is possible for mperf's non-halted cycles + idle states 1143 * to exceed TSC's all cycles: show c1 = 0% in that case. 1144 */ | 1/* 2 * turbostat -- show CPU frequency and C-state residency 3 * on modern Intel turbo-capable processors. 4 * 5 * Copyright (c) 2013 Intel Corporation. 6 * Len Brown <len.brown@intel.com> 7 * 8 * This program is free software; you can redistribute it and/or modify it --- 1128 unchanged lines hidden (view full) --- 1137 * which should be more accurate than the derivation below. 1138 */ 1139 } else { 1140 /* 1141 * As counter collection is not atomic, 1142 * it is possible for mperf's non-halted cycles + idle states 1143 * to exceed TSC's all cycles: show c1 = 0% in that case. 1144 */ |
1145 if ((old->mperf + core_delta->c3 + core_delta->c6 + core_delta->c7) > old->tsc) | 1145 if ((old->mperf + core_delta->c3 + core_delta->c6 + core_delta->c7) > (old->tsc * tsc_tweak)) |
1146 old->c1 = 0; 1147 else { 1148 /* normal case, derive c1 */ 1149 old->c1 = (old->tsc * tsc_tweak) - old->mperf - core_delta->c3 1150 - core_delta->c6 - core_delta->c7; 1151 } 1152 } 1153 --- 3911 unchanged lines hidden --- | 1146 old->c1 = 0; 1147 else { 1148 /* normal case, derive c1 */ 1149 old->c1 = (old->tsc * tsc_tweak) - old->mperf - core_delta->c3 1150 - core_delta->c6 - core_delta->c7; 1151 } 1152 } 1153 --- 3911 unchanged lines hidden --- |