modinfo vmlinux
PATCH 1/1 modinfo vmlinux
Sometimes I want to know which kind of kernel parameters are available for modules that are built into the kernel image.
This patch supports modinfo for vmlinux.
# modinfo -p vmlinux i8042.nokbd:Do not probe or use KBD port. i8042.noaux:Do not probe or use AUX (mouse) port. i8042.nomux:Do not check whether an active multiplexing conrtoller is present. : tcp_bic.initial_ssthresh:initial value of slow start threshold tcp_bic.bic_scale:scale (scaled by 1024) value for bic function (bic_scale/1024) tcp_bic.tcp_friendliness:turn on/off tcp friendliness
Signed-off-by Akinobu Mita <[email protected]>
include/linux/module.h renamed from include/linux/module.h.orig +1 -1
@@ -134,7 +134,7 @@ extern struct module __this_module;/* One for each parameter, describing how to use it. Some files do multiple of these per line, so can't just use MODULE_INFO. */ #define MODULE_PARM_DESC (_parm, desc) \ - __MODULE_INFO(parm, _parm, #_parm ":" desc) + __MODULE_INFO(parm, _parm, MODULE_PARAM_PREFIX #_parm ":" desc)#define MODULE_DEVICE_TABLE (type,name) \ MODULE_GENERIC_TABLE(type##_device,name)
include/linux/moduleparam.h renamed from include/linux/moduleparam.h.orig +1 -5
@@ -13,18 +13,14 @@#define MODULE_PARAM_PREFIX __stringify(KBUILD_MODNAME) "."#endif -#ifdef MODULE #define ___module_cat (a,b) __mod_ ## a ## b#define __module_cat (a,b) ___module_cat(a,b)#define __MODULE_INFO (tag, name, info) \ static const char __module_cat(name,__LINE__)[] \ __attribute_used__ \ __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info -#else /* !MODULE */ -#define __MODULE_INFO (tag, name, info) -#endif #define __MODULE_PARM_TYPE (name, _type) \ - __MODULE_INFO(parmtype, name##type, #name ":" _type) + __MODULE_INFO(parmtype, name##type, MODULE_PARAM_PREFIX #name ":" _type)struct kernel_param ;