vioserial: include VirtIO logs into driver logs
#if defined(EVENT_TRACING)
#include "utils.tmh"
+#else
+#define PRINT_DEBUG
#endif
#define TEMP_BUFFER_SIZE 256
@@ -85,7 +87,16 @@ static void DebugPrintFunc(const char *format, ...)
static void DebugPrintFuncWPP(const char *format, ...)
{
- UNREFERENCED_PARAMETER(format);
+ char buf[256];
+ NTSTATUS status;
+ va_list list;
+ va_start(list, format);
+ status = RtlStringCbVPrintfA(buf, sizeof(buf), format, list);
+ if (status == STATUS_SUCCESS)
+ {
+ TraceEvents(TRACE_LEVEL_INFORMATION, DBG_HW_ACCESS, "%s", buf);
+ }
+ va_end(list);
}
static void NoDebugPrintFunc(const char *format, ...)
@@ -96,6 +107,8 @@ static void NoDebugPrintFunc(const char *format, ...)
void InitializeDebugPrints(IN PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
+ virtioDebugLevel = 1;
+ driverDebugLevel = TRACE_LEVEL_INFORMATION;
//TODO - Read nDebugLevel and bDebugPrint from the registry
#if defined(EVENT_TRACING)
VirtioDebugPrintProc = DebugPrintFuncWPP;
@@ -112,8 +125,6 @@ void InitializeDebugPrints(IN PDRIVER_OBJECT DriverObject, PUNICODE_STRING Regi
UNREFERENCED_PARAMETER(RegistryPath);
bDebugPrint = 1;
- driverDebugLevel = TRACE_LEVEL_FATAL;
- virtioDebugLevel = -1;
}
tDebugPrintFunc VirtioDebugPrintProc;
