#
# LIMITATION: nanosecond accuracy timings on x86 CPUs works only if the
#             CPU has the rtdsc instruction.
#             if you have another x86 CPU, undef the HAVE_RTDSC define in
#	      include/asm/profiler.h.
# 	      See the 'tsc' flag in the /proc/cpuinfo flags field if
#	      unsure.
#
# Alpha CPU support is not yet tested.
# Intel SMP is tested
#
# IMPORTANT: install the patch before compiling ktrace! It needs some
#            include files


# to get the patch running, get a 2.1.48 kernel, plus do the following:

cd /usr/src

# linux dir is now one cd away

patch -p0  < patch-ktrace-2.1.48

cd linux

make menuconfig

# now you turn on all the new options in the Kernel Hacking
# section.

make dep ; make clean ; make zImage

# boot into the new kernel. It should boot cleanly, with no crashes
# and no wierdnesses. It should be somewhat slower than the unpatched
# kernel. Check out /proc/trace, if it exists then you can go on to
# to the user-space part:

# the user-space tools part:

cd ktrace

tar xzvf ktrace.tar.gz

cd ktrace-2.1.48

make

cp /usr/src/linux/System.map .

# now, to get the current trace on a 166 MHz CPU:

ktrace --cpu 166 > output.txt

you should get something like this in output.txt:

MHZ: 166.
read 4420 lines from System.map.
calibration done, estimated measurement latency: 0.34 microseconds.

c01299ca  put_unused_buffer_head +<e/5c> (0.90)
c011232b  wake_up +<13/f0> (1.48)
c0129a26  get_more_buffer_heads +<e/7c> (0.61)
c012880f  get_hash_table +<13/c0> (1.34)
c01296ca  __brelse +<e/54> (97.15)
c0129345  set_writetime +<d/50> (0.11)
c0129398  refile_buffer +<10/334> (0.36)
[...]

have fun, mail mingo@pc5829.hil.siemens.at if problems.

