Skip to content

Commit

Permalink
(TOOLS) valigrind-callgrind.sh use installed gprof2dot
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmoon79 committed Jun 16, 2024
1 parent 7b461a4 commit 7c0f4bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions tools/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# python libraries/programs for a few scripts here in `./tools`

gprof2dot==2024.06.06
logdissect==3.1.1
logmerger==0.8.0
systemd-python==235
Expand Down
16 changes: 7 additions & 9 deletions tools/valgrind-callgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ if [[ ! -x "${PROGRAM}" ]]; then
exit 1
fi

if [[ ! -r gprof2dot.py ]]; then
echo "Unable to find gprof2dot.py" >&2
echo "run:" >&2
echo "wget 'https://raw.githubusercontent.com/jrfonseca/gprof2dot/2024.06.06/gprof2dot.py'" >&2
exit 1
fi

(set -x; uname -a)
(set -x; git log -n1 --format='%h %D')
(set -x; "${PROGRAM}" --version)
Expand All @@ -70,7 +63,12 @@ Compile the latest valgrind:
exit 1
fi
(set -x; "${callgrind}" --version) || true # --version causes process return code 255

(set -x; gprof2dott --help &>/dev/null) || {
echo "gprof2dot not found in PATH" >&2
echo "install:" >&2
echo " pip install -r tools/requirements.txt" >&2
exit 1
}

echo

Expand Down Expand Up @@ -117,7 +115,7 @@ set -x
"${args[@]}" \
>/dev/null

python gprof2dot.py \
gprof2dot \
--format=callgrind \
--output="${OUTDOT}" \
"${OUTOUT}"
Expand Down

0 comments on commit 7c0f4bb

Please sign in to comment.