debugging memory leaks in drivers/module

Rajeev Bector (rajeev_bector@yahoo.com)
Wed, 1 Aug 2001 17:04:40 -0700 (PDT)


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/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/