lib/sys_info.c
Source file repositories/reference/linux-study-clean/lib/sys_info.c
File Facts
- System
- Linux kernel
- Corpus path
lib/sys_info.c- Extension
.c- Size
- 3842 bytes
- Lines
- 167
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/array_size.hlinux/bitops.hlinux/cleanup.hlinux/console.hlinux/log2.hlinux/kernel.hlinux/ftrace.hlinux/nmi.hlinux/sched/debug.hlinux/string.hlinux/sysctl.hlinux/sys_info.h
Detected Declarations
function sys_info_parse_paramfunction sys_info_write_handlerfunction sys_info_read_handlerfunction for_each_set_bitfunction sysctl_sys_info_handlerfunction sys_info_sysctl_initfunction __sys_infofunction sys_infomodule init sys_info_sysctl_init
Annotated Snippet
subsys_initcall(sys_info_sysctl_init);
#endif
static void __sys_info(unsigned long si_mask)
{
if (si_mask & SYS_INFO_TASKS)
show_state();
if (si_mask & SYS_INFO_MEM)
show_mem();
if (si_mask & SYS_INFO_TIMERS)
sysrq_timer_list_show();
if (si_mask & SYS_INFO_LOCKS)
debug_show_all_locks();
if (si_mask & SYS_INFO_FTRACE)
ftrace_dump(DUMP_ALL);
if (si_mask & SYS_INFO_ALL_BT)
trigger_all_cpu_backtrace();
if (si_mask & SYS_INFO_BLOCKED_TASKS)
show_state_filter(TASK_UNINTERRUPTIBLE);
}
void sys_info(unsigned long si_mask)
{
__sys_info(si_mask ? : kernel_si_mask);
}
Annotation
- Immediate include surface: `linux/array_size.h`, `linux/bitops.h`, `linux/cleanup.h`, `linux/console.h`, `linux/log2.h`, `linux/kernel.h`, `linux/ftrace.h`, `linux/nmi.h`.
- Detected declarations: `function sys_info_parse_param`, `function sys_info_write_handler`, `function sys_info_read_handler`, `function for_each_set_bit`, `function sysctl_sys_info_handler`, `function sys_info_sysctl_init`, `function __sys_info`, `function sys_info`, `module init sys_info_sysctl_init`.
- Atlas domain: Kernel Services / lib.
- Implementation status: integration 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.