blob: 5a52bee235b26e391ef171f261b62ddb5699eb7a (
plain)
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
|
#!/bin/bash
USERID=`id -u`
TSTAMP=`date +%Y%m%d-%H%M%S`
UDIR=$HOME
CURDIR=`pwd`
PERF_VERSION="$(uname -r)"
PERF_VERSION="${PERF_VERSION%%-*}"
case "$PERF_VERSION" in
*.*.*)
PERF_VERSION="${PERF_VERSION%.*}"
;;
esac
sudo modprobe usbmon
tshark -F pcap -i eth0 -w ~/lttng-traces/network-$TSTAMP.pcap &
#sudo and -F pcap is not working atm sudo is needed for usbmon
#sudo tshark -F pcap -i usbmon0 -w ~/lttng-traces/usb-$TSTAMP.pcap &
lttng create lttng-ust
lttng list --userspace
lttng enable-event --userspace hello_world:my_first_tracepoint
lttng start
mkdir -p uprobe-traces
cd uprobe-traces
sudo perf probe -x $CURDIR/hellolttngust MYEVENT=$CURDIR/hellolttngust.c:8
sudo perf probe -x $CURDIR/hellolttngust EVNAME=$CURDIR/hellolttngust.c:35
sudo perf record -e probe_hellolttngust:MYEVENT -e probe_hellolttngust:EVNAME &
cd -
mkdir -p kernel-traces
cd kernel-traces
sudo perf record -e sched:sched_switch &
cd -
./hellolttngust huhu haha hihi
sudo killall perf_$PERF_VERSION
killall tshark
#sudo killall tshark
lttng stop
lttng destroy
echo wait for writing perf data
wait
cd uprobe-traces
sudo perf data convert --to-ctf=$UDIR/lttng-traces/perf-uprobes-$TSTAMP
sudo perf probe -d probe_hellolttngust:MYEVENT
sudo perf probe -d probe_hellolttngust:EVNAME
cd -
cd kernel-traces
sudo perf data convert --to-ctf=$UDIR/lttng-traces/perf-kernel-$TSTAMP
cd -
sudo chown -R $USERID $UDIR/lttng-traces/*
|