[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJuCfpH+sXfyx3U4dBR0644vLD3hGas2=Vzb5nAsi7nBzrPTvQ@mail.gmail.com>
Date: Tue, 26 Mar 2024 13:35:11 -0700
From: Suren Baghdasaryan <surenb@...gle.com>
To: Randy Dunlap <rdunlap@...radead.org>
Cc: linux-kernel@...r.kernel.org, Stephen Rothwell <sfr@...b.auug.org.au>,
Jonathan Corbet <corbet@....net>, linux-doc@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>, Kent Overstreet <kent.overstreet@...ux.dev>
Subject: Re: [PATCH] scripts/kernel-doc: drop "_noprof" on function prototypes
On Mon, Mar 25, 2024 at 10:41 PM Randy Dunlap <rdunlap@...radead.org> wrote:
>
> 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@...radead.org>
> Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
> Closes: https://lore.kernel.org/all/20240325123603.1bdd6588@canb.auug.orgau/
> Cc: Jonathan Corbet <corbet@....net>
> Cc: linux-doc@...r.kernel.org
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Kent Overstreet <kent.overstreet@...ux.dev>
> Cc: Suren Baghdasaryan <surenb@...gle.com>
Tried it out and didn't see the warnings anymore. Thanks Randy!
Tested-by: Suren Baghdasaryan <surenb@...gle.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*)*\) +//;
Powered by blists - more mailing lists