sudo apt install mono-profiler mono-utils
Head to the Steam application directory
cd path/to/Unrailed
Game is started by shell script linux/UnrailedGame
the command can
then be tweaked to add the host Mono and pass extra parameters to mono
MONO_CFG_DIR="$PWD/linux/lib" \
MONO_PATH="/usr/lib/mono/4.5:$PWD/linux/lib" \
LD_LIBRARY_PATH="$PWD/linux/so:$LD_LIBRARY_PATH" \
mono \
--config ./linux/config.mono.linux \
--profile=log:report \
UnrailedGame.exe
And you get a profiling report!
Pass --profile=log
will saves the profiling data to output.mlpd
which can be inspected with mprof-report
.
Based on https://www.mono-project.com/docs/debug+profile/profile/profiler/ that is the equivalent of
--profile=log:calls,alloc,output=output.mlpd,maxframes=8,calldepth=100
But looks like calls
are not the default in the version on Debian Bullseye,
so gotta be added explicitly:
MONO_CFG_DIR="$PWD/linux/lib" MONO_PATH="/usr/lib/mono/4.5:$PWD/linux/lib" \
LD_LIBRARY_PATH="$PWD/linux/so:$LD_LIBRARY_PATH" \
mono --config ./linux/config.mono.linux \
'--profile=log:calls,maxframes=8,calldepth=100' UnrailedGame.exe