Skip to content

Commit a8af4d4

Browse files
committed
Log Framework name to more Windows ML relevant events
1 parent 99b06df commit a8af4d4

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

onnxruntime/core/platform/windows/telemetry.cc

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ void WindowsTelemetry::LogSessionCreationStart(uint32_t session_id) const {
204204
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
205205
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
206206
TraceLoggingUInt32(session_id, "sessionId"),
207-
TraceLoggingLevel(WINEVENT_LEVEL_INFO));
207+
TraceLoggingLevel(WINEVENT_LEVEL_INFO),
208+
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
208209
}
209210

210211
void WindowsTelemetry::LogEvaluationStop(uint32_t session_id) const {
@@ -304,7 +305,8 @@ void WindowsTelemetry::LogSessionCreation(uint32_t session_id, int64_t ir_versio
304305
TraceLoggingString(model_weight_hash.c_str(), "modelWeightHash"),
305306
TraceLoggingString(model_metadata_string.c_str(), "modelMetaData"),
306307
TraceLoggingString(loaded_from.c_str(), "loadedFrom"),
307-
TraceLoggingString(execution_provider_string.c_str(), "executionProviderIds"));
308+
TraceLoggingString(execution_provider_string.c_str(), "executionProviderIds"),
309+
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
308310
} else {
309311
TraceLoggingWrite(telemetry_provider_handle,
310312
"SessionCreation_CaptureState",
@@ -419,7 +421,8 @@ void WindowsTelemetry::LogRuntimeError(uint32_t session_id, const common::Status
419421
TraceLoggingString(status.ErrorMessage().c_str(), "errorMessage"),
420422
TraceLoggingString(file, "file"),
421423
TraceLoggingString(function, "function"),
422-
TraceLoggingInt32(line, "line"));
424+
TraceLoggingInt32(line, "line"),
425+
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
423426
#else
424427
TraceLoggingWrite(telemetry_provider_handle,
425428
"RuntimeError",
@@ -435,7 +438,8 @@ void WindowsTelemetry::LogRuntimeError(uint32_t session_id, const common::Status
435438
TraceLoggingString(status.ErrorMessage().c_str(), "errorMessage"),
436439
TraceLoggingString(file, "file"),
437440
TraceLoggingString(function, "function"),
438-
TraceLoggingInt32(line, "line"));
441+
TraceLoggingInt32(line, "line"),
442+
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
439443
#endif
440444
}
441445

@@ -465,7 +469,8 @@ void WindowsTelemetry::LogRuntimePerf(uint32_t session_id, uint32_t total_runs_s
465469
TraceLoggingUInt32(session_id, "sessionId"),
466470
TraceLoggingUInt32(total_runs_since_last, "totalRuns"),
467471
TraceLoggingInt64(total_run_duration_since_last, "totalRunDuration"),
468-
TraceLoggingString(total_duration_per_batch_size.c_str(), "totalRunDurationPerBatchSize"));
472+
TraceLoggingString(total_duration_per_batch_size.c_str(), "totalRunDurationPerBatchSize"),
473+
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
469474
}
470475

471476
void WindowsTelemetry::LogExecutionProviderEvent(LUID* adapterLuid) const {
@@ -541,7 +546,8 @@ void WindowsTelemetry::LogAutoEpSelection(uint32_t session_id, const std::string
541546
TraceLoggingUInt32(session_id, "sessionId"),
542547
TraceLoggingString(selection_policy.c_str(), "selectionPolicy"),
543548
TraceLoggingString(requested_execution_provider_string.c_str(), "requestedExecutionProviderIds"),
544-
TraceLoggingString(available_execution_provider_string.c_str(), "availableExecutionProviderIds"));
549+
TraceLoggingString(available_execution_provider_string.c_str(), "availableExecutionProviderIds"),
550+
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
545551
}
546552

547553
void WindowsTelemetry::LogProviderOptions(const std::string& provider_id, const std::string& provider_options_string, bool captureState) const {
@@ -560,7 +566,8 @@ void WindowsTelemetry::LogProviderOptions(const std::string& provider_id, const
560566
// Telemetry info
561567
TraceLoggingUInt8(0, "schemaVersion"),
562568
TraceLoggingString(provider_id.c_str(), "providerId"),
563-
TraceLoggingString(provider_options_string.c_str(), "providerOptions"));
569+
TraceLoggingString(provider_options_string.c_str(), "providerOptions"),
570+
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
564571
} else {
565572
TraceLoggingWrite(telemetry_provider_handle,
566573
"ProviderOptions_CaptureState",

0 commit comments

Comments
 (0)