From 0b2e5ba3db32a6188eb9a1ff2af135dcf27ccda0 Mon Sep 17 00:00:00 2001 From: Kevin Huck Date: Mon, 20 May 2024 16:13:08 -0700 Subject: [PATCH] Minor bug fix for flow event timestamp 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. --- src/apex/trace_event_listener.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apex/trace_event_listener.cpp b/src/apex/trace_event_listener.cpp index c25691cd..60f158df 100644 --- a/src/apex/trace_event_listener.cpp +++ b/src/apex/trace_event_listener.cpp @@ -218,7 +218,7 @@ inline void trace_event_listener::_common_stop(std::shared_ptr &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());