mirror of
https://github.com/par274/sharpemu.git
synced 2026-08-07 10:29:46 +08:00
fix(audioout2): wire skipped-submit trace counter (#761)
This commit is contained in:
@@ -921,6 +921,7 @@ public static class AudioOut2Exports
|
|||||||
|
|
||||||
if (mixedPorts == 0)
|
if (mixedPorts == 0)
|
||||||
{
|
{
|
||||||
|
TraceSubmitSkipped(context, frames, "no-ports");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -942,6 +943,7 @@ public static class AudioOut2Exports
|
|||||||
var backend = ResolveContextBackend(context, out var backendName);
|
var backend = ResolveContextBackend(context, out var backendName);
|
||||||
if (backend is null)
|
if (backend is null)
|
||||||
{
|
{
|
||||||
|
TraceSubmitSkipped(context, frames, "no-backend");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1212,4 +1214,14 @@ public static class AudioOut2Exports
|
|||||||
Console.Error.WriteLine($"[LOADER][TRACE] audio_out2.{message}");
|
Console.Error.WriteLine($"[LOADER][TRACE] audio_out2.{message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void TraceSubmitSkipped(ContextState context, int frames, string reason)
|
||||||
|
{
|
||||||
|
var n = Interlocked.Increment(ref _submitSkipTraceCount);
|
||||||
|
if (n <= 8 || n % 500 == 0)
|
||||||
|
{
|
||||||
|
TraceAudioOut2(
|
||||||
|
$"context-submit-skip#{n} handle=0x{context.Handle:X} frames={frames} reason={reason}");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user