runtime icon indicating copy to clipboard operation
runtime copied to clipboard

EventSource: Arrays in the Event payload are not supported

Open MikeDempseyFL opened this issue 8 years ago • 0 comments

I see a major problem with the Lttng output on Linux when an array is passed to an Event using a custom EventSource.

One of the events in our EventSource includes a byte array in its payload. [a data buffer] On Windows the event log correctly shows the data in that buffer, but on Linux it simply shows "System.Byte[]". Apparently it is using ToString() which will not work for arrays.

I am simply passing a Byte[] to the WriteEvent() function in my EventSource:

        [Event(6, Level = EventLevel.LogAlways)]
        private void DataMsg(String action, String msgType, UInt32 sesssion, UInt32 request, Int32 length, Byte[] data)
        {
            WriteEvent(6, action, msgType, sesssion, request, length, data);
        }

I copied the log file [chanel0_0] to Windows and read it using Notepad++. (I'm sure there is a simple way to read it on Ubuntu but I'm not familiar with Linux.)

An example of the payload received from this DataMsg event follows: {"action":"SEND", "msgType":"Start", "sesssion":9774, "request":1, "length":61, "data":System.Byte[]}

Everything looks good except for the 'data' value. On Windows the *.etl file contains the actual contents of the data buffer. (This value is displayed in PerfView as a hex-string.)

MikeDempseyFL avatar Mar 02 '18 18:03 MikeDempseyFL