Skip to content

Commit 2f7ce6f

Browse files
sraikund16facebook-github-bot
authored andcommitted
Extend CPU User Annotations to End of Profile (#986)
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
1 parent 79be470 commit 2f7ce6f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libkineto/src/CuptiActivityProfiler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ void CuptiActivityProfiler::processCpuTrace(
397397
const std::unique_ptr<GenericTraceActivity>>::value,
398398
"handleActivity is unsafe and relies on the caller to maintain not "
399399
"only lifetime but also address stability.");
400+
if (act->type() == ActivityType::USER_ANNOTATION && act->duration()<=0){
401+
act->endTime = captureWindowEndTime_;
402+
}
400403
logger.handleActivity(*act);
401404
}
402405
clientActivityTraceMap_[act->correlationId()] = &span_pair;

0 commit comments

Comments
 (0)