2 * Licensed to the .NET Foundation under one or more agreements.
3 * The .NET Foundation licenses this file to you under the MIT license.
4 * See the LICENSE file in the project root for more information.
8 * To #include this file, #define the following macros first:
10 * MONO_PROFILER_EVENT_0(name, type)
11 * MONO_PROFILER_EVENT_1(name, type, arg1_type, arg1_name)
12 * MONO_PROFILER_EVENT_2(name, type, arg1_type, arg1_name, arg2_type, arg2_name)
13 * MONO_PROFILER_EVENT_3(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name)
14 * MONO_PROFILER_EVENT_4(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name)
15 * MONO_PROFILER_EVENT_5(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name, arg5_type, arg5_name)
17 * To add new callbacks to the API, simply add a line in this file and use
18 * MONO_PROFILER_RAISE to raise the event wherever.
20 * If you need more arguments then the current macros provide, add another
21 * macro and update all areas where the macros are used. Remember that this is
22 * a public header and not all users will be defining the newly added macro. So
23 * to prevent errors in existing code, you must add something like this at the
24 * beginning of this file:
26 * #ifndef MONO_PROFILER_EVENT_6
27 * #define MONO_PROFILER_EVENT_6(...) # Do nothing.
31 #ifndef MONO_PROFILER_EVENT_5
32 #define MONO_PROFILER_EVENT_5(...)
35 MONO_PROFILER_EVENT_0(runtime_initialized
, RuntimeInitialized
)
36 MONO_PROFILER_EVENT_0(runtime_shutdown_begin
, RuntimeShutdownBegin
)
37 MONO_PROFILER_EVENT_0(runtime_shutdown_end
, RuntimeShutdownEnd
)
39 MONO_PROFILER_EVENT_1(context_loaded
, ContextLoaded
, MonoAppContext
*, context
)
40 MONO_PROFILER_EVENT_1(context_unloaded
, ContextUnloaded
, MonoAppContext
*, context
)
42 MONO_PROFILER_EVENT_1(domain_loading
, DomainLoading
, MonoDomain
*, domain
)
43 MONO_PROFILER_EVENT_1(domain_loaded
, DomainLoaded
, MonoDomain
*, domain
)
44 MONO_PROFILER_EVENT_1(domain_unloading
, DomainUnloading
, MonoDomain
*, domain
)
45 MONO_PROFILER_EVENT_1(domain_unloaded
, DomainUnloaded
, MonoDomain
*, domain
)
46 MONO_PROFILER_EVENT_2(domain_name
, DomainName
, MonoDomain
*, domain
, const char *, name
)
48 MONO_PROFILER_EVENT_1(jit_begin
, JitBegin
, MonoMethod
*, method
)
49 MONO_PROFILER_EVENT_1(jit_failed
, JitFailed
, MonoMethod
*, method
)
50 MONO_PROFILER_EVENT_2(jit_done
, JitDone
, MonoMethod
*, method
, MonoJitInfo
*, jinfo
)
51 MONO_PROFILER_EVENT_2(jit_chunk_created
, JitChunkCreated
, const mono_byte
*, chunk
, uintptr_t, size
)
52 MONO_PROFILER_EVENT_1(jit_chunk_destroyed
, JitChunkDestroyed
, const mono_byte
*, chunk
)
53 MONO_PROFILER_EVENT_4(jit_code_buffer
, JitCodeBuffer
, const mono_byte
*, buffer
, uint64_t, size
, MonoProfilerCodeBufferType
, type
, const void *, data
)
55 MONO_PROFILER_EVENT_1(class_loading
, ClassLoading
, MonoClass
*, klass
)
56 MONO_PROFILER_EVENT_1(class_failed
, ClassFailed
, MonoClass
*, klass
)
57 MONO_PROFILER_EVENT_1(class_loaded
, ClassLoaded
, MonoClass
*, klass
)
59 MONO_PROFILER_EVENT_1(vtable_loading
, VTableLoading
, MonoVTable
*, vtable
)
60 MONO_PROFILER_EVENT_1(vtable_failed
, VTableFailed
, MonoVTable
*, vtable
)
61 MONO_PROFILER_EVENT_1(vtable_loaded
, VTableLoaded
, MonoVTable
*, vtable
)
63 MONO_PROFILER_EVENT_1(image_loading
, ModuleLoading
, MonoImage
*, image
)
64 MONO_PROFILER_EVENT_1(image_failed
, ModuleFailed
, MonoImage
*, image
)
65 MONO_PROFILER_EVENT_1(image_loaded
, ModuleLoaded
, MonoImage
*, image
)
66 MONO_PROFILER_EVENT_1(image_unloading
, ModuleUnloading
, MonoImage
*, image
)
67 MONO_PROFILER_EVENT_1(image_unloaded
, ModuleUnloaded
, MonoImage
*, image
)
69 MONO_PROFILER_EVENT_1(assembly_loading
, AssemblyLoading
, MonoAssembly
*, assembly
)
70 MONO_PROFILER_EVENT_1(assembly_loaded
, AssemblyLLoaded
, MonoAssembly
*, assembly
)
71 MONO_PROFILER_EVENT_1(assembly_unloading
, AssemblyLUnloading
, MonoAssembly
*, assembly
)
72 MONO_PROFILER_EVENT_1(assembly_unloaded
, AssemblyLUnloaded
, MonoAssembly
*, assembly
)
74 MONO_PROFILER_EVENT_2(method_enter
, MethodEnter
, MonoMethod
*, method
, MonoProfilerCallContext
*, context
)
75 MONO_PROFILER_EVENT_2(method_leave
, MethodLeave
, MonoMethod
*, method
, MonoProfilerCallContext
*, context
)
76 MONO_PROFILER_EVENT_2(method_tail_call
, MethodTailCall
, MonoMethod
*, method
, MonoMethod
*, target
)
77 MONO_PROFILER_EVENT_2(method_exception_leave
, MethodExceptionLeave
, MonoMethod
*, method
, MonoObject
*, exception
)
78 MONO_PROFILER_EVENT_1(method_free
, MethodFree
, MonoMethod
*, method
)
79 MONO_PROFILER_EVENT_1(method_begin_invoke
, MethodBeginInvoke
, MonoMethod
*, method
)
80 MONO_PROFILER_EVENT_1(method_end_invoke
, MethodEndInvoke
, MonoMethod
*, method
)
82 MONO_PROFILER_EVENT_1(exception_throw
, ExceptionThrow
, MonoObject
*, exception
)
83 MONO_PROFILER_EVENT_4(exception_clause
, ExceptionClause
, MonoMethod
*, method
, uint32_t, index
, MonoExceptionEnum
, type
, MonoObject
*, exception
)
85 MONO_PROFILER_EVENT_3(gc_event
, GCEvent2
, MonoProfilerGCEvent
, event
, uint32_t, generation
, mono_bool
, is_serial
)
86 MONO_PROFILER_EVENT_1(gc_allocation
, GCAllocation
, MonoObject
*, object
)
87 MONO_PROFILER_EVENT_2(gc_moves
, GCMoves
, MonoObject
*const *, objects
, uint64_t, count
)
88 MONO_PROFILER_EVENT_1(gc_resize
, GCResize
, uintptr_t, size
)
89 MONO_PROFILER_EVENT_3(gc_handle_created
, GCHandleCreated
, uint32_t, handle
, MonoGCHandleType
, type
, MonoObject
*, object
)
90 MONO_PROFILER_EVENT_2(gc_handle_deleted
, GCHandleDeleted
, uint32_t, handle
, MonoGCHandleType
, type
)
91 MONO_PROFILER_EVENT_0(gc_finalizing
, GCFinalizing
)
92 MONO_PROFILER_EVENT_0(gc_finalized
, GCFinalized
)
93 MONO_PROFILER_EVENT_1(gc_finalizing_object
, GCFinalizingObject
, MonoObject
*, object
)
94 MONO_PROFILER_EVENT_1(gc_finalized_object
, GCFinalizedObject
, MonoObject
*, object
)
95 MONO_PROFILER_EVENT_5(gc_root_register
, RootRegister
, const mono_byte
*, start
, uintptr_t, size
, MonoGCRootSource
, source
, const void *, key
, const char *, name
)
96 MONO_PROFILER_EVENT_1(gc_root_unregister
, RootUnregister
, const mono_byte
*, start
)
97 MONO_PROFILER_EVENT_3(gc_roots
, GCRoots
, uint64_t, count
, const mono_byte
*const *, addresses
, MonoObject
*const *, objects
)
99 MONO_PROFILER_EVENT_1(monitor_contention
, MonitorContention
, MonoObject
*, object
)
100 MONO_PROFILER_EVENT_1(monitor_failed
, MonitorFailed
, MonoObject
*, object
)
101 MONO_PROFILER_EVENT_1(monitor_acquired
, MonitorAcquired
, MonoObject
*, object
)
103 MONO_PROFILER_EVENT_1(thread_started
, ThreadStarted
, uintptr_t, tid
)
104 MONO_PROFILER_EVENT_1(thread_stopping
, ThreadStopping
, uintptr_t, tid
)
105 MONO_PROFILER_EVENT_1(thread_stopped
, ThreadStopped
, uintptr_t, tid
)
106 MONO_PROFILER_EVENT_1(thread_exited
, ThreadExited
, uintptr_t, tid
)
107 MONO_PROFILER_EVENT_2(thread_name
, ThreadName
, uintptr_t, tid
, const char *, name
)
109 MONO_PROFILER_EVENT_2(sample_hit
, SampleHit
, const mono_byte
*, ip
, const void *, context
)