B U I L D I N G A N D
U S I N G A P R O F I L I N G K E R N E L
These instructions are based on a posting to the NetBSD-current mailing list by Jonathan Stone <jonathan@DSG.Stanford.EDU>, on Fri, 13 Jun 1997.
This document assumes that the config file for your current kernel is /sys/i386/conf/MYNAME, and the config file for your new kernel is MYNAME.PROF in the same directory. It also assumes that you are in /sys/i386/conf. Change things appropriately for your config file name and architecture.
cp MYNAME MYNAME.PROF
include "arch/i386/conf/MYNAME" # Always include profiling support; does not need 'config -p'. makeoptions PROF="-pg" options GPROF
/netbsd.prof
.
kgmon -N /netbsd.prof -r -b
, and execute the
code you need to profile. Ideally you'd like it to execute for
quite some time, say a half hour or so.
kgmon -N /netbsd.prof
-p
.
gprof /netbsd.prof gmon.out
.