Remove rejit requests queue logging

This commit is contained in:
FICTURE7 2021-04-13 11:41:40 +04:00
parent b65480cdf5
commit 60e56f3efe

View file

@ -24,10 +24,6 @@ namespace ARMeilleure.Translation
{ {
private const int CountTableCapacity = 4 * 1024 * 1024; private const int CountTableCapacity = 4 * 1024 * 1024;
private long _nextUpdate;
private long _requestAdded;
private long _requestRemoved;
private readonly IJitMemoryAllocator _allocator; private readonly IJitMemoryAllocator _allocator;
private readonly IMemoryManager _memory; private readonly IMemoryManager _memory;
@ -50,8 +46,6 @@ namespace ARMeilleure.Translation
public Translator(IJitMemoryAllocator allocator, IMemoryManager memory) public Translator(IJitMemoryAllocator allocator, IMemoryManager memory)
{ {
_nextUpdate = Stopwatch.GetTimestamp();
_allocator = allocator; _allocator = allocator;
_memory = memory; _memory = memory;
@ -79,8 +73,6 @@ namespace ARMeilleure.Translation
if (_backgroundStack.TryPop(out RejitRequest request) && if (_backgroundStack.TryPop(out RejitRequest request) &&
_backgroundSet.TryRemove(request.Address, out _)) _backgroundSet.TryRemove(request.Address, out _))
{ {
Interlocked.Increment(ref _requestRemoved);
TranslatedFunction func = Translate( TranslatedFunction func = Translate(
_memory, _memory,
_jumpTable, _jumpTable,
@ -102,28 +94,6 @@ namespace ARMeilleure.Translation
PtcProfiler.UpdateEntry(request.Address, request.Mode, highCq: true); PtcProfiler.UpdateEntry(request.Address, request.Mode, highCq: true);
} }
var nextUpdate = Interlocked.Exchange(ref _nextUpdate, 0);
if (nextUpdate != 0)
{
var now = Stopwatch.GetTimestamp();
if (now < nextUpdate)
{
_nextUpdate = nextUpdate;
}
else
{
Ryujinx.Common.Logging.Logger.Info?.Print(
Ryujinx.Common.Logging.LogClass.Cpu,
$"{_backgroundStack.Count} rejit requests remaining (+{_requestAdded}:-{_requestRemoved}).");
_requestAdded = 0;
_requestRemoved = 0;
_nextUpdate = now + Stopwatch.Frequency * 30;
}
}
_backgroundTranslatorLock.ReleaseReaderLock(); _backgroundTranslatorLock.ReleaseReaderLock();
} }
else else
@ -480,7 +450,6 @@ namespace ARMeilleure.Translation
{ {
if (_backgroundSet.TryAdd(guestAddress, null)) if (_backgroundSet.TryAdd(guestAddress, null))
{ {
Interlocked.Increment(ref _requestAdded);
_backgroundStack.Push(new RejitRequest(guestAddress, mode)); _backgroundStack.Push(new RejitRequest(guestAddress, mode));
_backgroundTranslatorEvent.Set(); _backgroundTranslatorEvent.Set();
} }
@ -513,8 +482,6 @@ namespace ARMeilleure.Translation
{ {
_backgroundTranslatorLock.AcquireWriterLock(Timeout.Infinite); _backgroundTranslatorLock.AcquireWriterLock(Timeout.Infinite);
Interlocked.Add(ref _requestRemoved, _backgroundStack.Count);
if (allowRequeue) if (allowRequeue)
{ {
while (_backgroundStack.TryPop(out var request)) while (_backgroundStack.TryPop(out var request))