1

When I run log.cmd from the windows command line, I get errors from xperf saying that the *.etl file already exists. I understand that other processes also use windows ETL and since gpuview uses xperf to trace events, it "collides" in some sense. Nevertheless, I get a ton of ETL files that are merged by running log.cmd again.

I hate using cmd and tried doing the same thing with cygwin bash. I get similar errors, but barring DXCstate.etl, i don't see anything else.

I'm running the terminal with admin privelges and log.cmd has 755 privileges.

$ ./log.cmd
Xperf: error: NT Kernel Logger: Cannot create a file when that file already exists. (0xb7).
Xperf: error: DxTest: Cannot create a file when that file already exists. (0xb7).
Xperf: error: DxLogger: Cannot create a file when that file already exists. (0xb7).
The trace you have just captured "C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\gpuview\DXCState.etl" may contain personally identifiable information, including but not necessarily limited to paths to files accessed, paths to registry accessed and process names. Exact information depends on the events that were logged. Please be aware of this when sharing out this trace with other people.
Xperf: error: DxcStackLogger: Cannot create a file when that file already exists. (0xb7).
Xperf: error: DxcLogger: Cannot create a file when that file already exists. (0xb7).
Xperf: error: UMDLogger: Cannot create a file when that file already exists. (0xb7).
Xperf: error: DXGILogger: Cannot create a file when that file already exists. (0xb7).
Xperf: error: Dx11Logger: Cannot create a file when that file already exists. (0xb7).
Xperf: error: D3D10Level9Logger: Cannot create a file when that file already exists. (0xb7).
Xperf: error: MFLogger: Cannot create a file when that file already exists. (0xb7).
Xperf: error: OLogger: Cannot create a file when that file already exists. (0xb7).
Xperf: error: XAMLLogger: Cannot create a file when that file already exists. (0xb7).
Xperf: error: D2DLogger: Cannot create a file when that file already exists. (0xb7).
Xperf: error: D2DScenariosLogger: Cannot create a file when that file already exists. (0xb7).

$ ls
DXCState.etl*  DxEtw.dll*  EventsForStackTrace.txt*  dota2/  GPUView.chm*  GPUView.exe*    
LDDMCore.man*  log.cmd*  plugins/  README.TXT*  tplugins/  UMDEtw.man*
Raja
  • 2,846
  • 5
  • 19
  • 28

1 Answers1

2

If you look in log.cmd you will see that each logger is associated with a filename. For instance, we have this line:

"%~dp0"..\Xperf -start DxcLogger -on %TRACE_DXC_MIN% %TRACE_LARGE_BUFFERS% -f DXC.etl

If you can a "Cannot create a file when that file already exists" error then that means that DXC.etl already exists which means that a previous invocation of log.cmd did not exit cleanly and did not stop logging to that file. You probably cancelled the batch file with Ctrl+C. It is not a conflict with Process Explorer or Resource Monitor because those would not be using DXC.etl in particular.

So, reboot your machine to get back to a good state, and be wary of halting log.cmd in the middle of its work.

Alternately, just stop using log.cmd. Use wprui.exe instead. See this blog post for details:

http://randomascii.wordpress.com/2013/04/20/xperf-basics-recording-a-trace-the-easy-way/

Bruce Dawson
  • 3,284
  • 29
  • 38
  • nope, the "Cannot create a file when that file already exists" error means a different tool is running which uses ETW. Took me a while to figure this out. – magicandre1981 Mar 25 '14 at 05:34
  • 1
    @magicandre1981, look closely at the error messages in the original question - we are both correct. Those messages happen when ETW tracing is enabled. But not all types of ETW tracing conflict. For instance, log.cmd starts up a dozen or so user-mode tracing sessions, each with different session names and file names. Another user of ETW is unlikely to use those same names and conflict, so the problem is definitely that log.cmd left those sessions running. The kernel provider is special. Only one program can monitor it. Duplicate uses give that error, specifically the NT Kernel Logger variant. – Bruce Dawson Mar 26 '14 at 15:50