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@xxxxxxxxxx> --- qxldod/QxlDod.cpp | 4 ++++ qxldod/driver.cpp | 9 +++++++++ qxldod/driver.h | 5 +++++ qxldod/qxldod.vcxproj | 5 +++++ 4 files changed, 23 insertions(+) diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp index b97301a..fc29c9f 100755 --- a/qxldod/QxlDod.cpp +++ b/qxldod/QxlDod.cpp @@ -12,6 +12,10 @@ #include "qxldod.h" #include "qxl_windows.h" #include "compat.h" +#if !DBG +#include "WppTrace.h" +#include "qxldod.tmh" +#endif #pragma code_seg("PAGE") diff --git a/qxldod/driver.cpp b/qxldod/driver.cpp index 1ff2abb..d33b345 100755 --- a/qxldod/driver.cpp +++ b/qxldod/driver.cpp @@ -10,6 +10,10 @@ #include "driver.h" #include "QxlDod.h" +#if !DBG +#include "WppTrace.h" +#include "driver.tmh" +#endif #pragma code_seg(push) #pragma code_seg("INIT") @@ -20,6 +24,7 @@ // int nDebugLevel = TRACE_LEVEL_ERROR; +static DRIVER_OBJECT* driverObject; // registry-based configuration is intended to be manual only // for VSync suppression during support and troubleshooting @@ -62,6 +67,9 @@ DriverEntry( { PAGED_CODE(); + WPP_INIT_TRACING(pDriverObject, pRegistryPath); + driverObject = pDriverObject; + DbgPrint(TRACE_LEVEL_FATAL, ("---> KMDOD build on on %s %s\n", __DATE__, __TIME__)); RTL_OSVERSIONINFOW versionInfo; @@ -157,6 +165,7 @@ DodUnload(VOID) { PAGED_CODE(); DbgPrint(TRACE_LEVEL_INFORMATION, ("<--> %s\n", __FUNCTION__)); + WPP_CLEANUP(driverObject); } NTSTATUS diff --git a/qxldod/driver.h b/qxldod/driver.h index a70b0e7..626ac24 100755 --- a/qxldod/driver.h +++ b/qxldod/driver.h @@ -272,3 +272,8 @@ void DebugPrint(int level, const char *fmt, ...); #else #define QXL_ASSERT_CHK(exp) {} #endif + +#if DBG +#define WPP_INIT_TRACING(driver, regpath) +#define WPP_CLEANUP(driver) +#endif 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 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel