diff --git a/libkineto/src/ActivityProfilerController.cpp b/libkineto/src/ActivityProfilerController.cpp index 99c629cf..19e20486 100644 --- a/libkineto/src/ActivityProfilerController.cpp +++ b/libkineto/src/ActivityProfilerController.cpp @@ -40,6 +40,11 @@ void ActivityProfilerController::setLoggerCollectorFactory( std::function()> factory) { loggerCollectorFactory() = factory(); } + +std::shared_ptr +ActivityProfilerController::getLoggerCollector() { + return loggerCollectorFactory(); +} #endif // !USE_GOOGLE_LOG ActivityProfilerController::ActivityProfilerController( diff --git a/libkineto/src/ActivityProfilerController.h b/libkineto/src/ActivityProfilerController.h index 47d21b24..b4f826a7 100644 --- a/libkineto/src/ActivityProfilerController.h +++ b/libkineto/src/ActivityProfilerController.h @@ -40,6 +40,7 @@ class ActivityProfilerController : public ConfigLoader::ConfigHandler { ~ActivityProfilerController(); #if !USE_GOOGLE_LOG + static std::shared_ptr getLoggerCollector(); static void setLoggerCollectorFactory( std::function()> factory); #endif // !USE_GOOGLE_LOG diff --git a/libkineto/src/CuptiActivityProfiler.cpp b/libkineto/src/CuptiActivityProfiler.cpp index 4eadec84..bf049123 100644 --- a/libkineto/src/CuptiActivityProfiler.cpp +++ b/libkineto/src/CuptiActivityProfiler.cpp @@ -1054,13 +1054,11 @@ void CuptiActivityProfiler::configure( // Set useful metadata into the logger. LOGGER_OBSERVER_SET_TRACE_DURATION_MS(config_->activitiesDuration().count()); + LOGGER_OBSERVER_SET_TRACE_ID(config_->requestTraceID()); + LOGGER_OBSERVER_SET_GROUP_TRACE_ID(config_->requestGroupTraceID()); if (!config_->requestTraceID().empty()) { - LOGGER_OBSERVER_SET_TRACE_ID(config_->requestTraceID()); addMetadata("trace_id", "\"" + config_->requestTraceID() + "\""); } - if (!config_->requestGroupTraceID().empty()) { - LOGGER_OBSERVER_SET_GROUP_TRACE_ID(config_->requestGroupTraceID()); - } #if defined(HAS_CUPTI) || defined(HAS_ROCTRACER) if (!cpuOnly_) {