[aot] Rewrite the AOT profiler. (#4176)
* [aot] Rewrite the AOT profiler.
The AOT profiler is used to collect the methods/instances used at runtime.
Usage:
* mono --profile=aot:output=out.aotprof <app>
* mono --aot=profile=out.aotprof <assembly>
The first command will run <app>, collecting the list of methods it uses into the out.aotprof file.
The second command passes the profile file to the AOT compiler to have it generate additional generic instances.
* [docs] Add a section for AOT profiling to the mono(1) man page.
* [build] Collect AOT profile info from building mscorlib in the build profile, and use it when aot-ing the csc assemblies.
* [runtime] Add missing mono-profiler-aot.h file.
* [runtime] Tidy up usage of MONO_PROFILER_API.
* [aot] Improve error handling in the aot profiler.
* [aot] Improve error handling, add more diagnostics.