Giter Club home page Giter Club logo

realmon's Introduction

some stuff maoni does

realmon's People

Contributors

chrisnas avatar hez2010 avatar maoni0 avatar mokosan avatar nickcraver avatar onyxmaster avatar ryandle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realmon's Issues

Proposal: Prettify console output using Spectre.Console

I hacked together a prototype of what the console might look like if we used a library like Spectre.Console to markup the output:

image

The above styling is just to get the idea across.

Is there any interest in using Spectre.Console to beautify the output? Leaving out extra details to first see if there is even interest in this or if there are reasons to keep the output simpler.

investigate memory usage

I looked at the tool briefly today and I could see sometimes the memory usage go up pretty quickly (like when I was using one gcmon process to monitor anther gcmon process ๐Ÿ˜€). a hasty look at the callstacks for VirtualAlloc* in windbg gives me a few categories for committed bytes - some are understandable; others aren't. for example, this is a pretty common callstack -

00 00007ffb`1433b36d     : 00000000`00000001 00007ffb`147db558 00000000`00000000 00007ffb`143ba699 : KERNELBASE!VirtualAlloc [minkernel\kernelbase\mmsup.c @ 1022] 
01 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!ClrVirtualAlloc+0x12 [D:\a\_work\1\s\src\coreclr\vm\hosting.cpp @ 75] 
[some gc frames omitted]
0b 00007ffb`14348ee1     : 00000000`00000002 00000000`00000050 00000116`e659d6c8 00000000`00000000 : coreclr!WKS::GCHeap::Alloc+0x84 [D:\a\_work\1\s\src\coreclr\gc\gc.cpp @ 43664] 
0c (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!Alloc+0xb3 [D:\a\_work\1\s\src\coreclr\vm\gchelpers.cpp @ 228] 
0d (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!AllocateObject+0x11b [D:\a\_work\1\s\src\coreclr\vm\gchelpers.cpp @ 981] 
0e 00007ffa`b4ef8022     : 00007ffa`b4fa4ea8 00000000`00000003 00000116`c609a488 00007ffa`b4efba7d : coreclr!JIT_New+0x201 [D:\a\_work\1\s\src\coreclr\vm\jithelpers.cpp @ 2324] 
0f 00007ffa`b4ef105a     : 00000116`c603c3a8 00000116`c603bee8 00000116`c6066100 00000116`c63b1fe8 : Microsoft_Diagnostics_Tracing_TraceEvent!Microsoft.Diagnostics.Tracing.Parsers.Clr.GCPerHeapHistoryTraceData.GenData(Microsoft.Diagnostics.Tracing.Parsers.Clr.Gens)+0x6212
10 00007ffa`b4ee9194     : 00000116`c609a188 00007ffb`14453876 00000000`00000000 00000116`c5f368e0 : Microsoft_Diagnostics_Tracing_TraceEvent!Microsoft.Diagnostics.Tracing.Analysis.GC.GCStats.ProcessPerHeapHistory(Microsoft.Diagnostics.Tracing.Analysis.TraceLoadedDotNetRuntime, Microsoft.Diagnostics.Tracing.Parsers.Clr.GCPerHeapHistoryTraceData)+0x27a
11 00007ffa`b4ef73d9     : 00000116`e81d1740 00000015`1ed7d860 00000116`e81d1f58 00000000`00000238 : Microsoft_Diagnostics_Tracing_TraceEvent!Microsoft.Diagnostics.Tracing.TraceEventDispatcher.DoDispatch(Microsoft.Diagnostics.Tracing.TraceEvent)+0x74
12 00007ffa`b4ee8ce2     : 00000116`e81d1f20 00000015`1ed7d969 00000116`e81b80e0 00000000`00000010 : Microsoft_Diagnostics_Tracing_TraceEvent!Microsoft.Diagnostics.Tracing.ETWTraceEventSource.RawDispatch(EVENT_RECORD*)+0xe6c9
13 00007ffb`4ac337fb     : 00000116`e81d1f20 00000015`1ed7d969 00000116`00000238 00000116`e828c6d0 : System_Console!ILStubClass.IL_STUB_ReversePInvoke(Int64)+0x42
14 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : sechost!EtwpDoEventRecordCallbacks+0x24 [minkernel\etw\control\tracedc.cpp @ 1945] 
15 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : sechost!EtwpDoEventCallbacks+0x31 [minkernel\etw\control\tracedc.cpp @ 1956] 
16 00007ffb`4ac33633     : 00000116`e828c6d0 00000000`00000000 00000000`00000000 7fffffff`ffffffff : sechost!EtwpLoadEventTrigger+0x15b [minkernel\etw\control\tracert.cpp @ 1435] 
17 00007ffb`4ac3b86a     : 00000000`00000000 00000015`1ed7db40 00000116`e828c6d0 00000000`00000000 : sechost!EtwpProcessRealTimeTraces+0xc7 [minkernel\etw\control\tracert.cpp @ 468] 
18 00007ffa`b4ee5be4     : 00000000`00000000 00007ffb`00000001 00000116`c5f377c8 00000000`00000000 : sechost!ProcessTrace+0x18a [minkernel\etw\control\tracedc.cpp @ 2469] 

we are still processing the GC events even though we are not displaying the results because those are not event happening in the process we asked for. these should be dead though since I'm not storing them anywhere. should verify this is the case.

but things like this seem odd -

 # RetAddr               : Args to Child                                                           : Call Site
00 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : KERNELBASE!VirtualAllocEx [minkernel\kernelbase\mmsup.c @ 1041] 
01 00007ffb`1440261d     : 00001d59`e1a7ba00 00000000`00000001 00007ffb`2ba50000 00000000`00000202 : KERNELBASE!VirtualAlloc+0x4 [minkernel\kernelbase\mmsup.c @ 1023] 
02 00007ffb`1436ab25     : 00000000`00000030 00000015`1dffdf29 00000000`00000030 00000000`00000000 : coreclr!UnlockedLoaderHeap::GetMoreCommittedPages+0x79 [D:\a\_work\1\s\src\coreclr\utilcode\loaderheap.cpp @ 1234] 
03 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!UnlockedLoaderHeap::UnlockedAllocMem_NoThrow+0xe6 [D:\a\_work\1\s\src\coreclr\utilcode\loaderheap.cpp @ 1400] 
04 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!UnlockedLoaderHeap::UnlockedAllocMem+0xe6 [D:\a\_work\1\s\src\coreclr\utilcode\loaderheap.cpp @ 1266] 
05 00007ffb`14344940     : 00000116`c4155178 00000015`1dffe379 00007ffb`147e29d0 00000116`c4155178 : coreclr!LoaderHeap::RealAllocMemUnsafe+0x141 [D:\a\_work\1\s\src\coreclr\inc\loaderheap.h @ 561] 
06 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!LoaderHeap::RealAllocMem+0x15 [D:\a\_work\1\s\src\coreclr\inc\loaderheap.h @ 517] 
07 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!EEJitManager::allocCode+0x379 [D:\a\_work\1\s\src\coreclr\vm\codeman.cpp @ 2707] 
08 00007ffb`2ba91b54     : 00000116`e660c800 00000116`00000000 00000116`00000001 00007ffb`0000001f : coreclr!CEEJitInfo::allocMem+0x570 [D:\a\_work\1\s\src\coreclr\vm\jitinterface.cpp @ 12451] 
09 00007ffb`2bb18433     : 00000015`1dffeb2c 00000116`e660bf18 00000116`e660c830 00007ffb`2ba50000 : clrjit!emitter::emitEndCodeGen+0x124 [D:\a\_work\1\s\src\coreclr\jit\emit.cpp @ 5731] 
0a 00007ffb`2bb1d482     : 00000116`e660c830 00000015`1dffe4b0 00000000`00000000 00007ffb`2bb880b0 : clrjit!CodeGen::genEmitMachineCode+0x183 [D:\a\_work\1\s\src\coreclr\jit\codegencommon.cpp @ 2446] 
0b 00007ffb`2bb18567     : 00000116`e660c830 00000015`1dffeaa8 00000000`00000000 00007ffb`2ba50000 : clrjit!CodeGenPhase::DoPhase+0x12 [D:\a\_work\1\s\src\coreclr\jit\codegen.h @ 1610] 
0c (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : clrjit!Phase::Run+0x44 [D:\a\_work\1\s\src\coreclr\jit\phase.cpp @ 61] 
0d (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : clrjit!DoPhase+0x4b [D:\a\_work\1\s\src\coreclr\jit\codegen.h @ 1623] 
0e 00007ffb`2bac4aed     : 00000116`e660bf18 00000116`e6613758 00000000`00000000 00000116`e6613758 : clrjit!CodeGen::genGenerateCode+0xd7 [D:\a\_work\1\s\src\coreclr\jit\codegencommon.cpp @ 2099] 
0f 00007ffb`2ba7deb1     : 00000116`e660bf18 00000116`e660bf18 00000000`00000000 00000116`e660bf18 : clrjit!Compiler::compCompile+0xf1d [D:\a\_work\1\s\src\coreclr\jit\compiler.cpp @ 5216] 
10 00007ffb`2ba8209a     : 00007ffa`b48f56d0 00000116`e660bf18 00000015`1dffeba0 00000015`1dfff900 : clrjit!Compiler::compCompileHelper+0x291 [D:\a\_work\1\s\src\coreclr\jit\compiler.cpp @ 6422] 
11 00007ffb`2ba83492     : 00000000`00000000 00000000`00000000 00007ffa`b49b4950 00000015`1dffe9d0 : clrjit!Compiler::compCompile+0x24a [D:\a\_work\1\s\src\coreclr\jit\compiler.cpp @ 5685] 
12 00007ffb`2bb1b633     : 00007ffa`b49b4950 00007ffa`b47e4000 00000015`1dffeb80 00000015`1dffee30 : clrjit!jitNativeCode+0x262 [D:\a\_work\1\s\src\coreclr\jit\compiler.cpp @ 7055] 
13 00007ffb`14367571     : 00000116`e6587110 00000000`00000000 00000015`1dfff0d8 00000015`1dffecd0 : clrjit!CILJit::compileMethod+0x83 [D:\a\_work\1\s\src\coreclr\jit\ee_il_dll.cpp @ 279] 
14 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!invokeCompileMethodHelper+0x86 [D:\a\_work\1\s\src\coreclr\vm\jitinterface.cpp @ 12774] 
15 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!invokeCompileMethod+0xc5 [D:\a\_work\1\s\src\coreclr\vm\jitinterface.cpp @ 12839] 
16 00007ffb`14366c31     : 00000015`00000096 00000015`1dfff0d8 00000015`1dfff070 00000015`1dffef10 : coreclr!UnsafeJitFunction+0x7f1 [D:\a\_work\1\s\src\coreclr\vm\jitinterface.cpp @ 13355] 
17 00007ffb`143668fc     : 00000000`00000001 00007ffa`b49b4950 00007ffa`b49b4950 00007ffb`4c73b86b : coreclr!MethodDesc::JitCompileCodeLocked+0x1f1 [D:\a\_work\1\s\src\coreclr\vm\prestub.cpp @ 1051] 
18 00007ffb`1435f7f9     : 00000116`e8243a70 00000015`1dfff520 00000116`e8243a70 00000116`e8243a78 : coreclr!MethodDesc::JitCompileCodeLockedEventWrapper+0x148 [D:\a\_work\1\s\src\coreclr\vm\prestub.cpp @ 920] 
19 00007ffb`14399dc2     : 00007ffa`b49b4950 00000116`00000000 00000000`00000000 00000000`00000000 : coreclr!MethodDesc::JitCompileCode+0x2a9 [D:\a\_work\1\s\src\coreclr\vm\prestub.cpp @ 860] 
1a 00007ffb`14399cee     : 00000000`00000000 00000000`00000000 00000116`e6521b90 00007ffa`00000000 : coreclr!MethodDesc::PrepareILBasedCode+0x66 [D:\a\_work\1\s\src\coreclr\vm\prestub.cpp @ 439] 
1b (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!MethodDesc::PrepareCode+0x10 [D:\a\_work\1\s\src\coreclr\vm\prestub.cpp @ 332] 
1c 00007ffb`1439a445     : 00000000`00000000 00000000`00000064 00000116`c4183920 00000000`00000002 : coreclr!TieredCompilationManager::CompileCodeVersion+0xce [D:\a\_work\1\s\src\coreclr\vm\tieredcompilation.cpp @ 906] 
1d (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!TieredCompilationManager::OptimizeMethod+0x22 [D:\a\_work\1\s\src\coreclr\vm\tieredcompilation.cpp @ 883] 
1e 00007ffb`1445bcb8     : 00000116`c4183920 00000015`1dfff7b8 00000000`0004e200 00000000`0007a120 : coreclr!TieredCompilationManager::DoBackgroundWork+0x125 [D:\a\_work\1\s\src\coreclr\vm\tieredcompilation.cpp @ 768] 
1f 00007ffb`1445bbac     : 00000000`00989680 00007ffb`147d5f98 00000116`c414f860 00000000`0004e200 : coreclr!TieredCompilationManager::BackgroundWorkerStart+0xc8 [D:\a\_work\1\s\src\coreclr\vm\tieredcompilation.cpp @ 482] 
20 00007ffb`143cf921     : 00000000`00000130 00000000`00000000 00000000`00000000 00007ffb`143cb8ee : coreclr!TieredCompilationManager::BackgroundWorkerBootstrapper1+0x5c [D:\a\_work\1\s\src\coreclr\vm\tieredcompilation.cpp @ 431] 
21 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!ManagedThreadBase_DispatchInner+0xd [D:\a\_work\1\s\src\coreclr\vm\threads.cpp @ 7312] 
22 00007ffb`143cf9fa     : 00000000`00000000 00000000`00000130 00000000`00000000 00000000`00000000 : coreclr!ManagedThreadBase_DispatchMiddle+0x85 [D:\a\_work\1\s\src\coreclr\vm\threads.cpp @ 7356] 
23 00007ffb`14473efa     : 00000116`00000001 ffffffff`ffffffff 00000116`e828b8f0 00000116`e6587110 : coreclr!ManagedThreadBase_DispatchOuter+0xae [D:\a\_work\1\s\src\coreclr\vm\threads.cpp @ 7515] 
24 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!ManagedThreadBase_FullTransition+0x24 [D:\a\_work\1\s\src\coreclr\vm\threads.cpp @ 7560] 
25 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!ManagedThreadBase::KickOff+0x24 [D:\a\_work\1\s\src\coreclr\vm\threads.cpp @ 7595] 
26 00007ffb`4c627034     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : coreclr!TieredCompilationManager::BackgroundWorkerBootstrapper0+0x3a [D:\a\_work\1\s\src\coreclr\vm\tieredcompilation.cpp @ 414] 
27 00007ffb`4c762651     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : KERNEL32!BaseThreadInitThunk+0x14 [clientcore\base\win32\client\thread.c @ 64] 
28 00000000`00000000     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x21 [minkernel\ntdll\rtlstrt.c @ 1153] 
 # RetAddr               : Args to Child                                                           : Call Site
00 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : KERNELBASE!VirtualAllocExNuma [minkernel\kernelbase\mmsup.c @ 1066] 
01 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : KERNELBASE!VirtualAllocEx+0xd [minkernel\kernelbase\mmsup.c @ 1041] 
02 00007ffb`1440261d     : 00007ffa`b4fb9000 00000000`00001000 00007ffb`2ba50000 00000000`00000202 : KERNELBASE!VirtualAlloc+0x11 [minkernel\kernelbase\mmsup.c @ 1023] 
03 00007ffb`1436ab25     : 00000000`00000030 00000015`1dffdf29 00000000`00000030 00000000`00000000 : coreclr!UnlockedLoaderHeap::GetMoreCommittedPages+0x79 [D:\a\_work\1\s\src\coreclr\utilcode\loaderheap.cpp @ 1234] 
04 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!UnlockedLoaderHeap::UnlockedAllocMem_NoThrow+0xe6 [D:\a\_work\1\s\src\coreclr\utilcode\loaderheap.cpp @ 1400] 
05 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!UnlockedLoaderHeap::UnlockedAllocMem+0xe6 [D:\a\_work\1\s\src\coreclr\utilcode\loaderheap.cpp @ 1266] 
06 00007ffb`14344940     : 00000116`c4155178 00000015`1dffe379 00007ffb`147e29d0 00000116`c4155178 : coreclr!LoaderHeap::RealAllocMemUnsafe+0x141 [D:\a\_work\1\s\src\coreclr\inc\loaderheap.h @ 561] 
07 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!LoaderHeap::RealAllocMem+0x15 [D:\a\_work\1\s\src\coreclr\inc\loaderheap.h @ 517] 
08 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!EEJitManager::allocCode+0x379 [D:\a\_work\1\s\src\coreclr\vm\codeman.cpp @ 2707] 
09 00007ffb`2ba91b54     : 00000116`e660c800 00000116`00000000 00000116`00000001 00007ffb`0000001f : coreclr!CEEJitInfo::allocMem+0x570 [D:\a\_work\1\s\src\coreclr\vm\jitinterface.cpp @ 12451] 
0a 00007ffb`2bb18433     : 00000015`1dffeb2c 00000116`e660bf18 00000116`e660c830 00007ffb`2ba50000 : clrjit!emitter::emitEndCodeGen+0x124 [D:\a\_work\1\s\src\coreclr\jit\emit.cpp @ 5731] 
0b 00007ffb`2bb1d482     : 00000116`e660c830 00000015`1dffe4b0 00000000`00000000 00007ffb`2bb880b0 : clrjit!CodeGen::genEmitMachineCode+0x183 [D:\a\_work\1\s\src\coreclr\jit\codegencommon.cpp @ 2446] 
0c 00007ffb`2bb18567     : 00000116`e660c830 00000015`1dffeaa8 00000000`00000000 00007ffb`2ba50000 : clrjit!CodeGenPhase::DoPhase+0x12 [D:\a\_work\1\s\src\coreclr\jit\codegen.h @ 1610] 
0d (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : clrjit!Phase::Run+0x44 [D:\a\_work\1\s\src\coreclr\jit\phase.cpp @ 61] 
0e (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : clrjit!DoPhase+0x4b [D:\a\_work\1\s\src\coreclr\jit\codegen.h @ 1623] 
0f 00007ffb`2bac4aed     : 00000116`e660bf18 00000116`e6613758 00000000`00000000 00000116`e6613758 : clrjit!CodeGen::genGenerateCode+0xd7 [D:\a\_work\1\s\src\coreclr\jit\codegencommon.cpp @ 2099] 
10 00007ffb`2ba7deb1     : 00000116`e660bf18 00000116`e660bf18 00000000`00000000 00000116`e660bf18 : clrjit!Compiler::compCompile+0xf1d [D:\a\_work\1\s\src\coreclr\jit\compiler.cpp @ 5216] 
11 00007ffb`2ba8209a     : 00007ffa`b48f56d0 00000116`e660bf18 00000015`1dffeba0 00000015`1dfff900 : clrjit!Compiler::compCompileHelper+0x291 [D:\a\_work\1\s\src\coreclr\jit\compiler.cpp @ 6422] 
12 00007ffb`2ba83492     : 00000000`00000000 00000000`00000000 00007ffa`b49b4950 00000015`1dffe9d0 : clrjit!Compiler::compCompile+0x24a [D:\a\_work\1\s\src\coreclr\jit\compiler.cpp @ 5685] 
13 00007ffb`2bb1b633     : 00007ffa`b49b4950 00007ffa`b47e4000 00000015`1dffeb80 00000015`1dffee30 : clrjit!jitNativeCode+0x262 [D:\a\_work\1\s\src\coreclr\jit\compiler.cpp @ 7055] 
14 00007ffb`14367571     : 00000116`e6587110 00000000`00000000 00000015`1dfff0d8 00000015`1dffecd0 : clrjit!CILJit::compileMethod+0x83 [D:\a\_work\1\s\src\coreclr\jit\ee_il_dll.cpp @ 279] 
15 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!invokeCompileMethodHelper+0x86 [D:\a\_work\1\s\src\coreclr\vm\jitinterface.cpp @ 12774] 
16 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!invokeCompileMethod+0xc5 [D:\a\_work\1\s\src\coreclr\vm\jitinterface.cpp @ 12839] 
17 00007ffb`14366c31     : 00000015`00000096 00000015`1dfff0d8 00000015`1dfff070 00000015`1dffef10 : coreclr!UnsafeJitFunction+0x7f1 [D:\a\_work\1\s\src\coreclr\vm\jitinterface.cpp @ 13355] 
18 00007ffb`143668fc     : 00000000`00000001 00007ffa`b49b4950 00007ffa`b49b4950 00007ffb`4c73b86b : coreclr!MethodDesc::JitCompileCodeLocked+0x1f1 [D:\a\_work\1\s\src\coreclr\vm\prestub.cpp @ 1051] 
19 00007ffb`1435f7f9     : 00000116`e8243a70 00000015`1dfff520 00000116`e8243a70 00000116`e8243a78 : coreclr!MethodDesc::JitCompileCodeLockedEventWrapper+0x148 [D:\a\_work\1\s\src\coreclr\vm\prestub.cpp @ 920] 
1a 00007ffb`14399dc2     : 00007ffa`b49b4950 00000116`00000000 00000000`00000000 00000000`00000000 : coreclr!MethodDesc::JitCompileCode+0x2a9 [D:\a\_work\1\s\src\coreclr\vm\prestub.cpp @ 860] 
1b 00007ffb`14399cee     : 00000000`00000000 00000000`00000000 00000116`e6521b90 00007ffa`00000000 : coreclr!MethodDesc::PrepareILBasedCode+0x66 [D:\a\_work\1\s\src\coreclr\vm\prestub.cpp @ 439] 
1c (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!MethodDesc::PrepareCode+0x10 [D:\a\_work\1\s\src\coreclr\vm\prestub.cpp @ 332] 
1d 00007ffb`1439a445     : 00000000`00000000 00000000`00000064 00000116`c4183920 00000000`00000002 : coreclr!TieredCompilationManager::CompileCodeVersion+0xce [D:\a\_work\1\s\src\coreclr\vm\tieredcompilation.cpp @ 906] 
1e (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!TieredCompilationManager::OptimizeMethod+0x22 [D:\a\_work\1\s\src\coreclr\vm\tieredcompilation.cpp @ 883] 
1f 00007ffb`1445bcb8     : 00000116`c4183920 00000015`1dfff7b8 00000000`0004e200 00000000`0007a120 : coreclr!TieredCompilationManager::DoBackgroundWork+0x125 [D:\a\_work\1\s\src\coreclr\vm\tieredcompilation.cpp @ 768] 
20 00007ffb`1445bbac     : 00000000`00989680 00007ffb`147d5f98 00000116`c414f860 00000000`0004e200 : coreclr!TieredCompilationManager::BackgroundWorkerStart+0xc8 [D:\a\_work\1\s\src\coreclr\vm\tieredcompilation.cpp @ 482] 
21 00007ffb`143cf921     : 00000000`00000130 00000000`00000000 00000000`00000000 00007ffb`143cb8ee : coreclr!TieredCompilationManager::BackgroundWorkerBootstrapper1+0x5c [D:\a\_work\1\s\src\coreclr\vm\tieredcompilation.cpp @ 431] 
22 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!ManagedThreadBase_DispatchInner+0xd [D:\a\_work\1\s\src\coreclr\vm\threads.cpp @ 7312] 
23 00007ffb`143cf9fa     : 00000000`00000000 00000000`00000130 00000000`00000000 00000000`00000000 : coreclr!ManagedThreadBase_DispatchMiddle+0x85 [D:\a\_work\1\s\src\coreclr\vm\threads.cpp @ 7356] 
24 00007ffb`14473efa     : 00000116`00000001 ffffffff`ffffffff 00000116`e828b8f0 00000116`e6587110 : coreclr!ManagedThreadBase_DispatchOuter+0xae [D:\a\_work\1\s\src\coreclr\vm\threads.cpp @ 7515] 
25 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!ManagedThreadBase_FullTransition+0x24 [D:\a\_work\1\s\src\coreclr\vm\threads.cpp @ 7560] 
26 (Inline Function)     : --------`-------- --------`-------- --------`-------- --------`-------- : coreclr!ManagedThreadBase::KickOff+0x24 [D:\a\_work\1\s\src\coreclr\vm\threads.cpp @ 7595] 
27 00007ffb`4c627034     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : coreclr!TieredCompilationManager::BackgroundWorkerBootstrapper0+0x3a [D:\a\_work\1\s\src\coreclr\vm\tieredcompilation.cpp @ 414] 
28 00007ffb`4c762651     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : KERNEL32!BaseThreadInitThunk+0x14 [clientcore\base\win32\client\thread.c @ 64] 
29 00000000`00000000     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x21 [minkernel\ntdll\rtlstrt.c @ 1153] 

and I'm seeing many of these (which is odd 'cause we should only be disposing the session once).

would be worthwhile to do a deeper investigation.

Add Functional Tests

Now that we are adding an increasing number of command line conditions, automated functional tests will be essential to efficiently test out conditions.

The conditions to test could include:

  1. Configuration creation.
  2. Testing basic monitoring functionality.
  3. Running both dotnet cli + GCRealTimeMon exes and comparing the equality of results.
  4. Testing different build configs such as AoT Compilation.

Once these tests are added, the .github/workflows script must be edited to include these new tests.

get rid of the CPU Time (%) column from all places

I should have thought about this when we added this column.

without actually collecting CPU samples this would always be NaN. and I don't see much usage for folks to actually need to know the CPU time %.

if it's proven to be something that folks do need we can certainly add it back and actually adjust the keywords for the events we collect to support showing a valid value for it. another reason is this doesn't currently work well on linux (you could use the built in cpu events which would suspend the EE everytime it needs to collect cpu samples so it's not practical to use). for windows the perfview command is this:

PerfView /nogui /KernelEvents=Process+Thread+ImageLoad+Profile /ClrEvents=GC+Stack /ClrEventLevel=Informational /BufferSize:3000 /CircularMB:3000 collect

we just need to make the corresponding change when we start the event session.

show callstacks for induced GCs and large object allocations

these are things that are very practical for perf diagnostics - you'd want to know if there are GCs induced who induced it and often folks would like to know who's allocating large objects.

this is the high level idea (the reason I didn't write down details is I only know the top level idea at this point :)) -

for ETW the IPs in the callstacks are decoded based on rundown events so the idea we run down at the beginning instead of at the end, and then when there are new JIT method events we will add those. and TraceLog can already be used with a real time session.

with EventPipe this may not be straightforward as right now it may not be able to run down at the beginning.

add a separate dir to build the NativeAoT version

some folks have expressed the desire to use this tool without having to install .NET 6. the .net 6 requirement is just for the NativeAoT which you can always build separately. so we should not require folks to have to have 6.0.

my suggestion is we should have a separate dir that builds AoT that does require 6.0 (instead of having everyone who wants to use this and doesn't want to install 6.0 to change src/GCRealTimeMon/GCRealTimeMon.csproj themselves). the rest can use 5.0 as a min version (actually we could even make it 3.1...).

Session Leaks on Ctrl+C

There are instances where if the user clicks Ctrl+C to close realmon, the session isn't getting disposed.

Repro Steps

  1. Run realmon normally and note the session name by putting a break point here.
  2. Ctrl+C to close the session.
  3. Open up a command line prompt / powershell in admin mode.
  4. logman query -ets to list all the sessions on the machine. Here is where I found the session still exists even after exiting the process.

Eventually, this will result in the following exception:
Unhandled exception. System.Runtime.InteropServices.COMException (0x800705AA): Insufficient system resources exist to complete the requested service. (0x800705AA).

Solution

Subscribe to the Console.CancelKeyPress event and explicitly dispose the session.

Remove the Reference to Sharprompt and Replace Usage with the Spectre.Console API (old Spectre.CLI API)

Related to #39, now that we are planning to incorporate the Spectre.Console API, makes sense to replace all usage of the Sharprompt API for the prompts and remove the reference altogether.

These include:

  1. Creating a new Config which involves:
  2. Filling in the Default Values if a configuration is meant to be overwritten:
    • For the MultiSelectionPrompt This done by using the Select<T> functionality.

Requires .NET 3.1.0 when newer .NET installed

When I installed the tool and tried to run it, I get an information: required .NET 3.1.0 (runtime or SDK) while I have installed .NET 5 and 6.

When I installed 3.1.0 SDK, it works fine.

Attaching screenshot.

obraz

Expected behavior: it should run on newer version of .NET.

make realmon work on Linux

this involves the following -

  • using the Diagnostics Client library to start an EventPipe session instead of an ETW session which is what TraceEventSession.EnableProvider does. conveniently there's already sample code here that shows how to start such a session in real time!

  • the necessary build files to build this on Linux.

gcmon stops emitting GC events if a 2nd gcmon is used to monitor the first

  1. Open admin console
  2. Run gcmon on a process dotnet gcmon -n <processName>
  3. Observe that it is emitting GC events / works as expected.
  4. Open a 2nd admin console
  5. Run a 2nd gcmon instance to monitor the first dotnet gcmon -p <pidOfFirstGcMonProcess>

Expected: The first gcmon process continues to work as expected and the second one reports on the 1st's GC behavior.

Actual: The first gcmon appears to stop writing gc events to the output once the 2nd starts monitoring it.

I've been able to repro this on Windows 10 20H2. Haven't tried any other platforms.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.