dwarves/README.ctracer

58 lines
1.6 KiB
Plaintext
Raw Normal View History

Basic instructions to use ctracer:
1. Install dwarves, if you are not that excited about building it I'm
keeping rpms for Fedora Core 6 here:
http://oops.ghostprotocols.net:81/acme/dwarves/rpm/
The .src.rpm is there in case you want to rebuild it for another
rpm based distro.
Since fedora 9 you just have to run:
yum install dwarves
2. build the kernel with CONFIG_DEBUG_INFO=y, i.e. gcc -g, that will
insert the DWARF info needed by all the pahole tools, ctracer, etc, or
just install the kernel-debuginfo rpm package on FC6, other distros
have it with a different name, its just the kernel built with debug
info.
3. Assuming you installed the kernel-debuginfo package, to run ctracer
on your workstation, just do the following steps:
mkdir foo
cd foo
ln -s /usr/share/dwarves/runtime/* .
make CLASS=sock # to trace struct sock methods, this one is safe, try others
# and tell me your horror (or success :-) ) story.
(kbuild gurus, send suggestions to simplify this procedure! :-) )
4. load the resulting module:
insmod ctracer.ko
dmesg will show how many probes were successfully installed
5. Do some related activity (ssh, in the above example should do)
6. Make sure debugfs is mounted
[root@filo ~]# mount -t debugfs none_debugfs /sys/kernel/debug/
7. Get the log:
cat /sys/kernel/debug/ctracer0 > /tmp/ctracer.log
8. Generate the callgraph!
make callgraph
9. rmmod ctracer
Change the shipped Makefile accordingly to build a module for qemu or another test
machine.
The relay transport is mostly ready and will be included in the upcoming changesets.