On Thu, 2011-02-10 at 11:08 +0100, Guillaume Dargaud wrote: > Thanks to the advice I received here, I now have my first 'real' Linux driver > up and running and am now at the optimization stage. > > Is it possible to see the resources consumed by a module ? They don't show in > 'ps/top' but I'm sure there are ways to see how much memory it uses (to check > for memory leaks) and how much CPU it takes. How ?
Hi Guillaume, It's actually not that easy to measure the resources used by a driver. In general your driver code only runs on behalf of another process, and so that process is where the cpu usage will be accounted. One exception is if your driver spawns a kernel thread for something, in that case you can see it with top. For memory usage, you can monitor /proc/slabinfo and see if anything is growing every time you access your driver. Another option is to enable CONFIG_DEBUG_KMEMLEAK, which will try and detect real leaks for you. cheers
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev