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 936E138CFF7; Fri, 13 Mar 2026 15:32:28 +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=1773415948; cv=none; b=OhsQ/Z8mCo6FwA8vW+Y/WYPGpi0Rawv5ThWmmCxKXz1JVNuMSX9CLCQxn7kvKJzR9MvG5A0g9FxD/s4jDanP2qr8kjAeiDjiLlItPhiEbFAPJJuQJRMM9gctQcqdDaHIi2WEfVe//0CYNlr0drK9rOT5llOTGhvP4zU9Gmj0t8M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773415948; c=relaxed/simple; bh=a9N56qquIiA7KzR/QoVlAd2WIKW6Tap6TTUftb/rEhU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GyfAe5am1Nn9FI915WI5Z4Hr48WzFRJxEvYw7nXcJ1uhyIM56dfre0Q7DdqLePV0chAUwETlxbi+7RMn9QjuyTvxklv3D/dnlij7MzTIZBUi7+nJtrGo2ZAdY+ts1TcZS37dl2udrM3TSSyi0GeY2hGMJRuPxn5DKImx/oOxgRc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AJZBf/lk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="AJZBf/lk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5F0DC19421; Fri, 13 Mar 2026 15:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773415948; bh=a9N56qquIiA7KzR/QoVlAd2WIKW6Tap6TTUftb/rEhU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AJZBf/lkOgDw/oG0tz5yl6vsWX7RiSNBCfq4pdSxHrdjxAfGAoil9NXUQI8/MKfgQ T0I126R5E/hEkZ8idIxV0+tbeF2mLuT1kzCNAU4YIHtEtK9YRcrNWezXHyNlgKM40y 3LFB5JoewgSuiUOjRMM0F8JOxGRLvdzU0NluWtFo= Date: Fri, 13 Mar 2026 16:32:23 +0100 From: Greg Kroah-Hartman To: Sasha Levin 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: <2026031301-duplicate-finalist-b7a5@gregkh> References: <20260313150928.2637368-1-sashal@kernel.org> <20260313150928.2637368-4-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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/ - 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? > --- /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