From: Randy Dunlap <rdunlap@infradead.org>
To: linux-kernel@vger.kernel.org
Cc: Randy Dunlap <rdunlap@infradead.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Kent Overstreet <kent.overstreet@linux.dev>,
Suren Baghdasaryan <surenb@google.com>
Subject: [PATCH] scripts/kernel-doc: drop "_noprof" on function prototypes
Date: Mon, 25 Mar 2024 22:41:49 -0700 [thread overview]
Message-ID: <20240326054149.2121-1-rdunlap@infradead.org> (raw)
Memory profiling introduces macros as hooks for function-level
allocation profiling[1]. Memory allocation functions that are profiled
are named like xyz_alloc() for API access to the function. xyz_alloc()
then calls xyz_alloc_noprof() to do the allocation work.
The kernel-doc comments for the memory allocation functions are
introduced with the xyz_alloc() function names but the function
implementations are the xyz_alloc_noprof() names.
This causes kernel-doc warnings for mismatched documentation and
function prototype names.
By dropping the "_noprof" part of the function name, the kernel-doc
function name matches the function prototype name, so the warnings
are resolved.
[1] https://lore.kernel.org/all/20240321163705.3067592-1-surenb@google.com/
Fixes: c64e38ed88d1 ("mm/slab: enable slab allocation tagging for kmalloc and friends")
Fixes: ea7b8933f21b ("mempool: hook up to memory allocation profiling")
Fixes: 576477564ede ("mm: vmalloc: enable memory allocation profiling")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/all/20240325123603.1bdd6588@canb.auug.org.au/
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>
---
a. Suren, Kent, feel free to correct my comments on memory profiling.
I haven't read the documentation in a few weeks.
b. There are some instances of the kernel-doc function name including
"_noprof". Suren is correcting those cases so that all _noprof warnings
will be resolved.
scripts/kernel-doc | 1 +
1 file changed, 1 insertion(+)
diff -- a/scripts/kernel-doc b/scripts/kernel-doc
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1723,6 +1723,7 @@ sub dump_function($$) {
$prototype =~ s/__must_check +//;
$prototype =~ s/__weak +//;
$prototype =~ s/__sched +//;
+ $prototype =~ s/_noprof//;
$prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//;
$prototype =~ s/__(?:re)?alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +//;
$prototype =~ s/__diagnose_as\s*\(\s*\S+\s*(?:,\s*\d+\s*)*\) +//;
next reply other threads:[~2024-03-26 5:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-26 5:41 Randy Dunlap [this message]
2024-03-26 20:35 ` [PATCH] scripts/kernel-doc: drop "_noprof" on function prototypes Suren Baghdasaryan
2025-06-05 19:07 ` Matthew Wilcox
2025-06-05 19:18 ` Jonathan Corbet
2025-06-05 19:31 ` Matthew Wilcox
2025-06-05 19:52 ` Jonathan Corbet
2025-06-05 22:50 ` Mauro Carvalho Chehab
2025-06-05 23:28 ` Mauro Carvalho Chehab
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=20240326054149.2121-1-rdunlap@infradead.org \
--to=rdunlap@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=kent.overstreet@linux.dev \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=surenb@google.com \
/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;
as well as URLs for NNTP newsgroup(s).