arch/x86/events/rapl.c
Source file repositories/reference/linux-study-clean/arch/x86/events/rapl.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/events/rapl.c- Extension
.c- Size
- 27974 bytes
- Lines
- 966
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/slab.hlinux/perf_event.hlinux/nospec.hasm/cpu_device_id.hasm/intel-family.hasm/msr.hperf_event.hprobe.h
Detected Declarations
struct rapl_pmustruct rapl_pmusstruct rapl_modelenum perf_rapl_pkg_eventsenum rapl_unit_quirkfunction get_rapl_pmu_idxfunction rapl_read_counterfunction rapl_scalefunction rapl_event_updatefunction rapl_start_hrtimerfunction rapl_hrtimer_handlefunction rapl_hrtimer_initfunction __rapl_pmu_event_startfunction rapl_pmu_event_startfunction rapl_pmu_event_stopfunction rapl_pmu_event_addfunction rapl_pmu_event_delfunction rapl_pmu_event_initfunction rapl_pmu_event_readfunction test_msrfunction rapl_check_hw_unitfunction rapl_advertisefunction cleanup_rapl_pmusfunction init_rapl_pmufunction init_rapl_pmusfunction rapl_pmu_initfunction intel_rapl_exitmodule init rapl_pmu_init
Annotated Snippet
module_init(rapl_pmu_init);
static void __exit intel_rapl_exit(void)
{
if (rapl_pmus_core) {
perf_pmu_unregister(&rapl_pmus_core->pmu);
cleanup_rapl_pmus(rapl_pmus_core);
}
perf_pmu_unregister(&rapl_pmus_pkg->pmu);
cleanup_rapl_pmus(rapl_pmus_pkg);
}
module_exit(intel_rapl_exit);
Annotation
- Immediate include surface: `linux/module.h`, `linux/slab.h`, `linux/perf_event.h`, `linux/nospec.h`, `asm/cpu_device_id.h`, `asm/intel-family.h`, `asm/msr.h`, `perf_event.h`.
- Detected declarations: `struct rapl_pmu`, `struct rapl_pmus`, `struct rapl_model`, `enum perf_rapl_pkg_events`, `enum rapl_unit_quirk`, `function get_rapl_pmu_idx`, `function rapl_read_counter`, `function rapl_scale`, `function rapl_event_update`, `function rapl_start_hrtimer`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.