File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -681,7 +681,8 @@ std::vector<Event_t> ADParser::getEvents() const{
681681 ndata_t [type] = it->second .size ();
682682 }
683683 }
684-
684+
685+ unsigned long last_func_entry = 0 ; // record the entry of the currently open function
685686 size_t off_t [3 ] = {0 ,0 ,0 };
686687
687688 while (data_t [0 ] != nullptr || data_t [1 ] != nullptr || data_t [2 ] != nullptr ){
@@ -715,6 +716,15 @@ std::vector<Event_t> ADParser::getEvents() const{
715716 int pe = getEarliest (arrays);
716717 int earliest = priority[pe]; // the index of the type that is earliest
717718
719+ // Catch edge case where ENTRY, CORRID, EXIT all have the same timestamp. We will assume the corrid is associated with this function event
720+ if (earliest == FUNC && func_event_type == EXIT && data_t [FUNC]->ts () == last_func_entry &&
721+ counter_is_correlation_id && data_t [COUNTER]->ts () == last_func_entry)
722+ earliest = COUNTER;
723+
724+ // Record function entry time for logic above
725+ if (earliest == FUNC && func_event_type == ENTRY)
726+ last_func_entry = data_t [FUNC]->ts ();
727+
718728 out.push_back (*data_t [earliest]);
719729 ++data_t [earliest];
720730 ++off_t [earliest];
You can’t perform that action at this time.
0 commit comments