Skip to content

Instantly share code, notes, and snippets.

@naveensrinivasan
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naveensrinivasan/0247d4e644a3da2bff04 to your computer and use it in GitHub Desktop.
Save naveensrinivasan/0247d4e644a3da2bff04 to your computer and use it in GitHub Desktop.
This ETW trace wouldn't generate events because of the order of the methods with event id's within the class.
using System.Diagnostics.Tracing;
namespace ETWSample
{
/// <summary>
/// This event would not be traced because the order of the
/// function should be in the order of the parameters.
/// </summary>
public class FailedEvent : EventSource
{
static public FailedEvent Trace = new FailedEvent();
public void FailedDetailedEvent(int id, string content)
{
WriteEvent(2, id, content);
}
public void FailedTraceEvent(string content)
{
WriteEvent(1, content);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment