aboutsummaryrefslogtreecommitdiff
path: root/scripts/create-flamegraph.sh
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-10-08 21:30:21 -0700
committerJoe Wilm <joe@jwilm.com>2016-10-08 21:30:21 -0700
commitb80abe9a54acaea65c5ed4e676a9fbc8e211fd40 (patch)
tree3f3080db9549194652012001c36ee4721098bed1 /scripts/create-flamegraph.sh
parentb91c90dc34cfb2a1381f3bc3da85a7c223ac480f (diff)
downloadalacritty-b80abe9a54acaea65c5ed4e676a9fbc8e211fd40.tar.gz
alacritty-b80abe9a54acaea65c5ed4e676a9fbc8e211fd40.zip
Add script for creating flamegraph with perf
Resolves #8
Diffstat (limited to 'scripts/create-flamegraph.sh')
-rwxr-xr-xscripts/create-flamegraph.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/create-flamegraph.sh b/scripts/create-flamegraph.sh
new file mode 100755
index 00000000..8c03aa28
--- /dev/null
+++ b/scripts/create-flamegraph.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+# Make sure FlameGraph scripts are available
+if [ ! -e ./FlameGraph ]
+then
+ git clone https://github.com/BrendanGregg/FlameGraph
+fi
+
+if [ ! -e target/release/alacritty ]
+then
+ echo "Must build alacritty first: cargo build --release"
+ exit 1
+fi
+
+# This will block while alacritty runs
+perf record -g -F 99 target/release/alacritty
+perf script | ./FlameGraph/stackcollapse-perf.pl | ./FlameGraph/flamegraph.pl --width 1920 > alacritty.svg
+
+echo "Flame graph created at file://$(pwd)/alacritty.svg"