Skip to content

Commit

Permalink
Add Process Metadata Events
Browse files Browse the repository at this point in the history
  • Loading branch information
Mukul Sabharwal committed Sep 18, 2020
1 parent 508ff0e commit 2a29458
Show file tree
Hide file tree
Showing 4 changed files with 859 additions and 26 deletions.
45 changes: 45 additions & 0 deletions src/TraceEvent/EventSources/ProcessMetadataEventSource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Diagnostics.Tracing;

namespace Microsoft.Diagnostics.Tracing
{
[EventSource(Name = "ProcessMetadataEventSource")]
public sealed class ProcessMetadataEventSource : EventSource
{
[Event(1)]
public void ProcessStart(long processId, long parentProcessId, string processName, string commandLineArguments)
{
this.WriteEvent(1, processId, parentProcessId, processName, commandLineArguments);
}

[Event(2)]
public void ProcessExit(long processId)
{
this.WriteEvent(2, processId);
}

[Event(3)]
public void ThreadCreate(long processId, long threadId, string threadName)
{
this.WriteEvent(3, processId, threadId, threadName);
}

[Event(4)]
public void ThreadDestroy(long processId, long threadId)
{
this.WriteEvent(4, processId, threadId);
}

[Event(5)]
public void ModuleLoad(long processId, long baseAddress, long moduleSize, Guid moduleGuid, int moduleAge, string moduleFilePath)
{
this.WriteEvent(5, processId, baseAddress, moduleSize, moduleGuid, moduleAge, moduleFilePath);
}

[Event(6)]
public void ModuleUnload(long processId, long baseAddress, long moduleSize, string moduleFilePath)
{
this.WriteEvent(6, processId, baseAddress, moduleSize, moduleFilePath);
}
}
}
Loading

0 comments on commit 2a29458

Please sign in to comment.