Skip to content

Commit 5c79bef

Browse files
authored
Improve output messages (#3083)
***NO_CI***
1 parent 4e9cd74 commit 5c79bef

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

src/CLR/Core/GarbageCollector.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//
1+
//
22
// Copyright (c) .NET Foundation and Contributors
33
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
44
// See LICENSE file in the project root for full license information.
@@ -144,7 +144,7 @@ CLR_UINT32 CLR_RT_GarbageCollector::ExecuteGarbageCollection()
144144
#if defined(NANOCLR_GC_VERBOSE)
145145
if (s_CLR_RT_fTrace_GC >= c_CLR_RT_Trace_Info)
146146
{
147-
CLR_Debug::Printf("\r\n\r\n Memory: Start %s\r\n", HAL_Time_CurrentDateTimeToString());
147+
CLR_Debug::Printf("\r\n\r\nGC: Start %s\r\n", HAL_Time_CurrentDateTimeToString());
148148
}
149149
#endif
150150

@@ -269,7 +269,10 @@ CLR_UINT32 CLR_RT_GarbageCollector::ExecuteGarbageCollection()
269269
#if defined(NANOCLR_GC_VERBOSE)
270270
if (s_CLR_RT_fTrace_GC >= c_CLR_RT_Trace_Info)
271271
{
272-
CLR_Debug::Printf("\r\n\r\n Memory: End %s\r\n", HAL_Time_CurrentDateTimeToString());
272+
CLR_Debug::Printf(
273+
"\r\n\r\nGC: (Run #%d) End %s\r\n",
274+
m_numberOfGarbageCollections,
275+
HAL_Time_CurrentDateTimeToString());
273276
}
274277
#endif
275278

src/CLR/Core/GarbageCollector_Compaction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ CLR_UINT32 CLR_RT_GarbageCollector::ExecuteCompaction()
3939
#if defined(NANOCLR_TRACE_MEMORY_STATS)
4040
if (s_CLR_RT_fTrace_MemoryStats >= c_CLR_RT_Trace_Info)
4141
{
42-
CLR_Debug::Printf("\r\n\r\nGC: heap compaction completed\r\n");
42+
CLR_Debug::Printf("\r\n\r\nGC: (Run %d) heap compaction completed\r\n", m_numberOfCompactions);
4343
}
4444
#endif
4545

src/CLR/Core/TypeSystem.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,11 +1726,20 @@ HRESULT CLR_RT_Assembly::CreateInstance(const CLR_RECORD_ASSEMBLY *header, CLR_R
17261726
header->SizeOfTable(TBL_MethodDef) + header->SizeOfTable(TBL_Attributes) +
17271727
header->SizeOfTable(TBL_TypeSpec) + header->SizeOfTable(TBL_Signatures);
17281728

1729-
CLR_Debug::Printf(
1730-
" (%d RAM - %d ROM - %d METADATA)\r\n\r\n",
1731-
iTotalRamSize,
1732-
header->TotalSize(),
1733-
iMetaData);
1729+
CLR_Debug::Printf(" (%d RAM - %d ROM - %d METADATA)", iTotalRamSize, header->TotalSize(), iMetaData);
1730+
1731+
#if defined(NANOCLR_GC_VERBOSE)
1732+
if (s_CLR_RT_fTrace_Memory >= c_CLR_RT_Trace_Info)
1733+
{
1734+
#ifdef _WIN64
1735+
1736+
CLR_Debug::Printf(" @ 0x%016" PRIxPTR "", (uintptr_t)assm);
1737+
#else
1738+
CLR_Debug::Printf(" @ 0x%08 PRIxPTR ", (uintptr_t)assm);
1739+
#endif
1740+
}
1741+
#endif
1742+
CLR_Debug::Printf("\r\n\r\n");
17341743

17351744
CLR_Debug::Printf(
17361745
" AssemblyRef = %8d bytes (%8d elements)\r\n",

0 commit comments

Comments
 (0)