fix(audioout2): wire skipped-submit trace counter (#761)

This commit is contained in:
Fa1dz 2026-08-04 02:22:39 +02:00 committed by GitHub
parent c086e32f3d
commit 418eb7ecea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -921,6 +921,7 @@ public static class AudioOut2Exports
if (mixedPorts == 0)
{
TraceSubmitSkipped(context, frames, "no-ports");
return false;
}
@ -942,6 +943,7 @@ public static class AudioOut2Exports
var backend = ResolveContextBackend(context, out var backendName);
if (backend is null)
{
TraceSubmitSkipped(context, frames, "no-backend");
return false;
}
@ -1212,4 +1214,14 @@ public static class AudioOut2Exports
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}");
}
}
}