Skip to content

Commit 5498df6

Browse files
committed
Added a workaround for unmatched correlation IDs associated with GPU-side calls where the ENTRY, EXIT and COUNTER events all have the same timestamp
1 parent 6dc5ddf commit 5498df6

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/ad/ADParser.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff 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];

0 commit comments

Comments
 (0)