From 533bc2ae61c6b8f2ac7acbf55ed23d39319197ad Mon Sep 17 00:00:00 2001 From: Ivan Berg Date: Wed, 20 Dec 2023 12:56:06 -0800 Subject: [PATCH] More PR fixes lintcpp and Linux build --- onnxruntime/core/platform/windows/logging/etw_sink.h | 9 ++++++--- onnxruntime/core/platform/windows/telemetry.cc | 4 ++-- .../providers/qnn/builder/qnn_backend_manager.cc | 12 +++++++----- onnxruntime/core/session/provider_registration.cc | 2 +- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/onnxruntime/core/platform/windows/logging/etw_sink.h b/onnxruntime/core/platform/windows/logging/etw_sink.h index 4744bcde22465..722870864f5a7 100644 --- a/onnxruntime/core/platform/windows/logging/etw_sink.h +++ b/onnxruntime/core/platform/windows/logging/etw_sink.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "core/common/logging/capture.h" #include "core/common/logging/isink.h" @@ -48,7 +48,9 @@ class EtwSink : public ISink { class EtwRegistrationManager { public: - using EtwInternalCallback = std::function; + using EtwInternalCallback = std::function; // Singleton instance access static EtwRegistrationManager& Instance(); @@ -80,7 +82,8 @@ class EtwRegistrationManager { EtwRegistrationManager(EtwRegistrationManager&&) = delete; EtwRegistrationManager& operator=(EtwRegistrationManager&&) = delete; - void InvokeCallbacks(LPCGUID SourceId, ULONG IsEnabled, UCHAR Level, ULONGLONG MatchAnyKeyword, ULONGLONG MatchAllKeyword, PEVENT_FILTER_DESCRIPTOR FilterData, PVOID CallbackContext); + void InvokeCallbacks(LPCGUID SourceId, ULONG IsEnabled, UCHAR Level, ULONGLONG MatchAnyKeyword, + ULONGLONG MatchAllKeyword, PEVENT_FILTER_DESCRIPTOR FilterData, PVOID CallbackContext); static void NTAPI ORT_TL_EtwEnableCallback( _In_ LPCGUID SourceId, diff --git a/onnxruntime/core/platform/windows/telemetry.cc b/onnxruntime/core/platform/windows/telemetry.cc index 500cb14d6b629..b6549207124b4 100644 --- a/onnxruntime/core/platform/windows/telemetry.cc +++ b/onnxruntime/core/platform/windows/telemetry.cc @@ -17,7 +17,7 @@ #include #include -#include "winmeta.h" +#include // Seems this workaround can be dropped when we drop support for VS2017 toolchains // https://developercommunity.visualstudio.com/content/problem/85934/traceloggingproviderh-is-incompatible-with-utf-8.html @@ -179,7 +179,7 @@ void WindowsTelemetry::LogEvaluationStop() const { return; TraceLoggingWrite(telemetry_provider_handle, - "EvaluationStop", ); + "EvaluationStop"); } void WindowsTelemetry::LogEvaluationStart() const { diff --git a/onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc b/onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc index d4563718a2551..73786c048bd64 100644 --- a/onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc +++ b/onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc @@ -853,7 +853,7 @@ Status QnnBackendManager::ExtractBackendProfilingInfo() { auto& provider = env.GetTelemetryProvider(); if (provider.IsEnabled()) { auto keyword = provider.Keyword(); - if ((keyword & static_cast(onnxruntime::logging::TLKeyword::Profiling)) != 0) { + if ((keyword & static_cast(onnxruntime::logging::TLKeyword::Profiling)) != 0) { tracelogging_provider_ep_enabled = true; } } @@ -875,9 +875,11 @@ Status QnnBackendManager::ExtractBackendProfilingInfo() { for (size_t event_idx = 0; event_idx < num_events; event_idx++) { ORT_RETURN_IF_ERROR( - ExtractProfilingEvent(*(profile_events + event_idx), "ROOT", outfile, backendSupportsExtendedEventData, tracelogging_provider_ep_enabled)); + ExtractProfilingEvent(*(profile_events + event_idx), "ROOT", outfile, backendSupportsExtendedEventData, + tracelogging_provider_ep_enabled)); ORT_RETURN_IF_ERROR( - ExtractProfilingSubEvents(*(profile_events + event_idx), outfile, backendSupportsExtendedEventData, tracelogging_provider_ep_enabled)); + ExtractProfilingSubEvents(*(profile_events + event_idx), outfile, backendSupportsExtendedEventData, + tracelogging_provider_ep_enabled)); } if (!tracelogging_provider_ep_enabled) { @@ -996,6 +998,7 @@ Status QnnBackendManager::ExtractProfilingEventExtended( << (event_data_extended.v1.identifier ? event_data_extended.v1.identifier : "NULL") << "\n"; } } else { +#ifdef _WIN32 LogQnnProfileEventAsTraceLogging( event_data_extended.v1.timestamp, message, @@ -1004,6 +1007,7 @@ Status QnnBackendManager::ExtractProfilingEventExtended( "BACKEND", eventLevel, (event_data_extended.v1.identifier ? event_data_extended.v1.identifier : "NULL")); +#endif } return Status::OK(); @@ -1017,7 +1021,6 @@ void QnnBackendManager::LogQnnProfileEventAsTraceLogging( const std::string& timingSource, const std::string& eventLevel, const char* eventIdentifier) { -#ifdef _WIN32 TraceLoggingWrite( telemetry_provider_handle, "QNNProfilingEvent", @@ -1030,7 +1033,6 @@ void QnnBackendManager::LogQnnProfileEventAsTraceLogging( TraceLoggingString(timingSource.c_str(), "Timing Source"), TraceLoggingString(eventLevel.c_str(), "Event Level"), TraceLoggingString(eventIdentifier, "Event Identifier")); -#endif } const std::string& QnnBackendManager::GetUnitString(QnnProfile_EventUnit_t unitType) { diff --git a/onnxruntime/core/session/provider_registration.cc b/onnxruntime/core/session/provider_registration.cc index e05030f9773c5..eba8fd58a0159 100644 --- a/onnxruntime/core/session/provider_registration.cc +++ b/onnxruntime/core/session/provider_registration.cc @@ -14,8 +14,8 @@ #include "core/providers/openvino/openvino_provider_factory_creator.h" #ifdef _WIN32 +#include #include "core/platform/tracing.h" -#include "winmeta.h" #endif #if defined(USE_DML)