diff options
| author | Sasha Levin <sashal@kernel.org> | 2025-06-24 14:07:35 -0400 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2026-10-07 18:26:44 -0400 |
| commit | 89224dc705016dd40cce6c924148e31f0a0dbbb0 (patch) | |
| tree | f14a9d5deaaa041deefa659e7cbde470f5779e1f /kernel/api/Makefile | |
| parent | 6d009bd85fa4e6dbad869e1cb707404968f3f20d (diff) | |
| download | linux-next-89224dc705016dd40cce6c924148e31f0a0dbbb0.tar.gz linux-next-89224dc705016dd40cce6c924148e31f0a0dbbb0.zip | |
kernel/api: add debugfs interface for kernel API specifications
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>
Diffstat (limited to 'kernel/api/Makefile')
| -rw-r--r-- | kernel/api/Makefile | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/api/Makefile b/kernel/api/Makefile index 6e14ca243980..2e1c3555d5aa 100644 --- a/kernel/api/Makefile +++ b/kernel/api/Makefile @@ -6,5 +6,8 @@ # Core API specification framework obj-y += kernel_api_spec.o +# Debugfs interface for kernel API specs +obj-$(CONFIG_KAPI_SPEC_DEBUGFS) += kapi_debugfs.o + # KUnit tests obj-$(CONFIG_KAPI_KUNIT_TEST) += kapi_kunit.o |
