mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-03 03:58:54 +00:00
User/brianma/telemetry (#5084)
* add runtime session id to (de)tensorization events * append start or stop to the event names and remove opcodes * add appsessionguid to telemetry events
This commit is contained in:
parent
1b46573bb7
commit
f41614a875
3 changed files with 61 additions and 24 deletions
|
|
@ -25,79 +25,97 @@ using namespace _winml;
|
|||
class GPUTensorToDX12TextureTelemetryEvent {
|
||||
public:
|
||||
GPUTensorToDX12TextureTelemetryEvent(const ImageTensorDescription& tensorDesc) {
|
||||
runtime_session_id_ = telemetry_helper.GetRuntimeSessionId();
|
||||
TraceLoggingWrite(
|
||||
winml_trace_logging_provider,
|
||||
"GPUTensorToDX12Texture",
|
||||
"GPUTensorToDX12TextureStart",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TraceLoggingOpcode(EVENT_TRACE_TYPE_START),
|
||||
TraceLoggingHexInt32(tensorDesc.channelType, "Type"),
|
||||
TraceLoggingInt64(tensorDesc.sizes[2], "Height"),
|
||||
TraceLoggingInt64(tensorDesc.sizes[3], "Width"),
|
||||
TraceLoggingInt32(runtime_session_id_, "runtimeSessionId"),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
~GPUTensorToDX12TextureTelemetryEvent() {
|
||||
TraceLoggingWrite(
|
||||
winml_trace_logging_provider,
|
||||
"GPUTensorToDX12Texture",
|
||||
"GPUTensorToDX12TextureStop",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TraceLoggingOpcode(EVENT_TRACE_TYPE_STOP),
|
||||
TraceLoggingHexInt32(S_OK, "HRESULT"),
|
||||
TraceLoggingInt32(runtime_session_id_, "runtimeSessionId"),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
|
||||
private:
|
||||
int runtime_session_id_;
|
||||
};
|
||||
|
||||
class ConvertGPUTensorToSoftwareBitmapTelemetryEvent {
|
||||
public:
|
||||
ConvertGPUTensorToSoftwareBitmapTelemetryEvent(const ImageTensorDescription& tensorDesc) {
|
||||
runtime_session_id_ = telemetry_helper.GetRuntimeSessionId();
|
||||
TraceLoggingWrite(
|
||||
winml_trace_logging_provider,
|
||||
"ConvertGPUTensorToSoftwareBitmap",
|
||||
"ConvertGPUTensorToSoftwareBitmapStart",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TraceLoggingOpcode(EVENT_TRACE_TYPE_START),
|
||||
TraceLoggingHexInt32(tensorDesc.channelType, "Type"),
|
||||
TraceLoggingInt64(tensorDesc.sizes[2], "Height"),
|
||||
TraceLoggingInt64(tensorDesc.sizes[3], "Width"),
|
||||
TraceLoggingInt32(runtime_session_id_, "runtimeSessionId"),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
~ConvertGPUTensorToSoftwareBitmapTelemetryEvent() {
|
||||
TraceLoggingWrite(
|
||||
winml_trace_logging_provider,
|
||||
"ConvertGPUTensorToSoftwareBitmap",
|
||||
"ConvertGPUTensorToSoftwareBitmapStop",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TraceLoggingOpcode(EVENT_TRACE_TYPE_STOP),
|
||||
TraceLoggingHexInt32(S_OK, "HRESULT"),
|
||||
TraceLoggingInt32(runtime_session_id_, "runtimeSessionId"),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
|
||||
private:
|
||||
int runtime_session_id_;
|
||||
};
|
||||
|
||||
class ConvertCPUTensorToVideoFrameWithSoftwareBitmapTelemetryEvent {
|
||||
public:
|
||||
ConvertCPUTensorToVideoFrameWithSoftwareBitmapTelemetryEvent(const ImageTensorDescription& tensorDesc) {
|
||||
runtime_session_id_ = telemetry_helper.GetRuntimeSessionId();
|
||||
TraceLoggingWrite(
|
||||
winml_trace_logging_provider,
|
||||
"ConvertCPUTensorToVideoFrameWithSoftwareBitmap",
|
||||
"ConvertCPUTensorToVideoFrameWithSoftwareBitmapStart",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TraceLoggingOpcode(EVENT_TRACE_TYPE_START),
|
||||
TraceLoggingHexInt32(tensorDesc.channelType, "Type"),
|
||||
TraceLoggingInt64(tensorDesc.sizes[2], "Height"),
|
||||
TraceLoggingInt64(tensorDesc.sizes[3], "Width"),
|
||||
TraceLoggingInt32(runtime_session_id_, "runtimeSessionId"),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
~ConvertCPUTensorToVideoFrameWithSoftwareBitmapTelemetryEvent() {
|
||||
TraceLoggingWrite(
|
||||
winml_trace_logging_provider,
|
||||
"ConvertCPUTensorToVideoFrameWithSoftwareBitmap",
|
||||
"ConvertCPUTensorToVideoFrameWithSoftwareBitmapStop",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TraceLoggingOpcode(EVENT_TRACE_TYPE_STOP),
|
||||
TraceLoggingHexInt32(S_OK, "HRESULT"),
|
||||
TraceLoggingInt32(runtime_session_id_, "runtimeSessionId"),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
|
||||
private:
|
||||
int runtime_session_id_;
|
||||
};
|
||||
|
||||
void TensorToVideoFrameConverter::DX12TensorToVideoFrame(
|
||||
|
|
|
|||
|
|
@ -24,79 +24,97 @@ using namespace _winml;
|
|||
class DX12TextureToGPUTensorTelemetryEvent {
|
||||
public:
|
||||
DX12TextureToGPUTensorTelemetryEvent(const ImageTensorDescription& tensorDesc) {
|
||||
runtime_session_id_ = telemetry_helper.GetRuntimeSessionId();
|
||||
TraceLoggingWrite(
|
||||
winml_trace_logging_provider,
|
||||
"DX12TextureToGPUTensor",
|
||||
"DX12TextureToGPUTensorStart",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TraceLoggingOpcode(EVENT_TRACE_TYPE_START),
|
||||
TraceLoggingHexInt32(tensorDesc.channelType, "Type"),
|
||||
TraceLoggingInt64(tensorDesc.sizes[2], "Height"),
|
||||
TraceLoggingInt64(tensorDesc.sizes[3], "Width"),
|
||||
TraceLoggingInt32(runtime_session_id_, "runtimeSessionId"),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
~DX12TextureToGPUTensorTelemetryEvent() {
|
||||
TraceLoggingWrite(
|
||||
winml_trace_logging_provider,
|
||||
"DX12TextureToGPUTensor",
|
||||
"DX12TextureToGPUTensorStop",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TraceLoggingOpcode(EVENT_TRACE_TYPE_STOP),
|
||||
TraceLoggingHexInt32(S_OK, "HRESULT"),
|
||||
TraceLoggingInt32(runtime_session_id_, "runtimeSessionId"),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
|
||||
private:
|
||||
int runtime_session_id_;
|
||||
};
|
||||
|
||||
class SoftwareBitmapToGPUTensorTelemetryEvent {
|
||||
public:
|
||||
SoftwareBitmapToGPUTensorTelemetryEvent(const ImageTensorDescription& tensorDesc) {
|
||||
runtime_session_id_ = telemetry_helper.GetRuntimeSessionId();
|
||||
TraceLoggingWrite(
|
||||
winml_trace_logging_provider,
|
||||
"SoftwareBitmapToGPUTensor",
|
||||
"SoftwareBitmapToGPUTensorStart",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TraceLoggingOpcode(EVENT_TRACE_TYPE_START),
|
||||
TraceLoggingHexInt32(tensorDesc.channelType, "Type"),
|
||||
TraceLoggingInt64(tensorDesc.sizes[2], "Height"),
|
||||
TraceLoggingInt64(tensorDesc.sizes[3], "Width"),
|
||||
TraceLoggingInt32(runtime_session_id_, "runtimeSessionId"),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
~SoftwareBitmapToGPUTensorTelemetryEvent() {
|
||||
TraceLoggingWrite(
|
||||
winml_trace_logging_provider,
|
||||
"SoftwareBitmapToGPUTensor",
|
||||
"SoftwareBitmapToGPUTensorStop",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TraceLoggingOpcode(EVENT_TRACE_TYPE_STOP),
|
||||
TraceLoggingHexInt32(S_OK, "HRESULT"),
|
||||
TraceLoggingInt32(runtime_session_id_, "runtimeSessionId"),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
|
||||
private:
|
||||
int runtime_session_id_;
|
||||
};
|
||||
|
||||
class ConvertVideoFrameWithSoftwareBitmapToCPUTensorTelemetryEvent {
|
||||
public:
|
||||
ConvertVideoFrameWithSoftwareBitmapToCPUTensorTelemetryEvent(const ImageTensorDescription& tensorDesc) {
|
||||
runtime_session_id_ = telemetry_helper.GetRuntimeSessionId();
|
||||
TraceLoggingWrite(
|
||||
winml_trace_logging_provider,
|
||||
"ConvertVideoFrameWithSoftwareBitmapToCPUTensor",
|
||||
"ConvertVideoFrameWithSoftwareBitmapToCPUTensorStart",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TraceLoggingOpcode(EVENT_TRACE_TYPE_START),
|
||||
TraceLoggingHexInt32(tensorDesc.channelType, "Type"),
|
||||
TraceLoggingInt64(tensorDesc.sizes[2], "Height"),
|
||||
TraceLoggingInt64(tensorDesc.sizes[3], "Width"),
|
||||
TraceLoggingInt32(runtime_session_id_, "runtimeSessionId"),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
~ConvertVideoFrameWithSoftwareBitmapToCPUTensorTelemetryEvent() {
|
||||
TraceLoggingWrite(
|
||||
winml_trace_logging_provider,
|
||||
"ConvertVideoFrameWithSoftwareBitmapToCPUTensor",
|
||||
"ConvertVideoFrameWithSoftwareBitmapToCPUTensorStop",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TraceLoggingOpcode(EVENT_TRACE_TYPE_STOP),
|
||||
TraceLoggingHexInt32(S_OK, "HRESULT"),
|
||||
TraceLoggingInt32(runtime_session_id_, "runtimeSessionId"),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
|
||||
private:
|
||||
int runtime_session_id_;
|
||||
};
|
||||
|
||||
void VideoFrameToTensorConverter::VideoFrameToSoftwareTensor(
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ class WinMLTelemetryHelper {
|
|||
uint32_t value);
|
||||
void EndRuntimeSession() { ++runtime_session_id_; };
|
||||
bool IsMeasureSampled();
|
||||
int GetRuntimeSessionId() { return runtime_session_id_; }
|
||||
|
||||
private:
|
||||
void RestartTimer() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue