int CompareNodes(Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) { int col; SortType type; store.GetSortColumnId(out col, out type); object o1 = model.GetValue(a, 6); object o2 = model.GetValue(b, 6); if (o1 is Backtrace && o2 is Backtrace) { Backtrace b1 = (Backtrace)o1; Backtrace b2 = (Backtrace)o2; switch (col) { case 0: return(string.Compare(b1.Type.Name, b2.Type.Name)); case 1: return(b1.LastObjectStats.AllocatedCount.CompareTo(b2.LastObjectStats.AllocatedCount)); case 2: return(b1.LastObjectStats.AllocatedTotalBytes.CompareTo(b2.LastObjectStats.AllocatedTotalBytes)); case 3: return(b1.LastObjectStats.AllocatedAverageBytes.CompareTo(b2.LastObjectStats.AllocatedAverageBytes)); case 4: return(b1.LastObjectStats.AllocatedAverageAge.CompareTo(b2.LastObjectStats.AllocatedAverageAge)); default: return(1); } } else if (o1 is Frame && o2 is Frame) { return(((Frame)o1).MethodName.CompareTo(((Frame)o2).MethodName)); } else if (o1 is Frame) { return(1); } else { return(-1); } }
private void ReadSummary_Backtraces(BinaryReader reader) { reader.BaseStream.Seek(backtrace_index_offset, SeekOrigin.Begin); for (int i = 0; i < backtraces.Length; ++i) { Backtrace backtrace; backtrace = new Backtrace((uint)i, this); backtraces [i] = backtrace; uint type_code; type_code = reader.ReadUInt32(); backtrace.Type = types [type_code]; backtrace.LastGeneration = reader.ReadInt32(); backtrace.LastObjectStats.Read(reader); backtrace_pos [i] = reader.ReadInt64(); } }
private void ReadLogFileChunk_Backtrace(BinaryReader reader) { uint code; code = reader.ReadUInt32(); uint type_code; type_code = reader.ReadUInt32(); int n_frames; n_frames = reader.ReadInt16(); if (i_backtrace >= n_backtraces) { for (int i = 0; i < n_frames; ++i) { reader.ReadUInt32(); // skip method code reader.ReadUInt32(); // skip native offset } return; } Backtrace backtrace; backtrace = new Backtrace(code, this); backtraces [i_backtrace] = backtrace; backtrace_codes [i_backtrace] = code; backtrace_type_codes [i_backtrace] = type_code; Frame [] frames = new Frame [n_frames]; backtrace.Frames = frames; for (int i = 0; i < n_frames; ++i) { frames [i].MethodCode = reader.ReadUInt32(); frames [i].IlOffset = reader.ReadUInt32(); } ++i_backtrace; }
private void ReadSummary_Backtraces (BinaryReader reader) { reader.BaseStream.Seek (backtrace_index_offset, SeekOrigin.Begin); for (int i = 0; i < backtraces.Length; ++i) { Backtrace backtrace; backtrace = new Backtrace ((uint) i, this); backtraces [i] = backtrace; uint type_code; type_code = reader.ReadUInt32 (); backtrace.Type = types [type_code]; backtrace.LastGeneration = reader.ReadInt32 (); backtrace.LastObjectStats.Read (reader); backtrace_pos [i] = reader.ReadInt64 (); } }
private void ReadLogFileChunk_Backtrace (BinaryReader reader) { uint code; code = reader.ReadUInt32 (); uint type_code; type_code = reader.ReadUInt32 (); int n_frames; n_frames = reader.ReadInt16 (); if (i_backtrace >= n_backtraces) { for (int i = 0; i < n_frames; ++i) { reader.ReadUInt32 (); // skip method code reader.ReadUInt32 (); // skip native offset } return; } Backtrace backtrace; backtrace = new Backtrace (code, this); backtraces [i_backtrace] = backtrace; backtrace_codes [i_backtrace] = code; backtrace_type_codes [i_backtrace] = type_code; Frame [] frames = new Frame [n_frames]; backtrace.Frames = frames; for (int i = 0; i < n_frames; ++i) { frames [i].MethodCode = reader.ReadUInt32 (); frames [i].IlOffset = reader.ReadUInt32 (); } ++i_backtrace; }