1 | #!/usr/bin/env bash
|
2 | #
|
3 | # Usage:
|
4 | # ./rr.sh <function name>
|
5 |
|
6 | set -o nounset
|
7 | set -o pipefail
|
8 | set -o errexit
|
9 |
|
10 | download() {
|
11 | wget --directory _deps \
|
12 | https://github.com/mozilla/rr/releases/download/5.3.0/rr-5.3.0-Linux-$(uname -m).deb
|
13 | }
|
14 |
|
15 | install() {
|
16 | sudo dpkg -i _deps/rr-5.3.0-Linux-$(uname -m).deb
|
17 | }
|
18 |
|
19 | demo() {
|
20 | rr record _bin/oils-for-unix.dbg -c 'x=Y; echo "_$x"'
|
21 | }
|
22 |
|
23 | # rr needs /proc/sys/kernel/perf_event_paranoid <= 1, but it is 3.
|
24 |
|
25 | # https://github.com/mozilla/rr/wiki/Building-And-Installing#os-configuration
|
26 |
|
27 | show() {
|
28 | cat /proc/sys/kernel/perf_event_paranoid
|
29 | }
|
30 |
|
31 | allow-perf-events() {
|
32 | sudo sysctl kernel.perf_event_paranoid=1
|
33 | }
|
34 |
|
35 | "$@"
|