etw-eventsource

When using EventSource, should I log two events, or compute the duration and log only one?

岁酱吖の 提交于 2020-01-05 09:08:41
问题 Assume I have some method that I want to trace performance information for. Using System.Diagnostics.Tracing.EventSource , I can see two logical ways of doing this; first, one could write two events, one at the start, and one at the end, and then the consumer of the events could compute the duration: MySource.Log.OperationStart(); RunMyOperation(); MySource.Log.OperatingFinish(); Or, I can compute the duration myself, and only write a single event: var sw = System.Diagnostics.Stopwatch

(ETW) EventSource in a common component

南笙酒味 提交于 2019-12-25 07:57:53
问题 I would like to know what are yours experiences regarding using EventSource for components that are common and that can be utilized few times within the same process. One simple example. My shared component is TestQueue and I would like to utilize it few times with my process and again in PerfView to see what event belongs to which queue. public class TestQueue<T> { private readonly IEtwQueue _etwQueue; private readonly Queue<T> _instance = new Queue<T>(); public TestQueue(IEtwQueue etwQueue)

.Net 4.5 EventSource ETW provider not showing up in provider list

纵饮孤独 提交于 2019-12-21 05:09:13
问题 I have been working on using .NET4.5 new feature ETW(EventSource). I have trouble having it show up on the trace provider lists using perfmon->Data Collector Sets. I was able to see the logs using perfview. I was able to generate manifest from EventSource class using its static method GenerateManifest. This will provide the manifest of myevents in EventSource class but it does not contain details about the channels. My question is how to add channel specific information after generating the

EventSource .net 4.0 GenerateManifest

醉酒当歌 提交于 2019-12-20 01:49:10
问题 I've been trying to work with ETW in .net 4.0. I have started using Microsoft EventSource Library 1.0.4-beta (https://www.nuget.org/packages/Microsoft.Diagnostics.Tracing.EventSource) Here is the code i written for generating events for my application. [EventSource(Name = "Samples-EventSourceDemos-EventSourceLogger")] public sealed class EventSourceLogger : EventSource { public static EventSourceLogger Log = new EventSourceLogger(); public static string GetManifest() { return GenerateManifest

EventSource in .NET 4.6 & Event Viewer

有些话、适合烂在心里 提交于 2019-12-06 10:25:37
问题 I'd like to ask a very specific question about writing to the event viewer using the System.Diagnostics.Tracing.EventSource and .NET 4.6 class. In the past, if you wanted to use the event viewer channels you needed to write/generate an XML manifest and register it with the operating system. Is this still the case? If so I'm struggling to find out how to get the build to generate the manifest, I belive this is possible with the EventSource nuget package, but I'd like to use the in built class

Dependency concerns Implementing EventSource for semantic logging in large application

好久不见. 提交于 2019-12-05 22:37:07
问题 I'm working on a large product consisting of a three windows services and several normal windows applications (.exe). Now we want to move to ETW and Semantic Logging, and use the Microsoft.Diagnostics.Tracing.EventSource. I read somewhere that all logically connected parts of the application should use the same event source. This means that preferrably we would like to have pretty much a single EventSource for our services. But how can we do this without introducing dependencies among pretty

EventSource in .NET 4.6 & Event Viewer

强颜欢笑 提交于 2019-12-04 15:26:11
I'd like to ask a very specific question about writing to the event viewer using the System.Diagnostics.Tracing.EventSource and .NET 4.6 class. In the past, if you wanted to use the event viewer channels you needed to write/generate an XML manifest and register it with the operating system. Is this still the case? If so I'm struggling to find out how to get the build to generate the manifest, I belive this is possible with the EventSource nuget package, but I'd like to use the in built class under the System.Diagnostics.Tracing namespace if possible. Thanks in advance. Take a look at the

.Net 4.5 EventSource ETW provider not showing up in provider list

你离开我真会死。 提交于 2019-12-03 15:33:37
I have been working on using .NET4.5 new feature ETW(EventSource). I have trouble having it show up on the trace provider lists using perfmon->Data Collector Sets. I was able to see the logs using perfview. I was able to generate manifest from EventSource class using its static method GenerateManifest. This will provide the manifest of myevents in EventSource class but it does not contain details about the channels. My question is how to add channel specific information after generating the manifest file for perfmon tracing session? I also would like to use the Perfmon's Tracing session to

What is the best way to log exceptions using ETW?

♀尐吖头ヾ 提交于 2019-12-03 07:24:37
问题 Is there a standard way to log exceptions using ETW? As far as I have seen the only way to do this is to log the message and possibly the inner exception message as there is not strongly typed parameter for the Exception type. 回答1: Use an extra Event and fire this event in the catch block and pass the exception message as a parameter to the Event [Event(1, Message = "Application Falure: {0}", Level = EventLevel.Error, Keywords = Keywords.Diagnostic)] public void Failure(string message) { if

EventSource .net 4.0 GenerateManifest

♀尐吖头ヾ 提交于 2019-12-01 21:49:46
I've been trying to work with ETW in .net 4.0. I have started using Microsoft EventSource Library 1.0.4-beta ( https://www.nuget.org/packages/Microsoft.Diagnostics.Tracing.EventSource ) Here is the code i written for generating events for my application. [EventSource(Name = "Samples-EventSourceDemos-EventSourceLogger")] public sealed class EventSourceLogger : EventSource { public static EventSourceLogger Log = new EventSourceLogger(); public static string GetManifest() { return GenerateManifest(typeof(EventSourceLogger), null); } [Event(200, Level = Microsoft.Diagnostics.Tracing.EventLevel