From 2ccdc026dbc6c77d1e6d73bbc7c28771cd29f48f Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Thu, 28 May 2015 08:05:22 -0700 Subject: [PATCH] Fix GCSample --- src/gc/gc.cpp | 4 ++-- src/gc/sample/etmdummy.h | 17 ++++++++++++++++- src/gc/sample/gcenv.h | 23 +++++++++++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp index fe66f02..64585bc 100644 --- a/src/gc/gc.cpp +++ b/src/gc/gc.cpp @@ -5908,7 +5908,7 @@ BYTE* get_plug_start_in_saved (BYTE* old_loc, mark* pinned_plug_entry) BYTE* plug_start_in_saved = saved_pre_plug_info + (old_loc - (pinned_plug (pinned_plug_entry) - sizeof (plug_and_gap))); //dprintf (1, ("detected a very short plug: %Ix before PP %Ix, pad %Ix", // old_loc, pinned_plug (pinned_plug_entry), plug_start_in_saved)); - dprintf (1, ("EP: %Ix(%Ix), %Ix", old_loc, (BYTE)pinned_plug_entry, plug_start_in_saved)); + dprintf (1, ("EP: %Ix(%Ix), %Ix", old_loc, pinned_plug (pinned_plug_entry), plug_start_in_saved)); return plug_start_in_saved; } @@ -21401,7 +21401,7 @@ void gc_heap::plan_phase (int condemned_gen_number) if (convert_to_pinned_p) { - assert (last_npinned_plug_p == TRUE); + assert (last_npinned_plug_p != FALSE); assert (last_pinned_plug_p == FALSE); convert_to_pinned_plug (last_npinned_plug_p, last_pinned_plug_p, pinned_plug_p, ps, artificial_pinned_size); diff --git a/src/gc/sample/etmdummy.h b/src/gc/sample/etmdummy.h index 57fa60e..983bba6 100644 --- a/src/gc/sample/etmdummy.h +++ b/src/gc/sample/etmdummy.h @@ -77,6 +77,7 @@ #define FireEtwThreadPoolWorkerThreadAdjustmentSample(Throughput, ClrInstanceID) 0 #define FireEtwThreadPoolWorkerThreadAdjustmentAdjustment(AverageThroughput, NewWorkerThreadCount, Reason, ClrInstanceID) 0 #define FireEtwThreadPoolWorkerThreadAdjustmentStats(Duration, Throughput, ThreadWave, ThroughputWave, ThroughputErrorEstimate, AverageThroughputErrorEstimate, ThroughputRatio, Confidence, NewControlSetting, NewThreadWaveMagnitude, ClrInstanceID) 0 +#define FireEtwThreadPoolWorkerThreadWait(ActiveWorkerThreadCount, RetiredWorkerThreadCount, ClrInstanceID) 0 #define FireEtwThreadPoolWorkingThreadCount(Count, ClrInstanceID) 0 #define FireEtwThreadPoolEnqueue(WorkID, ClrInstanceID) 0 #define FireEtwThreadPoolDequeue(WorkID, ClrInstanceID) 0 @@ -87,6 +88,13 @@ #define FireEtwThreadRunning(ID, ClrInstanceID) 0 #define FireEtwExceptionThrown() 0 #define FireEtwExceptionThrown_V1(ExceptionType, ExceptionMessage, ExceptionEIP, ExceptionHRESULT, ExceptionFlags, ClrInstanceID) 0 +#define FireEtwExceptionCatchStart(EntryEIP, MethodID, MethodName, ClrInstanceID) 0 +#define FireEtwExceptionCatchStop() 0 +#define FireEtwExceptionFinallyStart(EntryEIP, MethodID, MethodName, ClrInstanceID) 0 +#define FireEtwExceptionFinallyStop() 0 +#define FireEtwExceptionFilterStart(EntryEIP, MethodID, MethodName, ClrInstanceID) 0 +#define FireEtwExceptionFilterStop() 0 +#define FireEtwExceptionThrownStop() 0 #define FireEtwContention() 0 #define FireEtwContentionStart_V1(ContentionFlags, ClrInstanceID) 0 #define FireEtwContentionStop(ContentionFlags, ClrInstanceID) 0 @@ -153,6 +161,14 @@ #define FireEtwRuntimeInformationStart(ClrInstanceID, Sku, BclMajorVersion, BclMinorVersion, BclBuildNumber, BclQfeNumber, VMMajorVersion, VMMinorVersion, VMBuildNumber, VMQfeNumber, StartupFlags, StartupMode, CommandLine, ComObjectGuid, RuntimeDllPath) 0 #define FireEtwIncreaseMemoryPressure(BytesAllocated, ClrInstanceID) 0 #define FireEtwDecreaseMemoryPressure(BytesFreed, ClrInstanceID) 0 +#define FireEtwGCMarkWithType(HeapNum, ClrInstanceID, Type, Bytes) 0 +#define FireEtwGCJoin_V2(Heap, JoinTime, JoinType, ClrInstanceID, JoinID) 0 +#define FireEtwGCPerHeapHistory_V3(ClrInstanceID, FreeListAllocated, FreeListRejected, EndOfSegAllocated, CondemnedAllocated, PinnedAllocated, PinnedAllocatedAdvance, RunningFreeListEfficiency, CondemnReasons0, CondemnReasons1, CompactMechanisms, ExpandMechanisms, HeapIndex, ExtraGen0Commit, Count, Values_Len_, Values) 0 +#define FireEtwGCGlobalHeapHistory_V2(FinalYoungestDesired, NumHeaps, CondemnedGeneration, Gen0ReductionCount, Reason, GlobalMechanisms, ClrInstanceID, PauseMode, MemoryPressure) 0 +#define FireEtwDebugIPCEventStart() 0 +#define FireEtwDebugIPCEventEnd() 0 +#define FireEtwDebugExceptionProcessingStart() 0 +#define FireEtwDebugExceptionProcessingEnd() 0 #define FireEtwCLRStackWalkDCStart(ClrInstanceID, Reserved1, Reserved2, FrameCount, Stack) 0 #define FireEtwMethodDCStart(MethodID, ModuleID, MethodStartAddress, MethodSize, MethodToken, MethodFlags) 0 #define FireEtwMethodDCStart_V1(MethodID, ModuleID, MethodStartAddress, MethodSize, MethodToken, MethodFlags, ClrInstanceID) 0 @@ -382,4 +398,3 @@ #define FireEtwBeginCreateManagedReference(ClrInstanceID) 0 #define FireEtwEndCreateManagedReference(ClrInstanceID) 0 #define FireEtwObjectVariantMarshallingToManaged(TypeName, Int1, ClrInstanceID) 0 -#define FireEtwGCPerHeapHistorySpecial(DataPerHeap, DataSize, ClrInstanceId) 0 diff --git a/src/gc/sample/gcenv.h b/src/gc/sample/gcenv.h index 456e416..f7f39cb 100644 --- a/src/gc/sample/gcenv.h +++ b/src/gc/sample/gcenv.h @@ -125,6 +125,8 @@ inline HRESULT HRESULT_FROM_WIN32(unsigned long x) #define C_ASSERT(cond) static_assert( cond, #cond ) +#define UNREFERENCED_PARAMETER(P) (void)(P) + #define INVALID_HANDLE_VALUE ((HANDLE)-1) #pragma pack(push, 8) @@ -380,6 +382,8 @@ typedef uintptr_t TADDR; typedef DPTR(size_t) PTR_size_t; typedef DPTR(BYTE) PTR_BYTE; +struct _DacGlobals; + // ----------------------------------------------------------------------------------------------------------- #define DATA_ALIGNMENT sizeof(uintptr_t) @@ -864,6 +868,25 @@ void UnsafeDeleteCriticalSection(CRITICAL_SECTION *lpCriticalSection); #define ETW_EVENT_ENABLED(e,f) false +namespace ETW +{ + class GCLog + { + public: + struct ETW_GC_INFO + { + typedef enum _GC_ROOT_KIND { + GC_ROOT_STACK = 0, + GC_ROOT_FQ = 1, + GC_ROOT_HANDLES = 2, + GC_ROOT_OLDER = 3, + GC_ROOT_SIZEDREF = 4, + GC_ROOT_OVERFLOW = 5 + } GC_ROOT_KIND; + }; + }; +}; + // // Logging // -- 2.7.4