From cee712105850ac3385cd0091a923438167433f9f Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Sat, 8 Apr 2023 01:22:00 +0200 Subject: Move solution and projects to src --- ARMeilleure/Diagnostics/TranslatorEventSource.cs | 67 ------------------------ 1 file changed, 67 deletions(-) delete mode 100644 ARMeilleure/Diagnostics/TranslatorEventSource.cs (limited to 'ARMeilleure/Diagnostics/TranslatorEventSource.cs') diff --git a/ARMeilleure/Diagnostics/TranslatorEventSource.cs b/ARMeilleure/Diagnostics/TranslatorEventSource.cs deleted file mode 100644 index a4f17844..00000000 --- a/ARMeilleure/Diagnostics/TranslatorEventSource.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.Diagnostics.Tracing; -using System.Threading; - -namespace ARMeilleure.Diagnostics -{ - [EventSource(Name = "ARMeilleure")] - class TranslatorEventSource : EventSource - { - public static readonly TranslatorEventSource Log = new(); - - private int _rejitQueue; - private ulong _funcTabSize; - private ulong _funcTabLeafSize; - private PollingCounter _rejitQueueCounter; - private PollingCounter _funcTabSizeCounter; - private PollingCounter _funcTabLeafSizeCounter; - - public TranslatorEventSource() - { - _rejitQueueCounter = new PollingCounter("rejit-queue-length", this, () => _rejitQueue) - { - DisplayName = "Rejit Queue Length" - }; - - _funcTabSizeCounter = new PollingCounter("addr-tab-alloc", this, () => _funcTabSize / 1024d / 1024d) - { - DisplayName = "AddressTable Total Bytes Allocated", - DisplayUnits = "MiB" - }; - - _funcTabLeafSizeCounter = new PollingCounter("addr-tab-leaf-alloc", this, () => _funcTabLeafSize / 1024d / 1024d) - { - DisplayName = "AddressTable Total Leaf Bytes Allocated", - DisplayUnits = "MiB" - }; - } - - public void RejitQueueAdd(int count) - { - Interlocked.Add(ref _rejitQueue, count); - } - - public void AddressTableAllocated(int bytes, bool leaf) - { - _funcTabSize += (uint)bytes; - - if (leaf) - { - _funcTabLeafSize += (uint)bytes; - } - } - - protected override void Dispose(bool disposing) - { - _rejitQueueCounter.Dispose(); - _rejitQueueCounter = null; - - _funcTabLeafSizeCounter.Dispose(); - _funcTabLeafSizeCounter = null; - - _funcTabSizeCounter.Dispose(); - _funcTabSizeCounter = null; - - base.Dispose(disposing); - } - } -} -- cgit v1.2.3