Skip to content

Commit

Permalink
Write the stats from the start so we can see the beginning of the trace
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Oct 18, 2024
1 parent 4977325 commit 8f777d2
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/extension/TraceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,10 @@ namespace extension {
// Open a new file in the target location
trace_file.open(e.file, std::ios::binary);

// Write a reset packet so that incremental state works
std::vector<char> data;
{
const trace::protobuf::SubMessage packet(1, data);
trace::protobuf::uint32(10, trusted_packet_sequence_id, data); // trusted_packet_sequence_id:10:uint32
trace::protobuf::int32(87, 1, data); // first_packet_on_sequence:87:bool
trace::protobuf::int32(42, 1, data); // previous_packet_dropped:42:bool
trace::protobuf::int32(13, SEQ_INCREMENTAL_STATE_CLEARED, data); // sequence flags:13:int32
}
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) { //
Expand Down

0 comments on commit 8f777d2

Please sign in to comment.