drivers/hv/hv_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/hv/hv_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hv/hv_debugfs.c- Extension
.c- Size
- 4487 bytes
- Lines
- 179
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/hyperv.hlinux/debugfs.hlinux/delay.hlinux/err.hhyperv_vmbus.h
Detected Declarations
function hv_debugfs_delay_getfunction hv_debugfs_delay_setfunction hv_debugfs_state_getfunction hv_debugfs_state_setfunction hv_debug_delay_filesfunction hv_debug_set_test_statefunction hv_debug_set_dir_dentryfunction hv_debug_add_dev_dirfunction hv_debug_rm_dev_dirfunction hv_debug_rm_all_dirfunction hv_debug_delay_testfunction hv_debug_init
Annotated Snippet
if (IS_ERR(dev_root)) {
pr_debug("debugfs_hyperv: hyperv/%s/ not created\n",
device);
return PTR_ERR(dev_root);
}
hv_debug_set_test_state(dev, dev_root);
hv_debug_set_dir_dentry(dev, dev_root);
delay = debugfs_create_dir(delay_name, dev_root);
if (IS_ERR(delay)) {
pr_debug("debugfs_hyperv: hyperv/%s/%s/ not created\n",
device, delay_name);
return PTR_ERR(delay);
}
ret = hv_debug_delay_files(dev, delay);
return ret;
}
pr_debug("debugfs_hyperv: hyperv/ not in root debugfs path\n");
return PTR_ERR(hv_debug_root);
}
/* Remove dentry associated with released hv device */
void hv_debug_rm_dev_dir(struct hv_device *dev)
{
if (!IS_ERR(hv_debug_root))
debugfs_remove_recursive(dev->debug_dir);
}
/* Remove all dentrys associated with vmbus testing */
void hv_debug_rm_all_dir(void)
{
debugfs_remove_recursive(hv_debug_root);
}
/* Delay buffer/message reads on a vmbus channel */
void hv_debug_delay_test(struct vmbus_channel *channel, enum delay delay_type)
{
struct vmbus_channel *test_channel = channel->primary_channel ?
channel->primary_channel :
channel;
bool state = test_channel->fuzz_testing_state;
if (state) {
if (delay_type == 0)
udelay(test_channel->fuzz_testing_interrupt_delay);
else
udelay(test_channel->fuzz_testing_message_delay);
}
}
/* Initialize top dentry for vmbus testing */
int hv_debug_init(void)
{
hv_debug_root = debugfs_create_dir("hyperv", NULL);
if (IS_ERR(hv_debug_root)) {
pr_debug("debugfs_hyperv: hyperv/ not created\n");
return PTR_ERR(hv_debug_root);
}
return 0;
}
Annotation
- Immediate include surface: `linux/hyperv.h`, `linux/debugfs.h`, `linux/delay.h`, `linux/err.h`, `hyperv_vmbus.h`.
- Detected declarations: `function hv_debugfs_delay_get`, `function hv_debugfs_delay_set`, `function hv_debugfs_state_get`, `function hv_debugfs_state_set`, `function hv_debug_delay_files`, `function hv_debug_set_test_state`, `function hv_debug_set_dir_dentry`, `function hv_debug_add_dev_dir`, `function hv_debug_rm_dev_dir`, `function hv_debug_rm_all_dir`.
- 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.