Skip to content

Commit ab9190f

Browse files
committed
Create new CollectTypeMap to separate between the crank and local runs
1 parent 97687bf commit ab9190f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure.Core/TraceCollection/TraceCollector.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ public sealed class TraceCollector : IDisposable
3636
};
3737

3838
internal static readonly Dictionary<CollectType, string> LinuxCollectTypeMap = new()
39+
{
40+
{ CollectType.gc, "gcCollectOnly" },
41+
{ CollectType.cpu, "collect_cpu" },
42+
{ CollectType.threadtime, "collect_threadTime" }
43+
};
44+
45+
internal static readonly Dictionary<CollectType, string> LinuxLocalRunCollectTypeMap = new()
3946
{
4047
{ CollectType.gc, "--clrevents gc" },
4148
{ CollectType.cpu, "--clrevents gc+stack --clreventlevel informational" },
@@ -158,7 +165,7 @@ public TraceCollector(string name, string collectType, string outputPath, int? p
158165
_collectorPath = Path.Combine(DependenciesFolder, "dotnet-trace");
159166

160167
Name = Path.Combine(outputPath, $"{name}.nettrace");
161-
arguments = $"-p {pid} -o {Name} {LinuxCollectTypeMap[_collectType]}";
168+
arguments = $"-p {pid} -o {Name} {LinuxLocalRunCollectTypeMap[_collectType]}";
162169
string command = $"collect {arguments}";
163170

164171
_traceProcess = new();

src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure/Commands/GCPerfSim/GCPerfSimCommand.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ internal static Dictionary<string, ProcessExecutionDetails> ExecuteLocally(GCPer
204204
// If a trace is requested, ensure the file exists. If not, there is was an error and alert the user.
205205
if (configuration.TraceConfigurations?.Type != "none")
206206
{
207-
// Not checking Linux here since the local run only allows for Windows.
207+
// On Windows, the trace file path ends with ".etl.zip"; On Linux, it ends with ".nettrace".
208208
if (!File.Exists(Path.Combine(outputPath, traceName + ".etl.zip")) && !File.Exists(Path.Combine(outputPath, traceName + ".nettrace")))
209209
{
210210
AnsiConsole.MarkupLine($"[yellow bold] ({DateTime.Now}) The trace for the run wasn't successfully captured. Please check the log file for more details: {Markup.Escape(output)} Full run details: {Path.GetFileNameWithoutExtension(configuration.Name)}: {runInfo.CorerunDetails.Key} for {runInfo.RunDetails.Key} [/]");

0 commit comments

Comments
 (0)