I am trying to create one performance counter through "logman.exe" and try to read through Microsoft Tx (LINQ to Logs and Traces), but I am getting below error,
System.ComponentModel.Win32Exception: 'The instance name passed was not recognized as valid by a WMI data provider'
Process logman = Process.Start(
"logman.exe",
"create counter Test_Perf_log -c \"Processor(_Total)\"% Processor Time");
logman.WaitForExit();
IObservable<EtwNativeEvent> session = EtwObservable.FromSession("Test_Perf_log");
using (session.Subscribe(e => Console.WriteLine("{0} {1}", e.TimeStamp, e.UserData)))
{
Console.ReadLine();
}
I am suspecting that counter "Test_Perf_log" creation through "logman.exe" is not correct, please help on this.
Thanks,