-
Notifications
You must be signed in to change notification settings - Fork 389
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
NO-SDV [vioscsi] Tracing improvements #1176
NO-SDV [vioscsi] Tracing improvements #1176
Conversation
Includes: a) New RUN_UNCHECKED and RUN_MIN_CHECKED definitions for compilation conditional tracing b) DBG definition fix (remove superfluous "define") c) Use keywords for WPP FLAGS d) New INLINE function WPP definitions e) WPP Optimisation f) ETW Prettification g) Suggestion to cull code for InitializeDebugPrints() when EVENT_TRACING Signed-off-by: benyamin-codez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one incredibly small nitpick
@benyamin-codez It is the only way to troubleshoot the boot time, installation time and crash handler problems. Best, |
Thanks @vrozenfe Just to be clear, I'm not proposing to alter the DBG path but rather just the ETW path like this: --- a/vioscsi/utils.c
+++ b/vioscsi/utils.c
@@ -86,34 +86,33 @@
void InitializeDebugPrints(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
{
//TBD - Read nDebugLevel and bDebugPrint from the registry
bDebugPrint = 1;
virtioDebugLevel = 0;
- nVioscsiDebugLevel = TRACE_LEVEL_ERROR;
+#if !defined(RUN_UNCHECKED)
+ nVioscsiDebugLevel = TRACE_ALL;
+#endif
#if defined(PRINT_DEBUG)
VirtioDebugPrintProc = DebugPrintFunc;
#elif defined(COM_DEBUG)
VirtioDebugPrintProc = DebugPrintFuncSerial;
#else
VirtioDebugPrintProc = NoDebugPrintFunc;
#endif
}
-tDebugPrintFunc VirtioDebugPrintProc;
-#else
+#else // Everything above here is DBG, everything below is ETW
+static void NoDebugPrintFunc(const char *format, ...) {} // This is NOT strictly required for ETW
void InitializeDebugPrints(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
{
- //TBD - Read nDebugLevel and bDebugPrint from the registry
- bDebugPrint = 0;
- virtioDebugLevel = 0;
- nVioscsiDebugLevel = 4;// TRACE_LEVEL_ERROR;
+ VirtioDebugPrintProc = NoDebugPrintFunc; // This is NOT strictly required for ETW - neither DbgPrint nor DbgPrintEx will be called when EVENT_TRACING is defined
}
-
-tDebugPrintFunc VirtioDebugPrintProc = DbgPrint;
#endif
+// Both DBG and ETW from here...
+tDebugPrintFunc VirtioDebugPrintProc; // This is necessary for compilation due to VirtIO\kdebugprint.h requisites
#undef MAKE_CASE
#define MAKE_CASE(scsiOpCode) \
case scsiOpCode: \
scsiOpStr = #scsiOpCode; \
Any concerns? cc: @YanVugenfirer |
Looks good to me. Please submit the final version when it is ready. Best, |
Includes: a) Indentation fixes upon review (Credit to the eagle eye of @JonKohler..!) b) Removes unnecessary and orphaned code c) Culls unused code for InitializeDebugPrints() when EVENT_TRACING d) Added comments to show necessary and necessary ETW inclusions Signed-off-by: benyamin-codez <[email protected]>
More failed checks with:
|
Currently, we have vioscsi driver bug in the upstream, so before merging #1180 we can't identify the real reason of the fail |
rerun tests |
@kostyanf14 please re-run CI tests after DMA remapping rollback merge |
@YanVugenfirer |
@kostyanf14, I'm guessing something started working again with recent changes to the build scripts..? So, it would appear calling Calling Anyway, I will raise a PR to fix both defects - hopefully in the next couple of hours (I have already fixed them and just need to raise the PR after seeing to some other commitments). I presume DDI versions 24H2 and higher only use CodeQL and not SDV. Fixing the above defects will likely fix this too. I note viostor does not report any SDV defects. I still need to explicitly check VirtIO... |
A PR to fix SDV defects has been raised: #1181 |
No, this is a requirement from MS. Starting from 24H2/Server 2025 SDV is deprecated and removed.
|
Thanks for the reply. I thought it pertinent to clarify a couple of things...
I think we are saying the same thing here, i.e. that CodeQL is a must have from 24H2 as SDV is deprecated.
SDV aside, would it be true that if CodeQL finds a Must-Fix defect, the I noticed in the HLK Test Reference for the Static Tools Logo Test, that KM driver submissions need to pass all Must-Fix rules:
Are you able to advise whether up-to-date standard CodeQL query suites are used, e.g. windows_driver_recommended.qls (which includes windows_driver_mustfix.qls) or is a custom query suite that includes windows_driver_mustfix.qls used instead? Moreover, is the same query suite used on all CI targets? I'm curious as to why the CI check for Server2025 failed the Best regards, |
Yes
See for details: https://github.com/virtio-win/kvm-guest-drivers-windows/blob/master/build/build.bat#L238
Yes
See note in docs https://learn.microsoft.com/en-us/windows-hardware/test/hlk/testref/6ab6df93-423c-4af6-ad48-8ea1049155ae (look for |
Many thanks for making the time to reply. That's good to know that the query suite and tooling is the same for all CI targets, and that there's a known cause for the failure on Server2025 and a plan to address it. On the versions specified in the wiki, I'm not sure if it's come to your attention, but there are some additional steps required - at least for WHCP_24H2 (and maybe others). I'll raise a PR for your consideration to address this over on https://github.com/virtio-win/virtio-win.github.io. Best regards, |
@benyamin-codez Feel free to send PR for wiki |
Includes:
a) New RUN_UNCHECKED and RUN_MIN_CHECKED definitions for compilation conditional tracing
b) DBG definition fix (remove superfluous "define")
c) Use keywords for WPP FLAGS
d) New INLINE function WPP definitions
e) WPP Optimisation
f) ETW Prettification
g) Suggestion to cull code for InitializeDebugPrints() when EVENT_TRACING