3
0
mirror of https://github.com/hyprwm/Hyprland.git synced 2026-08-18 02:51:23 +00:00

debug-tools: add flame

This commit is contained in:
Vaxry
2026-04-04 13:24:42 +01:00
committed by Vaxry
parent b898fc1c34
commit 43f7f683d0
2 changed files with 24 additions and 0 deletions

4
.gitignore vendored
View File

@ -38,6 +38,8 @@ hyprctl/hw-protocols/*.h*
gmon.out
*.out
*.tar.gz
perf.data
flame.svg
PKGBUILD
@ -48,3 +50,5 @@ example/hyprland.desktop
**/.#*.*
**/#*.*#
debug-tools/flamegraph

20
debug-tools/flamegraph.sh Executable file
View File

@ -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