install
-------

download and apply the kernel patch

# cd /usr/src/linux
# patch -p1 < ~/kmemprof/patch/linux-2.4.20-kmemprof.diff
# make oldconfig

build modules

# cd kmemprof
# make

allocation call-graph profiling
-------------------------------

# cd kmemprof/bin
# ruby kmemprof --load-cgprof
# ruby kmemprof --start
# favorite_benchmark
# ruby kmemprof --stop
# ruby cgprof-analyzer /proc/ruby kmemprof-cgprof/* | less

# ruby cgprof-analyzer --dotty /proc/ruby kmemprof-cgprof/* > cg.dot
# dotty cg.dot
# ruby kmemprof --unload-cgprof

allocation tracing
------------------

# ruby kmemprof --load-trace
# ruby kmemprof --start
# favorite_benchmark
# ruby kmemprof --stop
# ruby trace-analyzer /proc/kmemprof-trace/{logbuf-0,strtab-0} | less
# ruby kmemprof --unload-trace

filtering options
-----------------

# ruby kmemprof --set-frequency 100
# ruby kmemprof --set-filter "filter_pid=`cat /var/run/httpd.pid`"
# ruby kmemprof --set-objfilter blkdev_requests,buffer_head

quit
----

# ruby kmemprof --shutdown

