This repository has been archived by the owner on Oct 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathwatch-jack.sh
executable file
·64 lines (56 loc) · 1.7 KB
/
watch-jack.sh
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
#!/bin/sh
#
# Copyright (C) 2015 Julien Desfossez <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; only
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
CONF="/sys/kernel/debug/latency/rt"
destroy()
{
lttng destroy
exit 0
}
if [ "$(id -u)" != "0" ]; then
echo "Need to be root"
exit 1
fi
trap "destroy" SIGINT SIGTERM SIGPIPE SIGHUP
chrt -r -p 99 $$
chrt -r -p 99 "$(pgrep lttng-sessiond)"
chrt -r -p 99 "$(pgrep lttng-consumerd)"
rm -rf /tmp/debugrt
pgrep -u root lttng-sessiond || lttng-sessiond -d
lttng create --snapshot -o /tmp/debugrt
lttng enable-channel -k bla --subbuf-size 2M
lttng enable-event -k -a -c bla
lttng enable-event -u -a
lttng start
echo 25000000 > $CONF/threshold
echo 0 > $CONF/filters/timer_tracing
echo 1 > $CONF/filters/irq_tracing
echo -1 > $CONF/filters/irq_filter
echo -1 > $CONF/filters/softirq_filter
echo 1 > $CONF/filters/enter_userspace
echo 0 > $CONF/filters/switch_out_blocked
echo jackd > $CONF/filters/procname
while true; do
cat $CONF/wakeup_pipe
lttng stop
lttng snapshot record
if test "$SUDO_USER" != ""; then
chown -R "$SUDO_USER" /tmp/debugrt
fi
lttng start
done