Skip to content

Commit 0aeb827

Browse files
committed
update CreateFromEventPipeEventSource to support providing preloaded rundown source
1 parent 576bba9 commit 0aeb827

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/TraceEvent/TraceLog.cs

+17-1
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,20 @@ public static TraceLogEventSource CreateFromEventPipeSession(EventPipeSession se
220220
/// the .Log Property) which lets you get at aggregated information (Processes, threads, images loaded, and perhaps most
221221
/// importantly TraceEvent.CallStack() will work. Thus you can get real time stacks from events).
222222
/// </summary>
223-
public static TraceLogEventSource CreateFromEventPipeEventSource(EventPipeEventSource source)
223+
/// <param name="rundownSource">
224+
/// If given, the rundownSource is used to initialize module and method information.
225+
/// This only makes sense in realtime sessions when you need to resolve function names.
226+
/// </param>
227+
public static TraceLogEventSource CreateFromEventPipeEventSource(EventPipeEventSource source, EventPipeSession rundownSource = null)
224228
{
225229
var traceLog = new TraceLog(source);
226230
traceLog.rawEventSourceToConvert.AllEvents += traceLog.onAllEventPipeEventsRealTime;
231+
232+
if (rundownSource != null)
233+
{
234+
traceLog.ProcessInitialRundown(rundownSource);
235+
}
236+
227237
return traceLog.realTimeSource;
228238
}
229239

@@ -248,6 +258,12 @@ private void ProcessInitialRundown(EventPipeSession session)
248258
}
249259
}
250260

261+
private void ProcessInitialRundown(EventPipeEventSource source)
262+
{
263+
SetupInitialRundownCallbacks(source);
264+
source.Process();
265+
}
266+
251267
/// <summary>
252268
/// Attaches callbacks to initialize modules and methods based on the rundown events.
253269
/// Unlike SetupCallbacks(), these callbacks are attached before any events are processed so

0 commit comments

Comments
 (0)