Buffer undo trace to a ring, add dump action, stop per-tick loadSaveProj spam

Trace lines fill a 4096-line ring instead of hitting the console per line;
DUMP_UNDO_TRACE drains it in one ShowConsoleMsg call. Overflow is marked, not silent.
This commit is contained in:
2026-08-09 13:16:05 -04:00
parent b782fb2731
commit e423bf6502
3 changed files with 75 additions and 12 deletions
+14 -3
View File
@@ -108,6 +108,9 @@ static void RunShowVersion(int) {
// the console window).
ShowConsoleMsg(("ReaSampler " + reasampler::version::appVersion() + "\n").c_str());
}
// TEMPORARY: drains the undo-trace ring buffer to the console in one call. See
// undo_trace.h; revert together with the rest of the undo-span tracing pass.
static void RunDumpUndoTrace(int) { reasampler::undoTraceDump(); }
// ONE row per bindable action this TU owns: FOREVER-STABLE id suffix, Actions-list
// phrase, handler, per-row arg. Registration, hookcommand dispatch, and the unload
@@ -170,6 +173,9 @@ static std::vector<reasampler::ActionTableRow> buildMainActionTable() {
rows.push_back({"IMPORT_BANK_PACKAGE", "import bank package (.rsbank)",
&RunImportBankPackage});
rows.push_back({"SHOW_VERSION", "show version", &RunShowVersion});
// TEMPORARY: see undo_trace.h; revert together with the rest of the undo-span
// tracing pass.
rows.push_back({"DUMP_UNDO_TRACE", "DIAG: dump undo trace", &RunDumpUndoTrace});
return rows;
}
@@ -185,10 +191,15 @@ static void OnTimer()
if (capture::g_rtCapture) capture::DriveRealtimeCapture(g_session);
// TEMPORARY: captured in a local (rather than calling GetCurrentProjectInLoadSave()
// twice) so the trace can report the value on every tick, standoff or not, with no
// change to the call below. See undo_trace.h.
// twice) so the trace can report it without a second call, with no change to the
// call below. See undo_trace.h. Traced only on CHANGE — every tick reads this
// regardless of state, and the transition is the whole point of the line.
ReaProject* const loadSaveProj = GetCurrentProjectInLoadSave();
REASAMPLER_TRACE("[Timer] loadSaveProj=%p", (void*)loadSaveProj);
static ReaProject* s_tracedLoadSaveProj = nullptr;
if (loadSaveProj != s_tracedLoadSaveProj) {
REASAMPLER_TRACE("[Timer] loadSaveProj=%p", (void*)loadSaveProj);
s_tracedLoadSaveProj = loadSaveProj;
}
// A project load or save is IN FLIGHT, so this tick is running inside its own message
// pump — a restore brings plugins online and a plugin load pumps. Everything below