On Sun, May 05, 2002 at 03:08:18PM +0300, Oleg Goldshmidt wrote: > > Hi, > > Is there a way to monitor how much memory a kernel module uses? I can > do it very crudely by watching top while rmmoding/insmoding. Is there > any tool that I am unaware of (and did not find on TFW) that does it > better?
Not likely, but if you have that module's source, you can hack something yourself(*). Explanation why not (which you might or might not already know): a module is just a regular object file which gets linked into the kernel at run time. The notion of "memory which the kernel module uses" is not very well defined, since there are no clear boundaries between the module and the kernel (on cannot differentiate between memory used by the "base" kernel and memory used by the module). (*) Explanation why you might be able to hack something yourself: almost all kernel memory allocation facilities come down to a few page allocation routines. Since you have the list of symbols for this module (and every other module) and the kernel mode stack of each process, you can hack the memory allocation routines to do book keeping on memory allocated specifically for a given module. You will suffer a performance loss, of course. Can you elaborate further on what you're trying to achieve? Hope this helps, Muli. -- The ill-formed Orange Fails to satisfy the eye: http://vipe.technion.ac.il/~mulix/ Segmentation fault. http://syscalltrack.sf.net/ ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]