public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Sasha Levin <sashal@kernel.org>
Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kbuild@vger.kernel.org, linux-kselftest@vger.kernel.org,
	workflows@vger.kernel.org, tools@kernel.org, x86@kernel.org,
	Thomas Gleixner <tglx@kernel.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Dmitry Vyukov <dvyukov@google.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Cyril Hrubis <chrubis@suse.cz>, Kees Cook <kees@kernel.org>,
	Jake Edge <jake@lwn.net>,
	David Laight <david.laight.linux@gmail.com>,
	Askar Safin <safinaskar@zohomail.com>,
	Gabriele Paoloni <gpaoloni@redhat.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Christian Brauner <brauner@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Ingo Molnar <mingo@redhat.com>, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH 3/9] kernel/api: add debugfs interface for kernel API specifications
Date: Fri, 13 Mar 2026 16:32:23 +0100	[thread overview]
Message-ID: <2026031301-duplicate-finalist-b7a5@gregkh> (raw)
In-Reply-To: <20260313150928.2637368-4-sashal@kernel.org>

On Fri, Mar 13, 2026 at 11:09:13AM -0400, Sasha Levin wrote:
> Add a debugfs interface 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
> 
> 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, notes, and deprecation status
> 
> This enables runtime introspection of kernel APIs for documentation
> tools, static analyzers, and debugging purposes.
> 
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  Documentation/dev-tools/kernel-api-spec.rst |  88 ++--

You are removing stuff from the file you created earlier in this patch
series, is that ok?

> --- /dev/null
> +++ b/kernel/api/kapi_debugfs.c
> @@ -0,0 +1,503 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Kernel API specification debugfs interface
> + *
> + * This provides a debugfs interface to expose kernel API specifications
> + * at runtime, allowing tools and users to query the complete API specs.
> + */

No copyright line?  :)

And this is, a totally and crazy interface with debugfs, I love it!

Two minor minor nits:

> +static int __init kapi_debugfs_init(void)
> +{
> +	struct kernel_api_spec *spec;
> +	struct dentry *spec_dir;
> +
> +	/* Create main directory */
> +	kapi_debugfs_root = debugfs_create_dir("kapi", NULL);
> +
> +	/* Create list file */
> +	debugfs_create_file("list", 0444, kapi_debugfs_root, NULL, &kapi_list_fops);
> +
> +	/* Create specs subdirectory */
> +	spec_dir = debugfs_create_dir("specs", kapi_debugfs_root);
> +
> +	/* Create a file for each API spec */
> +	for (spec = __start_kapi_specs; spec < __stop_kapi_specs; spec++) {
> +		debugfs_create_file(spec->name, 0444, spec_dir, spec, &kapi_spec_fops);
> +	}

No need for { }

> +
> +	pr_info("Kernel API debugfs interface initialized\n");

When code is working properly, it should be quiet, no need for this as
initializing this can not fail.

thanks,

greg k-h

  reply	other threads:[~2026-03-13 15:32 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 15:09 [PATCH 0/9] Kernel API Specification Framework Sasha Levin
2026-03-13 15:09 ` [PATCH 1/9] kernel/api: introduce kernel API specification framework Sasha Levin
2026-03-17 17:49   ` Jonathan Corbet
2026-03-18  6:00     ` Mauro Carvalho Chehab
2026-03-18 14:53       ` Sasha Levin
2026-03-18 14:30     ` Sasha Levin
2026-03-18 16:50       ` Jonathan Corbet
2026-03-18 14:32     ` Sasha Levin
2026-03-18 16:51       ` Jonathan Corbet
2026-03-13 15:09 ` [PATCH 2/9] kernel/api: enable kerneldoc-based API specifications Sasha Levin
2026-03-13 15:09 ` [PATCH 3/9] kernel/api: add debugfs interface for kernel " Sasha Levin
2026-03-13 15:32   ` Greg Kroah-Hartman [this message]
2026-03-13 16:27     ` Sasha Levin
2026-03-13 15:09 ` [PATCH 4/9] tools/kapi: Add kernel API specification extraction tool Sasha Levin
2026-03-13 15:09 ` [PATCH 5/9] kernel/api: add API specification for sys_open Sasha Levin
2026-03-13 15:33   ` Greg Kroah-Hartman
2026-03-13 16:42     ` Sasha Levin
2026-03-17 18:37       ` Jonathan Corbet
2026-03-18 14:12         ` Sasha Levin
2026-03-18 14:16           ` Jonathan Corbet
2026-03-13 15:09 ` [PATCH 6/9] kernel/api: add API specification for sys_close Sasha Levin
2026-03-13 15:49   ` Greg Kroah-Hartman
2026-03-13 16:46     ` Sasha Levin
2026-03-13 15:52   ` Greg Kroah-Hartman
2026-03-13 16:55     ` Sasha Levin
2026-03-13 15:09 ` [PATCH 7/9] kernel/api: add API specification for sys_read Sasha Levin
2026-03-13 15:09 ` [PATCH 8/9] kernel/api: add API specification for sys_write Sasha Levin
2026-03-13 15:09 ` [PATCH 9/9] kernel/api: add runtime verification selftest Sasha Levin
2026-03-14 18:18 ` [PATCH 0/9] Kernel API Specification Framework Jakub Kicinski
2026-03-14 22:44   ` David Laight
2026-03-15  6:46     ` Sasha Levin
2026-03-15  6:36   ` Sasha Levin
2026-03-18  6:24     ` Mauro Carvalho Chehab
2026-03-18 14:14       ` Sasha Levin
2026-03-16  7:05   ` Dmitry Vyukov
2026-03-16 22:57     ` Jakub Kicinski
2026-03-16 23:29       ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026031301-duplicate-finalist-b7a5@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=brauner@kernel.org \
    --cc=chrubis@suse.cz \
    --cc=corbet@lwn.net \
    --cc=david.laight.linux@gmail.com \
    --cc=dvyukov@google.com \
    --cc=gpaoloni@redhat.com \
    --cc=jake@lwn.net \
    --cc=kees@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=safinaskar@zohomail.com \
    --cc=sashal@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@kernel.org \
    --cc=tools@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=workflows@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox