Skip to content

Commit

Permalink
build: added perf.sh to generate perf.data and flamecharts
Browse files Browse the repository at this point in the history
  • Loading branch information
krypt0nn committed Jan 10, 2024
1 parent 597035b commit c32cd2b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/flamegraph.svg
/perf.data
/perf.data.old
/perf-output.data
/profile.json
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ strip = true
lto = true
opt-level = "s"

[profile.profiling]
inherits = "release"
strip = false
debug = true

[build-dependencies]
glib-build-tools = "0.18.0"

Expand Down
11 changes: 11 additions & 0 deletions perf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/env bash

# Build the app in profiling mode
cargo build --profile profiling

# Generate perf.data and flamechart for the app
# cargo install flamegraph
flamegraph --flamechart -F 2000 -- ./target/profiling/anime-games-launcher

# Format perf.data to the profiler.firefox.com compatible format
perf script -F +pid > perf-output.data

0 comments on commit c32cd2b

Please sign in to comment.