Skip to content

Commit

Permalink
Store trace events that mark the start of the trace (#157)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
TrentHouliston authored Oct 26, 2024
1 parent e71efa5 commit 4a83418
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/extension/TraceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Trigger<ReactionEvent>, Pool<TracePool>>().then([this](const ReactionEvent& e) { //
encode_event(e);
Expand Down

0 comments on commit 4a83418

Please sign in to comment.