PerfView - Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)

0

When I try to create an ETL file using PerfView v1.9.0.0 (Collect -> Collect -> Start Collection, with default parameters) the operation fails stating "An exceptional condition occurred, see log for details."

Below is what I see in the log:

Started with command line: "C:\Users\XYZ\Desktop\PerfView.exe" 
PerfView Version: 1.9.0.0  BuildDate: Fri 02/12/2016 11:19:34.83
Started: View
Warning: PdbScope not found at C:\Users\XYZ\Desktop\PerfViewExtensions\PdbScope.exe
Disabling the Image Size Menu Item.
Warning: ILSize not found at C:\Users\XYZ\Desktop\PerfViewExtensions\ILSize.dll
Disabling the IL Size Menu Item.
Completed: View   (Elapsed Time: 0.021 sec)
Collection Dialog open.
Started: Collecting data C:\Users\XYZ\Desktop\PerfViewData.etl
[Kernel Log: C:\Users\XYZ\Desktop\PerfViewData.kernel.etl]
Kernel keywords enabled: Default
Aborting tracing for sessions 'NT Kernel Logger' and 'PerfViewSession'.
Insuring .NET Allocation profiler not installed.
Completed: Collecting data C:\Users\XYZ\Desktop\PerfViewData.etl   (Elapsed Time: 1.300 sec)
Exception Occurred: System.Runtime.InteropServices.COMException (0x800700B7): Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.EnableKernelProvider(Keywords flags, Keywords stackCapture)
   at PerfView.CommandProcessor.Start(CommandLineArgs parsedArgs)
   at PerfView.CommandProcessor.Collect(CommandLineArgs parsedArgs)
   at PerfView.MainWindow.<>c__DisplayClass13_0.<ExecuteCommand>b__0()
   at PerfView.StatusBar.<>c__DisplayClass19_0.<StartWork>b__0(Object <state>)
An exceptional condition occurred, see log for details.

Off course, the file never existed before and does not exist after the (failed) operation too. This happens every time I try to collect, regardless of the file name or the directory I provide.

What am I doing wrong?

perfview
asked on Stack Overflow Jul 12, 2017 by zsoumya

2 Answers

1

Until Windows 7, you can only use one kernel session with the name NT Kernel Logger. Starting with Windows 8, you can create new sessions with a different name.

On Windows 8, Windows Server 2012, and later, the SystemTraceProvider can be multiplexed for up to 8 logger sessions. The first two slots for logger sessions are reserved for the NT Kernel Logger and the Circular Kernel Context Logger .

So stop tools that use NT Kernel Logger (like Process Explorer, Process Hacker, Resmon) to fix the the issue.

answered on Stack Overflow Jul 14, 2017 by magicandre1981
0

Thank you magicandre1981 for your suggestion. I am indeed using Windows 7 and I was running Process Hacker. After stopping Process Hacker, PerfView was able to successfully perform the collection. Cheers.

answered on Stack Overflow Jul 13, 2017 by zsoumya

User contributions licensed under CC BY-SA 3.0