TraceParserGen Users' Guide

TraceParserGen is tool for taking ETW manifest files (as generated from tracerpt -export), and generating C# subclasses of TraceEvent which can parse the events into strongly type managed objects. 

You can generate a ETW manifest file from an ETL file by using the -export option on the 'traceRpt' command

Once you have the manifest, you generate C#  subclasses of TraceEvent which understand those events by doing

You can then add 'manifest.cs' to your project, and link it against the TraceEvent.dll to form a complete parser for your new events. 

The default outputfile is derived by simply changing the file extension to .cs thus the command above can be abbreviated to

Merge Support

It is likely that you will want to update the .CS file that was generated from TraceParserGen.  Possibly to give better names to operations, add missing information (like enumating type), or to simply fix errors from the original manifest.  This presents a problem if you want to regenerated the .CS file from the manifest again (either because TraceParserGen was updated to produce 'better' templates, or more events were added to the manifest. 

This problem can be solve by Saving the original file generated by TraceParserGen before making any local modifications (suggested name is filename .base.cs).  This allows a 3 way difference to be done between the newly generated .CS file, the original generated .CS file and the user-modified CS file. 

The /merge option of TraceParserGen supports this mode.  If you typed

TraceParTraceParserGen will then

  1. Rename providerMetaData.cs to providerMetaData.NUM.cs and and providerMetaData.base.cs to providerMetaData.NUM.base.cs where NUM is the first decimal number that ensures that the new files don't clobber existing ones.  
  2. Create a new manifest generated C# into providerMetaData.base.cs
  3. Do a 3 way merge between the newly generated providerMetaData.base.cs and providerMetaData.NUM.cs (the original user-modified file), using providerMetaData.NUM.base.cs as the base. 

The result is that user-modifications will be merged into the newly generated data.    Ultimately the numbered files can be deleted, but are handy in case something goes wrong. 

The default for the baseline is to change the extension to .base.cs, so the command above can be abbreviated to