aprofutil turns an opaque Mono AOT profile into a readable report of its modules, types and methods. This guide gets you from a raw .aotprofile file to a filtered result you can trust, in about fifteen minutes. The examples use aprofutil from Ubuntu's mono-devel package, version 6.8.0.105+dfsg-3.6ubuntu2.
You need a shell, mono-devel, and an AOT profile produced by Mono's AOT profiler. This tool only reads an existing profile: it will not create one, compile an assembly, or touch the running application that produced it.
Checkpoint: by the end you should have either a useful report or a specific reason why the input cannot be read. Keep the original profile untouched while you experiment.
Confirm which executable runs and record the package version. These are read-only checks and need no sudo:
$ command -v aprofutil
/usr/bin/aprofutil
$ dpkg-query -W -f='${Package} ${Version}\n' mono-devel
mono-devel 6.8.0.105+dfsg-3.6ubuntu2
Ask the binary for its own help too:
$ aprofutil --help
Usage: aotprofile-tool.exe OPTIONS* <aotprofile-file>
Processes AOTPROFILE files created by Mono's AOT Profiler
Tip: the installed binary advertises options that are missing from the installed aprofutil(1) manual, including --skip-method, --take-count and --port. This guide sticks to the documented, shared options so the commands match your local manual. When you script this, check both the package version and the local help output.
Set a shell variable to the real profile path. Replace the placeholder rather than using it literally:
$ PROFILE='/path/to/your-aot-profile.aotprofile'
$ test -r "$PROFILE" && echo 'profile is readable'
profile is readable
$ aprofutil --summary "$PROFILE"
Modules: ...
Types: ...
Methods: ...
Exact counts depend on the application. A successful run prints the report and returns status zero, so check that status when scripting it:
$ aprofutil --summary "$PROFILE" > /tmp/aprofutil-summary.txt
$ printf 'exit status: %s\n' "$?"
exit status: 0
Writing into /tmp is optional. The output file is a new report, not a replacement for the profile. Skip sudo unless the profile directory itself denies your account access.
Use one or more display switches to narrow the report:
$ aprofutil --modules "$PROFILE"
$ aprofutil --types "$PROFILE"
$ aprofutil --methods "$PROFILE"
$ aprofutil --all "$PROFILE"
The output is readable text with profile-specific names and counts. For a first pass, use --summary or --modules: method-level output can be large and distracting on a profile from a substantial application.
Short forms combine. The manual's own example uses -sd for a summary plus module listing:
$ aprofutil -sd "$PROFILE"
Modules:
...
Summary:
Modules: ...
Types: ...
Methods: ...
Filters take regular expressions. Start with a literal name, then broaden the expression only if the result is too narrow. That keeps a long report manageable:
$ aprofutil --filter-module='System\.Core' --all "$PROFILE"
$ aprofutil --filter-type='Java\.Interop\.Runtime' --summary --all "$PROFILE"
$ aprofutil --filter-method='IsGCUserPeer' --methods "$PROFILE"
Shell quoting matters here: single quotes keep the backslash and other regular-expression characters away from shell expansion. The filter is matched against the relevant profile names, so spelling and punctuation must match what the profile actually contains.
Tip: a filtered summary gives the selected count followed by the total, such as Types: 1 (of 907). An empty or unexpectedly small result usually means a pattern problem, not proof the profile lacks data. Display modules or types without a filter first, copy an exact name, then try again.
Use -o or --output to write profile content to a file:
$ REPORT='/tmp/aprofutil-filtered.txt'
$ aprofutil --filter-type='YOUR\.TYPE\.NAME' --all --output="$REPORT" "$PROFILE"
$ test -s "$REPORT" && echo "report written: $REPORT"
report written: /tmp/aprofutil-filtered.txt
The output path is a normal file path, and the command can quietly replace whatever already sits there. Choose a new, clearly named destination while investigating, or preserve an old report first:
$ cp --preserve=all /tmp/aprofutil-filtered.txt /tmp/aprofutil-filtered.txt.previous
$ aprofutil --summary --output=/tmp/aprofutil-filtered.txt "$PROFILE"
Warning: do not delete the original profile to tidy up. If you created a report under /tmp, remove only that known report after checking it, and remember that deletion is irreversible. No elevated privileges are needed for files you own.
An empty file is not an AOT profile. The installed program exits non-zero and reports an input-size error:
$ : > /tmp/empty.aotprofile
$ aprofutil --summary /tmp/empty.aotprofile
Unhandled Exception:
System.IO.IOException: Input file is too small.
$ printf 'exit status: %s\n' "$?"
exit status: 1
The exact stack trace is version-specific. Treat this as an invalid or truncated input, not a prompt to run the command as root. Check the path and size first:
$ ls -lh "$PROFILE"
$ test -s "$PROFILE" && echo 'profile is non-empty'
Recovery: if the file is non-empty but still rejected, get the profile again from the process or build workflow that created it. Do not edit binary profile data with a text editor. A non-zero status can also mean the output path is not writable or the chosen filter is invalid, so preserve the error text while troubleshooting.
aprofutil binary and mono-devel version.