Commit b80abe9a authored by Joe Wilm's avatar Joe Wilm

Add script for creating flamegraph with perf

Resolves #8
parent b91c90dc
There are two scripts included at the time this README was written, and they
both support flamegraph generation on Ubuntu. The first script installs the
required dependencies:
The second script will run Alacritty while recording call stacks. After the
Alacritty process exits, a flamegraph will be generated and its URI printed.
**NOTE**: The _create-flamegraph.sh_ script is intended to be run from the
alacritty project root.
#!/usr/bin/env bash
# Make sure FlameGraph scripts are available
if [ ! -e ./FlameGraph ]
git clone
if [ ! -e target/release/alacritty ]
echo "Must build alacritty first: cargo build --release"
exit 1
# This will block while alacritty runs
perf record -g -F 99 target/release/alacritty
perf script | ./FlameGraph/ | ./FlameGraph/ --width 1920 > alacritty.svg
echo "Flame graph created at file://$(pwd)/alacritty.svg"
#!/usr/bin/env bash
set -v
# Get kernel info
UNAME=$(uname -r)
# Install linux tools for the perf binary
sudo apt-get install -y \
linux-tools-common \
linux-tools-generic \
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment