From 4a834181bd2e1621e7c2bdb7509fda6bc10bca28 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Sat, 26 Oct 2024 13:58:11 +1100 Subject: [PATCH] Store trace events that mark the start of the trace (#157) The trigger that starts the trace itself wasn't logged properly. This made it difficult to get a "zero time" for the trace. Logging the BeginTrace reaction itself means you get to see when the begin trace was requested --- src/extension/TraceController.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/extension/TraceController.cpp b/src/extension/TraceController.cpp index 7e135d86..b2a40608 100644 --- a/src/extension/TraceController.cpp +++ b/src/extension/TraceController.cpp @@ -275,6 +275,11 @@ namespace extension { } write_trace_packet(data); + // Write the trace events that happened before the trace started + auto current_stats = threading::ReactionTask::get_current_task()->statistics; + encode_event(ReactionEvent(ReactionEvent::CREATED, current_stats)); + encode_event(ReactionEvent(ReactionEvent::STARTED, current_stats)); + // Bind new handles event_handle = on, Pool>().then([this](const ReactionEvent& e) { // encode_event(e);