Skip to content

Commit

Permalink
Add UST Logging for Empty Trace (#1003)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #1003

There was a request to have UST log when traces are empty. We make a special case in the logger to log when the desired string is encountered

Reviewed By: aaronenyeshi

Differential Revision: D64559516

fbshipit-source-id: 4c8053a7d81c77fed142ae789ee02ede755eaa46
  • Loading branch information
hjmeta authored and facebook-github-bot committed Oct 18, 2024
1 parent eb1713f commit ca5ff59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions libkineto/include/ILoggerObserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ constexpr char kWarmUpStage[] = "Warm Up";
constexpr char kCollectionStage[] = "Collection";
constexpr char kPostProcessingStage[] = "Post Processing";

// Special string in UST for determining if traces are empty
constexpr char kEmptyTrace[] =
"No Valid Trace Events (CPU/GPU) found. Outputting empty trace.";

#if !USE_GOOGLE_LOG

#include <map>
Expand Down
3 changes: 1 addition & 2 deletions libkineto/src/CuptiActivityProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,7 @@ void CuptiActivityProfiler::processTraceInternal(ActivityLogger& logger) {
}
#endif // HAS_ROCTRACER
if (!traceNonEmpty()) {
LOG(WARNING)
<< "No Valid Trace Events (CPU/GPU) found. Outputting empty trace.";
LOG(WARNING) << kEmptyTrace;
}

for (const auto& session : sessions_) {
Expand Down

0 comments on commit ca5ff59

Please sign in to comment.