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:
4
.gitignore
vendored
4
.gitignore
vendored
@ -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
20
debug-tools/flamegraph.sh
Executable 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
|
||||
Reference in New Issue
Block a user