Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1464734 > unrolled thread

[RFC PATCH 5/5] Add kconf_symb as kernel module attribute

Started byCristina Moraru <cristina.moraru09@gmail.com>
First post2016-08-17 21:30 +0200
Last post2016-08-19 03:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC PATCH 5/5] Add kconf_symb as kernel module attribute Cristina Moraru <cristina.moraru09@gmail.com> - 2016-08-17 21:30 +0200
    Re: [RFC PATCH 5/5] Add kconf_symb as kernel module attribute "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-08-19 03:00 +0200

#1464734 — [RFC PATCH 5/5] Add kconf_symb as kernel module attribute

FromCristina Moraru <cristina.moraru09@gmail.com>
Date2016-08-17 21:30 +0200
Subject[RFC PATCH 5/5] Add kconf_symb as kernel module attribute
Message-ID<s7eHf-5l0-13@gated-at.bofh.it>
Add kconf_symbol attribute to kernel struct module.

This patch 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.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
---
 include/linux/module.h | 1 +
 kernel/module.c        | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/include/linux/module.h b/include/linux/module.h
index 3daf2b3..bef5e44 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -353,6 +353,7 @@ struct module {
 	struct module_attribute *modinfo_attrs;
 	const char *version;
 	const char *srcversion;
+	const char *kconfig_symbol;
 	struct kobject *holders_dir;
 
 	/* Exported symbols */
diff --git a/kernel/module.c b/kernel/module.c
index 5f71aa6..bb27300 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -757,6 +757,7 @@ static struct module_attribute modinfo_##field = {                    \
 
 MODINFO_ATTR(version);
 MODINFO_ATTR(srcversion);
+MODINFO_ATTR(kconfig_symbol);
 
 static char last_unloaded_module[MODULE_NAME_LEN+1];
 
@@ -1229,6 +1230,7 @@ static struct module_attribute *modinfo_attrs[] = {
 	&module_uevent,
 	&modinfo_version,
 	&modinfo_srcversion,
+	&modinfo_kconfig_symbol,
 	&modinfo_initstate,
 	&modinfo_coresize,
 	&modinfo_initsize,
-- 
2.7.4

[toc] | [next] | [standalone]


#1465678

From"Luis R. Rodriguez" <mcgrof@kernel.org>
Date2016-08-19 03:00 +0200
Message-ID<s7Gka-6XF-27@gated-at.bofh.it>
In reply to#1464734
On Wed, Aug 17, 2016 at 09:27:03PM +0200, Cristina Moraru wrote:
> Add kconf_symbol attribute to kernel struct module.

Nice, you can describe here what and how this can be
used by userspace, for instance you can mention how
udevadm might use this, etc.

> This patch 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.

You can leave this out.

> Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
> ---
>  include/linux/module.h | 1 +
>  kernel/module.c        | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/include/linux/module.h b/include/linux/module.h
> index 3daf2b3..bef5e44 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -353,6 +353,7 @@ struct module {
>  	struct module_attribute *modinfo_attrs;
>  	const char *version;
>  	const char *srcversion;
> +	const char *kconfig_symbol;
>  	struct kobject *holders_dir;
>  
>  	/* Exported symbols */
> diff --git a/kernel/module.c b/kernel/module.c
> index 5f71aa6..bb27300 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -757,6 +757,7 @@ static struct module_attribute modinfo_##field = {                    \
>  
>  MODINFO_ATTR(version);
>  MODINFO_ATTR(srcversion);
> +MODINFO_ATTR(kconfig_symbol);
>  
>  static char last_unloaded_module[MODULE_NAME_LEN+1];
>  
> @@ -1229,6 +1230,7 @@ static struct module_attribute *modinfo_attrs[] = {
>  	&module_uevent,
>  	&modinfo_version,
>  	&modinfo_srcversion,
> +	&modinfo_kconfig_symbol,
>  	&modinfo_initstate,
>  	&modinfo_coresize,
>  	&modinfo_initsize,
> -- 

Do we #ifdef over other features that are optional?

  Luis

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web