[profiler] More options reworking/refactoring.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Thu, 13 Jul 2017 11:37:27 +0000 (13:37 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Fri, 14 Jul 2017 18:23:32 +0000 (20:23 +0200)
commit92ac04725e0ef294e92a05f3072da0b18ffe2962
tree2280e910df7d5b806cc342ea2801160d442ed435
parented7352ea6385c56ae798196114da5af2dead624d
[profiler] More options reworking/refactoring.

This commit does a few different things.

First, metadata event options have been removed. We now always emit these
events. This is done because they contain important data that must be present
in order for dynamic event mask changes at runtime to result in useful data.
Also, almost all uses of the profiler require this data to be present, so
letting it be turned arguably just adds confusion for users.

Second, the PROFLOG_*_FEATURE flags have been removed. These made the code a
bit confusing because it was unclear whether code in log.c should be checking
the PROFLOG_*_FEATURE flag or the PROFLOG_*_EVENTS flag for a particular kind
of event. For heapshot in particular, the heapshot mode is now a separate enum
configuration variable. For enter/leave and coverage, switching those on and
off in the log profiler at runtime is not something we want to support at this
time.

As a result of the above change, some options are now processed manually rather
than being part of the event_list array.

Third, the way we turn off GC root events when needed is now by setting the
callback to NULL. This is more efficient as it signals to the runtime that it
doesn't have to gather root information. This will especially matter later on
when the profiler root info revamp lands, as it collects a lot more data than
we do today. Also, GC roots are no longer gathered unless we're doing a
heapshot.

Fourth, the profiler now always starts the sampling thread in idle mode. This
is so that we can reconfigure and enable/disable it at runtime as needed.

Finally, the alloc alias option now includes GC move events, and GC resize
events are only emitted if the gc option is given.
mono/profiler/log-args.c
mono/profiler/log.c
mono/profiler/log.h