

1) Copy in the new files:
cp trace.s 9/pc/
cp devtrace.c 9/port/

2) Prevent profiling in certain areas.
Around simplecycles() in pc/devarch.c:
#pragma profile 0
(simplecycles)
#pragma profile 1

Do the same for panic() in port/devcons.c

Put a #pragma profile 0 after the includes in port/qlock.c and port/taslock.c

Go through every .s file in pc/ and change the function declarations from:
TEXT splhi(SB), $0
to
TEXT splhi(SB), 1, $0
to prevent profiling.

3) Edit the kernel config file to include devtrace & setup mkfile
In the pccpu config file (or whatever config you want to use), put "trace	trace" under kprof in the "dev" section.

Modify the mkfile in pc/mkfile from
	$LD -o $target -T0xFFFFFFFF80110000 -l $OBJ $CONF.$O $LIB
to
	$LD -p -o $target -T0xFFFFFFFF80110000 -l $OBJ $CONF.$O $LIB

4) Disable profiling in some libc functions
Edit /sys/src/libc/386/getcallerpc.s and tas.s so they look like "TEXT getcallerpc(SB), 1, $0" and "TEXT	_tas(SB), 1, $0". 
Put a #pragma profile 0 at the top of /sys/src/libc/port/lock.c and rebuild libc.

5) Build kernel, profit!
