perfview
perfview copied to clipboard
[Exception Occurred: System.Runtime.InteropServices.COMException (0x80070296): Exception from HRESULT: 0x80070296
When I'm running prefview in the windows container, I encounter this exception:
[Exception Occurred: System.Runtime.InteropServices.COMException (0x80070296): Exception from HRESULT: 0x80070296
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.Diagnostics.Tracing.Extensions.ETWControl.EnableStackCaching(UInt64 traceHandle)
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.CommandProcessor.ExecuteCommand(CommandLineArgs parsedArgs)]
Here is my usage:
- Download the latest prefview from: https://github.com/microsoft/perfview/releases/download/v3.0.6/PerfView.exe
- Copy the
PerfView.exeinto the windows container - use
crictl exec <contianer id> powershellcommand to open a Powershell in the container - Running the command
.\PerfView "/DataFile:PerfViewData.etl" /BufferSizeMB:256 /StackCompression /CircularMB:500 /logFile=log.txt /maxCollectSec=30 /NoGui collect
My windows container's base image is: mcr.microsoft.com/windows/nanoserver:1809
My isolation runtime is: runhcs-wcow-hypervisor
And I have read this post: https://githublab.com/repository/issues/microsoft/perfview/1601. It said that we should use hyper-v isolation and that's exactly what I'm using.
Anything I can do about it? Thanks in advance.
I also faced this problem when I used Docker
docker run -it mcr.microsoft.com/windows/servercore:1803 powershell
It only works when added parameter /KernelEvents:Profile like below.
.\PerfView.exe "/DataFile:Data.etl" /BufferSizeMB:256 /StackCompression /CircularMB:500 /NoGui /AcceptEula
/MaxCollectSec:30 /LogFile=collect.log /KernelEvents:Profile collect
But it lost many details in Flame Graph, so I still want to remove this parameter when I collect PerfView.