[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/5] Replace RegisterEventSource with TraceLoggingRegister


  • To: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>, "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Mon, 9 Feb 2026 14:02:27 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mk/GPFDNCvr77DGlZQ3BlamcJm6keQ4g/+cG8aQ3d7U=; b=ZGpTuLw95srzRPWuZx8h91zNm9AfHkg7GjoUw6vLIdd6Wm7VYYQfBpAW6/0FBARy+bBwZcYBr4MlKNtdJpHkIzX5TNhLl4Pn9Guvh2uPnsb7a3+0Fl+L7RraqDahyuU1W9ItF3xin1i3A+l8TSdjVEjmBraSV2qocx2SL+G/uGTQ4srietnSo5CRpYk5TYq+wOx5BZUy2QIFajrtt/uRZrO3vrwGCfRCpYizod5XanBCYzvNbLWk3wHQu41kZqJ8vdxkw0/hyepNcJbWP6xuc7/m/cI62jJN0DpBDthjw/flq4GAGQWRX259bD6SuiKh1f+de9G+0XkyLmwz8+dOPw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OoZW/9e9qD28SV1CPGmNmFrYxID/gsVQbHxU5qGXBf4i1RLk9x6zvh6Q7XuBW0Sp+AbRtC9t7mNRoTkMka/0ZpVBr64eT0Sdp/O5qf165NLleFWCwa9uqMLraPvLJpFN8HgqbfeELdFOV/2eWL/LDrfD1b9ID8gWddb7AyD+bW+IZBVBxafUtxXu8TGAGfIiVgp0Mv7XOLLb+RMXOtBXYFhPSLm+ie/RVcAm7KGUrR0HZbLIezpAFHH/wZ6Q5I2DMiCkKwHapaxemuQxdWoEtdqpxV1+YXIe1TPpxd6StL3iNC+fliY3GZ9N8SwSKHGCMnF0H5XWOc0JNFiXQMT+mQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: david ambu <david.preetham@xxxxxxxxx>
  • Delivery-date: Mon, 09 Feb 2026 14:02:41 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHcl0T31r+8us63wEKZLAFQEO/a57V1f0IAgAS1O+I=
  • Thread-topic: [PATCH 5/5] Replace RegisterEventSource with TraceLoggingRegister

> Could you add some comments to explain the potential issue with
> RegisterEventSource?

RegisterEventSource is marked deprecated - CodeQL detected this issue
https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/28735-banned-crimson-api-usage
I will add a comment to this effect.

> I think it'd be great if you could provide similar patches for
> xencons_monitor and xenagent as well.

Similar patches will be created for the other user mode components.

>> ---
>> +TRACELOGGING_DEFINE_PROVIDER(g_xenbus_monitor,
>
>
>The provider handle name should use the same convention as other global
>variables (e.g. MonitorTraceLoggingProvider).
>
>> +                             MONITOR_NAME,
>> +                             //{E8ADEEB7-6DD1-447E-A49B-A6571CC74039}
>> +                             (0xe8adeeb7, 0x6dd1, 0x447e, 0xa4, 0x9b, 0xa6, 
>> 0x57, 0x1c, 0xc7, 0x40, 0x39)
>
>Is it worth having a DEFINE_GUID for this somewhere?

This is how the macro is documented - I'd assume the macro will internally 
define the guid correctly,
using DEFINE_GUID will cause issues with the trace macro's expansion.

>> +    case LOG_INFO:
>> +        TraceLoggingWrite(g_xenbus_monitor,
>> +            "Information",
>> +            TraceLoggingLevel(WINEVENT_LEVEL_INFO),
>> +            TraceLoggingString(Buffer, "Info")
>
>Buffer is a PTSTR, so we should have an appropriate #define for
>TraceLoggingString.


>> -        Log("[%u]: %s [%s]",
>> +        LogInfo("[%u]: %s [%s]",
>>               SessionId,
>>               Name,
>>               WTSStateName(State));
>
>Could you align the arguments here (and elsewhere)?

Sure



Owen




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.