26

I followed the KB article from MS in order to turn on MSDTC trace. Unfortunately it was hard to follow, since it doesn't assume a very reasonable and obvious expectation of the reader, specifically "how do I read this binary log file?" I read this page from MSDN as well, where I find that I can't read the log file because I'm missing some executable called tracefmt.exe, and I'm apparently the only one anywhere with this problem.

Hence my question: Why don't I have tracefmt.exe and where do I get it? or, to get to the point: How do I read my MSDTC trace logs?

Peter O.
  • 32,158
  • 14
  • 82
  • 96
Adam Ritenauer
  • 3,151
  • 4
  • 33
  • 40
  • Approach suggested by Thomas Bratt helped me to solve this issue (Copying the exe from C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64 to the Trace folder). – LCJ Mar 11 '15 at 17:20

8 Answers8

33

With Visual Studio 2010 installed, I found the tool in the following location:

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64\TraceFmt.exe

I then copied the .EXE to the following location:

C:\Windows\System32\Msdtc\Trace

And ran it as follows:

TraceFmt.exe dtctrace.log.2012-06-13-10-38-57-0601-00

Although most of the time I use msdtcvtr.bat, as follows:

C:\Windows\System32\Msdtc\Trace\msdtcvtr.bat -tracelog dtctrace.log.2012-06-13-10-38-57-0601-00

Thomas Bratt
  • 48,038
  • 36
  • 121
  • 139
19

To save on downloading all of the WDK (600MB+), just for 200KB of files, I opted for a 4.7MB download by doing the following:

  1. Download "Windows XP Service Pack 2 Support Tools" from here: http://www.microsoft.com/downloads/details.aspx?FamilyId=49AE8576-9BB9-4126-9761-BA8011FABF38&displaylang=en
  2. If running from XP, just extract and go
  3. If running from 2003 (like I am), you'll get an error saying this can only be installed on XP. So to get around this, use a tool to extract the exe instead.
  4. Inside the exe will be a support.cab, extract the contents of this somewhere
  5. Look for these two files, tracefmt.exe and traceprt.dll. Copy these to your %windir%\system32\msdtc\trace directory
eyesnz
  • 2,698
  • 2
  • 16
  • 27
  • 1
    It keeps telling me that traceprt.dll is missing but that dll is in the path. I also tried to register it whith regsvr32 but that didn't work. – VVS Jul 18 '11 at 11:28
  • 2
    This doesn't seem to work on Windows 7 x64 (even after adding traceprt.dll to C:\Windows\SysWow64, then it stops complaining about the dll). Using amd64 version of tracefmt.exe from Windows DDK works fine, though. – Sergii Volchkov Jun 05 '12 at 12:53
  • Confirmed: it does not work for Windows 7 x64, however tracefmt.exe taken from amd64 folder magically works even with Intel processor – YMC Jan 15 '13 at 18:47
12

tracefmt (and traceview which is easier to use) are available in the Windows Driver Kit (WDK). It is available here: http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11800. It is in the WDK since this tracing technology is more commonly used in device drivers.

Michael
  • 54,279
  • 5
  • 125
  • 144
  • 1
    Thank you! I wish the guys or girls who documented MSDTC would have included this important detail instead of referring to it consistently as "The SDK" – Adam Ritenauer Aug 25 '09 at 17:14
  • If you don't want to install the whole SDK, mount the ISO file, go to the WDK folder and locate the file tracingtool_x64fre_cab001.cab (x86 or ia64 depending on your architecture) and extract the file _tracefmt.exe_00002 to a folder of your choice. Rename the file to tracefmt.exe and you're done. – spaghettidba Apr 22 '20 at 09:03
12

DTC Tracing

The Distributed Services Support Team blog goes over how to trace the DTC in more detail.

Windows Driver Kit

The links in the accepted answer seem to be broken. I've found the Windows Driver Kit homepage and current download link.

Once you have the ISO downloaded and you're at the installation screen, Microsoft Windows Driver Kit, select only Tools from Full Development Environment. The tracefmt.exe is in <install-path>\<version>\Tools\tracing\i386. Make sure you copy the version of tracefmt.exe from the 64-bit or 32-bit directory!

The blogger above moved those files to the DTC folder %systemroot%\MsDtc\Trace, probably so they were in the msdtcvtr.bat path.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Anthony Mastrean
  • 21,850
  • 21
  • 110
  • 188
  • 1
    If the server that generated the trace is a 64 bit machine, you will need to use the x64 version of exe. – sdanna Jun 01 '11 at 17:46
5

After searching for tracefmt.exe and traceprt.dll from the above posts (and elsewhere) I found that you need the 64 bit version of the tools for the program to run on Windows Server 2008.

I found this blog post.

and found that if you have visual studio installed you should be able to find both the 64-bit and 32-bit versions for the exe and dll on your local machine:

  • ProgramFiles\Microsoft SDKs\Windows\v6.0A\Bin\ (32 bit)
  • ProgramFiles\Microsoft SDKs\Windows\v6.0A\Bin\x64\ (64 bit)
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Darrin S.
  • 51
  • 1
  • 3
  • True for **VS 2008**, which I was lucky to find. Unfortunately on a system with VS 2010 and VS 2012, I could not find it, neither under `Program Files` (where there is no `Microsoft SDKs` sub folder any more) nor under `Program Files (x86)`, where they seemed to have moved it. – Evgeniy Berezovsky Mar 13 '15 at 07:27
2

Tracefmt.exe comes with the Windows Driver Kit.

http://www.microsoft.com/downloads/details.aspx?FamilyID=2105564e-1a9a-4bf4-8d74-ec5b52da3d00&displaylang=en

RyanY
  • 749
  • 1
  • 6
  • 16
1

Very often you should use existed *.mof file for enconding trace files. In C:\Windows\System32\Msdtc\Trace\ u can see msdtctr.mof. This file has description of the trace files and u need to use it file like this:

tracefmt log_filename -tmf msdtctr.mof
Alexander Shapkin
  • 1,126
  • 1
  • 13
  • 11
0

I found Darren's and Thomas Bratt's answers quite helpful, but in order to successfully parse DTC files using tracefmt, I had to provide the tmf parameter:

tracefmt -tmf msdtctr.mof dtctrace.log

Otherwise every event turned out something like

Unknown( 21): GUID=75f91e0e-d50c-47c9-b06f-3f2013e9da73 (No Format Information found).
Evgeniy Berezovsky
  • 18,571
  • 13
  • 82
  • 156