Profiling Interface

Profiler Operation

The following methods can be used by dynamic profiler methods to monitor different aspects of the program.

A custom profiler will have one public method defined in the shared library which is the entry point that Mono calls at startup, it has the following signature:

	void mono_profiler_startup (const char *desc)
	

Where "desc" is the set of arguments that were passed from the command line. This routine will call mono_profiler_install to activate the profiler and will install one or more filters (one of the various mono_profiler_install_ functions).

In addition, a profiler developer will typically call mono_profiler_set_events to register which kinds of traces should be enabled, these can be an OR-ed combination of the following:

	MONO_PROFILE_NONE
        MONO_PROFILE_APPDOMAIN_EVENTS
        MONO_PROFILE_ASSEMBLY_EVENTS
        MONO_PROFILE_MODULE_EVENTS    
        MONO_PROFILE_CLASS_EVENTS     
        MONO_PROFILE_JIT_COMPILATION  
        MONO_PROFILE_INLINING         
        MONO_PROFILE_EXCEPTIONS       
        MONO_PROFILE_ALLOCATIONS      
        MONO_PROFILE_GC               
        MONO_PROFILE_THREADS          
        MONO_PROFILE_REMOTING         
        MONO_PROFILE_TRANSITIONS      
        MONO_PROFILE_ENTER_LEAVE      
        MONO_PROFILE_COVERAGE         
        MONO_PROFILE_INS_COVERAGE     
        MONO_PROFILE_STATISTICAL      
	

Developers can change the set of monitored events at runtime by calling mono_profiler_set_events.

mono_profiler_install

mono_profiler_install_allocation

mono_profiler_install_appdomain

mono_profiler_install_assembly

mono_profiler_install_class

mono_profiler_install_coverage_filter

mono_profiler_install_enter_leave

mono_profiler_install_jit_compile

mono_profiler_install_module

mono_profiler_install_thread

mono_profiler_install_transition

mono_profiler_install_gc

mono_profiler_install_statistical

mono_profiler_set_events

mono_profiler_get_events

Coverage

To support profiling modules that need to do code coverage analysis, the following routines is provided:

mono_profiler_coverage_get