forked from acmel/dwarves
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.ctracer
57 lines (35 loc) · 1.59 KB
/
README.ctracer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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.