Skip to content

Commit 461b709

Browse files
authored
Added the kernel keyword as a parameter to the ETWConfig (#2049)
1 parent e4ff20f commit 461b709

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/BenchmarkDotNet.Diagnostics.Windows/EtwProfilerConfig.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public class EtwProfilerConfig
1818
public float CpuSampleIntervalInMilliseconds { get; }
1919

2020
public KernelTraceEventParser.Keywords KernelKeywords { get; }
21+
public KernelTraceEventParser.Keywords KernelStackKeywords { get; }
2122

2223
public IReadOnlyDictionary<HardwareCounter, Func<ProfileSourceInfo, int>> IntervalSelectors { get; }
2324

@@ -37,12 +38,14 @@ public EtwProfilerConfig(
3738
int bufferSizeInMb = 256,
3839
float cpuSampleIntervalInMilliseconds = 1.0f,
3940
KernelTraceEventParser.Keywords kernelKeywords = KernelTraceEventParser.Keywords.ImageLoad | KernelTraceEventParser.Keywords.Profile,
41+
KernelTraceEventParser.Keywords kernelStackKeywords = KernelTraceEventParser.Keywords.Profile,
4042
IReadOnlyDictionary<HardwareCounter, Func<ProfileSourceInfo, int>> intervalSelectors = null,
4143
IReadOnlyCollection<(Guid providerGuid, TraceEventLevel providerLevel, ulong keywords, TraceEventProviderOptions options)> providers = null,
4244
bool createHeapSession = false)
4345
{
4446
CreateHeapSession = createHeapSession;
4547
KernelKeywords = kernelKeywords;
48+
KernelStackKeywords = kernelStackKeywords;
4649
PerformExtraBenchmarksRun = performExtraBenchmarksRun;
4750
BufferSizeInMb = bufferSizeInMb;
4851
CpuSampleIntervalInMilliseconds = cpuSampleIntervalInMilliseconds;

src/BenchmarkDotNet.Diagnostics.Windows/Sessions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ internal override Session EnableProviders()
7676

7777
try
7878
{
79-
TraceEventSession.EnableKernelProvider(keywords, KernelTraceEventParser.Keywords.Profile);
79+
TraceEventSession.EnableKernelProvider(keywords, Config.KernelStackKeywords);
8080
}
8181
catch (Win32Exception)
8282
{

0 commit comments

Comments
 (0)