/
README
125 lines (80 loc) · 4.33 KB
/
README
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
Notes on using the sa-systemtap layer
This repository contains a Yocto Project layer which provides a staging area
for systemtap related patches that are currently in the process ofbeing pushed
to their various upstream projects. Please note that any commits to this
repository should also be pushed up to their respective project.
This layer may be used on top of Yocto/Poky or MEL5. At this time the layer
has only been tested on the Beagleboard-XM.
Using this layer with Yocto/Poky:
============================
1. Clone the poky tree, and checkout the 1.2_M3.rc1 tag. Please note that
older versions may not work due to missing systemtap metadata. Newer
versions are untested.
git clone git://git.yoctoproject.org/poky
cd poky
git checkout -b 1.2_M3.rc1 1.2_M3.rc1
2. Source the OE configure script:
. ./oe-init-build-env
3. Modify conf/local.conf for your particular environment. Uncomment the line
"#MACHINE ?= "beagleboard" and add the following line to the end of the
file:
IMAGE_INSTALL_append = " systemtap systemtap-uprobes dropbear"
Note that the minimal Poky image does not contain a SSH server by default.
Here we are adding the dropbear package to provide SSH access. Make any
other adjustments to the file as necessary for your configuration.
4. In conf/bblayers.conf add the path to this repository in the BBLAYERS
variable. E.g.:
BBLAYERS ?= " \
/path/to/sa-systemtap \
/path/to/poky/meta \
/path/to/poky/meta-yocto \
"
5. Build the minimal image
bitbake core-image-minimal
The resulting images should now contain the patches in the sa-systemtap layer.
Using this layer with MEL5:
===========================
1. Follow the guide posted here to configure MEL:
http://confluence.alm.mentorg.com:8090/display/MEL/Getting+Started
Be sure to modify the create-config.py command line to build the beagleboard
machine.
2. Add the following line to conf/local.conf:
IMAGE_INSTALL_append = " systemtap systemtap-uprobes"
Note that the MEL devel-image contains openssh as the SSH server. Therefore,
it is unnecessary to supply an SSH package here. Make any
other adjustments to the file as necessary for your configuration.
3. In conf/bblayers.conf add the path to this repository in the BBLAYERS
variable. E.g.:
BBLAYERS = '/path/to/sa-systemtap ${OEDIR}/sb-core ${OEDIR}/meta-ti ${OEDIR}/oe-core/meta ${OEDIR}/meta-yocto'
4. Build the devel image:
bitbake devel-image
The resulting images should now contain the patches in the sa-systemtap layer.
Kernel configuration:
=======================
The following options should be enabled in your kernel for proper
systemtap operation:
* CONFIG_RELAY
* CONFIG_DEBUG_FS
* CONFIG_DEBUG_INFO
* CONFIG_KPROBES
* CONFIG_PROFILING
* CONFIG_TRACEPOINT
* CONFIG_UTRACE
Please ensure that these are enabled before compiling the probes.
Compiling and running systemtap probes:
=======================================
1. Note the location of your Poky or MEL build output directory, hereafter
referred to as <build>. For Poky <build> will be /path/to/poky/build/tmp.
For MEL, <build> will be /path/to/mel/build_beagleboard_debug.
2. Copy the vmlinux file into the kernel headers directory in the OE sysroot.
cp <build>/work/beagleboard-poky-linux-gnueabi/linux-yocto-3.0.22+git1+808b49474268040ab27c8ee687b60807a11547b4_1+368e38c673ffac8b37fc2a2d4c1e4a1e6f8abf19-r3/linux-beagleboard-standard-build/vmlinux <build>/sysroots/beagleboard/kernel/
3. If compiling a userspace probe, copy any relevant binary files (with debug
symbols enabled) into the sysroot. The destination must match the actual
filesystem on the target. For example, if the binary to be debugged is
located on the target at /home/root/foo, then this file must be copied to
<build>/sysroots/beagleboard/home/root/foo on the target.
4. Compile the probe using the following command:
<build>/sysroots/i686-linux/usr/bin/stap -a arm -B CROSS_COMPILE=/path/to/codebench/bin/arm-none-linux-gnueabi- -r <build>/sysroots/beagleboard/kernel/ -m <probe_name> /path/to/probe_name.stp --sysroot=<build>/sysroots/beagleboard/ <additional parameters as specified by the probe>
5. Copy the resulting .ko file to the target.
6. Run the probe. On the target, execute:
staprun -u <probe_name>.ko <additional parameters as specified by the probe>