dotnet/diagnostics

`dotnet-trace collect --format SpeedScope` creates a new file with `.json` extension instead of using the filename provided

vladimir-lu opened this issue · 1 comments

Description

This is probably the same as #1351

When running:

dotnet-trace collect --format SpeedScope --profile cpu-sampling --duration "00:00:00:10" -o /tmp/profile.speedscope -p <PID>

there is a profile.speedscope file created and a much larger profile.speedscope.json file that is the actual speedscope report. I expect either the tool to warn about this or use the filename provided (and store any temporary files under different names).

Configuration

  • Yes, it's dotnet-trace
  • Linux (inside mcr.microsoft.com/dotnet/sdk:8.0 container)
  • amd64
  • Probably not specific to that configuration
  • Docker

Regression?

Not as far as I know.

Other information

At its core, I believe dotnet-trace always collects a .nettrace and writes it to the specified output file name.
If a non-NetTrace file format was requested, the conversion occurs after the initial .nettrace file is written, and the requested file format is written under the corresponding file format extension while reading the original .nettrace file.

I'll update the conversion message to be more explicit that another file is created.