drivers/hv/mshv_debugfs_counters.c
Source file repositories/reference/linux-study-clean/drivers/hv/mshv_debugfs_counters.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hv/mshv_debugfs_counters.c- Extension
.c- Size
- 16227 bytes
- Lines
- 491
- Domain
- Driver Families
- Bucket
- drivers/hv
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2026, Microsoft Corporation.
*
* Data for printing stats page counters via debugfs.
*
* Authors: Microsoft Linux virtualization team
*/
/*
* For simplicity, this file is included directly in mshv_debugfs.c.
* If these are ever needed elsewhere they should be compiled separately.
* Ensure this file is not used twice by accident.
*/
#ifndef MSHV_DEBUGFS_C
#error "This file should only be included in mshv_debugfs.c"
#endif
/* HV_HYPERVISOR_COUNTER */
static char *hv_hypervisor_counters[] = {
[1] = "HvLogicalProcessors",
[2] = "HvPartitions",
[3] = "HvTotalPages",
[4] = "HvVirtualProcessors",
[5] = "HvMonitoredNotifications",
[6] = "HvModernStandbyEntries",
[7] = "HvPlatformIdleTransitions",
[8] = "HvHypervisorStartupCost",
[10] = "HvIOSpacePages",
[11] = "HvNonEssentialPagesForDump",
[12] = "HvSubsumedPages",
};
/* HV_CPU_COUNTER */
static char *hv_lp_counters[] = {
[1] = "LpGlobalTime",
[2] = "LpTotalRunTime",
[3] = "LpHypervisorRunTime",
[4] = "LpHardwareInterrupts",
[5] = "LpContextSwitches",
[6] = "LpInterProcessorInterrupts",
[7] = "LpSchedulerInterrupts",
[8] = "LpTimerInterrupts",
[9] = "LpInterProcessorInterruptsSent",
[10] = "LpProcessorHalts",
[11] = "LpMonitorTransitionCost",
[12] = "LpContextSwitchTime",
[13] = "LpC1TransitionsCount",
[14] = "LpC1RunTime",
[15] = "LpC2TransitionsCount",
[16] = "LpC2RunTime",
[17] = "LpC3TransitionsCount",
[18] = "LpC3RunTime",
[19] = "LpRootVpIndex",
[20] = "LpIdleSequenceNumber",
[21] = "LpGlobalTscCount",
[22] = "LpActiveTscCount",
[23] = "LpIdleAccumulation",
[24] = "LpReferenceCycleCount0",
[25] = "LpActualCycleCount0",
[26] = "LpReferenceCycleCount1",
[27] = "LpActualCycleCount1",
[28] = "LpProximityDomainId",
[29] = "LpPostedInterruptNotifications",
[30] = "LpBranchPredictorFlushes",
#if IS_ENABLED(CONFIG_X86_64)
[31] = "LpL1DataCacheFlushes",
[32] = "LpImmediateL1DataCacheFlushes",
[33] = "LpMbFlushes",
[34] = "LpCounterRefreshSequenceNumber",
[35] = "LpCounterRefreshReferenceTime",
[36] = "LpIdleAccumulationSnapshot",
[37] = "LpActiveTscCountSnapshot",
[38] = "LpHwpRequestContextSwitches",
[39] = "LpPlaceholder1",
[40] = "LpPlaceholder2",
[41] = "LpPlaceholder3",
[42] = "LpPlaceholder4",
[43] = "LpPlaceholder5",
[44] = "LpPlaceholder6",
[45] = "LpPlaceholder7",
[46] = "LpPlaceholder8",
[47] = "LpPlaceholder9",
[48] = "LpSchLocalRunListSize",
[49] = "LpReserveGroupId",
[50] = "LpRunningPriority",
[51] = "LpPerfmonInterruptCount",
#elif IS_ENABLED(CONFIG_ARM64)
[31] = "LpCounterRefreshSequenceNumber",
Annotation
- Atlas domain: Driver Families / drivers/hv.
- 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.