The Windows Event Tracing framework (ETW) can be used to log a lot of information about the system internals. The tracefmt.exe
tool that comes with Windows SDK can be used to convert the .etl
log files into text.
However, it requires .tmf
message format files to process the messages. Otherwise the data fill just appear as unknowns:
Unknown( 25): GUID=72e5b5cd-5b46-3568-7f3a-3eb074bedc0f (No Format Information found).
How can I download the needed .tmf
files?
1. Identify which
.sys
file is related to the GUID.Sometimes simply searching the GUID online will identify the related
.sys
file. If it does not, one can do a binary search among the.sys
files inC:\Windows\System32
.Any binary grep tool can be used, but the GUID bytes have to be reordered to little-endian order. For example
72e5b5cd
will appear as0xcd 0xb5 0xe5 0x72
. I have used the following Python one-liner to perform the search:That particular GUID will appear in
winusb.sys
.Note that only 64-bit applications can access the real system files, 32-bit applications will not see them.
2. Download the
.pdb
file for the.sys
For this step you'll need
symchk.exe
from Windows SDK. Create a new directory to store the files, here I've usedC:\tracing
:3. Extract the trace formats from the
.pdb
For this step you'll need
tracepdb.exe
from Windows SDK. I've placed the output in the same directory as the previous step.Note that the hex string will depend on the system file version. Check the file listing to see under what name the symbols have been downloaded.
Now you will see a listing of TMF files being generated:
Hopefully you'll see the GUID you want in that listing. If not, it either wasn't actually in that file, or it has been removed from the public symbols for some reason.
Note that if you are debugging an
.etl
collected from another computer, you'll need to collect the.sys
files from that computer also to get the correct symbol versions.4. Decode the trace
Now that we have the
.tmf
files, they can be passed totracefmt.exe
:The command will show result count as:
In this case most of the events were decoded ok, but there are still a few unknowns. Check out which lines still have
Unknown
in them, and repeat from step 1.