Skip to content

Commit 6bdd801

Browse files
sraikund16facebook-github-bot
authored andcommitted
Extend CPU User Annotations to End of Profile
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
1 parent 76f2334 commit 6bdd801

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
@@ -381,6 +381,9 @@ void CuptiActivityProfiler::processCpuTrace(
381381
const std::unique_ptr<GenericTraceActivity>>::value,
382382
"handleActivity is unsafe and relies on the caller to maintain not "
383383
"only lifetime but also address stability.");
384+
if (act->type() == ActivityType::USER_ANNOTATION && act->duration()<=0){
385+
act->endTime = captureWindowEndTime_;
386+
}
384387
logger.handleActivity(*act);
385388
}
386389
clientActivityTraceMap_[act->correlationId()] = &span_pair;

0 commit comments

Comments
 (0)