debugging memory leaks in drivers/module
Hi,
I am thinking of creating a small patch
to track heap memory allocations and deallocations from drivers and modules. This could be really useful in a system where you are testing lots of drivers and modules in your test environment and want to keep track of how much kmalloc()ed memory the module has allocated.
Has anyone written such a thing and it is available for use somewhere ?
(Basically how it would work is I would intercept the kmalloc() call in my routine and then look at the __builtin_return_address to find which module has requested the allocation) Same with kfree() although I will have to dig into the slab cache to figure out the original request size. We can then record this info in a table of some sort and export it via /proc or an ioctl()).. Is there a better way of doing this ?
Thanks in advance !
Rajeev
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/