0

When I'm running prefview tool (https://github.com/microsoft/perfview) 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:

  1. Download the latest prefview from: https://github.com/microsoft/perfview/releases/download/v3.0.6/PerfView.exe
  2. Copy the PerfView.exe into the windows container
  3. use crictl exec <contianer id> powershell command to open a Powershell in the container
  4. 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

Anything I can do about it? Thanks in advance.

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.

1 Answer 1

0

Have you tried to use the Server Core image? It might be the case that PerfView is trying to access OS APIs that are not present in Nano Server.

answered Dec 2, 2022 at 18:55
Sign up to request clarification or add additional context in comments.

3 Comments

Yes, we have tried different image using docker: docker run -it mcr.microsoft.com/windows/servercore:1803 powershell Also encounter this problem. Currently we can only add parameter /KernelEvents:Profile to omit some kernel info. But it lost many details in Flame Graph, so I still want to remove this parameter when I collect PerfView.
It does seems to me that the tool is trying to access something that is not present. First, this image of Server Core is very old and not supported anymore. I'd try with the 1809/ltsc2019 (which are the same), or the ltsc2022. Also, you might want to try with the Windows or Server image as they have the largest set of APIs available.
A larger image may cause overhead to my service, but I will try them. Thanks a lot for your answer.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.