Trace Message Format File

The trace message format (TMF) file is a structured text file that contains instructions for parsing and formatting the binary trace messages that a trace provider generates. The formatting instructions are included in the trace provider's source code and are added to the trace provider's PDB symbol file by the WPP preprocessor.

Some tools that log and display formatted trace messages require a TMF file. Tracefmt and TraceView, WDK tools that format and display trace messages, can use a TMF file or they can extract the formatting information directly from a PDB symbol file.

You can create a TMF file by using Tracefmt and including the -i parameter, which directs Tracefmt to create a TMF file for Tracedrv. For more info, see Example 9: Creating a TMF file.

If you do not have a TMF file for a trace provider, use Tracepdb. Tracepdb extracts the formatting instructions from the PDB symbol file and creates a TMF file to store them. Many application and driver developers prefer shipping a TMF file, rather than a PDB symbol file.

The name of the TMF file is the message GUID of the messages associated with that TMF file. ETW uses the message GUID to associate particular trace messages with the TMF file that holds their formatting instructions.

A TMF file contains the following data:

  • The name of the PDB file from which the TMF file data was extracted.

  • The message GUID of the trace messages in the source file and the source file name.

  • For each trace message, an entry that specifies the message type, the source code file name, a line number, a message number, a message definition string, a trace flag name, and the name of the C function that contains the macro call.

  • A list of variables whose values appear in the trace messages and their associated internal type names. The variables are represented by the %n notation in a message definition string.

Note  The TMF file is reserved for internal use, and its format is subject to change between different versions of Windows.