public ETWLineReader(ETLTrace trace) { this.trace = trace; this.t0 = trace.itparms.T0; this.t1 = trace.itparms.T1; int slot = (int)(t0 / 100000); long offset = trace.offsets[slot]; stm = trace.stm; stm.Position = offset; this.idThreadId = trace.atomsFields.Lookup("ThreadID"); this.idNewTID = trace.atomsFields.Lookup("New TID"); this.idOldTID = trace.atomsFields.Lookup("Old TID"); this.idBaseAddr = trace.atomsFields.Lookup("BaseAddr"); this.idEndAddr = trace.atomsFields.Lookup("EndAddr"); this.idVirtualAddr = trace.atomsFields.Lookup("VirtualAddr"); this.idProcessPid = trace.atomsFields.Lookup("Process Name ( PID)"); this.threadFilters = trace.itparms.GetThreadFilters(); this.processFilters = trace.itparms.GetProcessFilters(); this.byFilterText = new byte[0]; // trace.itparms.FilterText; idType = -1; b = new ByteWindow(); bRecord = new ByteWindow(); bAll = new ByteWindow(); ComputeMemoryRanges(); }
public ETLTrace(ITraceParameters itparms, ITraceUINotify itnotify, string filename) { this.filename = filename; this.initial_parms = itparms; // the original parameters this.itparms = itparms; this.itnotify = itnotify; stm = new BigStream(filename); if (!TryLoadState()) { InitializeFromPrimary(); } else { itnotify.ClearEventFields(); foreach (TimeMark t in listInitialTime) { itnotify.AddTimeToTimeList(t.desc); } } for (int i = 0; i < atomsRecords.Count; i++) { if (recordInfo[i].count > 0) { itnotify.AddEventToEventList(atomsRecords.MakeString(i)); } } for (int i = 0; i < sortedThreads.Length; i++) { ThreadInfo ti = threads[sortedThreads[i]]; itnotify.AddThreadToThreadList(String.Format("{0,20} {1,5} {2}", ByteWindow.MakeString(ti.processPid), ti.threadid, ByteWindow.MakeString(ti.threadproc))); } for (int i = 0; i < processes.Count; i++) { ProcessInfo pi = processes[sortedProcesses[i]]; itnotify.AddProcessToProcessList(ByteWindow.MakeString(pi.processPid)); } for (int i = 0; i < stackTypes.Length; i++) { if (stackTypes[i]) { itnotify.AddEventToStackEventList(atomsRecords.MakeString(i)); } } }