Skip to content

Commit b2bb4e5

Browse files
committed
roll back debug assert change in tracelog
1 parent 68c1081 commit b2bb4e5

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/TraceEvent/TraceLog.cs

+11-4
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public static TraceLogEventSource CreateFromTraceEventSession(TraceEventSession
186186
/// importantly TraceEvent.CallStack() will work. Thus you can get real time stacks from events).
187187
/// </summary>
188188
/// <param name="rundownConfiguration">
189-
/// If enabled, a rundown is triggered immediately as a separate session.
189+
/// If enabled, a rundown is triggered immediately as a separate session.
190190
/// This is used to initialize module and method information and then the session is closed.
191191
/// This only makes sense in realtime sessions when you need to resolve function names during the session.
192192
/// </param>
@@ -215,7 +215,8 @@ public static TraceLogEventSource CreateFromEventPipeSession(EventPipeSession se
215215
using (var rundownSession = rundownDiagnosticsClient.StartEventPipeSession(
216216
new EventPipeProvider(ClrTraceEventParser.ProviderName, EventLevel.Informational, (long)ClrTraceEventParser.Keywords.Default),
217217
requestRundown: true
218-
)) {
218+
))
219+
{
219220
traceLog.ProcessInitialRundown(rundownSession);
220221
}
221222
}
@@ -10865,7 +10866,10 @@ public static TraceProcess Process(this TraceEvent anEvent)
1086510866
throw new InvalidOperationException("Attempted to use TraceLog support on a non-TraceLog TraceEventSource.");
1086610867
}
1086710868
TraceProcess ret = log.Processes.GetProcess(anEvent.ProcessID, anEvent.TimeStampQPC);
10868-
Debug.Assert(ret != null);
10869+
// When the trace was converted, a TraceProcess should have been created for
10870+
// every mentioned Process ID.
10871+
// When we care, we should ensure this is true for the RealTime case.
10872+
Debug.Assert(ret != null || log.IsRealTime);
1086910873
return ret;
1087010874
}
1087110875
/// <summary>
@@ -10880,7 +10884,10 @@ public static TraceThread Thread(this TraceEvent anEvent)
1088010884
throw new InvalidOperationException("Attempted to use TraceLog support on a non-TraceLog TraceEventSource.");
1088110885
}
1088210886
TraceThread ret = log.Threads.GetThread(anEvent.ThreadID, anEvent.TimeStampQPC);
10883-
Debug.Assert(ret != null);
10887+
// When the trace was converted, a TraceThread should have been created for
10888+
// every mentioned Thread ID.
10889+
// When we care, we should ensure this is true for the RealTime case.
10890+
Debug.Assert(ret != null || log.IsRealTime);
1088410891
return ret;
1088510892
}
1088610893
/// <summary>

0 commit comments

Comments
 (0)