-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Expand file tree
/
Copy pathep-rt-mono.c
More file actions
6869 lines (5812 loc) · 184 KB
/
ep-rt-mono.c
File metadata and controls
6869 lines (5812 loc) · 184 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include <config.h>
#ifdef ENABLE_PERFTRACING
#include <eventpipe/ep-rt-config.h>
#include <eventpipe/ep-types.h>
#include <eventpipe/ep-rt.h>
#include <eventpipe/ep.h>
#include <eventpipe/ep-event.h>
#include <eglib/gmodule.h>
#include <mono/utils/mono-lazy-init.h>
#include <mono/utils/mono-time.h>
#include <mono/utils/mono-proclib.h>
#include <mono/utils/mono-threads.h>
#include <mono/utils/mono-rand.h>
#include <mono/metadata/profiler.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/debug-internals.h>
#include <mono/metadata/gc-internals.h>
#include <mono/metadata/profiler-private.h>
#include <mono/metadata/cil-coff.h>
#include <mono/metadata/mono-endian.h>
#include <mono/mini/mini-runtime.h>
#include <mono/sgen/sgen-conf.h>
#include <mono/sgen/sgen-tagged-pointer.h>
#include "mono/utils/mono-logger-internals.h"
#include <runtime_version.h>
#include <clretwallmain.h>
// EventPipe rt init state.
gboolean _ep_rt_mono_initialized;
// EventPipe TLS key.
MonoNativeTlsKey _ep_rt_mono_thread_holder_tls_id;
// Random byte provider.
gpointer _ep_rt_mono_rand_provider;
// EventPipe global config lock.
ep_rt_spin_lock_handle_t _ep_rt_mono_config_lock = {0};
// OS cmd line.
mono_lazy_init_t _ep_rt_mono_os_cmd_line_init = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED;
char *_ep_rt_mono_os_cmd_line = NULL;
// Managed cmd line.
mono_lazy_init_t _ep_rt_mono_managed_cmd_line_init = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED;
char *_ep_rt_mono_managed_cmd_line = NULL;
// Sample profiler.
static GArray * _ep_rt_mono_sampled_thread_callstacks = NULL;
static uint32_t _ep_rt_mono_max_sampled_thread_count = 32;
// Mono profilers.
static MonoProfilerHandle _ep_rt_default_profiler = NULL;
static MonoProfilerHandle _ep_rt_dotnet_runtime_profiler_provider = NULL;
static MonoProfilerHandle _ep_rt_dotnet_mono_profiler_provider = NULL;
static MonoProfilerHandle _ep_rt_dotnet_mono_profiler_heap_collect_provider = NULL;
static MonoCallSpec _ep_rt_dotnet_mono_profiler_provider_callspec = {0};
// Phantom JIT compile method.
MonoMethod *_ep_rt_mono_runtime_helper_compile_method = NULL;
MonoJitInfo *_ep_rt_mono_runtime_helper_compile_method_jitinfo = NULL;
// Monitor.Enter methods.
MonoMethod *_ep_rt_mono_monitor_enter_method = NULL;
MonoJitInfo *_ep_rt_mono_monitor_enter_method_jitinfo = NULL;
MonoMethod *_ep_rt_mono_monitor_enter_v4_method = NULL;
MonoJitInfo *_ep_rt_mono_monitor_enter_v4_method_jitinfo = NULL;
// Rundown types.
typedef
bool
(*ep_rt_mono_fire_method_rundown_events_func)(
const uint64_t method_id,
const uint64_t module_id,
const uint64_t method_start_address,
const uint32_t method_size,
const uint32_t method_token,
const uint32_t method_flags,
const ep_char8_t *method_namespace,
const ep_char8_t *method_name,
const ep_char8_t *method_signature,
const uint16_t count_of_map_entries,
const uint32_t *il_offsets,
const uint32_t *native_offsets,
bool aot_method,
bool verbose,
void *user_data);
typedef
bool
(*ep_rt_mono_fire_assembly_rundown_events_func)(
const uint64_t domain_id,
const uint64_t assembly_id,
const uint32_t assembly_flags,
const uint32_t binding_id,
const ep_char8_t *assembly_name,
const uint64_t module_id,
const uint32_t module_flags,
const uint32_t reserved_flags,
const ep_char8_t *module_il_path,
const ep_char8_t *module_native_path,
const uint8_t *managed_pdb_signature,
const uint32_t managed_pdb_age,
const ep_char8_t *managed_pdb_build_path,
const uint8_t *native_pdb_signature,
const uint32_t native_pdb_age,
const ep_char8_t *native_pdb_build_path,
void *user_data);
typedef
bool
(*ep_rt_mono_fire_domain_rundown_events_func)(
const uint64_t domain_id,
const uint32_t domain_flags,
const ep_char8_t *domain_name,
const uint32_t domain_index,
void *user_data);
typedef struct _EventPipeFireMethodEventsData {
MonoDomain *domain;
uint8_t *buffer;
size_t buffer_size;
ep_rt_mono_fire_method_rundown_events_func method_events_func;
} EventPipeFireMethodEventsData;
typedef struct _EventPipeStackWalkData {
EventPipeStackContents *stack_contents;
bool top_frame;
bool async_frame;
bool safe_point_frame;
bool runtime_invoke_frame;
} EventPipeStackWalkData;
typedef struct _EventPipeSampleProfileStackWalkData {
EventPipeStackWalkData stack_walk_data;
EventPipeStackContents stack_contents;
uint64_t thread_id;
uintptr_t thread_ip;
uint32_t payload_data;
} EventPipeSampleProfileStackWalkData;
// Rundown flags.
#define RUNTIME_SKU_CORECLR 0x2
#define METHOD_FLAGS_DYNAMIC_METHOD 0x1
#define METHOD_FLAGS_GENERIC_METHOD 0x2
#define METHOD_FLAGS_SHARED_GENERIC_METHOD 0x4
#define METHOD_FLAGS_JITTED_METHOD 0x8
#define METHOD_FLAGS_JITTED_HELPER_METHOD 0x10
#define METHOD_FLAGS_EXTENT_HOT_SECTION 0x00000000
#define METHOD_FLAGS_EXTENT_COLD_SECTION 0x10000000
#define MODULE_FLAGS_NATIVE_MODULE 0x2
#define MODULE_FLAGS_DYNAMIC_MODULE 0x4
#define MODULE_FLAGS_MANIFEST_MODULE 0x8
#define ASSEMBLY_FLAGS_DYNAMIC_ASSEMBLY 0x2
#define ASSEMBLY_FLAGS_NATIVE_ASSEMBLY 0x4
#define ASSEMBLY_FLAGS_COLLECTIBLE_ASSEMBLY 0x8
#define DOMAIN_FLAGS_DEFAULT_DOMAIN 0x1
#define DOMAIN_FLAGS_EXECUTABLE_DOMAIN 0x2
// Event data types.
struct _ModuleEventData {
uint8_t module_il_pdb_signature [EP_GUID_SIZE];
uint8_t module_native_pdb_signature [EP_GUID_SIZE];
uint64_t domain_id;
uint64_t module_id;
uint64_t assembly_id;
const char *module_il_path;
const char *module_il_pdb_path;
const char *module_native_path;
const char *module_native_pdb_path;
uint32_t module_il_pdb_age;
uint32_t module_native_pdb_age;
uint32_t reserved_flags;
uint32_t module_flags;
};
typedef struct _ModuleEventData ModuleEventData;
struct _AssemblyEventData {
uint64_t domain_id;
uint64_t assembly_id;
uint64_t binding_id;
char *assembly_name;
uint32_t assembly_flags;
};
typedef struct _AssemblyEventData AssemblyEventData;
// Event flags.
#define THREAD_FLAGS_GC_SPECIAL 0x00000001
#define THREAD_FLAGS_FINALIZER 0x00000002
#define THREAD_FLAGS_THREADPOOL_WORKER 0x00000004
#define EXCEPTION_THROWN_FLAGS_HAS_INNER 0x1
#define EXCEPTION_THROWN_FLAGS_IS_NESTED 0x2
#define EXCEPTION_THROWN_FLAGS_IS_RETHROWN 0x4
#define EXCEPTION_THROWN_FLAGS_IS_CSE 0x8
#define EXCEPTION_THROWN_FLAGS_IS_CLS_COMPLIANT 0x10
// Provider keyword flags.
#define GC_KEYWORD 0x1
#define GC_HANDLE_KEYWORD 0x2
#define LOADER_KEYWORD 0x8
#define JIT_KEYWORD 0x10
#define APP_DOMAIN_RESOURCE_MANAGEMENT_KEYWORD 0x800
#define CONTENTION_KEYWORD 0x4000
#define EXCEPTION_KEYWORD 0x8000
#define THREADING_KEYWORD 0x10000
#define GC_HEAP_DUMP_KEYWORD 0x100000
#define GC_ALLOCATION_KEYWORD 0x200000
#define GC_MOVES_KEYWORD 0x400000
#define GC_HEAP_COLLECT_KEYWORD 0x800000
#define GC_FINALIZATION_KEYWORD 0x1000000
#define GC_RESIZE_KEYWORD 0x2000000
#define GC_ROOT_KEYWORD 0x4000000
#define GC_HEAP_DUMP_VTABLE_CLASS_REF_KEYWORD 0x8000000
#define METHOD_TRACING_KEYWORD 0x20000000
#define TYPE_DIAGNOSTIC_KEYWORD 0x8000000000
#define TYPE_LOADING_KEYWORD 0x8000000000
#define MONITOR_KEYWORD 0x10000000000
#define METHOD_INSTRUMENTATION_KEYWORD 0x40000000000
// MonoProfiler types.
typedef enum {
MONO_PROFILER_BUFFERED_GC_EVENT = 1,
MONO_PROFILER_BUFFERED_GC_EVENT_RESIZE = 2,
MONO_PROFILER_BUFFERED_GC_EVENT_ROOTS = 3,
MONO_PROFILER_BUFFERED_GC_EVENT_MOVES = 4,
MONO_PROFILER_BUFFERED_GC_EVENT_OBJECT_REF = 5,
MONO_PROFILER_BUFFERED_GC_EVENT_ROOT_REGISTER = 6,
MONO_PROFILER_BUFFERED_GC_EVENT_ROOT_UNREGISTER = 7
} MonoProfilerBufferedGCEventType;
typedef struct _MonoProfilerBufferedGCEvent MonoProfilerBufferedGCEvent;
struct _MonoProfilerBufferedGCEvent {
MonoProfilerBufferedGCEventType type;
uint32_t payload_size;
};
#define MONO_PROFILER_MEM_DEFAULT_BLOCK_SIZE (mono_pagesize() * 16)
#define MONO_PROFILER_MEM_BLOCK_SIZE_INC (mono_pagesize())
typedef struct _MonoProfilerMemBlock MonoProfilerMemBlock;
struct _MonoProfilerMemBlock {
MonoProfilerMemBlock *next;
MonoProfilerMemBlock *prev;
uint8_t *start;
uint32_t alloc_size;
uint32_t size;
uint32_t offset;
uint32_t last_used_offset;
};
// MonoProfiler GC dump.
static volatile MonoProfilerMemBlock *_ep_rt_mono_profiler_mem_blocks = NULL;
static volatile MonoProfilerMemBlock *_ep_rt_mono_profiler_current_mem_block = NULL;
static volatile uint32_t _ep_rt_mono_profiler_gc_heap_collect_requests = 0;
static volatile uint32_t _ep_rt_mono_profiler_gc_heap_collect_in_progress = 0;
static bool _ep_rt_mono_profiler_gc_can_collect_heap = false;
static GSList *_ep_rt_mono_profiler_provider_params = NULL;
static GQueue *_ep_rt_mono_profiler_gc_heap_collect_request_params = NULL;
// Lightweight atomic "exclusive/shared" lock, prevents new fire events to happend while GC is in progress and gives GC ability to wait until all pending fire events are done
// before progressing. State uint32_t is split into two uint16_t, upper uint16_t represent gc in progress state, taken when GC starts, preventing new fire events to execute and lower
// uint16_t keeps number of fire events in flight, (gc_in_progress << 16) | (fire_event_count & 0xFFFF). Spin lock is only taken on slow path to queue up pending shared requests
// while GC is in progress and should very rarely be needed.
typedef uint32_t mono_profiler_gc_state_t;
typedef uint16_t mono_profiler_gc_state_count_t;
#define MONO_PROFILER_GC_STATE_GET_FIRE_EVENT_COUNT(x) ((mono_profiler_gc_state_count_t)((x & 0xFFFF)))
#define MONO_PROFILER_GC_STATE_INC_FIRE_EVENT_COUNT(x) ((mono_profiler_gc_state_t)((mono_profiler_gc_state_t)(x & 0xFFFF0000) | (mono_profiler_gc_state_t)(MONO_PROFILER_GC_STATE_GET_FIRE_EVENT_COUNT(x) + 1)))
#define MONO_PROFILER_GC_STATE_DEC_FIRE_EVENT_COUNT(x) ((mono_profiler_gc_state_t)((mono_profiler_gc_state_t)(x & 0xFFFF0000) | (mono_profiler_gc_state_t)(MONO_PROFILER_GC_STATE_GET_FIRE_EVENT_COUNT(x) - 1)))
#define MONO_PROFILER_GC_STATE_GC_IN_PROGRESS_START(x) ((mono_profiler_gc_state_t)((mono_profiler_gc_state_t)(0xFFFF << 16) | (mono_profiler_gc_state_t)MONO_PROFILER_GC_STATE_GET_FIRE_EVENT_COUNT(x)))
#define MONO_PROFILER_GC_STATE_IS_GC_IN_PROGRESS(x) (((x >> 16) & 0xFFFF) == 0xFFFF)
#define MONO_PROFILER_GC_STATE_GC_IN_PROGRESS_STOP(x) ((mono_profiler_gc_state_t)((mono_profiler_gc_state_t)MONO_PROFILER_GC_STATE_GET_FIRE_EVENT_COUNT(x)))
static volatile mono_profiler_gc_state_t _ep_rt_mono_profiler_gc_state = 0;
static ep_rt_spin_lock_handle_t _ep_rt_mono_profiler_gc_state_lock = {0};
/*
* Forward declares of all static functions.
*/
static
bool
fire_method_rundown_events_func (
const uint64_t method_id,
const uint64_t module_id,
const uint64_t method_start_address,
const uint32_t method_size,
const uint32_t method_token,
const uint32_t method_flags,
const ep_char8_t *method_namespace,
const ep_char8_t *method_name,
const ep_char8_t *method_signature,
const uint16_t count_of_map_entries,
const uint32_t *il_offsets,
const uint32_t *native_offsets,
bool aot_method,
bool verbose,
void *user_data);
static
bool
fire_assembly_rundown_events_func (
const uint64_t domain_id,
const uint64_t assembly_id,
const uint32_t assembly_flags,
const uint32_t binding_id,
const ep_char8_t *assembly_name,
const uint64_t module_id,
const uint32_t module_flags,
const uint32_t reserved_flags,
const ep_char8_t *module_il_path,
const ep_char8_t *module_native_path,
const uint8_t *managed_pdb_signature,
const uint32_t managed_pdb_age,
const ep_char8_t *managed_pdb_build_path,
const uint8_t *native_pdb_signature,
const uint32_t native_pdb_age,
const ep_char8_t *native_pdb_build_path,
void *user_data);
static
bool
fire_domain_rundown_events_func (
const uint64_t domain_id,
const uint32_t domain_flags,
const ep_char8_t *domain_name,
const uint32_t domain_index,
void *user_data);
static
void
eventpipe_fire_method_events (
MonoJitInfo *ji,
MonoMethod *method,
EventPipeFireMethodEventsData *events_data);
static
void
eventpipe_fire_method_events_func (
MonoJitInfo *ji,
void *user_data);
static
void
eventpipe_fire_assembly_events (
MonoDomain *domain,
MonoAssembly *assembly,
ep_rt_mono_fire_assembly_rundown_events_func assembly_events_func);
static
gboolean
eventpipe_execute_rundown (
ep_rt_mono_fire_domain_rundown_events_func domain_events_func,
ep_rt_mono_fire_assembly_rundown_events_func assembly_events_func,
ep_rt_mono_fire_method_rundown_events_func methods_events_func);
static
gboolean
eventpipe_walk_managed_stack_for_thread (
MonoStackFrameInfo *frame,
MonoContext *ctx,
EventPipeStackWalkData *stack_walk_data);
static
gboolean
eventpipe_walk_managed_stack_for_thread_func (
MonoStackFrameInfo *frame,
MonoContext *ctx,
void *data);
static
gboolean
eventpipe_sample_profiler_walk_managed_stack_for_thread_func (
MonoStackFrameInfo *frame,
MonoContext *ctx,
void *data);
static
void
profiler_eventpipe_runtime_initialized (MonoProfiler *prof);
static
void
profiler_eventpipe_thread_exited (
MonoProfiler *prof,
uintptr_t tid);
static
bool
parse_mono_profiler_options (const ep_char8_t *option);
static
bool
get_module_event_data (
MonoImage *image,
ModuleEventData *module_data);
static
bool
get_assembly_event_data (
MonoAssembly *assembly,
AssemblyEventData *assembly_data);
static
uint32_t
get_type_start_id (MonoType *type);
static
gboolean
get_exception_ip_func (
MonoStackFrameInfo *frame,
MonoContext *ctx,
void *data);
static
void
runtime_profiler_jit_begin (
MonoProfiler *prof,
MonoMethod *method);
static
void
runtime_profiler_jit_failed (
MonoProfiler *prof,
MonoMethod *method);
static
void
runtime_profiler_jit_done (
MonoProfiler *prof,
MonoMethod *method,
MonoJitInfo *ji);
static
void
runtime_profiler_image_loaded (
MonoProfiler *prof,
MonoImage *image);
static
void
runtime_profiler_image_unloaded (
MonoProfiler *prof,
MonoImage *image);
static
void
runtime_profiler_assembly_loaded (
MonoProfiler *prof,
MonoAssembly *assembly);
static
void
runtime_profiler_assembly_unloaded (
MonoProfiler *prof,
MonoAssembly *assembly);
static
void
runtime_profiler_thread_started (
MonoProfiler *prof,
uintptr_t tid);
static
void
runtime_profiler_thread_stopped (
MonoProfiler *prof,
uintptr_t tid);
static
void
runtime_profiler_class_loading (
MonoProfiler *prof,
MonoClass *klass);
static
void
runtime_profiler_class_failed (
MonoProfiler *prof,
MonoClass *klass);
static
void
runtime_profiler_class_loaded (
MonoProfiler *prof,
MonoClass *klass);
static
void
runtime_profiler_exception_throw (
MonoProfiler *prof,
MonoObject *exception);
static
void
runtime_profiler_exception_clause (
MonoProfiler *prof,
MonoMethod *method,
uint32_t clause_num,
MonoExceptionEnum clause_type,
MonoObject *exc);
static
void
runtime_profiler_monitor_contention (
MonoProfiler *prof,
MonoObject *obj);
static
void
runtime_profiler_monitor_acquired (
MonoProfiler *prof,
MonoObject *obj);
static
void
runtime_profiler_monitor_failed (
MonoProfiler *prof,
MonoObject *obj);
static
void
runtime_profiler_jit_code_buffer (
MonoProfiler *prof,
const mono_byte *buffer,
uint64_t size,
MonoProfilerCodeBufferType type,
const void *data);
static
void
mono_profiler_get_class_data (
MonoClass *klass,
uint64_t *class_id,
uint64_t *module_id,
ep_char8_t **class_name,
uint32_t *class_generic_type_count,
uint8_t **class_generic_types);
static
void
mono_profiler_fire_event_enter (void);
static
void
mono_profiler_fire_event_exit (void);
static
void
mono_profiler_gc_in_progress_start (void);
static
void
mono_profiler_gc_in_progress_stop (void);
static
MonoProfilerMemBlock *
mono_profiler_mem_block_alloc (uint32_t req_size);
static
uint8_t *
mono_profiler_mem_alloc (uint32_t req_size);
static
void
mono_profiler_mem_block_free_all (void);
static
void
mono_profiler_mem_block_free_all_but_current (void);
static
void
mono_profiler_trigger_heap_collect (MonoProfiler *prof);
static
void
mono_profiler_fire_gc_event_root_register (
uint8_t *data,
uint32_t payload_size);
static
void
mono_profiler_fire_buffered_gc_event_root_register (
MonoProfiler *prof,
const mono_byte *start,
uintptr_t size,
MonoGCRootSource source,
const void * key,
const char * name);
static
void
mono_profiler_fire_gc_event_root_unregister (
uint8_t *data,
uint32_t payload_size);
static
void
mono_profiler_fire_buffered_gc_event_root_unregister (
MonoProfiler *prof,
const mono_byte *start);
static
void
mono_profiler_fire_gc_event (
uint8_t *data,
uint32_t payload_size);
static
void
mono_profiler_fire_buffered_gc_event (
uint8_t gc_event_type,
uint32_t generation);
static
void
mono_profiler_fire_gc_event_resize (
uint8_t *data,
uint32_t payload_size);
static
void
mono_profiler_fire_buffered_gc_event_resize (
MonoProfiler *prof,
uintptr_t size);
static
void
mono_profiler_fire_gc_event_moves (
uint8_t *data,
uint32_t payload_size);
static
void
mono_profiler_fire_buffered_gc_event_moves (
MonoProfiler *prof,
MonoObject *const* objects,
uint64_t count);
static
void
mono_profiler_fire_gc_event_roots (
uint8_t *data,
uint32_t payload_size);
static
void
mono_profiler_fire_buffered_gc_event_roots (
MonoProfiler *prof,
uint64_t count,
const mono_byte *const * addresses,
MonoObject *const * objects);
static
void
mono_profiler_fire_gc_event_heap_dump_object_reference (
uint8_t *data,
uint32_t payload_size,
GHashTable *cache);
static
int
mono_profiler_fire_buffered_gc_event_heap_dump_object_reference (
MonoObject *obj,
MonoClass *klass,
uintptr_t size,
uintptr_t num,
MonoObject **refs,
uintptr_t *offsets,
void *data);
static
void
mono_profiler_fire_buffered_gc_events (
MonoProfilerMemBlock *block,
GHashTable *cache);
static
void
mono_profiler_fire_buffered_gc_events_in_alloc_order (GHashTable *cache);
static
void
mono_profiler_fire_cached_gc_events (GHashTable *cache);
static
void
mono_profiler_app_domain_loading (
MonoProfiler *prof,
MonoDomain *domain);
static
void
mono_profiler_app_domain_loaded (
MonoProfiler *prof,
MonoDomain *domain);
static
void
mono_profiler_app_domain_unloading (
MonoProfiler *prof,
MonoDomain *domain);
static
void
mono_profiler_app_domain_unloaded (
MonoProfiler *prof,
MonoDomain *domain);
static
void
mono_profiler_app_domain_name (
MonoProfiler *prof,
MonoDomain *domain,
const char *name);
static
void
mono_profiler_get_generic_types (
MonoGenericInst *generic_instance,
uint32_t *generic_type_count,
uint8_t **generic_types);
static
void
mono_profiler_get_jit_data (
MonoMethod *method,
uint64_t *method_id,
uint64_t *module_id,
uint32_t *method_token,
uint32_t *method_generic_type_count,
uint8_t **method_generic_types);
static
void
mono_profiler_jit_begin (
MonoProfiler *prof,
MonoMethod *method);
static
void
mono_profiler_jit_failed (
MonoProfiler *prof,
MonoMethod *method);
static
void
mono_profiler_jit_done (
MonoProfiler *prof,
MonoMethod *method,
MonoJitInfo *ji);
static
void
mono_profiler_jit_chunk_created (
MonoProfiler *prof,
const mono_byte *chunk,
uintptr_t size);
static
void
mono_profiler_jit_chunk_destroyed (
MonoProfiler *prof,
const mono_byte *chunk);
static
void
mono_profiler_jit_code_buffer (
MonoProfiler *prof,
const mono_byte *buffer,
uint64_t size,
MonoProfilerCodeBufferType type,
const void *data);
static
void
mono_profiler_class_loading (
MonoProfiler *prof,
MonoClass *klass);
static
void
mono_profiler_class_failed (
MonoProfiler *prof,
MonoClass *klass);
static
void
mono_profiler_class_loaded (
MonoProfiler *prof,
MonoClass *klass);
static
void
mono_profiler_vtable_loading (
MonoProfiler *prof,
MonoVTable *vtable);
static
void
mono_profiler_vtable_failed (
MonoProfiler *prof,
MonoVTable *vtable);
static
void
mono_profiler_vtable_loaded (
MonoProfiler *prof,
MonoVTable *vtable);
static
void
mono_profiler_module_loading (
MonoProfiler *prof,
MonoImage *image);
static
void
mono_profiler_module_failed (
MonoProfiler *prof,
MonoImage *image);
static
void
mono_profiler_module_loaded (
MonoProfiler *prof,
MonoImage *image);
static
void
mono_profiler_module_unloading (
MonoProfiler *prof,
MonoImage *image);
static
void
mono_profiler_module_unloaded (
MonoProfiler *prof,
MonoImage *image);
static
void
mono_profiler_assembly_loading (
MonoProfiler *prof,
MonoAssembly *assembly);
static
void
mono_profiler_assembly_loaded (
MonoProfiler *prof,
MonoAssembly *assembly);
static
void
mono_profiler_assembly_unloading (
MonoProfiler *prof,
MonoAssembly *assembly);
static
void
mono_profiler_assembly_unloaded (
MonoProfiler *prof,
MonoAssembly *assembly);
static
void
mono_profiler_method_enter (
MonoProfiler *prof,
MonoMethod *method,
MonoProfilerCallContext *context);
static
void
mono_profiler_method_leave (
MonoProfiler *prof,
MonoMethod *method,
MonoProfilerCallContext *context);
static
void
mono_profiler_method_tail_call (
MonoProfiler *prof,
MonoMethod *method,
MonoMethod *target_method);
static
void
mono_profiler_method_exception_leave (
MonoProfiler *prof,
MonoMethod *method,
MonoObject *exc);
static
void
mono_profiler_method_free (
MonoProfiler *prof,
MonoMethod *method);
static
void
mono_profiler_method_begin_invoke (
MonoProfiler *prof,
MonoMethod *method);
static
void
mono_profiler_method_end_invoke (
MonoProfiler *prof,
MonoMethod *method);
static
MonoProfilerCallInstrumentationFlags
mono_profiler_method_instrumentation (
MonoProfiler *prof,
MonoMethod *method);
static
void
mono_profiler_exception_throw (
MonoProfiler *prof,
MonoObject *exc);
static
void
mono_profiler_exception_clause (
MonoProfiler *prof,
MonoMethod *method,
uint32_t clause_num,
MonoExceptionEnum clause_type,
MonoObject *exc);
static
void
mono_profiler_gc_event (
MonoProfiler *prof,
MonoProfilerGCEvent gc_event,
uint32_t generation,
mono_bool serial);
static
void
mono_profiler_gc_allocation (
MonoProfiler *prof,
MonoObject *object);
static
void
mono_profiler_gc_handle_created (
MonoProfiler *prof,
uint32_t handle,
MonoGCHandleType type,
MonoObject * object);
static
void
mono_profiler_gc_handle_deleted (
MonoProfiler *prof,
uint32_t handle,
MonoGCHandleType type);
static
void
mono_profiler_gc_finalizing (MonoProfiler *prof);
static
void
mono_profiler_gc_finalized (MonoProfiler *prof);
static
void
mono_profiler_gc_root_register (
MonoProfiler *prof,
const mono_byte *start,
uintptr_t size,
MonoGCRootSource source,
const void * key,
const char * name);
static
void
mono_profiler_gc_root_unregister (
MonoProfiler *prof,
const mono_byte *start);
static