title: How can I capture process names using the TraceEvent library?
body: <p>I'm using the <a href="https://bcl.codeplex.com/wikipage?title=TraceEvent" rel="nofollow">TraceEvent library</a> to capture ETW traces, but I'm not able to determine the name of the process that caused an event.</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>var session = new TraceEventSession(sessionName, null);
  session.EnableProvider(MyEventSource.Log.Guid, TraceEventLevel.Informational,
      options: TraceEventOptions.Stacks);
  Task.Delay(1000).ContinueWith(t =&gt; session.Stop()); // for testing, deal with it (⌐■_■)
  var src = new ETWTraceEventSource(sessionName, TraceEventSourceType.Session);
  TraceLog.CreateFromSource(src, etlxFile, null);
  var log = TraceLog.OpenOrConvert(etlxFile);
  var process = log.Events.First().ProcessName;
  // breakpoint
  </code></pre>
  
  <p>When the breakpoint at the end is hit, <code>process</code> is <code>""</code>. <code>ProcessID</code> is a proper PID, but that's the only useful information I could find from the processes in the log.</p>
  
  <p>I expected process names to be captured by the log. Am I doing something wrong, or is this API just not available on my OS (Windows 7)?</p>