Debian Codegraph @

README.ctracer

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