perfview icon indicating copy to clipboard operation
perfview copied to clipboard

Not able to find a way to use perfview (without GUI) from powershell in windows server core 2019

Open vipul0506 opened this issue 3 years ago • 10 comments

We are moving from windows server to windows server core, but not able to find a way to replace perfview. Because there is no GUI available in core and perfview isn't executable from powershell in windows server core.

We tried to go with this approach as well: Execute this from the command line and create a ETL file for you to look at on another machine. But can't find a way to generate a ETL file for our IIS application.

Can someone please guide how we can replace the perfview usage with our change to windows server core!

vipul0506 avatar Oct 27 '22 07:10 vipul0506

If you don't have access to a GUI, as in this case, you can run PerfViewCollect, which is effectively a non-GUI version of the collection capabilities in PerfView. We don't currently build and ship it, but it is available in this repo and is built if you run build.cmd. Would this work for you?

brianrob avatar Oct 27 '22 15:10 brianrob

I tried to build it, but getting this error. Don't know exactly what's i need to change on my setup. Error --> C:\Users\vipul.malik\.nuget\packages\microsoft.build.tasks.git\1.0.0-beta-63127-02\build\Microsoft.Build.Tasks.Git.targets(20,5): error : Unable to locate repository containing directory 'D:\perfview-main\src\PerfViewCollect'.

I checked this file Microsoft.Build.Tasks.Git.targets , seems fine, not sure if i need to make any change in it.

vipul0506 avatar Nov 04 '22 06:11 vipul0506

Just to confirm, did you clone the repo, or did you download the source as a zip file? This package assumes that you cloned it using git. It probably also needs git to be on your path.

brianrob avatar Nov 04 '22 18:11 brianrob

I downloaded it as a zip file. I'm trying again by installing git on my server.

vipul0506 avatar Nov 07 '22 07:11 vipul0506

It worked and had build the solution. I can see the PerfviewCollect application on this path C:\Users\vipul.malik\perfview\src\PerfViewCollect\bin\Release\netcoreapp3.1\win-x64 Is this what we need to deploy? And where i can find the usage of it like the commands we can execute from powershell for data collection? because i'm opening it and get close in like milliseconds.

Also, i can see release of Perfview application as well on this path C:\Users\vipul.malik\perfview\src\PerfView\bin\Release\net462

vipul0506 avatar Nov 07 '22 08:11 vipul0506

You likely want to run dotnet publish -c Release -r win-x64 --self-contained and then copy the entire publish directory at C:\Users\vipul.malik\perfview\src\PerfViewCollect\bin\Release\netcoreapp3.1\win-x64\publish. This will ensure that you don't have to have a copy of the .NET Core 3.1 runtime installed on the machine. The self-contained publish will carry all of the dependenceis that you need. You should be able to run PerfViewCollect /? to get the command line help.

brianrob avatar Nov 10 '22 16:11 brianrob

While running dotnet publish -c Release -r win-x64 --self-contained I'm getting such error: Screenshot 2022-11-14 at 12 52 21 PM

Also, will it make any difference if we're on .NET 4.8 or 6 and this requires .NET 3.1?

vipul0506 avatar Nov 14 '22 07:11 vipul0506

As long as you have the .NET Core 3.1 SDK installed, you should be fine. These errors don't look SDK specific to me. What directory are you running this in?

brianrob avatar Nov 14 '22 16:11 brianrob

I'm running this on root directory of repository D:\perfview-main

vipul0506 avatar Nov 15 '22 06:11 vipul0506

I believe you will need to build from the PerfViewCollect directory. I get similar failures when building at the root. I got another failure building in the PerfViewCollect directory, but haven't had time to debug it yet. If you get a GIT failure, we may need to update the package as there has been a change to upgrade to .NET Core 3.1 that may have caused this.

brianrob avatar Nov 16 '22 23:11 brianrob