Skip to content

Commit

Permalink
Minor bug fix for flow event timestamp
Browse files Browse the repository at this point in the history
The google trace event format leaves a little bit to be desired,
in that the start of a flow event has to be between the start end end
of the parent task, not equal to the start. So, we take the start
timestamp of the parent and add 0.250 microseconds which is the
smallest resolution we can use to increase the timestamp to make
sure it is during the parent but not after the parent stopped.
  • Loading branch information
khuck committed May 20, 2024
1 parent a704117 commit 0b2e5ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/apex/trace_event_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ inline void trace_event_listener::_common_stop(std::shared_ptr<profiler> &p) {
) {
//std::cout << "FLOWING!" << std::endl;
uint64_t flow_id = reversed_node_id + get_flow_id();
write_flow_event(ss, p->tt_ptr->parent->get_flow_us(), 's', "ControlFlow", flow_id,
write_flow_event(ss, p->tt_ptr->parent->get_flow_us()+0.250, 's', "ControlFlow", flow_id,
saved_node_id, p->tt_ptr->parent->thread_id, p->tt_ptr->parent->task_id->get_name());
write_flow_event(ss, p->get_start_us(), 'f', "ControlFlow", flow_id,
saved_node_id, _tid, p->tt_ptr->parent->task_id->get_name());
Expand Down

0 comments on commit 0b2e5ba

Please sign in to comment.