|
From: Nuno C. <li...@gm...> - 2011-06-15 17:24:56
|
Hi list, Can I use Valgrind to make some memory leaks tests and performance tests on device drivers? Thanks, Huck. |
|
From: Eugene S. <dam...@ma...> - 2011-06-15 17:55:59
|
Hi, On 15.06.2011 21:24, Nuno Cardoso wrote: > Hi list, > Can I use Valgrind to make some memory leaks tests and performance > tests on device drivers? I guess, you are talking about the device drivers implemented as Linux kernel modules, right? If so, the answer is "you can - to some extent". Valgrind-based tools operate on user-space processes. You can try User-Mode Linux project (http://en.wikipedia.org/wiki/User-mode_Linux) to run a kernel as a whole in a user-space process. That process can probably be analyzed with Valgrind-based tools. Haven't tried this myself though. Apart from that, there are other tools that may be more suitable for you and easier to use depending on what you try to accomplish. They are more oriented towards kernel-mode software. SystemTap (http://sourceware.org/systemtap/) and profiling facilities included into the kernel can help you obtain performance-related information. Ftrace and LTTng might also be helpful here. To detect memory leaks in a kernel module, you can try Kmemleak (included into the kernel) or KEDR (http://kedr.berlios.de/) - both are quite easy to use. You could also try Kmemcheck tool, if you need to detect incorrect memory accesses. Despite its name, Kmemcheck is based on a different technology then Valgrind's Memcheck. The overhead of Kmemcheck is rather high but it is a useful tool nonetheless. Hope this helps. Regards, Eugene |