From: Nigel Cunningham <ncunningham@linuxmail.org>
To: Andrew Morton <akpm@digeo.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] Suspend2 Merge: Get module list.
Date: Thu, 16 Sep 2004 21:06:12 +1000 [thread overview]
Message-ID: <1095332772.3855.170.camel@laptop.cunninghams> (raw)
Hi again.
This patch adds support for getting a list of currently loaded modules.
It's used in displaying debugging info:
> 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_mppe ppp_deflate zlib_inflate zlib_deflate
> bsd_comp ltmodem_cs ds i82365 pcmcia_core maestro3 ac97_codec
> soundcore ftdi_sio visor usbserial printer usb-uhci usbcore Mvnetd
> Mvnet Mvnetint Mvw Mvmouse Mvkbd Mvgic Mvdsp Mserial Mmpip Mmerge
> mki-adapter i830 agpgart parport_pc lp parport ide-cd cdrom floppy
> ipt_LOG ipt_state ipt_MASQUERADE iptable_nat ip_conntrack
> ipt_multiport ipt_REJECT iptable_filter ip_tables ppp_async
> ppp_generic slhc af_packet omnibook battery button eepro100 mii rtc
> unix suspend_swap suspend_block_io suspend_lzf suspend_bootsplash
> suspend_text suspend_core
> - Attempt number : 1
> - Parameters : 0 2816 0 0 0 128
> - Limits : 161664 pages RAM. Initial boot: 156425.
> - Overall expected compression percentage: 0.
> - 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
diff -ruN linux-2.6.9-rc1/kernel/module.c software-suspend-linux-2.6.9-rc1-rev3/kernel/module.c
--- linux-2.6.9-rc1/kernel/module.c 2004-09-07 21:59:00.000000000 +1000
+++ software-suspend-linux-2.6.9-rc1-rev3/kernel/module.c 2004-09-09 19:36:24.000000000 +1000
@@ -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);
--
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.
next reply other threads:[~2004-09-16 11:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-16 11:06 Nigel Cunningham [this message]
2004-09-17 7:25 ` Christoph Hellwig
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=1095332772.3855.170.camel@laptop.cunninghams \
--to=ncunningham@linuxmail.org \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®