ulong event property is displayed as long in event viewer.
I have a method to write ulong event in my event source:
[NonEvent]
private unsafe void WriteEvent(int eventId, ulong arg1)
{
if (IsEnabled())
{
EventData* descrs = stackalloc EventData[1];
descrs[0] = new EventData { DataPointer = (IntPtr)(&arg1), Size = 8 };
WriteEventCore(eventId, 1, descrs);
}
}
Yet it is still displayed as a long value inside the events grid view.
Is this expected behavior or fixable?
I am not surprised at this. Looking at the code - at a minimum, this is coming from the PayloadFetch struct, which converts incoming signed and unsigned types into their signed .NET equivalents.
I am not sure how easy this is to fix, but I would hope relatively simple. Let's start with copilot trying to update PayloadFetch to differentiate between signed and unsigned types and see if that solves the problem.
Copilot: Please focus specifically on changing the handling of UInt16, UInt32, and UInt64. Don't touch UInt8. You should be able to update the switch statement to set the .NET type to be the unsigned type that matches the input type, rather than translating to the signed .NET type.
@tomuxmon would you mind testing #2315 and see if that fixes your issue?
@tomuxmon would you mind testing https://github.com/microsoft/perfview/pull/2315 and see if that fixes your issue?