FreeBSD kernel lock profiling

I recently discovered that FreeBSD has a neat way of doing kernel lock profiling. To use it you just need to add a single line in your kernel config script:


Rebuild, install and reboot your new kernel. To check if it's working call sysctl debug.lock, you should see some options. Now try:

> sysctl

> (launch a program or just wait a few seconds)

> sysctl

> sysctl

The stats include: file:line and lock type, maximum time held, total time held, total wait time, count, average time held, average wait time, contention while holding, contention while locking

Posted by Daniel Tralamazza on Monday 19 January 2009 at 15:38