diff options
| author | Vaxry <vaxry@vaxry.net> | 2026-04-04 13:24:42 +0100 |
|---|---|---|
| committer | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-04-04 08:50:36 -0400 |
| commit | 43f7f683d0ac667f2a5273f5e9a3ec0fc0d999e1 (patch) | |
| tree | 180ca31b36fc568a0a23b1580c09cfc44d7cb8f6 /debug-tools | |
| parent | b898fc1c34d830aac77ac1e5c0c3714c07949889 (diff) | |
debug-tools: add flame
Diffstat (limited to 'debug-tools')
| -rwxr-xr-x | debug-tools/flamegraph.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/debug-tools/flamegraph.sh b/debug-tools/flamegraph.sh new file mode 100755 index 00000000..73d54b4b --- /dev/null +++ b/debug-tools/flamegraph.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +FLAMEGRAPH_DIR="$SCRIPT_DIR/flamegraph" + +if [ ! -d "$FLAMEGRAPH_DIR" ]; then + echo "Cloning FlameGraph tools..." + git clone https://github.com/brendangregg/FlameGraph "$FLAMEGRAPH_DIR" +fi + +if [ ! -f perf.data ]; then + echo "No perf.data found in current directory." + echo "Run Hyprland under perf first:" + echo " perf record -F 99 -g -- ./build/Hyprland" + exit 1 +fi + +echo "Generating flame graph..." +perf script | "$FLAMEGRAPH_DIR/stackcollapse-perf.pl" | "$FLAMEGRAPH_DIR/flamegraph.pl" > flame.svg +xdg-open flame.svg |
