-
Notifications
You must be signed in to change notification settings - Fork 52
Add LINKTYPE_ETW.html #18
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
Conversation
|
The UserData field of an
and the Retrieving Event Data Using TDH says
So, in order to parse that data, would the program 1) have to be running on Windows, 2) have a manifest, MOF, or TMF file that defines the event format, and 3) use those APIs? If so, then those APIs appears to take a |
|
Let me update it a little bit. The UserData in fact is the binary content of the pointer. Technically it doesn't have to be limited to be the same as the content as UserData field of EVENT_RECORD. I will update it as UserData is specific event data of the provider, its format is defined by the provider It is created mainly for Windows, it saves the data that has been parsed on Windows so it doesn't require to call any windows API to parse it again. So technically, the binary format works on Linux also. https://gitlab.com/wireshark/wireshark/-/merge_requests/697, this PR in Wireshark dissects this binary format and is OS independent |
...but the only user data it dissects appears to be data from the Mobile Broadband Interface Model provider. I assume the provider GUID, plus the
Manifests appear to be XML files, so code to parse UserData for those events could either read such an XML file and us it to interpret the data, or could be generated from that XML file. The manifest includes a GUID that's presumably the provider GUID, so code to parse these could look for a manifest with that GUID and use it. "MOF" is presumably the Managed Object Format, and the Common Information Model to which they refer is presumably this Common Information Model, so code to parse UserData for those events could either read such an MOF file and us it to interpret the data, or could be generated from that MOF file. I'm not sure how MOF files are associated with provider GUIDs. I'm also assuming that the Managed Object Format is this Managed Object Format. I'm guessing that if For this specification, it's probably best to indicate what fields indicate how to parse the UserData, and treat the ETW header as similar to the Ethernet header, to the extent that the meanings of all the fields in the Ethernet header are fixed, but the meaning of the payload depends on the value of the type/length header. However, the Microsoft documentation does not indicate the numerical values of the bits in |
As I mentioned before, this binary format (includes UserData, Message, Providername) doesn't require to use extra manifest or MOF to pare
Are you ok to update this with below sentence? EVENT_HEADER is 80 bytes long data struct defined by Microsoft. It is the replication of EVENT_HEADER when the event is collected on Windows, it won't indicate how to parse UserData in LINKTYPE_ETW format. UserData is absolutely provider specific, the provider of UserData should write the full UserData in LINKTYPE_ETW format and be able to read/parse it without dependencies of other file. |
Yes, it is easy to get its numerical values from eventcons.h that is published within SDK. I can list of them in the spec if you think it is interesting to the reader of this specification #define EVENT_HEADER_PROPERTY_XML 0x0001 #define EVENT_HEADER_PROPERTY_FORWARDED_XML 0x0002 #define EVENT_HEADER_PROPERTY_LEGACY_EVENTLOG 0x0004 #define EVENT_HEADER_FLAG_EXTENDED_INFO 0x0001 #define EVENT_HEADER_FLAG_PRIVATE_SESSION 0x0002 #define EVENT_HEADER_FLAG_STRING_ONLY 0x0004 #define EVENT_HEADER_FLAG_TRACE_MESSAGE 0x0008 #define EVENT_HEADER_FLAG_NO_CPUTIME 0x0010 #define EVENT_HEADER_FLAG_32_BIT_HEADER 0x0020 #define EVENT_HEADER_FLAG_64_BIT_HEADER 0x0040 #define EVENT_HEADER_FLAG_CLASSIC_HEADER 0x0100 |
It requires knowledge of the format. One form that this knowledge takes is an XML manifest; another form is an MOF file. Perhaps others have formats described by TMF files, or by some other files. If If The other values of If |
|
What, if anything, do |
|
What about the "extended data" -
Those look sort of like TLVs. |
This specification will not include everything of MSDN, it will be supper long if it does that. This specification only defines the Binary format of LINKTYPE_ETW, how the provider interpret of this binary format and generate this binary format is up to the provider. Right? Like "extended data", if a provider needs persist the extended data from an event, the provider can choose to leverage UserData to accommodate that. In UserData, the provider can save whatever is interesting and decode it, it can be another struct specific to the provider |
Again, they won't change, they are just the replication from the EVENT_HEADER when the event is collected on Windows. Dissection just show this number and doesn't need do anything special with it |
This is the provider responsibility to understand the knowledge of those FLAGs. When a provider decided to use the LINKTYPE_ETW, the provider is responsible to understand how to decode the those data from original ETL file and write it as in LINKTYPE_ETW format. Right? For example, assume I am Mobile Broadband Interface Model provider, when I write LINKTYPE_ETW format, I know if I need check those FLAGS and what bytes need be wrote to UserData. https://gitlab.com/wireshark/wireshark/-/merge_requests/468, I believe this PR should be the good example to demonstrate how to generate this DLT_ETW binary format from the Windows ETW source |
I sure agree that it would be great if we could parse the data elsewhere, and certainly anyone trying to make a tcpdump or wireshark dissector needs that.... but are we being too heavy-weighted on DLT values here? |
@mcr, sounds like you agree to link to MSDN in stead of explain those fields in the this document again. Is this document good enough for publish? Let me know if anything else need be updated
The DLT_ETW binary format itself can be parsed elsewhere other than windows. Windows is only needed when the DLT_ETW binary format is generated since its source is windows EVENT_RECORD. Then Wireshark, tcpdump or any other application can parse it on any platform. So the answer is it doesn't need run on Windows, or need manifest, MOF or TMF to parse the data. Check this Wireshark PR https://gitlab.com/wireshark/wireshark/-/merge_requests/697 as an example that dissects this binary format and it works on Linux also
At first, I don't think MS will likely change this format. MS will definitely publish the change if in worst case MS changed it because the data structure is published on MSDN |
|
Pointing to the MSDN structures works, if eventually there are links for all of Microsoft's primitive types such as We should, however, provide the values for flag bits, unless Microsoft defines them in a document rather than in a header file. |
@guyharris, here is the MSDN document for the size of different types on Windows. https://docs.microsoft.com/en-us/cpp/cpp/data-type-ranges?view=msvc-160 I will have it in the document and also have the values for the flag bit in the document. I might not answer every question, hopefully I clarified most of them. Thanks |
414f6d7 to
fdbaedf
Compare
fdbaedf to
e0efdff
Compare
|
@guyharris, @mcr, Is it good to merge? Two PRs in Wireshark are waiting for this DLT_ETW to enable supporting ETW so Windows developer can benefit from this new functionality. Thanks very much. |
|
I have updated the document, @guyharris and @mcr, could you please take a look and merge it if it looks good? Thanks |
|
@guyharris , I haven't read this deeply, but I'm happy with this. |
|
@mcr, Thanks very much to merge it. Could you please help to merge the-tcpdump-group/libpcap#978 that add DLT_ETW value in the code so Wireshark can move on with the value? |
|
IMO, Guy was doing this review better than anyone else could. |
|
@infrastation, not sure if @guyharris started Thanksgiving vacation. He seems not responding for a week. Because the Wireshark PRs are waiting for the DLT_ETW value, could you please merge the-tcpdump-group/libpcap#978 so its value can be locked? I will update the specification if @guyharris has other feedback |
Finishes the job started in pull request #18.
Finishes the job started in pull request #18.
No description provided.