Skip to content

Commit

Permalink
valgrind-massif.sh NFC fix comment, variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmoon79 committed Jan 27, 2023
1 parent 4d06b72 commit e889722
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tools/valgrind-massif.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# valgrind-callgrind.sh
# valgrind-massif.sh
#
# Run valgrind with heap profiling by Massif, `valgrind --tool=massif`.
# https://valgrind.org/docs/manual/ms-manual.html
Expand Down Expand Up @@ -36,7 +36,8 @@ declare -r bin=./target/release/s4

echo

declare -a files=(
# default s4 arguments
declare -a args=(
./logs/other/tests/gen-1000-3-foobar.log
./logs/other/tests/gen-20-1-⚀⚁⚂⚃⚄⚅.log
./logs/other/tests/gen-99999-1-Motley_Crue.log
Expand All @@ -48,9 +49,10 @@ declare -a files=(
./logs/other/tests/gen-100-10-FOOBAR.log
)
if [[ ${#} -ge 1 ]]; then
files=()
for file_ in "${@}"; do
files+=("${file_}")
# use user-passed arguments
args=()
for arg in "${@}"; do
args+=("${arg}")
done
fi

Expand All @@ -70,7 +72,7 @@ $valgrind \
--massif-out-file="${OUT}" \
-- \
"${bin}" \
"${files[@]}" \
"${args[@]}" \
>/dev/null

exec \
Expand Down

0 comments on commit e889722

Please sign in to comment.