···3503 dump_nhm_cst_cfg();3504}3505000000000000000003506static void3507dump_sysfs_cstate_config(void)3508{···35323533 if (!DO_BIC(BIC_sysfs))3534 return;00000000035353536 for (state = 0; state < 10; ++state) {3537
···3503 dump_nhm_cst_cfg();3504}35053506+static void dump_sysfs_file(char *path)3507+{3508+ FILE *input;3509+ char cpuidle_buf[64];3510+3511+ input = fopen(path, "r");3512+ if (input == NULL) {3513+ if (debug)3514+ fprintf(outf, "NSFOD %s\n", path);3515+ return;3516+ }3517+ if (!fgets(cpuidle_buf, sizeof(cpuidle_buf), input))3518+ err(1, "%s: failed to read file", path);3519+ fclose(input);3520+3521+ fprintf(outf, "%s: %s", strrchr(path, '/') + 1, cpuidle_buf);3522+}3523static void3524dump_sysfs_cstate_config(void)3525{···35153516 if (!DO_BIC(BIC_sysfs))3517 return;3518+3519+ if (access("/sys/devices/system/cpu/cpuidle", R_OK)) {3520+ fprintf(outf, "cpuidle not loaded\n");3521+ return;3522+ }3523+3524+ dump_sysfs_file("/sys/devices/system/cpu/cpuidle/current_driver");3525+ dump_sysfs_file("/sys/devices/system/cpu/cpuidle/current_governor");3526+ dump_sysfs_file("/sys/devices/system/cpu/cpuidle/current_governor_ro");35273528 for (state = 0; state < 10; ++state) {3529