Skip to content

Commit

Permalink
Extend CPU User Annotations to End of Profile (#986)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #986

If a CPU User Annotation doesn't end by the time the profile ends, the annotation is marked as a 0-length event. This can be annoying to look at because it seems like profiler just never got the annotation event when it did. Lets set the end time to the end of profiling.

Reviewed By: aaronenyeshi

Differential Revision: D62604717

fbshipit-source-id: 34cb06b87c3c369601e1e6df859f61377b8198f6
  • Loading branch information
sraikund16 authored and facebook-github-bot committed Sep 13, 2024
1 parent 79be470 commit 2f7ce6f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libkineto/src/CuptiActivityProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ void CuptiActivityProfiler::processCpuTrace(
const std::unique_ptr<GenericTraceActivity>>::value,
"handleActivity is unsafe and relies on the caller to maintain not "
"only lifetime but also address stability.");
if (act->type() == ActivityType::USER_ANNOTATION && act->duration()<=0){
act->endTime = captureWindowEndTime_;
}
logger.handleActivity(*act);
}
clientActivityTraceMap_[act->correlationId()] = &span_pair;
Expand Down

0 comments on commit 2f7ce6f

Please sign in to comment.