All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] Add CONFIG symbol as module attribute
@ 2016-08-17 19:26 Cristina Moraru
  2016-08-17 19:26 ` [RFC PATCH 1/5] Add generation of Module.symb in streamline_config Cristina Moraru
                   ` (5 more replies)
  0 siblings, 6 replies; 96+ messages in thread
From: Cristina Moraru @ 2016-08-17 19:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: mcgrof, teg, kay, rusty, akpm, Cristina Moraru

This patchset implements dynamic pegging of kconfig symbol
into driver modinfo section

* updates streamline_config.pl to generate the auxiliary file
scripts/mod/Module.ksymb containing associations of driver file
names and corresponding kconfig symbols CONFIG_*
* updates Makefiles to trigger streamline_config.pl call for
Module.ksymb generation and pass the determined CONFIG_* symbol
as compilation parameter -D in KBUILD_KSYMB variable
* adds kconfig_symb as module attribute
* updates modpost to set KBUILD_KSYMB macro as value for
kbuild_symb attribute

Note: the content of the file Module.ksymb is generated for
all modules that have only one associate CONFIG option. All
others are considered to be components linked at the final
modules but not final modules itselves.

The result of this patchset is the following. All modules from
/sys expose the correct CONFIG_* symbol in the module attribute
kconfig_symb with some exceptions. For a total number of 58
modules, 4 of them do not:

snd_seq_midi_event
mptscsih
libahci
mptbase

After a short research:

For mptscsih - ./drivers/message/fusion/Makefile
obj-$(CONFIG_FUSION_SPI)	+= mptbase.o mptscsih.o mptspi.o
obj-$(CONFIG_FUSION_FC)		+= mptbase.o mptscsih.o mptfc.o
obj-$(CONFIG_FUSION_SAS)	+= mptbase.o mptscsih.o mptsas.o
As appears in the Makefile mptscsi is part of more config
options so it's excluded because it's not considered a module
by itself but, somehow gets compiled as module. Same for the
mptbase. I still have to understand better the Kbuild logic so
I cannot state that this is loose practice.

For libahci there are multiple CONFIG_ symbols for different
architectures.

Although past discussion recommended not to use streamline_config,
this patchset still relies on it, for the sake of the proof of
concept. Although the result is close to the target it still does
not provide complete correctness. However it can be replaced by
creating another script which tries to determine better the
module <-> CONFIG associations and output them in auxiliary file
Module.ksymb. Maybe this way we could also determine all CONFIGs
for a particular driver, not only the exact one that enables it.

The auxiliary file is necessary because the Makefile itself does
not have a mapping. The makefile includes the config file with
directive include which creates a series of internal variables
CONFIG_FOO=y/m/n. Afterwards, when recursively descending into
other Makefiles, lines like 

obj-$(CONFIG_FOO) = foo.o 

are resolved in place to obj-y, obj-m etc according to 'make'
logic and the association is lost.

Finally, what does this patchset provide is an infrastructure
to dinamically peg CONFIG_* options to associate drivers using
the mapping from Module.ksymb file. Generation of Module.ksymb
can be replaced but keeping the same format permit the usage of
the other patches.

This patchset is part of a research project within
Google Summer of Code of porting 'make localmodconfig'
for backported drivers. The goal is to enable each
module to expose in /sys its corresponding CONFIG_* option.
The value of this attribute will be dynamically pegged by
modpost without requiring extra work from the driver developers.
Further, this information will be used by a hardware interogation
tool to extract build information about the existing devices.

Cristina Moraru (5):
  Add generation of Module.symb in streamline_config
  Add CONFIG symbol to module as compilation parameter
  Trigger Module.ksymb generation in Makefile
  Set KCONFIG_KSYMB as value for kconfig_ksymb module attribute
  Add kconf_symb as kernel module attribute

 Makefile                             |  4 ++++
 include/linux/module.h               |  1 +
 kernel/module.c                      |  2 ++
 scripts/Makefile.lib                 |  9 ++++++++-
 scripts/kconfig/streamline_config.pl | 30 +++++++++++++++++++++++++++++-
 scripts/mod/modpost.c                |  7 +++++++
 6 files changed, 51 insertions(+), 2 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 96+ messages in thread

end of thread, other threads:[~2019-07-13 14:45 UTC | newest]

Thread overview: 96+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-17 19:26 [RFC PATCH 0/5] Add CONFIG symbol as module attribute Cristina Moraru
2016-08-17 19:26 ` [RFC PATCH 1/5] Add generation of Module.symb in streamline_config Cristina Moraru
2016-08-18 18:22   ` Luis R. Rodriguez
2016-08-18 18:22     ` Luis R. Rodriguez
2016-08-18 18:32     ` Luis R. Rodriguez
2016-08-18 18:32       ` Luis R. Rodriguez
     [not found]     ` <CAGZ2q2xi9Uy-ye387=mWhy_fOEJBC593Nos7fH027m-_ZdoOXA@mail.gmail.com>
2016-08-20 14:49       ` Cristina-Gabriela Moraru
2016-08-20 14:49         ` Cristina-Gabriela Moraru
2016-08-23 19:00       ` Luis R. Rodriguez
2016-08-23 19:00         ` Luis R. Rodriguez
2016-08-17 19:27 ` [RFC PATCH 2/5] Add CONFIG symbol to module as compilation parameter Cristina Moraru
2016-08-18 18:10   ` Luis R. Rodriguez
2016-08-18 18:10     ` Luis R. Rodriguez
2016-08-18 18:55     ` Luis R. Rodriguez
2016-08-18 18:55       ` Luis R. Rodriguez
2016-08-20 15:11     ` Cristina-Gabriela Moraru
2016-08-20 15:11       ` Cristina-Gabriela Moraru
2016-08-23 19:07       ` Luis R. Rodriguez
2016-08-23 19:07         ` Luis R. Rodriguez
2016-08-17 19:27 ` [RFC PATCH 3/5] Trigger Module.ksymb generation in Makefile Cristina Moraru
2016-08-18 18:30   ` Luis R. Rodriguez
2016-08-18 18:30     ` Luis R. Rodriguez
2016-08-17 19:27 ` [RFC PATCH 4/5] Set KCONFIG_KSYMB as value for kconfig_ksymb module attribute Cristina Moraru
2016-08-18 18:59   ` Luis R. Rodriguez
2016-08-18 18:59     ` Luis R. Rodriguez
2016-08-20 15:16     ` Cristina-Gabriela Moraru
2016-08-20 15:16       ` Cristina-Gabriela Moraru
2016-08-23 19:10       ` Luis R. Rodriguez
2016-08-23 19:10         ` Luis R. Rodriguez
2016-08-17 19:27 ` [RFC PATCH 5/5] Add kconf_symb as kernel " Cristina Moraru
2016-08-18 19:02   ` Luis R. Rodriguez
2016-08-18 19:02     ` Luis R. Rodriguez
2016-08-18 17:55 ` [RFC PATCH 0/5] Add CONFIG symbol as " Luis R. Rodriguez
2016-08-18 17:55   ` Luis R. Rodriguez
2016-08-19  9:07   ` Michal Marek
2016-08-19  9:07     ` Michal Marek
2016-08-22 19:48     ` Cristina-Gabriela Moraru
2016-08-22 19:48       ` Cristina-Gabriela Moraru
2016-08-23 21:32     ` Luis R. Rodriguez
2016-08-23 21:32       ` Luis R. Rodriguez
2016-08-24 11:05       ` Michal Marek
2016-08-24 11:05         ` Michal Marek
2016-08-24 16:33         ` Luis R. Rodriguez
2016-08-24 16:33           ` Luis R. Rodriguez
2016-08-24 17:31           ` Naveen Kumar
2016-08-24 17:31             ` Naveen Kumar
2016-08-22 19:35   ` Cristina-Gabriela Moraru
2016-08-22 19:35     ` Cristina-Gabriela Moraru
2016-08-23 19:17     ` Luis R. Rodriguez
2016-08-23 19:17       ` Luis R. Rodriguez
2016-08-25  7:43   ` Christoph Hellwig
2016-08-25  7:43     ` Christoph Hellwig
2016-08-25  8:00     ` Johannes Berg
2016-08-25  8:00       ` Johannes Berg
2016-08-25 19:51       ` Luis R. Rodriguez
2016-08-25 19:51         ` Luis R. Rodriguez
2016-08-25  8:41     ` Michal Marek
2016-08-25  8:41       ` Michal Marek
2016-08-25 20:19     ` Luis R. Rodriguez
2016-08-25 20:19       ` Luis R. Rodriguez
2019-02-05 22:07       ` Luis Chamberlain
2019-02-05 22:07         ` Luis Chamberlain
2019-06-26 22:21         ` Luis Chamberlain
2019-06-26 22:21           ` Luis Chamberlain
2019-06-27  4:50           ` Christoph Hellwig
2019-06-27  4:50             ` Christoph Hellwig
2019-06-28 18:40             ` Luis Chamberlain
2019-06-28 18:40               ` Luis Chamberlain
2019-06-29  8:42               ` Greg Kroah-Hartman
2019-06-29  8:42                 ` Greg Kroah-Hartman
2019-07-02 20:51                 ` Luis Chamberlain
2019-07-02 20:51                   ` Luis Chamberlain
2019-07-03  7:40                   ` Greg Kroah-Hartman
2019-07-03  7:40                     ` Greg Kroah-Hartman
2019-07-03 16:50                     ` Luis Chamberlain
2019-07-03 16:50                       ` Luis Chamberlain
2019-07-03 18:57                       ` Greg Kroah-Hartman
2019-07-03 18:57                         ` Greg Kroah-Hartman
2019-07-03 22:25                         ` Luis Chamberlain
2019-07-03 22:25                           ` Luis Chamberlain
2019-07-11 23:07                           ` Brendan Higgins
2019-07-11 23:07                             ` Brendan Higgins
2019-07-11 23:22                             ` Luis Chamberlain
2019-07-11 23:22                               ` Luis Chamberlain
2019-07-03 12:16               ` Enrico Weigelt, metux IT consult
2019-07-03 12:16                 ` Enrico Weigelt, metux IT consult
2019-07-03 17:35                 ` Luis Chamberlain
2019-07-03 17:35                   ` Luis Chamberlain
2019-07-03 19:31                   ` Enrico Weigelt, metux IT consult
2019-07-03 19:31                     ` Enrico Weigelt, metux IT consult
2019-07-03 22:42                     ` Luis Chamberlain
2019-07-03 22:42                       ` Luis Chamberlain
2019-07-11 23:27                       ` Brendan Higgins
2019-07-11 23:27                         ` Brendan Higgins
2019-07-13 14:44                         ` Enrico Weigelt, metux IT consult
2019-07-13 14:44                           ` Enrico Weigelt, metux IT consult

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.