Skip to content

Commit

Permalink
Extend CPU User Annotations to End of Profile
Browse files Browse the repository at this point in the history
Summary: 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.

Differential Revision: D62604717
  • Loading branch information
sraikund16 authored and facebook-github-bot committed Sep 12, 2024
1 parent 76f2334 commit 6bdd801
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 @@ -381,6 +381,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 6bdd801

Please sign in to comment.