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

Yuri Benditovich yuri.benditovich at daynix.com
Wed Jul 5 22:13:49 UTC 2017


On Mon, Jul 3, 2017 at 5:53 PM, Frediano Ziglio <fziglio at redhat.com> 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 at daynix.com>
> > ---
> >  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
>
> Why not putting these lines in driver.h? All debug defines are already
> there.
>

I'll move WppTrace.h to common header
Include directive for TMF file should be in the source file, according to
MSFT guidelines, otherwise there are compilation problems
https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/adding-wpp-macros-to-a-trace-provider


>
> >
> >  #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);
>
> From MS documentation
>
> A pointer to the driver object that represents the driver. Starting with
> Windows XP, if the driver is not using Inflight Trace Recorder (IFR), this
> parameter is not used and can be set to NULL.
>
> so we can avoid to save driverObject and just pass NULL.
>

OK


>
> >  }
> >
> >  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" />
>
> Frediano
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170706/4df13de5/attachment.html>


More information about the Spice-devel mailing list