public void EnableKernelProvider(params TraceSessionManager.KernelKeyword[] keywords)
        {
            // Create keyword flags for windows events
            KernelTraceEventParser.Keywords flags = 0;
            foreach (var keyword in keywords)
            {
                flags |= kernelKeywords[keyword];
            }
            bool enabled = false;

            try
            {
                enabled = KernelSession.EnableKernelProvider(flags);
            }
            catch (System.Runtime.InteropServices.COMException)
            {
            }
            finally
            {
                if (!enabled)
                {
                    Console.WriteLine("Unable to enable kernel provider. Try freeing some memory.");
                    Environment.Exit(1);
                }
            }
        }
Exemple #2
0
 public void EnableKernelProvider(params TraceSessionManager.KernelKeyword[] keywords)
 {
     // Create keyword flags for windows events
     KernelTraceEventParser.Keywords flags = 0;
     foreach (var keyword in keywords)
     {
         flags |= kernelKeywords[keyword];
     }
     KernelSession.EnableKernelProvider(flags);
 }