1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4
5#ifndef __GCTOCLREVENTSINK_H__
6#define __GCTOCLREVENTSINK_H__
7
8#include "gcinterface.h"
9
10class GCToCLREventSink : public IGCToCLREventSink
11{
12public:
13 void FireDynamicEvent(const char* eventName, void* payload, uint32_t payloadSize);
14 void FireGCStart_V2(uint32_t count, uint32_t depth, uint32_t reason, uint32_t type);
15 void FireGCEnd_V1(uint32_t count, uint32_t depth);
16 void FireGCGenerationRange(uint8_t generation, void* rangeStart, uint64_t rangeUsedLength, uint64_t rangeReservedLength);
17 void FireGCHeapStats_V1(uint64_t generationSize0,
18 uint64_t totalPromotedSize0,
19 uint64_t generationSize1,
20 uint64_t totalPromotedSize1,
21 uint64_t generationSize2,
22 uint64_t totalPromotedSize2,
23 uint64_t generationSize3,
24 uint64_t totalPromotedSize3,
25 uint64_t finalizationPromotedSize,
26 uint64_t finalizationPromotedCount,
27 uint32_t pinnedObjectCount,
28 uint32_t sinkBlockCount,
29 uint32_t gcHandleCount);
30 void FireGCCreateSegment_V1(void* address, size_t size, uint32_t type);
31 void FireGCFreeSegment_V1(void* address);
32 void FireGCCreateConcurrentThread_V1();
33 void FireGCTerminateConcurrentThread_V1();
34 void FireGCTriggered(uint32_t reason);
35 void FireGCMarkWithType(uint32_t heapNum, uint32_t type, uint64_t bytes);
36 void FireGCJoin_V2(uint32_t heap, uint32_t joinTime, uint32_t joinType, uint32_t joinId);
37 void FireGCGlobalHeapHistory_V2(uint64_t finalYoungestDesired,
38 int32_t numHeaps,
39 uint32_t condemnedGeneration,
40 uint32_t gen0reductionCount,
41 uint32_t reason,
42 uint32_t globalMechanisms,
43 uint32_t pauseMode,
44 uint32_t memoryPressure);
45 void FireGCAllocationTick_V1(uint32_t allocationAmount, uint32_t allocationKind);
46 void FireGCAllocationTick_V3(uint64_t allocationAmount, uint32_t allocationKind, uint32_t heapIndex, void* objectAddress);
47 void FirePinObjectAtGCTime(void* object, uint8_t** ppObject);
48 void FirePinPlugAtGCTime(uint8_t* plug_start, uint8_t* plug_end, uint8_t* gapBeforeSize);
49 void FireGCPerHeapHistory_V3(void *freeListAllocated,
50 void *freeListRejected,
51 void *endOfSegAllocated,
52 void *condemnedAllocated,
53 void *pinnedAllocated,
54 void *pinnedAllocatedAdvance,
55 uint32_t runningFreeListEfficiency,
56 uint32_t condemnReasons0,
57 uint32_t condemnReasons1,
58 uint32_t compactMechanisms,
59 uint32_t expandMechanisms,
60 uint32_t heapIndex,
61 void *extraGen0Commit,
62 uint32_t count,
63 uint32_t valuesLen,
64 void *values);
65 void FireBGCBegin();
66 void FireBGC1stNonConEnd();
67 void FireBGC1stConEnd();
68 void FireBGC1stSweepEnd(uint32_t genNumber);
69 void FireBGC2ndNonConBegin();
70 void FireBGC2ndNonConEnd();
71 void FireBGC2ndConBegin();
72 void FireBGC2ndConEnd();
73 void FireBGCDrainMark(uint64_t objects);
74 void FireBGCRevisit(uint64_t pages, uint64_t objects, uint32_t isLarge);
75 void FireBGCOverflow(uint64_t min, uint64_t max, uint64_t objects, uint32_t isLarge);
76 void FireBGCAllocWaitBegin(uint32_t reason);
77 void FireBGCAllocWaitEnd(uint32_t reason);
78 void FireGCFullNotify_V1(uint32_t genNumber, uint32_t isAlloc);
79 void FireSetGCHandle(void *handleID, void *objectID, uint32_t kind, uint32_t generation, uint64_t appDomainID);
80 void FirePrvSetGCHandle(void *handleID, void *objectID, uint32_t kind, uint32_t generation, uint64_t appDomainID);
81 void FireDestroyGCHandle(void *handleID);
82 void FirePrvDestroyGCHandle(void *handleID);
83};
84
85extern GCToCLREventSink g_gcToClrEventSink;
86
87#endif // __GCTOCLREVENTSINK_H__
88
89