Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'turbostat-2025.05.06' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux

Pull turbostat updates from Len Brown:

- support up to 8192 processors

- add cpuidle governor debug telemetry, disabled by default

- update default output to exclude cpuidle invocation counts

- bug fixes

* tag 'turbostat-2025.05.06' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
tools/power turbostat: v2025.05.06
tools/power turbostat: disable "cpuidle" invocation counters, by default
tools/power turbostat: re-factor sysfs code
tools/power turbostat: Restore GFX sysfs fflush() call
tools/power turbostat: Document GNR UncMHz domain convention
tools/power turbostat: report CoreThr per measurement interval
tools/power turbostat: Increase CPU_SUBSET_MAXCPUS to 8192
tools/power turbostat: Add idle governor statistics reporting
tools/power turbostat: Fix names matching
tools/power turbostat: Allow Zero return value for some RAPL registers
tools/power turbostat: Clustered Uncore MHz counters should honor show/hide options

+135 -43
+12 -4
tools/power/x86/turbostat/turbostat.8
··· 100 100 .PP 101 101 \fB--show column\fP show only the specified built-in columns. May be invoked multiple times, or with a comma-separated list of column names. 102 102 .PP 103 - \fB--show CATEGORY --hide CATEGORY\fP Show and hide also accept a single CATEGORY of columns: "all", "topology", "idle", "frequency", "power", "sysfs", "other". 103 + \fB--show CATEGORY --hide CATEGORY\fP Show and hide also accept a single CATEGORY of columns: "all", "topology", "idle", "frequency", "power", "cpuidle", "hwidle", "swidle", "other". "idle" (enabled by default), includes "hwidle" and "idle_pct". "cpuidle" (default disabled) includes cpuidle software invocation counters. "swidle" includes "cpuidle" plus "idle_pct". "hwidle" includes only hardware based idle residency counters. Older versions of turbostat used the term "sysfs" for what is now "swidle". 104 104 .PP 105 105 \fB--Dump\fP displays the raw counter values. 106 106 .PP ··· 158 158 .PP 159 159 \fBSMI\fP The number of System Management Interrupts serviced CPU during the measurement interval. While this counter is actually per-CPU, SMI are triggered on all processors, so the number should be the same for all CPUs. 160 160 .PP 161 - \fBC1, C2, C3...\fP The number times Linux requested the C1, C2, C3 idle state during the measurement interval. The system summary line shows the sum for all CPUs. These are C-state names as exported in /sys/devices/system/cpu/cpu*/cpuidle/state*/name. While their names are generic, their attributes are processor specific. They the system description section of output shows what MWAIT sub-states they are mapped to on each system. 161 + \fBC1, C2, C3...\fP The number times Linux requested the C1, C2, C3 idle state during the measurement interval. The system summary line shows the sum for all CPUs. These are C-state names as exported in /sys/devices/system/cpu/cpu*/cpuidle/state*/name. While their names are generic, their attributes are processor specific. They the system description section of output shows what MWAIT sub-states they are mapped to on each system. These counters are in the "cpuidle" group, which is disabled, by default. 162 162 .PP 163 - \fBC1%, C2%, C3%\fP The residency percentage that Linux requested C1, C2, C3.... The system summary is the average of all CPUs in the system. Note that these are software, reflecting what was requested. The hardware counters reflect what was actually achieved. 163 + \fBC1+, C2+, C3+...\fP The idle governor idle state misprediction statistics. Inidcates the number times Linux requested the C1, C2, C3 idle state during the measurement interval, but should have requested a deeper idle state (if it exists and enabled). These statistics come from the /sys/devices/system/cpu/cpu*/cpuidle/state*/below file. These counters are in the "cpuidle" group, which is disabled, by default. 164 164 .PP 165 - \fBCPU%c1, CPU%c3, CPU%c6, CPU%c7\fP show the percentage residency in hardware core idle states. These numbers are from hardware residency counters. 165 + \fBC1-, C2-, C3-...\fP The idle governor idle state misprediction statistics. Inidcates the number times Linux requested the C1, C2, C3 idle state during the measurement interval, but should have requested a shallower idle state (if it exists and enabled). These statistics come from the /sys/devices/system/cpu/cpu*/cpuidle/state*/above file. These counters are in the "cpuidle" group, which is disabled, by default. 166 + .PP 167 + \fBC1%, C2%, C3%\fP The residency percentage that Linux requested C1, C2, C3.... The system summary is the average of all CPUs in the system. Note that these are software, reflecting what was requested. The hardware counters reflect what was actually achieved. These counters are in the "pct_idle" group, which is enabled by default. 168 + .PP 169 + \fBCPU%c1, CPU%c3, CPU%c6, CPU%c7\fP show the percentage residency in hardware core idle states. These numbers are from hardware residency counters and are in the "hwidle" group, which is enabled, by default. 166 170 .PP 167 171 \fBCoreTmp\fP Degrees Celsius reported by the per-core Digital Thermal Sensor. 168 172 .PP 169 173 \fBPkgTmp\fP Degrees Celsius reported by the per-package Package Thermal Monitor. 174 + .PP 175 + \fBCoreThr\fP Core Thermal Throttling events during the measurement interval. Note that events since boot can be find in /sys/devices/system/cpu/cpu*/thermal_throttle/* 170 176 .PP 171 177 \fBGFX%rc6\fP The percentage of time the GPU is in the "render C6" state, rc6, during the measurement interval. From /sys/class/drm/card0/power/rc6_residency_ms or /sys/class/drm/card0/gt/gt0/rc6_residency_ms or /sys/class/drm/card0/device/tile0/gtN/gtidle/idle_residency_ms depending on the graphics driver being used. 172 178 .PP ··· 205 199 \fBUncMHz\fP per-package uncore MHz, instantaneous sample. 206 200 .PP 207 201 \fBUMHz1.0\fP per-package uncore MHz for domain=1 and fabric_cluster=0, instantaneous sample. System summary is the average of all packages. 202 + Intel Granite Rapids systems use domains 0-2 for CPUs, and 3-4 for IO, with cluster always 0. 203 + For the "--show" and "--hide" options, use "UncMHz" to operate on all UMHz*.* as a group. 208 204 .SH TOO MUCH INFORMATION EXAMPLE 209 205 By default, turbostat dumps all possible information -- a system configuration header, followed by columns for all counters. 210 206 This is ideal for remote debugging, use the "--out" option to save everything to a text file, and get that file to the expert helping you debug.
+123 -39
tools/power/x86/turbostat/turbostat.c
··· 153 153 { 0x0, "TSC_MHz", NULL, 0, 0, 0, NULL, 0 }, 154 154 { 0x0, "IRQ", NULL, 0, 0, 0, NULL, 0 }, 155 155 { 0x0, "SMI", NULL, 32, 0, FORMAT_DELTA, NULL, 0 }, 156 - { 0x0, "sysfs", NULL, 0, 0, 0, NULL, 0 }, 156 + { 0x0, "cpuidle", NULL, 0, 0, 0, NULL, 0 }, 157 157 { 0x0, "CPU%c1", NULL, 0, 0, 0, NULL, 0 }, 158 158 { 0x0, "CPU%c3", NULL, 0, 0, 0, NULL, 0 }, 159 159 { 0x0, "CPU%c6", NULL, 0, 0, 0, NULL, 0 }, ··· 206 206 { 0x0, "Sys_J", NULL, 0, 0, 0, NULL, 0 }, 207 207 { 0x0, "NMI", NULL, 0, 0, 0, NULL, 0 }, 208 208 { 0x0, "CPU%c1e", NULL, 0, 0, 0, NULL, 0 }, 209 + { 0x0, "pct_idle", NULL, 0, 0, 0, NULL, 0 }, 209 210 }; 210 211 211 212 #define MAX_BIC (sizeof(bic) / sizeof(struct msr_counter)) ··· 220 219 #define BIC_TSC_MHz (1ULL << 7) 221 220 #define BIC_IRQ (1ULL << 8) 222 221 #define BIC_SMI (1ULL << 9) 223 - #define BIC_sysfs (1ULL << 10) 222 + #define BIC_cpuidle (1ULL << 10) 224 223 #define BIC_CPU_c1 (1ULL << 11) 225 224 #define BIC_CPU_c3 (1ULL << 12) 226 225 #define BIC_CPU_c6 (1ULL << 13) ··· 273 272 #define BIC_Sys_J (1ULL << 60) 274 273 #define BIC_NMI (1ULL << 61) 275 274 #define BIC_CPU_c1e (1ULL << 62) 275 + #define BIC_pct_idle (1ULL << 63) 276 276 277 - #define BIC_TOPOLOGY (BIC_Package | BIC_Node | BIC_CoreCnt | BIC_PkgCnt | BIC_Core | BIC_CPU | BIC_Die) 278 - #define BIC_THERMAL_PWR (BIC_CoreTmp | BIC_PkgTmp | BIC_PkgWatt | BIC_CorWatt | BIC_GFXWatt | BIC_RAMWatt | BIC_PKG__ | BIC_RAM__ | BIC_SysWatt) 279 - #define BIC_FREQUENCY (BIC_Avg_MHz | BIC_Busy | BIC_Bzy_MHz | BIC_TSC_MHz | BIC_GFXMHz | BIC_GFXACTMHz | BIC_SAMMHz | BIC_SAMACTMHz | BIC_UNCORE_MHZ) 280 - #define BIC_IDLE (BIC_Busy | BIC_sysfs | BIC_CPU_c1 | BIC_CPU_c3 | BIC_CPU_c6 | BIC_CPU_c7 | BIC_GFX_rc6 | BIC_Pkgpc2 | BIC_Pkgpc3 | BIC_Pkgpc6 | BIC_Pkgpc7 | BIC_Pkgpc8 | BIC_Pkgpc9 | BIC_Pkgpc10 | BIC_CPU_LPI | BIC_SYS_LPI | BIC_Mod_c6 | BIC_Totl_c0 | BIC_Any_c0 | BIC_GFX_c0 | BIC_CPUGFX | BIC_SAM_mc6 | BIC_Diec6) 277 + #define BIC_GROUP_TOPOLOGY (BIC_Package | BIC_Node | BIC_CoreCnt | BIC_PkgCnt | BIC_Core | BIC_CPU | BIC_Die) 278 + #define BIC_GROUP_THERMAL_PWR (BIC_CoreTmp | BIC_PkgTmp | BIC_PkgWatt | BIC_CorWatt | BIC_GFXWatt | BIC_RAMWatt | BIC_PKG__ | BIC_RAM__ | BIC_SysWatt) 279 + #define BIC_GROUP_FREQUENCY (BIC_Avg_MHz | BIC_Busy | BIC_Bzy_MHz | BIC_TSC_MHz | BIC_GFXMHz | BIC_GFXACTMHz | BIC_SAMMHz | BIC_SAMACTMHz | BIC_UNCORE_MHZ) 280 + #define BIC_GROUP_HW_IDLE (BIC_Busy | BIC_CPU_c1 | BIC_CPU_c3 | BIC_CPU_c6 | BIC_CPU_c7 | BIC_GFX_rc6 | BIC_Pkgpc2 | BIC_Pkgpc3 | BIC_Pkgpc6 | BIC_Pkgpc7 | BIC_Pkgpc8 | BIC_Pkgpc9 | BIC_Pkgpc10 | BIC_CPU_LPI | BIC_SYS_LPI | BIC_Mod_c6 | BIC_Totl_c0 | BIC_Any_c0 | BIC_GFX_c0 | BIC_CPUGFX | BIC_SAM_mc6 | BIC_Diec6) 281 + #define BIC_GROUP_SW_IDLE (BIC_Busy | BIC_cpuidle | BIC_pct_idle ) 282 + #define BIC_GROUP_IDLE (BIC_GROUP_HW_IDLE | BIC_pct_idle) 281 283 #define BIC_OTHER (BIC_IRQ | BIC_NMI | BIC_SMI | BIC_ThreadC | BIC_CoreTmp | BIC_IPC) 282 284 283 - #define BIC_DISABLED_BY_DEFAULT (BIC_USEC | BIC_TOD | BIC_APIC | BIC_X2APIC) 285 + #define BIC_DISABLED_BY_DEFAULT (BIC_USEC | BIC_TOD | BIC_APIC | BIC_X2APIC | BIC_cpuidle) 284 286 285 287 unsigned long long bic_enabled = (0xFFFFFFFFFFFFFFFFULL & ~BIC_DISABLED_BY_DEFAULT); 286 - unsigned long long bic_present = BIC_USEC | BIC_TOD | BIC_sysfs | BIC_APIC | BIC_X2APIC; 288 + unsigned long long bic_present = BIC_USEC | BIC_TOD | BIC_cpuidle | BIC_pct_idle | BIC_APIC | BIC_X2APIC; 287 289 288 290 #define DO_BIC(COUNTER_NAME) (bic_enabled & bic_present & COUNTER_NAME) 289 291 #define DO_BIC_READ(COUNTER_NAME) (bic_present & COUNTER_NAME) ··· 1125 1121 int backwards_count; 1126 1122 char *progname; 1127 1123 1128 - #define CPU_SUBSET_MAXCPUS 1024 /* need to use before probe... */ 1124 + #define CPU_SUBSET_MAXCPUS 8192 /* need to use before probe... */ 1129 1125 cpu_set_t *cpu_present_set, *cpu_possible_set, *cpu_effective_set, *cpu_allowed_set, *cpu_affinity_set, *cpu_subset; 1130 1126 size_t cpu_present_setsize, cpu_possible_setsize, cpu_effective_setsize, cpu_allowed_setsize, cpu_affinity_setsize, cpu_subset_size; 1131 1127 #define MAX_ADDED_THREAD_COUNTERS 24 ··· 2215 2211 return 0; 2216 2212 } 2217 2213 2218 - int probe_msr(int cpu, off_t offset) 2214 + int probe_rapl_msr(int cpu, off_t offset, int index) 2219 2215 { 2220 2216 ssize_t retval; 2221 2217 unsigned long long value; ··· 2224 2220 2225 2221 retval = pread(get_msr_fd(cpu), &value, sizeof(value), offset); 2226 2222 2227 - /* 2228 - * Expect MSRs to accumulate some non-zero value since the system was powered on. 2229 - * Treat zero as a read failure. 2230 - */ 2231 - if (retval != sizeof(value) || value == 0) 2223 + /* if the read failed, the probe fails */ 2224 + if (retval != sizeof(value)) 2232 2225 return 1; 2233 2226 2227 + /* If an Energy Status Counter MSR returns 0, the probe fails */ 2228 + switch (index) { 2229 + case RAPL_RCI_INDEX_ENERGY_PKG: 2230 + case RAPL_RCI_INDEX_ENERGY_CORES: 2231 + case RAPL_RCI_INDEX_DRAM: 2232 + case RAPL_RCI_INDEX_GFX: 2233 + case RAPL_RCI_INDEX_ENERGY_PLATFORM: 2234 + if (value == 0) 2235 + return 1; 2236 + } 2237 + 2238 + /* PKG,DRAM_PERF_STATUS MSRs, can return any value */ 2234 2239 return 0; 2235 2240 } 2236 2241 ··· 2358 2345 retval |= ~0; 2359 2346 break; 2360 2347 } else if (!strcmp(name_list, "topology")) { 2361 - retval |= BIC_TOPOLOGY; 2348 + retval |= BIC_GROUP_TOPOLOGY; 2362 2349 break; 2363 2350 } else if (!strcmp(name_list, "power")) { 2364 - retval |= BIC_THERMAL_PWR; 2351 + retval |= BIC_GROUP_THERMAL_PWR; 2365 2352 break; 2366 2353 } else if (!strcmp(name_list, "idle")) { 2367 - retval |= BIC_IDLE; 2354 + retval |= BIC_GROUP_IDLE; 2355 + break; 2356 + } else if (!strcmp(name_list, "swidle")) { 2357 + retval |= BIC_GROUP_SW_IDLE; 2358 + break; 2359 + } else if (!strcmp(name_list, "sysfs")) { /* legacy compatibility */ 2360 + retval |= BIC_GROUP_SW_IDLE; 2361 + break; 2362 + } else if (!strcmp(name_list, "hwidle")) { 2363 + retval |= BIC_GROUP_HW_IDLE; 2368 2364 break; 2369 2365 } else if (!strcmp(name_list, "frequency")) { 2370 - retval |= BIC_FREQUENCY; 2366 + retval |= BIC_GROUP_FREQUENCY; 2371 2367 break; 2372 2368 } else if (!strcmp(name_list, "other")) { 2373 2369 retval |= BIC_OTHER; ··· 2385 2363 2386 2364 } 2387 2365 if (i == MAX_BIC) { 2366 + fprintf(stderr, "deferred %s\n", name_list); 2388 2367 if (mode == SHOW_LIST) { 2389 2368 deferred_add_names[deferred_add_index++] = name_list; 2390 2369 if (deferred_add_index >= MAX_DEFERRED) { ··· 3499 3476 old->c6 = new->c6 - old->c6; 3500 3477 old->c7 = new->c7 - old->c7; 3501 3478 old->core_temp_c = new->core_temp_c; 3502 - old->core_throt_cnt = new->core_throt_cnt; 3479 + old->core_throt_cnt = new->core_throt_cnt - old->core_throt_cnt; 3503 3480 old->mc6_us = new->mc6_us - old->mc6_us; 3504 3481 3505 3482 DELTA_WRAP32(new->core_energy.raw_value, old->core_energy.raw_value); ··· 6053 6030 int retval; 6054 6031 6055 6032 rewind(gfx_info[idx].fp); 6033 + fflush(gfx_info[idx].fp); 6056 6034 6057 6035 switch (idx) { 6058 6036 case GFX_rc6: ··· 6727 6703 sprintf(path, "%s/current_freq_khz", path_base); 6728 6704 sprintf(name_buf, "UMHz%d.%d", domain_id, cluster_id); 6729 6705 6730 - add_counter(0, path, name_buf, 0, SCOPE_PACKAGE, COUNTER_K2M, FORMAT_AVERAGE, 0, package_id); 6706 + /* 6707 + * Once add_couter() is called, that counter is always read 6708 + * and reported -- So it is effectively (enabled & present). 6709 + * Only call add_counter() here if legacy BIC_UNCORE_MHZ (UncMHz) 6710 + * is (enabled). Since we are in this routine, we 6711 + * know we will not probe and set (present) the legacy counter. 6712 + * 6713 + * This allows "--show/--hide UncMHz" to be effective for 6714 + * the clustered MHz counters, as a group. 6715 + */ 6716 + if BIC_IS_ENABLED(BIC_UNCORE_MHZ) 6717 + add_counter(0, path, name_buf, 0, SCOPE_PACKAGE, COUNTER_K2M, FORMAT_AVERAGE, 0, package_id); 6731 6718 6732 6719 if (quiet) 6733 6720 continue; ··· 7931 7896 rci->flags[cai->rci_index] = cai->flags; 7932 7897 7933 7898 /* Use MSR for this counter */ 7934 - } else if (!no_msr && cai->msr && probe_msr(cpu, cai->msr) == 0) { 7899 + } else if (!no_msr && cai->msr && probe_rapl_msr(cpu, cai->msr, cai->rci_index) == 0) { 7935 7900 rci->source[cai->rci_index] = COUNTER_SOURCE_MSR; 7936 7901 rci->msr[cai->rci_index] = cai->msr; 7937 7902 rci->msr_mask[cai->rci_index] = cai->msr_mask; ··· 8069 8034 cai->present = true; 8070 8035 8071 8036 /* User MSR for this counter */ 8072 - } else if (!no_msr && cai->msr && probe_msr(cpu, cai->msr) == 0) { 8037 + } else if (!no_msr && cai->msr && probe_rapl_msr(cpu, cai->msr, cai->rci_index) == 0) { 8073 8038 cci->source[cai->rci_index] = COUNTER_SOURCE_MSR; 8074 8039 cci->msr[cai->rci_index] = cai->msr; 8075 8040 cci->msr_mask[cai->rci_index] = cai->msr_mask; ··· 8183 8148 8184 8149 /* User MSR for this counter */ 8185 8150 } else if (!no_msr && cai->msr && pkg_cstate_limit >= cai->pkg_cstate_limit 8186 - && probe_msr(cpu, cai->msr) == 0) { 8151 + && probe_rapl_msr(cpu, cai->msr, cai->rci_index) == 0) { 8187 8152 cci->source[cai->rci_index] = COUNTER_SOURCE_MSR; 8188 8153 cci->msr[cai->rci_index] = cai->msr; 8189 8154 } ··· 9594 9559 9595 9560 void print_version() 9596 9561 { 9597 - fprintf(outf, "turbostat version 2025.02.02 - Len Brown <lenb@kernel.org>\n"); 9562 + fprintf(outf, "turbostat version 2025.04.06 - Len Brown <lenb@kernel.org>\n"); 9598 9563 } 9599 9564 9600 9565 #define COMMAND_LINE_SIZE 2048 ··· 9627 9592 for (mp = head; mp; mp = mp->next) { 9628 9593 if (debug) 9629 9594 fprintf(stderr, "%s: %s %s\n", __func__, name, mp->name); 9630 - if (!strncmp(name, mp->name, strlen(mp->name))) 9595 + if (!strcmp(name, mp->name)) 9631 9596 return mp; 9632 9597 } 9633 9598 return NULL; ··· 10274 10239 return 0; 10275 10240 } 10276 10241 10277 - void probe_sysfs(void) 10242 + void probe_cpuidle_residency(void) 10278 10243 { 10279 10244 char path[64]; 10280 10245 char name_buf[16]; 10281 10246 FILE *input; 10282 10247 int state; 10248 + int min_state = 1024, max_state = 0; 10283 10249 char *sp; 10250 + 10251 + if (!DO_BIC(BIC_pct_idle)) 10252 + return; 10284 10253 10285 10254 for (state = 10; state >= 0; --state) { 10286 10255 ··· 10308 10269 10309 10270 sprintf(path, "cpuidle/state%d/time", state); 10310 10271 10311 - if (!DO_BIC(BIC_sysfs) && !is_deferred_add(name_buf)) 10272 + if (!DO_BIC(BIC_pct_idle) && !is_deferred_add(name_buf)) 10312 10273 continue; 10313 10274 10314 10275 if (is_deferred_skip(name_buf)) 10315 10276 continue; 10316 10277 10317 10278 add_counter(0, path, name_buf, 64, SCOPE_CPU, COUNTER_USEC, FORMAT_PERCENT, SYSFS_PERCPU, 0); 10279 + 10280 + if (state > max_state) 10281 + max_state = state; 10282 + if (state < min_state) 10283 + min_state = state; 10318 10284 } 10285 + } 10286 + 10287 + void probe_cpuidle_counts(void) 10288 + { 10289 + char path[64]; 10290 + char name_buf[16]; 10291 + FILE *input; 10292 + int state; 10293 + int min_state = 1024, max_state = 0; 10294 + char *sp; 10295 + 10296 + if (!DO_BIC(BIC_cpuidle)) 10297 + return; 10319 10298 10320 10299 for (state = 10; state >= 0; --state) { 10321 10300 ··· 10343 10286 continue; 10344 10287 if (!fgets(name_buf, sizeof(name_buf), input)) 10345 10288 err(1, "%s: failed to read file", path); 10346 - /* truncate "C1-HSW\n" to "C1", or truncate "C1\n" to "C1" */ 10347 - sp = strchr(name_buf, '-'); 10348 - if (!sp) 10349 - sp = strchrnul(name_buf, '\n'); 10350 - *sp = '\0'; 10351 10289 fclose(input); 10352 10290 10353 10291 remove_underbar(name_buf); 10354 10292 10355 - sprintf(path, "cpuidle/state%d/usage", state); 10356 - 10357 - if (!DO_BIC(BIC_sysfs) && !is_deferred_add(name_buf)) 10293 + if (!DO_BIC(BIC_cpuidle) && !is_deferred_add(name_buf)) 10358 10294 continue; 10359 10295 10360 10296 if (is_deferred_skip(name_buf)) 10361 10297 continue; 10362 10298 10363 - add_counter(0, path, name_buf, 64, SCOPE_CPU, COUNTER_ITEMS, FORMAT_DELTA, SYSFS_PERCPU, 0); 10364 - } 10299 + /* truncate "C1-HSW\n" to "C1", or truncate "C1\n" to "C1" */ 10300 + sp = strchr(name_buf, '-'); 10301 + if (!sp) 10302 + sp = strchrnul(name_buf, '\n'); 10365 10303 10304 + /* 10305 + * The 'below' sysfs file always contains 0 for the deepest state (largest index), 10306 + * do not add it. 10307 + */ 10308 + if (state != max_state) { 10309 + /* 10310 + * Add 'C1+' for C1, and so on. The 'below' sysfs file always contains 0 for 10311 + * the last state, so do not add it. 10312 + */ 10313 + 10314 + *sp = '+'; 10315 + *(sp + 1) = '\0'; 10316 + sprintf(path, "cpuidle/state%d/below", state); 10317 + add_counter(0, path, name_buf, 64, SCOPE_CPU, COUNTER_ITEMS, FORMAT_DELTA, SYSFS_PERCPU, 0); 10318 + } 10319 + 10320 + *sp = '\0'; 10321 + sprintf(path, "cpuidle/state%d/usage", state); 10322 + add_counter(0, path, name_buf, 64, SCOPE_CPU, COUNTER_ITEMS, FORMAT_DELTA, SYSFS_PERCPU, 0); 10323 + 10324 + /* 10325 + * The 'above' sysfs file always contains 0 for the shallowest state (smallest 10326 + * index), do not add it. 10327 + */ 10328 + if (state != min_state) { 10329 + *sp = '-'; 10330 + *(sp + 1) = '\0'; 10331 + sprintf(path, "cpuidle/state%d/above", state); 10332 + add_counter(0, path, name_buf, 64, SCOPE_CPU, COUNTER_ITEMS, FORMAT_DELTA, SYSFS_PERCPU, 0); 10333 + } 10334 + } 10366 10335 } 10367 10336 10368 10337 /* ··· 10632 10549 print_bootcmd(); 10633 10550 } 10634 10551 10635 - probe_sysfs(); 10552 + probe_cpuidle_residency(); 10553 + probe_cpuidle_counts(); 10636 10554 10637 10555 if (!getuid()) 10638 10556 set_rlimit();