Suspend2 Merge: Get module list.
PATCH 1/1 Suspend2 Merge: Get module list.
Hi again.
This patch adds support for getting a list of currently loaded modules. It's used in displaying debugging info:
Quoted 19 lines
Please include the following information in bug reports:
- SWSUSP core : 2.0.0.107
- Kernel Version : 2.4.27
- Version spec. : 2.0.1
- Compiler vers. : 3.3
- Modules loaded :ppp_mppeppp_deflatezlib_inflatezlib_deflatebsd_compltmodem_csds i82365pcmcia_coremaestro3ac97_codecsoundcoreftdi_siovisor usbserial printer usb-uhci usbcore Mvnetd Mvnet Mvnetint Mvw Mvmouse Mvkbd Mvgic Mvdsp Mserial Mmpip Mmerge mki-adapter i830 agpgartparport_pclp parport ide-cd cdrom floppyipt_LOGipt_stateipt_MASQUERADEiptable_natip_conntrackipt_multiportipt_REJECTiptable_filterip_tablesppp_asyncppp_genericslhcaf_packetomnibook battery button eepro100 mii rtc unixsuspend_swapsuspend_block_iosuspend_lzfsuspend_bootsplashsuspend_textsuspend_core
- Attempt number : 1
- Parameters : 0 2816 0 0 0 128
- Limits : 161664 pages RAM. Initial boot: 156425.
- Overall expected compression percentage: 0.
Quoted 8 lines
- LZF Compressor enabled.
Compressed 340914176 bytes into 187258858 (45 percent compression).
- Swapwriter active.
Swap available for image: 172688 pages.
- Debugging compiled in.
- Preemptive kernel.
- I/O speed: Write 28 MB/s, Read 49 MB/s.
[root@laptop current-2.6.9-rc2-patches]#
(I'm using 2.4 because there's no 2.6 pcmcia_cs ltmodem driver yet :>).
Regards,
Nigel
kernel/module.c +30 -0
@@ -2146,6 +2146,33 @@printk ("\n" ); } +#define MODLIST_SIZE 4096 + +void print_module_list (void ) +{ +static char modlist[MODLIST_SIZE ]; +struct module *mod; +int pos =0 ; + +list_for_each_entry (mod, &modules, list) +if (mod->name) + pos +=snprintf (modlist+pos,MODLIST_SIZE -pos-1 , +"%s " , mod->name); +printk ("%s\n" ,modlist); +} + +int print_module_list_to_buffer (char * buffer,int size) +{ +struct module *mod; +int pos =0 ; + +list_for_each_entry (mod, &modules, list) +if (mod->name) + pos +=snprintf (buffer+pos, size-pos-1 , +"%s " , mod->name); +return pos; +} +#ifdef CONFIG_MODVERSIONS /* Generate the signature for struct module here, too, for modversions. */ void struct_module (struct module *mod) {return ; }
@@ -2157,3 +2184,6 @@return subsystem_register (&module_subsys); }__initcall (modules_init); + +/* For Suspend2 */ +EXPORT_SYMBOL (print_module_list_to_buffer);
Signature · 7 lines
Nigel Cunningham Pastoral Worker Christian Reformed Church of Tuggeranong PO Box 1004, Tuggeranong, ACT 2901 Many today claim to be tolerant. True tolerance, however, can cope with others being intolerant.
Quoted 4 lines · Nigel Cunningham
Hi again.
This patch adds support for getting a list of currently loaded modules. It's used in displaying debugging info:
This is printed in an oops anyway, and if the system doesn't crash a cat /proc/modules does the same.