On Fri, Jun 30, 2017 at 12:11:44PM +0300, Yuri Benditovich wrote: > 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 I think I'd just add these #if !DBG in DriverEntry/DodUnload. It would make it more explicit that these are only enabled in non-debug builds. Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx> Christophe
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel