OILS / devtools / rr.sh View on Github | oilshell.org

35 lines, 19 significant
1#!/usr/bin/env bash
2#
3# Usage:
4# ./rr.sh <function name>
5
6set -o nounset
7set -o pipefail
8set -o errexit
9
10download() {
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
15install() {
16 sudo dpkg -i _deps/rr-5.3.0-Linux-$(uname -m).deb
17}
18
19demo() {
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
27show() {
28 cat /proc/sys/kernel/perf_event_paranoid
29}
30
31allow-perf-events() {
32 sudo sysctl kernel.perf_event_paranoid=1
33}
34
35"$@"