Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHEL-11854: exclude trace files from clang format [HLK-SANITY] #1255

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
matrix:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/clang-fomart/clang-format/g

path:
- check: '.'
exclude: './NetKVM|./pciserial|./viocrypt|./viofs|./viogpu|./vioinput|./viomem|./viorng|./vioscsi|./vioserial|./viosock|./viostor|./VirtIO'
exclude: './pvpanic/pvpanic/trace.h|./viomem/sys/trace.h|./NetKVM|./pciserial|./viocrypt|./viofs|./viogpu|./vioinput|./viomem|./viorng|./vioscsi|./vioserial|./viosock|./viostor|./VirtIO'
- check: 'VirtIO'
exclude: ''

Expand Down
23 changes: 15 additions & 8 deletions pvpanic/pvpanic/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,25 @@
// Tracing GUID - 5eeabb8c-be9a-40d0-99fd-86f2a0b21378
//

#define WPP_CONTROL_GUIDS \
WPP_DEFINE_CONTROL_GUID(PVPanicTraceGuid, \
(5eeabb8c, be9a, 40d0, 99fd, 86f2a0b21378), \
WPP_DEFINE_BIT(DBG_ALL) WPP_DEFINE_BIT(DBG_INIT) WPP_DEFINE_BIT(DBG_POWER))
#define WPP_CONTROL_GUIDS \
WPP_DEFINE_CONTROL_GUID( \
PVPanicTraceGuid, (5eeabb8c,be9a,40d0,99fd,86f2a0b21378), \
WPP_DEFINE_BIT(DBG_ALL) \
WPP_DEFINE_BIT(DBG_INIT) \
WPP_DEFINE_BIT(DBG_POWER) \
)

#define WPP_FLAG_LEVEL_LOGGER(flag, level) WPP_LEVEL_LOGGER(flag)
#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_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_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)
#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) \
(WPP_LEVEL_ENABLED(flags) && WPP_CONTROL(WPP_BIT_ ## flags).Level >= lvl)

//
// This comment block is scanned by the trace preprocessor to define our
Expand Down
127 changes: 66 additions & 61 deletions viomem/sys/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "kdebugprint.h"

#if ((OSVERSION_MASK & NTDDI_VERSION) > NTDDI_VISTA)
// #define EVENT_TRACING
//#define EVENT_TRACING
#endif

#if !defined(EVENT_TRACING)
Expand All @@ -38,79 +38,84 @@ extern ULONG driverDebugFlags;
extern int driverDebugLevel;

#if !defined(TRACE_LEVEL_NONE)
#define TRACE_LEVEL_NONE 0
#define TRACE_LEVEL_FATAL 1
#define TRACE_LEVEL_ERROR 2
#define TRACE_LEVEL_WARNING 3
#define TRACE_LEVEL_INFORMATION 4
#define TRACE_LEVEL_VERBOSE 5
#define TRACE_LEVEL_RESERVED6 6
#define TRACE_LEVEL_RESERVED7 7
#define TRACE_LEVEL_RESERVED8 8
#define TRACE_LEVEL_RESERVED9 9
#define TRACE_LEVEL_NONE 0
#define TRACE_LEVEL_FATAL 1
#define TRACE_LEVEL_ERROR 2
#define TRACE_LEVEL_WARNING 3
#define TRACE_LEVEL_INFORMATION 4
#define TRACE_LEVEL_VERBOSE 5
#define TRACE_LEVEL_RESERVED6 6
#define TRACE_LEVEL_RESERVED7 7
#define TRACE_LEVEL_RESERVED8 8
#define TRACE_LEVEL_RESERVED9 9
#endif


//
// Define Debug Flags
//
#define DBG_INIT 0x00000001
#define DBG_PNP 0x00000002
#define DBG_POWER 0x00000004
#define DBG_WMI 0x00000008
#define DBG_CREATE_CLOSE 0x00000010
#define DBG_IOCTLS 0x00000020
#define DBG_WRITE 0x00000040
#define DBG_READ 0x00000080
#define DBG_DPC 0x00000100
#define DBG_INTERRUPT 0x00000200
#define DBG_LOCKS 0x00000400
#define DBG_QUEUEING 0x00000800
#define DBG_HW_ACCESS 0x00001000
#define DBG_INIT 0x00000001
#define DBG_PNP 0x00000002
#define DBG_POWER 0x00000004
#define DBG_WMI 0x00000008
#define DBG_CREATE_CLOSE 0x00000010
#define DBG_IOCTLS 0x00000020
#define DBG_WRITE 0x00000040
#define DBG_READ 0x00000080
#define DBG_DPC 0x00000100
#define DBG_INTERRUPT 0x00000200
#define DBG_LOCKS 0x00000400
#define DBG_QUEUEING 0x00000800
#define DBG_HW_ACCESS 0x00001000

#define TraceEvents(level, flags, message, ...) VirtioDebugPrintProc(message, __VA_ARGS__)

#define WPP_INIT_TRACING(a, b)
#define WPP_INIT_TRACING(a,b)
#define WPP_CLEANUP(DriverObject)

#else
#define WPP_CHECK_FOR_NULL_STRING

#define WPP_CONTROL_GUIDS \
WPP_DEFINE_CONTROL_GUID(ViomemTraceGuid, \
(08cb9471, 36fb, 46ee, 998b, d1bfbe1c4899), \
WPP_DEFINE_BIT(DBG_INIT) /* bit 0 = 0x00000001 */ \
WPP_DEFINE_BIT(DBG_PNP) /* bit 1 = 0x00000002 */ \
WPP_DEFINE_BIT(DBG_POWER) /* bit 2 = 0x00000004 */ \
WPP_DEFINE_BIT(DBG_WMI) /* bit 3 = 0x00000008 */ \
WPP_DEFINE_BIT(DBG_CREATE_CLOSE) /* bit 4 = 0x00000010 */ \
WPP_DEFINE_BIT(DBG_IOCTLS) /* bit 5 = 0x00000020 */ \
WPP_DEFINE_BIT(DBG_WRITE) /* bit 6 = 0x00000040 */ \
WPP_DEFINE_BIT(DBG_READ) /* bit 7 = 0x00000080 */ \
WPP_DEFINE_BIT(DBG_DPC) /* bit 8 = 0x00000100 */ \
WPP_DEFINE_BIT(DBG_INTERRUPT) /* bit 9 = 0x00000200 */ \
WPP_DEFINE_BIT(DBG_LOCKS) /* bit 10 = 0x00000400 */ \
WPP_DEFINE_BIT(DBG_QUEUEING) /* bit 11 = 0x00000800 */ \
WPP_DEFINE_BIT(DBG_HW_ACCESS) /* bit 12 = 0x00001000 */ \
)

#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)

//
// This comment block is scanned by the trace preprocessor to define our
// Trace function.
//
// begin_wpp config
// FUNC Trace{FLAG=MYDRIVER_ALL_INFO}(LEVEL, MSG, ...);
// FUNC TraceEvents(LEVEL, FLAGS, MSG, ...);
// end_wpp
//
#define WPP_CONTROL_GUIDS \
WPP_DEFINE_CONTROL_GUID(ViomemTraceGuid,(08cb9471,36fb,46ee,998b,d1bfbe1c4899), \
WPP_DEFINE_BIT(DBG_INIT) /* bit 0 = 0x00000001 */ \
WPP_DEFINE_BIT(DBG_PNP) /* bit 1 = 0x00000002 */ \
WPP_DEFINE_BIT(DBG_POWER) /* bit 2 = 0x00000004 */ \
WPP_DEFINE_BIT(DBG_WMI) /* bit 3 = 0x00000008 */ \
WPP_DEFINE_BIT(DBG_CREATE_CLOSE) /* bit 4 = 0x00000010 */ \
WPP_DEFINE_BIT(DBG_IOCTLS) /* bit 5 = 0x00000020 */ \
WPP_DEFINE_BIT(DBG_WRITE) /* bit 6 = 0x00000040 */ \
WPP_DEFINE_BIT(DBG_READ) /* bit 7 = 0x00000080 */ \
WPP_DEFINE_BIT(DBG_DPC) /* bit 8 = 0x00000100 */ \
WPP_DEFINE_BIT(DBG_INTERRUPT) /* bit 9 = 0x00000200 */ \
WPP_DEFINE_BIT(DBG_LOCKS) /* bit 10 = 0x00000400 */ \
WPP_DEFINE_BIT(DBG_QUEUEING) /* bit 11 = 0x00000800 */ \
WPP_DEFINE_BIT(DBG_HW_ACCESS) /* bit 12 = 0x00001000 */ \
)


#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)

//
// This comment block is scanned by the trace preprocessor to define our
// Trace function.
//
// begin_wpp config
// FUNC Trace{FLAG=MYDRIVER_ALL_INFO}(LEVEL, MSG, ...);
// FUNC TraceEvents(LEVEL, FLAGS, MSG, ...);
// end_wpp
//

#endif

void InitializeDebugPrints(IN PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath);
void InitializeDebugPrints(IN PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath);