[Spice-devel] [PATCH v3 3/4] qxl-wddm-dod: Support ETW for release version

Yuri Benditovich yuri.benditovich at daynix.com
Sun Jul 9 07:54:24 UTC 2017


Add ability to produce ETW (Event Tracing for Windows) to release
version of the driver to be able to record binary traces in case
of problem in customer environment for further analysis.
Logging of debug build is not changed.

Signed-off-by: Yuri Benditovich <yuri.benditovich at daynix.com>
---
 qxldod/QxlDod.cpp     | 3 +++
 qxldod/driver.cpp     | 6 ++++++
 qxldod/driver.h       | 2 +-
 qxldod/qxldod.vcxproj | 5 +++++
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index b97301a..4f508bd 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -12,6 +12,9 @@
 #include "qxldod.h"
 #include "qxl_windows.h"
 #include "compat.h"
+#if !DBG
+#include "qxldod.tmh"
+#endif
 
 #pragma code_seg("PAGE")
 
diff --git a/qxldod/driver.cpp b/qxldod/driver.cpp
index 1ff2abb..aa245c8 100755
--- a/qxldod/driver.cpp
+++ b/qxldod/driver.cpp
@@ -10,6 +10,9 @@
 
 #include "driver.h"
 #include "QxlDod.h"
+#if !DBG
+#include "driver.tmh"
+#endif
 
 #pragma code_seg(push)
 #pragma code_seg("INIT")
@@ -62,6 +65,8 @@ DriverEntry(
 {
     PAGED_CODE();
 
+    WPP_INIT_TRACING(NULL, NULL);
+
     DbgPrint(TRACE_LEVEL_FATAL, ("---> KMDOD build on on %s %s\n", __DATE__, __TIME__));
 
     RTL_OSVERSIONINFOW versionInfo;
@@ -157,6 +162,7 @@ DodUnload(VOID)
 {
     PAGED_CODE();
     DbgPrint(TRACE_LEVEL_INFORMATION, ("<--> %s\n", __FUNCTION__));
+    WPP_CLEANUP(NULL);
 }
 
 NTSTATUS
diff --git a/qxldod/driver.h b/qxldod/driver.h
index a70b0e7..df5fb9f 100755
--- a/qxldod/driver.h
+++ b/qxldod/driver.h
@@ -10,7 +10,7 @@
 
 #pragma once
 #include "BaseObject.h"
-
+#include "WppTrace.h"
 
 extern "C"
 DRIVER_INITIALIZE DriverEntry;
diff --git a/qxldod/qxldod.vcxproj b/qxldod/qxldod.vcxproj
index 1766a61..15e36d9 100755
--- a/qxldod/qxldod.vcxproj
+++ b/qxldod/qxldod.vcxproj
@@ -185,6 +185,8 @@
     <ClCompile>
       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH);.\Include</AdditionalIncludeDirectories>
       <WarningLevel>Level3</WarningLevel>
+      <WppScanConfigurationData>WppTrace.h</WppScanConfigurationData>
+      <WppEnabled>true</WppEnabled>
     </ClCompile>
     <PostBuildEvent>
       <Command>Inf2Cat /driver:$(OutDir) /os:8_X86,6_3_X86</Command>
@@ -255,6 +257,8 @@
     <ClCompile>
       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH);.\Include</AdditionalIncludeDirectories>
       <WarningLevel>Level3</WarningLevel>
+      <WppScanConfigurationData>WppTrace.h</WppScanConfigurationData>
+      <WppEnabled>true</WppEnabled>
     </ClCompile>
     <PostBuildEvent>
       <Command>Inf2Cat /driver:$(OutDir) /os:8_X64,Server8_X64,Server6_3_X64,6_3_X64</Command>
@@ -277,6 +281,7 @@
     <ClInclude Include="driver.h" />
     <ClInclude Include="QxlDod.h" />
     <ClInclude Include="resource.h" />
+    <ClInclude Include="WppTrace.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="BaseObject.cpp" />
-- 
2.7.0.windows.1



More information about the Spice-devel mailing list