Skip to content

Commit f9531d2

Browse files
committed
Fix record-trace output
1 parent a8d5d97 commit f9531d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/tests/tracing/eventpipe/userevents/userevents.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public static int TestEntryPoint()
3434
string appBaseDir = AppContext.BaseDirectory;
3535
string recordTracePath = Path.Combine(appBaseDir, "record-trace");
3636
string scriptFilePath = Path.Combine(appBaseDir, "dotnet-common.script");
37-
string traceFilePath = Path.GetTempFileName();
3837
const string userEventsDataPath = "/sys/kernel/tracing/user_events_data";
3938

4039
if (!File.Exists(recordTracePath))
@@ -48,6 +47,10 @@ public static int TestEntryPoint()
4847
return -1;
4948
}
5049

50+
string traceFilePath = Path.GetTempFileName();
51+
File.Delete(traceFilePath); // record-trace requires the output file to not exist
52+
traceFilePath = Path.ChangeExtension(traceFilePath, ".nettrace");
53+
5154
ProcessStartInfo recordTraceStartInfo = new();
5255
recordTraceStartInfo.FileName = "sudo";
5356
recordTraceStartInfo.Arguments = $"-n {recordTracePath} --script-file {scriptFilePath} --out {traceFilePath}";

0 commit comments

Comments
 (0)