diff --git a/src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure.Core/CommandBuilders/ASPNetBenchmarks.CommandBuilder.cs b/src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure.Core/CommandBuilders/ASPNetBenchmarks.CommandBuilder.cs index 5b0e14e902e..29a27cc0b0f 100644 --- a/src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure.Core/CommandBuilders/ASPNetBenchmarks.CommandBuilder.cs +++ b/src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure.Core/CommandBuilders/ASPNetBenchmarks.CommandBuilder.cs @@ -67,16 +67,25 @@ public static (string, string) Build(ASPNetBenchmarksConfiguration configuration else { - if (configuration.TraceConfigurations.Type != "gc") + if (configuration.TraceConfigurations.Type != "gc" || configuration.TraceConfigurations.Type != "cpu") { - throw new ArgumentException($"{nameof(ASPNetBenchmarksCommandBuilder)}: Currently only GCCollectOnly traces are allowed for Linux."); + throw new ArgumentException($"{nameof(ASPNetBenchmarksCommandBuilder)}: Currently only GCCollectOnly and CPU traces are allowed for Linux."); } else { - traceFileSuffix = ".nettrace"; - commandStringBuilder.Append(" --application.dotnetTrace true "); - commandStringBuilder.Append(" --application.dotnetTraceProviders gc-collect "); + if (configuration.TraceConfigurations.Type == "gc") + { + traceFileSuffix = ".nettrace"; + commandStringBuilder.Append(" --application.dotnetTrace true "); + commandStringBuilder.Append(" --application.dotnetTraceProviders gc-collect "); + } + + else + { + commandStringBuilder.Append(" --application.collect true "); + commandStringBuilder.Append(" --application.collectStartup true "); + } } }