Skip to content

Commit be6ec3b

Browse files
committed
valgrind massif report
1 parent b67f20d commit be6ec3b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

valgrind.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,20 @@ then
6161
log_cmd="logfile $logfile"
6262
fi
6363

64+
massif_logpath="logs/massif_${COMMIT_HASH:-null}_$(date '+%F_%H-%M')"
65+
66+
# traditionally massif also includes the pid with %p placeholder
67+
# but then it becomes tricky for us to log the logpath
68+
# because getting the pid only works at runtime
69+
# we can not use $$ because its a wrapped launcher
70+
# there should probably be a proper launch_cmd() helper
71+
# that can pritty print args and handle pid and exit codes
72+
# massif_logpath="${massif_logpath}.%p"
73+
6474
read -rd '' run_cmd << EOF
6575
$CFG_ENV_RUNTIME valgrind \
6676
--tool=massif \
77+
--massif-out-file=$massif_logpath \
6778
./$CFG_BIN -f autoexec.cfg "$log_cmd;#sid:$SERVER_UUID:valgrind.sh"
6879
EOF
6980

@@ -83,4 +94,9 @@ if [ "$git_patches" != "" ]
8394
then
8495
log "applied patches: $git_patches"
8596
fi
97+
log "created massif report at $massif_logpath"
98+
log "you can inspect it using this command:"
99+
echo ""
100+
echo " $(tput bold)ms_print $massif_logpath$(tput sgr0)"
101+
echo ""
86102

0 commit comments

Comments
 (0)