tools/power/cpupower/utils/cpuidle-info.c
Source file repositories/reference/linux-study-clean/tools/power/cpupower/utils/cpuidle-info.c
File Facts
- System
- Linux kernel
- Corpus path
tools/power/cpupower/utils/cpuidle-info.c- Extension
.c- Size
- 4687 bytes
- Lines
- 216
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
unistd.hstdio.herrno.hstdlib.hstring.hgetopt.hcpuidle.hhelpers/sysfs.hhelpers/helpers.hhelpers/bitmask.h
Detected Declarations
function cpuidle_cpu_outputfunction cpuidle_general_outputfunction proc_cpuidle_cpu_outputfunction cpuidle_exitfunction cmd_idle_info
Annotated Snippet
switch (ret) {
case '?':
output_param = '?';
cont = 0;
break;
case 's':
verbose = 0;
break;
case -1:
cont = 0;
break;
case 'o':
if (output_param) {
output_param = -1;
cont = 0;
break;
}
output_param = ret;
break;
}
} while (cont);
switch (output_param) {
case -1:
printf(_("You can't specify more than one "
"output-specific argument\n"));
cpuidle_exit(EXIT_FAILURE);
case '?':
printf(_("invalid or unknown argument\n"));
cpuidle_exit(EXIT_FAILURE);
}
/* Default is: show output of base_cpu only */
if (bitmask_isallclear(cpus_chosen))
bitmask_setbit(cpus_chosen, base_cpu);
if (output_param == 0)
cpuidle_general_output();
for (cpu = bitmask_first(cpus_chosen);
cpu <= bitmask_last(cpus_chosen); cpu++) {
if (!bitmask_isbitset(cpus_chosen, cpu))
continue;
printf(_("analyzing CPU %d:\n"), cpu);
if (sysfs_is_cpu_online(cpu) != 1) {
printf(_(" *is offline\n"));
printf("\n");
continue;
}
switch (output_param) {
case 'o':
proc_cpuidle_cpu_output(cpu);
break;
case 0:
printf("\n");
cpuidle_cpu_output(cpu, verbose);
break;
}
printf("\n");
}
return EXIT_SUCCESS;
}
Annotation
- Immediate include surface: `unistd.h`, `stdio.h`, `errno.h`, `stdlib.h`, `string.h`, `getopt.h`, `cpuidle.h`, `helpers/sysfs.h`.
- Detected declarations: `function cpuidle_cpu_output`, `function cpuidle_general_output`, `function proc_cpuidle_cpu_output`, `function cpuidle_exit`, `function cmd_idle_info`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.