Skip to content

Commit 58f2d18

Browse files
authored
Use Pipes for host and benchmark process communication (#2092)
1 parent 8514b23 commit 58f2d18

File tree

72 files changed

+637
-1176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+637
-1176
lines changed

src/BenchmarkDotNet.Diagnostics.Windows/ConcurrencyVisualizerProfiler.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ public void DisplayResults(ILogger logger)
6060
logger.WriteLineInfo("DO remember that this Diagnoser just tries to mimic the CVCollectionCmd.exe and you need to have Visual Studio with Concurrency Visualizer plugin installed to visualize the data.");
6161
}
6262

63-
public bool RequiresBlockingAcknowledgments(BenchmarkCase benchmarkCase) => true;
64-
6563
public void Handle(HostSignal signal, DiagnoserActionParameters parameters)
6664
{
6765
etwProfiler.Handle(signal, parameters);

src/BenchmarkDotNet.Diagnostics.Windows/EtwDiagnoser.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace BenchmarkDotNet.Diagnostics.Windows
2121
protected readonly Dictionary<BenchmarkCase, int> BenchmarkToProcess = new Dictionary<BenchmarkCase, int>();
2222
protected readonly ConcurrentDictionary<int, TStats> StatsPerProcess = new ConcurrentDictionary<int, TStats>();
2323

24-
public bool RequiresBlockingAcknowledgments(BenchmarkCase benchmarkCase) => true;
2524
public virtual RunMode GetRunMode(BenchmarkCase benchmarkCase) => RunMode.ExtraRun;
2625

2726
public virtual IEnumerable<IExporter> Exporters => Array.Empty<IExporter>();

src/BenchmarkDotNet.Diagnostics.Windows/EtwProfiler.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ public EtwProfiler(EtwProfilerConfig config)
6060
public IEnumerable<ValidationError> Validate(ValidationParameters validationParameters)
6161
=> HardwareCounters.Validate(validationParameters, mandatory: false);
6262

63-
public bool RequiresBlockingAcknowledgments(BenchmarkCase benchmarkCase) => false;
64-
6563
public void Handle(HostSignal signal, DiagnoserActionParameters parameters)
6664
{
6765
// it's crucial to start the trace before the process starts and stop it after the benchmarked process stops to have all of the necessary events in the trace file!

src/BenchmarkDotNet.Diagnostics.Windows/NativeMemoryProfiler.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ public void DisplayResults(ILogger resultLogger)
4646
resultLogger.Write(line.Kind, line.Text);
4747
}
4848

49-
public bool RequiresBlockingAcknowledgments(BenchmarkCase benchmarkCase) => etwProfiler.RequiresBlockingAcknowledgments(benchmarkCase);
50-
5149
public void Handle(HostSignal signal, DiagnoserActionParameters parameters) => etwProfiler.Handle(signal, parameters);
5250

5351
public RunMode GetRunMode(BenchmarkCase benchmarkCase) => etwProfiler.GetRunMode(benchmarkCase);

src/BenchmarkDotNet/Code/CodeGenerator.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ internal static string Generate(BuildPartition buildPartition)
7979
else if (buildPartition.IsWasm)
8080
extraDefines.Add("#define WASM");
8181

82-
if (buildPartition.NoAcknowledgments)
83-
extraDefines.Add("#define NO_ACK");
84-
8582
string benchmarkProgramContent = new SmartStringBuilder(ResourceHelper.LoadTemplate("BenchmarkProgram.txt"))
8683
.Replace("$ShadowCopyDefines$", useShadowCopy ? "#define SHADOWCOPY" : null).Replace("$ShadowCopyFolderPath$", shadowCopyFolderPath)
8784
.Replace("$ExtraDefines$", string.Join(Environment.NewLine, extraDefines))

src/BenchmarkDotNet/Diagnosers/CompositeDiagnoser.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ public IEnumerable<IExporter> Exporters
3131
public IEnumerable<IAnalyser> Analysers
3232
=> diagnosers.SelectMany(diagnoser => diagnoser.Analysers);
3333

34-
public bool RequiresBlockingAcknowledgments(BenchmarkCase benchmarkCase)
35-
=> diagnosers.Any(diagnoser => diagnoser.RequiresBlockingAcknowledgments(benchmarkCase));
36-
3734
public void Handle(HostSignal signal, DiagnoserActionParameters parameters)
3835
{
3936
foreach (var diagnoser in diagnosers)

src/BenchmarkDotNet/Diagnosers/EventPipeProfiler.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ public IEnumerable<ValidationError> Validate(ValidationParameters validationPara
6969
}
7070
}
7171

72-
public bool RequiresBlockingAcknowledgments(BenchmarkCase benchmarkCase) => true;
73-
7472
public void Handle(HostSignal signal, DiagnoserActionParameters parameters)
7573
{
7674
if (signal != HostSignal.BeforeAnythingElse)

src/BenchmarkDotNet/Diagnosers/IDiagnoser.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ public interface IDiagnoser
2020

2121
RunMode GetRunMode(BenchmarkCase benchmarkCase);
2222

23-
bool RequiresBlockingAcknowledgments(BenchmarkCase benchmarkCase);
24-
2523
void Handle(HostSignal signal, DiagnoserActionParameters parameters);
2624

2725
IEnumerable<Metric> ProcessResults(DiagnoserResults results);

src/BenchmarkDotNet/Diagnosers/MemoryDiagnoser.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public void DisplayResults(ILogger logger) { }
3030
public IEnumerable<ValidationError> Validate(ValidationParameters validationParameters) => Array.Empty<ValidationError>();
3131

3232
// the action takes places in other process, and the values are gathered by Engine
33-
public bool RequiresBlockingAcknowledgments(BenchmarkCase benchmarkCase) => false;
3433
public void Handle(HostSignal signal, DiagnoserActionParameters parameters) { }
3534

3635
public IEnumerable<Metric> ProcessResults(DiagnoserResults diagnoserResults)

src/BenchmarkDotNet/Diagnosers/ThreadingDiagnoser.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ public void DisplayResults(ILogger logger) { }
2929

3030
public RunMode GetRunMode(BenchmarkCase benchmarkCase) => RunMode.NoOverhead;
3131

32-
public bool RequiresBlockingAcknowledgments(BenchmarkCase benchmarkCase) => false;
33-
3432
public void Handle(HostSignal signal, DiagnoserActionParameters parameters) { }
3533

3634
public IEnumerable<Metric> ProcessResults(DiagnoserResults results)

0 commit comments

Comments
 (0)