How to profile

While talking about something else, Hiten Pandya mentioned the steps necessary to turn on profiling, to help catch bugs. I’ve saved the steps here, in case they are useful…

(Following text is all from Hiten Pandya.)


# cd /sys/i386/conf/ && config -g -p TINDERBOX
# cd /sys/compile/TINDERBOX && make depend && make

... load profile enabled kernel ...

# kgmon -b
## try the compile until CPU reaches 100%
# kgmon -h
## gprof / gmon.out

“And then send the resulting file from gprof. ”