Skip to content

Commit 01fe14f

Browse files
committed
Fix speedscope output naming
1 parent 9ffb038 commit 01fe14f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/ProfileTool/Program.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ bool EnsureToolAvailable(string toolName, string installHint)
163163

164164
var timestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss", System.Globalization.CultureInfo.InvariantCulture);
165165
var traceFile = Path.Combine(outputDir, $"{label}_{timestamp}.nettrace");
166-
var speedscopeFile = Path.Combine(outputDir, $"{label}_{timestamp}.speedscope.json");
166+
var speedscopeBase = Path.Combine(outputDir, $"{label}_{timestamp}");
167+
var speedscopeFile = speedscopeBase + ".speedscope.json";
167168

168169
return AnsiConsole.Status()
169170
.Spinner(Spinner.Known.Dots)
@@ -196,7 +197,7 @@ bool EnsureToolAvailable(string toolName, string installHint)
196197
"--format",
197198
"Speedscope",
198199
"--output",
199-
speedscopeFile
200+
speedscopeBase
200201
};
201202
var convert = RunProcess("dotnet-trace", convertArgs, timeoutMs: 120000);
202203
if (!convert.Success || !File.Exists(speedscopeFile))
@@ -455,15 +456,16 @@ void PrintCpuResults(
455456
}
456457

457458
var timestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss", CultureInfo.InvariantCulture);
458-
var speedscopeFile = Path.Combine(outputDir, $"{label}_{timestamp}.speedscope.json");
459+
var speedscopeBase = Path.Combine(outputDir, $"{label}_{timestamp}");
460+
var speedscopeFile = speedscopeBase + ".speedscope.json";
459461
var convertArgs = new[]
460462
{
461463
"convert",
462464
inputPath,
463465
"--format",
464466
"Speedscope",
465467
"--output",
466-
speedscopeFile
468+
speedscopeBase
467469
};
468470
var convert = RunProcess("dotnet-trace", convertArgs, timeoutMs: 120000);
469471
if (!convert.Success || !File.Exists(speedscopeFile))

0 commit comments

Comments
 (0)