Files
invoke-ai--invokeai/scripts/generate_profile_graphs.sh
wehub-resource-sync cddb07a176
build container image / cpu (push) Waiting to run
build container image / cuda (push) Waiting to run
build container image / rocm (push) Waiting to run
docs / deploy (push) Blocked by required conditions
docs / changes (push) Waiting to run
docs / check-and-build (push) Blocked by required conditions
frontend tests / frontend-tests (push) Waiting to run
openapi checks / openapi-checks (push) Waiting to run
python tests / py3.12: macos-default (push) Waiting to run
python tests / py3.11: windows-cpu (push) Waiting to run
python tests / py3.12: windows-cpu (push) Waiting to run
python tests / py3.11: linux-cpu (push) Waiting to run
python tests / py3.12: linux-cpu (push) Waiting to run
typegen checks / typegen-checks (push) Waiting to run
uv lock checks / uv-lock-checks (push) Waiting to run
frontend checks / frontend-checks (push) Waiting to run
lfs checks / lfs-check (push) Waiting to run
python checks / python-checks (push) Waiting to run
python tests / py3.11: macos-default (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:22:06 +08:00

28 lines
894 B
Bash
Executable File

#!/bin/bash
# Accepts a path to a directory containing .prof files and generates a graphs
# for each of them. The default output format is pdf, but can be changed by
# providing a second argument.
# Usage: ./generate_profile_graphs.sh <path_to_profiles> <type>
# <path_to_profiles> is the path to the directory containing the .prof files
# <type> is the type of graph to generate. Defaults to 'pdf' if not provided.
# Valid types are: 'svg', 'png' and 'pdf'.
# Requires:
# - graphviz: https://graphviz.org/download/
# - gprof2dot: https://github.com/jrfonseca/gprof2dot
if [ -z "$1" ]; then
echo "Missing path to profiles directory"
exit 1
fi
type=${2:-pdf}
for file in $1/*.prof; do
base_name=$(basename "$file" .prof)
gprof2dot -f pstats "$file" | dot -T$type -Glabel="Session ID ${base_name}" -Glabelloc="t" -o "$1/$base_name.$type"
echo "Generated $1/$base_name.$type"
done