【问题标题】:PerfView - Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)PerfView - 当该文件已存在时无法创建该文件。 (来自 HRESULT 的异常:0x800700B7)
【发布时间】:2017-07-14 23:11:23
【问题描述】:

当我尝试使用 PerfView v1.9.0.0(收集​​ -> 收集 -> 开始收集,使用默认参数)创建 ETL 文件时,操作失败并显示“异常情况发生,请参阅日志了解详情。"

以下是我在日志中看到的内容:

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.

当然,文件从不之前存在,在(失败的)操作之后也不存在。每次我尝试收集时都会发生这种情况,无论我提供的文件名或目录如何。

我做错了什么?

【问题讨论】:

  • 如果您使用 Windows 7,请停止使用 ETW 的其他工具(ProcessExplorer、Resmon)

标签: perfview


【解决方案1】:

在 Windows 7 之前,您只能使用一个名为 NT Kernel Logger 的内核会话。从 Windows 8 开始,您可以创建具有不同名称的新会话。

在 Windows 8、Windows Server 2012 及更高版本上,SystemTraceProvider 最多可复用 8 个记录器会话。前两个插槽 for logger 会话保留给 NT Kernel Logger 和 循环内核上下文记录器。

所以停止使用 NT Kernel Logger 的工具(如 Process Explorer、Process Hacker、Resmon)来解决问题。

【讨论】:

  • 谢谢。我一直在 Windows 7 上运行 Process Explorer,从没想过这是问题所在。杀了它,突然间我可以运行分析器了!
【解决方案2】:

感谢magicandre1981 的建议。我确实在使用 Windows 7,并且正在运行 Process Hacker。停止 Process Hacker 后,PerfView 能够成功执行收集。干杯。

【讨论】:

    猜你喜欢
    • 2021-11-19
    • 2012-11-12
    • 1970-01-01
    • 1970-01-01
    • 2011-03-10
    • 2020-12-18
    • 2022-07-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多