[Spice-devel] [PATCH v2 2/4] qxl-wddm-dod: add trace definition file for WPP
Yuri Benditovich
yuri.benditovich at daynix.com
Wed Jul 5 22:22:56 UTC 2017
Added file with Windows trace preprocessor definitions,
required for generating trace messages.
Signed-off-by: Yuri Benditovich <yuri.benditovich at daynix.com>
---
qxldod/WppTrace.h | 56 +++++++++++++++++++++++++++++++++++++++++++
qxldod/qxldod.vcxproj.filters | 3 +++
2 files changed, 59 insertions(+)
create mode 100644 qxldod/WppTrace.h
diff --git a/qxldod/WppTrace.h b/qxldod/WppTrace.h
new file mode 100644
index 0000000..9643683
--- /dev/null
+++ b/qxldod/WppTrace.h
@@ -0,0 +1,56 @@
+/*
+* Copyright 2013-2016 Red Hat, Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+*
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+*/
+
+#pragma once
+
+//
+// Define the tracing flags.
+//
+// Tracing GUID - {756ABE50-54E3-4A05-B5BB-F0112C75B18A}
+//
+
+#define WPP_CONTROL_GUIDS \
+ WPP_DEFINE_CONTROL_GUID( \
+ QxlDodTraceGuid, (756ABE50,54E3,4A05,B5BB,F0112C75B18A), \
+ \
+ WPP_DEFINE_BIT(TRACE_DRIVER) \
+ WPP_DEFINE_BIT(TRACE_DEVICE) \
+ WPP_DEFINE_BIT(TRACE_MEMORY) \
+ WPP_DEFINE_BIT(TRACE_TIMING) \
+ WPP_DEFINE_BIT(TRACE_HARDWARE) \
+ )
+
+#define WPP_FLAG_LEVEL_LOGGER(flag, level) WPP_LEVEL_LOGGER(flag)
+
+#define WPP_FLAG_LEVEL_ENABLED(flag, level) \
+ (WPP_LEVEL_ENABLED(flag) && \
+ WPP_CONTROL(WPP_BIT_ ## flag).Level >= level)
+
+#define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) WPP_LEVEL_LOGGER(flags)
+
+#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) \
+ (WPP_LEVEL_ENABLED(flags) && WPP_CONTROL(WPP_BIT_ ## flags).Level >= lvl)
+
+#if DBG
+#define WPP_INIT_TRACING(driver, regpath)
+#define WPP_CLEANUP(driver)
+#endif
+
+//
+// This comment block is scanned by the trace preprocessor to define our
+// Trace function.
+//
+// begin_wpp config
+// FUNC Trace{FLAG=TRACE_DRIVER}(LEVEL,MSG, ...);
+// FUNC TraceEvents(LEVEL, FLAGS, MSG, ...);
+// FUNC DbgPrint{FLAG=TRACE_DRIVER}(LEVEL, (MSG, ...));
+// CUSTOM_TYPE(devprop, ItemEnum(DEVICE_REGISTRY_PROPERTY));
+// end_wpp
+//
diff --git a/qxldod/qxldod.vcxproj.filters b/qxldod/qxldod.vcxproj.filters
index 1e86aa6..2eaa333 100755
--- a/qxldod/qxldod.vcxproj.filters
+++ b/qxldod/qxldod.vcxproj.filters
@@ -34,6 +34,9 @@
<ClInclude Include="QxlDod.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="WppTrace.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="BaseObject.cpp">
--
2.7.0.windows.1
More information about the Spice-devel
mailing list