Skip to content

Commit 6162e9d

Browse files
Improve HardwareCounters validation, see #1856
1 parent 975a0e0 commit 6162e9d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/BenchmarkDotNet.Diagnostics.Windows/HardwareCounters.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@ public static IEnumerable<ValidationError> Validate(ValidationParameters validat
5050

5151
foreach (var hardwareCounter in validationParameters.Config.GetHardwareCounters())
5252
{
53-
if (!EtwTranslations.TryGetValue(hardwareCounter, out var counterName))
54-
yield return new ValidationError(true, $"Counter {hardwareCounter} not recognized. Please make sure that you are using counter available on your machine. You can get the list of available counters by running `tracelog.exe -profilesources Help`");
53+
if (!EtwTranslations.TryGetValue(hardwareCounter, out string counterName))
54+
{
55+
yield return new ValidationError(true,
56+
$"Counter {hardwareCounter} not recognized. " +
57+
$"Please make sure that you are using counter available on your machine. " +
58+
$"You can get the list of available counters by running `tracelog.exe -profilesources Help`");
59+
continue;
60+
}
5561

5662
if (!availableCpuCounters.ContainsKey(counterName))
5763
yield return new ValidationError(true, $"The counter {counterName} is not available. Please make sure you are Windows 8+ without Hyper-V");

0 commit comments

Comments
 (0)