summaryrefslogtreecommitdiff
path: root/kernel/api/kapi_debugfs.c
AgeCommit message (Collapse)Author
6 dayskernel/api: add debugfs interface for kernel API specificationsSasha Levin
Add a debugfs interface, enabled by CONFIG_KAPI_SPEC_DEBUGFS, to expose kernel API specifications at runtime. This allows tools and users to query the complete API specifications through the debugfs filesystem. The interface provides: - /sys/kernel/debug/kapi/list - lists all available API specifications - /sys/kernel/debug/kapi/specs/<name> - detailed info for each API - /sys/kernel/debug/kapi/specs-json/<name> - the same spec as JSON Each specification file includes: - Function name, version, and descriptions - Execution context requirements and flags - Parameter details with types, flags, and constraints - Return value specifications and success conditions - Error codes with descriptions and conditions - Locking requirements and constraints - Signal handling specifications - Examples and notes This enables runtime introspection of kernel APIs for documentation tools, static analyzers, and debugging purposes. Assisted-by: LLM Signed-off-by: Sasha Levin <sashal@kernel.org>