Just for completeness -- Linux already had a way to profile latencies
since quite some time. It's little known unfortunately and doesn't
work for modules since it's a special mode in the old non modular kernel
profiler.
You enable CONFIG_SCHEDSTATS and boot with profile=sleep and then you can
use the readprofile command to read the data. Information can be reset with
echo > /proc/profile
There's also a profile=sched to profile the scheduler which works even
without CONFIG_SCHEDSTATS
Latencytop will be probably a little more user friendly though.
-Andi
--