All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Alcock <nick.alcock@oracle.com>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Masahiro Yamada <masahiroy@kernel.org>,
	linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org,
	Hitomi Hasegawa <hasegawa-hitomi@fujitsu.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	iommu@lists.linux.dev
Subject: Re: [PATCH 21/27] kbuild, dma-mapping: benchmark: remove MODULE_LICENSE in non-modules
Date: Fri, 24 Feb 2023 14:20:16 +0000	[thread overview]
Message-ID: <87pm9zm9gf.fsf@esperi.org.uk> (raw)
In-Reply-To: <Y/fR0KnxKP2rF3Da@bombadil.infradead.org> (Luis Chamberlain's message of "Thu, 23 Feb 2023 12:51:28 -0800")

On 23 Feb 2023, Luis Chamberlain outgrape:

> On Thu, Feb 23, 2023 at 03:31:50PM +0000, Nick Alcock wrote:
>> Nor can I -- and more generally I can't figure out a way to get from the
>> Kconfig symbols to the source files that constitute them without
>> retraversing the tree, since the only place the relationship is recorded
>> is in makefiles, and those makefiles use a lot of make functionality
>> (including more or less arbitrary make functions).
>
> $ grep "_MODULE 1" ./include/generated/autoconf.h| wc -l
> 560
>
> $ grep "_MODULE 1" ./include/generated/autoconf.h| grep XFS
> #define CONFIG_XFS_FS_MODULE 1
>
> I *think* the trick will likely be to have new a possibilities.h or just
> agument autoconf.h with POSSIBLE_MODULE for each module.
>
> The next complexity lies in inferring the license and doing the license
> output given a combination. I *think* you already figured out the objs
> from the module, and in fact your new kallsyms extension I think prints
> these out right (which I find highly useful)?

Oh, of course, I forgot about that (how stupid of me). Of course the
double-traversal is only necessary if we're trying to *compare* the
results of tristate in Kconfig with the result of the modinfo objs=: if
we assume the modinfo objs= is right (which it should be in the end), we
can just rely on it and then we don't need to double-traverse after all,
except when verifying that (which is a rare intermittent maintenance
task).

(Of course, kallmodsyms elides all objnames that aren't necessary for
symbol disambiguation and reduces the length of what it keeps as far as
it can, but I'm open to an option that just stores the lot, unelided: it
would eat ~750KiB in the kernel image for all but very small kernels,
but for debugging that's fine. Saving more space than that requires
storing the things in a per-path-component tree or something, and would
likely still eat >500K because the leaves are extremely numerous.)

>                                               If so then we use these as
> input source for an SPDX license lookup. Instead of having this
> relationship grep'd after at build time, I wonder if might be good to
> just collect all license associates to all files in a header file
> similar to _MODULE prefix so maybe SPDX_$(file_path)_LICENSE_$license
> which creates a header file 1-1 mapping.
>
> Not sure if that's too much noise.
>
> Just a thought, to get the wheels spinning.

The only problem that I can see with that is that this stops us using
MODULE_LICENSE for modinfo construction, since right now things like the
objs= and the module name are dependent on per-module #defines passed in
via -D, which obviously can only have one value while compiling a single
file. But it would be perfectly doable to rename MODULE_LICENSE() to
something like a zero-arg MODULE_INFO() and relieve it of the
responsibility for setting the license, so we could put the license info
into a single file as you suggest. Non-builtin modules could just stuff
a single MODULE_LICENSE line in the mod.c.

-- 
NULL && (void)

  reply	other threads:[~2023-02-24 14:20 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230222121453.91915-1-nick.alcock@oracle.com>
2023-02-22 12:14 ` [PATCH 01/27] kbuild, power: reset: keystone-reset: remove MODULE_LICENSE in non-modules Nick Alcock
2023-02-22 12:14 ` [PATCH 02/27] kbuild, video: fbdev: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-22 12:14 ` [PATCH 03/27] kbuild, KEYS: " Nick Alcock
2023-02-22 12:14 ` [PATCH 04/27] kbuild, soc: bcm: raspberrypi-power: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-24 21:26   ` Florian Fainelli
2023-02-24 21:26     ` Florian Fainelli
2023-02-22 12:14 ` [PATCH 05/27] kbuild, soc: bcm: bcm2835-power: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-24 21:26   ` Florian Fainelli
2023-02-24 21:26     ` Florian Fainelli
2023-02-22 12:14 ` [PATCH 06/27] kbuild, pinctrl: bcm: ns: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-22 12:14 ` [PATCH 07/27] kbuild, MIPS: BCM47XX: " Nick Alcock
2023-02-26 22:14   ` Philippe Mathieu-Daudé
2023-02-22 12:14 ` [PATCH 08/27] kbuild, clocksource: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-22 12:14 ` [PATCH 09/27] kbuild, clocksource/drivers/timer-tegra186: " Nick Alcock
2023-02-22 12:14 ` [PATCH 10/27] kbuild, clocksource: " Nick Alcock
2023-02-22 12:14 ` [PATCH 11/27] kbuild, clk: bcm2835: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-22 23:43   ` Stephen Boyd
2023-02-22 23:43     ` Stephen Boyd
2023-02-23  1:36     ` Luis Chamberlain
2023-02-23  1:36       ` Luis Chamberlain
2023-03-06 19:29   ` Stephen Boyd
2023-03-06 19:29     ` Stephen Boyd
2023-02-22 12:14 ` [PATCH 12/27] kbuild, clk: " Nick Alcock
2023-02-22 12:41   ` Conor Dooley
2023-02-22 23:43   ` Stephen Boyd
2023-03-06 19:29   ` [PATCH 12/27] kbuild, clk: remove MODULE_LICENSE in non-modules Stephen Boyd
2023-02-22 12:14 ` [PATCH 13/27] kbuild, vgacon: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-22 12:14 ` [PATCH 14/27] kbuild, cpufreq: tegra124: " Nick Alcock
2023-02-23  4:20   ` Viresh Kumar
2023-02-22 12:14 ` [PATCH 15/27] kbuild, cpufreq: " Nick Alcock
2023-02-23  4:20   ` Viresh Kumar
2023-02-22 12:14 ` [PATCH 16/27] kbuild, crypto: " Nick Alcock
2023-02-23 10:18   ` Herbert Xu
2023-02-22 12:14 ` [PATCH 17/27] " Nick Alcock
2023-02-23 10:21   ` Herbert Xu
2023-02-22 12:14 ` [PATCH 18/27] kbuild, mfd: " Nick Alcock
2023-02-22 22:38   ` DLG Adam Ward
2023-02-23 13:48     ` Lee Jones
2023-02-23 19:24       ` Nick Alcock
2023-02-24 15:03         ` DLG Adam Ward
2023-02-27 13:15           ` Nick Alcock
2023-03-01  9:04             ` Lee Jones
2023-02-22 12:14 ` [PATCH 19/27] kbuild, dmaengine: stm32-mdma: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-22 12:14 ` [PATCH 20/27] kbuild, dmaengine: " Nick Alcock
2023-02-22 12:14 ` [PATCH 21/27] kbuild, dma-mapping: benchmark: " Nick Alcock
2023-02-22 14:48   ` Christoph Hellwig
2023-02-22 22:52     ` Luis Chamberlain
2023-02-23 15:31       ` Nick Alcock
2023-02-23 20:51         ` Luis Chamberlain
2023-02-24 14:20           ` Nick Alcock [this message]
2023-02-24 17:18             ` Luis Chamberlain
2023-02-22 12:14 ` [PATCH 22/27] kbuild, dma-buf: heaps: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-22 12:14 ` [PATCH 23/27] kbuild, drm/dsi: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-22 12:14 ` [PATCH 24/27] kbuild, binfmt_elf: " Nick Alcock
2023-02-22 12:14 ` [PATCH 25/27] kbuild, video: fbdev: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-22 12:14 ` [PATCH 26/27] kbuild, phy: intel: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-02-22 12:14 ` [PATCH 27/27] kbuild, gpio: gpio-aspeed-sgpio: " Nick Alcock
2023-02-22 12:14   ` Nick Alcock
2023-03-06  9:59   ` Bartosz Golaszewski
2023-03-06  9:59     ` Bartosz Golaszewski

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=87pm9zm9gf.fsf@esperi.org.uk \
    --to=nick.alcock@oracle.com \
    --cc=hasegawa-hitomi@fujitsu.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=masahiroy@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.