static KernelProvider()
 {
     Default = new KernelProvider {
         Flags = KernelTraceEventParser.Keywords.ImageLoad
                 | KernelTraceEventParser.Keywords.Process
                 | KernelTraceEventParser.Keywords.Profile
                 | KernelTraceEventParser.Keywords.Thread,
         StackCapture = KernelTraceEventParser.Keywords.None,
     };
 }
示例#2
0
        /// <summary>
        /// Determines whether a kernel session is needed.
        /// </summary>
        /// <param name="kernelProvider">Provider data that will be traced.</param>
        /// <returns>True if a kernel session is needed, False otherwise.</returns>
        public static bool NeedSeparateKernelSession(KernelProvider kernelProvider)
        {
            if (kernelProvider == null)
            {
                throw new ArgumentNullException(nameof(kernelProvider));
            }

            // CPU counters need the special kernel session
            return((kernelProvider.Flags & (KernelTraceEventParser.Keywords.Profile | KernelTraceEventParser.Keywords.PMCProfile))
                   != KernelTraceEventParser.Keywords.None);
        }