kernel/trace/remote_test.c
Source file repositories/reference/linux-study-clean/kernel/trace/remote_test.c
File Facts
- System
- Linux kernel
- Corpus path
kernel/trace/remote_test.c- Extension
.c- Size
- 6058 bytes
- Lines
- 262
- Domain
- Core OS
- Bucket
- Scheduler, Processes, Timers, Sync, And Syscalls
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/simple_ring_buffer.hlinux/trace_remote.hlinux/tracefs.hlinux/types.htrace/define_remote_events.h
Detected Declarations
function remote_test_load_simple_rbfunction scoped_guardfunction remote_test_unload_simple_rbfunction for_each_ring_buffer_descfunction remote_test_unloadfunction remote_test_enable_tracingfunction remote_test_swap_reader_pagefunction remote_test_resetfunction remote_test_enable_eventfunction write_event_writefunction remote_test_init_tracefsfunction remote_test_initmodule init remote_test_init
Annotated Snippet
static const struct file_operations write_event_fops = {
.write = write_event_write,
};
static int remote_test_init_tracefs(struct dentry *d, void *unused)
{
return tracefs_create_file("write_event", 0200, d, NULL, &write_event_fops) ?
0 : -ENOMEM;
}
static struct trace_remote_callbacks trace_remote_callbacks = {
.init = remote_test_init_tracefs,
.load_trace_buffer = remote_test_load,
.unload_trace_buffer = remote_test_unload,
.enable_tracing = remote_test_enable_tracing,
.swap_reader_page = remote_test_swap_reader_page,
.reset = remote_test_reset,
.enable_event = remote_test_enable_event,
};
static int __init remote_test_init(void)
{
return trace_remote_register("test", &trace_remote_callbacks, NULL,
&remote_event_selftest, 1);
}
module_init(remote_test_init);
MODULE_DESCRIPTION("Test module for the trace remote interface");
MODULE_AUTHOR("Vincent Donnefort");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/module.h`, `linux/simple_ring_buffer.h`, `linux/trace_remote.h`, `linux/tracefs.h`, `linux/types.h`, `trace/define_remote_events.h`.
- Detected declarations: `function remote_test_load_simple_rb`, `function scoped_guard`, `function remote_test_unload_simple_rb`, `function for_each_ring_buffer_desc`, `function remote_test_unload`, `function remote_test_enable_tracing`, `function remote_test_swap_reader_page`, `function remote_test_reset`, `function remote_test_enable_event`, `function write_event_write`.
- Atlas domain: Core OS / Scheduler, Processes, Timers, Sync, And Syscalls.
- Implementation status: pattern 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.