mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
parent
b91c90dc34
commit
b80abe9a54
4 changed files with 51 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
target
|
target
|
||||||
|
FlameGraph
|
||||||
|
|
20
scripts/README.md
Normal file
20
scripts/README.md
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
scripts
|
||||||
|
=======
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
scripts/ubuntu-install-perf.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
The second script will run Alacritty while recording call stacks. After the
|
||||||
|
Alacritty process exits, a flamegraph will be generated and its URI printed.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
scripts/create-flamegraph.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
**NOTE**: The _create-flamegraph.sh_ script is intended to be run from the
|
||||||
|
alacritty project root.
|
19
scripts/create-flamegraph.sh
Executable file
19
scripts/create-flamegraph.sh
Executable file
|
@ -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"
|
11
scripts/ubuntu-install-perf.sh
Executable file
11
scripts/ubuntu-install-perf.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/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 \
|
||||||
|
linux-tools-$UNAME
|
Loading…
Reference in a new issue