From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFC613019A6; Fri, 13 Mar 2026 16:27:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773419254; cv=none; b=lgC/OH9YrVxY6l4kEHIlsjYOdMT/kKp5buRr6/RuVOxqQSGL97oNXFuKcYGm54NQm3Z8RFwdqutUQOSztmMnXhHHURGjO21qVmkm4jRfq0yG/wnvM+roJBeYN/W32Pi6by4a0udtS/bXIMtArVuxIiQ6XkLMEFDzLRki1AsV75A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773419254; c=relaxed/simple; bh=/eJtS8h0mKw/fLWieWSxlYbg5ksWap1zDbR7F4gZ0Bk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JXg9wbU8h2lAhbV2qBl7rpN8CD/6gFh+gIS8t4hWRXVh2K2C5yvG8I99rzHmqmaJ9ndK90EL6Qn/HZiCqRSrINDHJDAYuaKoB26CEeiC38erp9DbHbFUsnRGJmhQUBlWCiSE4FX8AWvcuhTz5OHFG03kuWVvoz1x76bnDBsLfRE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=g5ys7i1O; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g5ys7i1O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B561C19421; Fri, 13 Mar 2026 16:27:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773419254; bh=/eJtS8h0mKw/fLWieWSxlYbg5ksWap1zDbR7F4gZ0Bk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g5ys7i1O4Oyyqudvfshayx5x83ZBrEEd0hPy5o7hcH9EDWSkBdxYYZhK0r1GGyM5G syCsC3eq1DUtsRKhNj21oAjko603bAQ8oYUQSwVNYXJYnpkqJrZrzL+Qr9e/x3BaDJ M37e6xzk+OxV1qR3jc4v11SJY98DLwi/oLO/z/dp5RHapEBh2nFHW1mxc2t1ayskjP OgjJTag8HwIxlnqHx55zKZEE15NKqEvjn2la7wrAn7lMgyKNFTLEAaJPUj811LesBL GRHk15xq6KF2kJ/9MYge7WEDYF85dN+2wkTaIg/SiwbDVxI2Mij/HaLc6uTCfqkcto kSe137WPVc22w== Date: Fri, 13 Mar 2026 12:27:32 -0400 From: Sasha Levin To: Greg Kroah-Hartman 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 , "Paul E. McKenney" , Jonathan Corbet , Dmitry Vyukov , Randy Dunlap , Cyril Hrubis , Kees Cook , Jake Edge , David Laight , Askar Safin , Gabriele Paoloni , Mauro Carvalho Chehab , Christian Brauner , Alexander Viro , Andrew Morton , Masahiro Yamada , Shuah Khan , Ingo Molnar , Arnd Bergmann Subject: Re: [PATCH 3/9] kernel/api: add debugfs interface for kernel API specifications Message-ID: References: <20260313150928.2637368-1-sashal@kernel.org> <20260313150928.2637368-4-sashal@kernel.org> <2026031301-duplicate-finalist-b7a5@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <2026031301-duplicate-finalist-b7a5@gregkh> On Fri, Mar 13, 2026 at 04:32:23PM +0100, Greg Kroah-Hartman wrote: >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/ - 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 >> --- >> 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? Sorry, just a rebasing artifact from shuffling patches around. I'll fix it. >> --- /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? :) I'll add one. >And this is, a totally and crazy interface with debugfs, I love it! Thanks :) >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 { } ack >> + >> + 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. ack -- Thanks, Sasha