Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Backport small fixes from trunk (make it like r129643).
Browse files Browse the repository at this point in the history
svn path=/branches/mono-2-4/mono-tools/; revision=129644
  • Loading branch information
Massimiliano Mantione committed Mar 17, 2009
1 parent 047f214 commit 432a15f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
4 changes: 4 additions & 0 deletions Mono.Profiler/heap-snapshot-explorer/ChangeLog
@@ -1,3 +1,7 @@
2009-03-17 Massimiliano Mantione <massi@ximian.com>
* HeapSnapshotExplorer.cs: backport small fixes from trunk (make it
like r129643).

2008-12-01 Massimiliano Mantione <massi@ximian.com>
* HeapExplorerTreeModel.cs: Linked all root nodes n a list, so that it
is possible to find the allocation event of a given heap object (now
Expand Down
23 changes: 12 additions & 11 deletions Mono.Profiler/heap-snapshot-explorer/HeapSnapshotExplorer.cs
Expand Up @@ -75,16 +75,17 @@ class StatisticsNodeMenuHandlerForClasses : StatisticsNodeMenuHandler {
protected override Menu GetContextMenu () {
return menu;
}

public StatisticsNodeMenuHandlerForClasses (HeapSnapshotExplorer explorer) : base (explorer) {
menu = new Menu ();
MenuItem menuItem;
menuItem = new MenuItem ("Filter current set by this class");
menuItem.Activated += delegate {
menuItem.Activated += delegate (object sender, EventArgs e) {
FilterCurrentSetByCurrentClass ();
};
menu.Add (menuItem);
menuItem = new MenuItem ("Show statistics by caller method");
menuItem.Activated += delegate {
menuItem.Activated += delegate (object sender, EventArgs e) {
explorer.FillStatisticsListWithMethodData ();
};
menu.Add (menuItem);
Expand All @@ -110,12 +111,12 @@ class StatisticsNodeMenuHandlerForMethods : StatisticsNodeMenuHandler {
menu = new Menu ();
MenuItem menuItem;
menuItem = new MenuItem ("Filter current set by this method");
menuItem.Activated += delegate {
menuItem.Activated += delegate (object sender, EventArgs e) {
FilterCurrentSetByCurrentMethod ();
};
menu.Add (menuItem);
menuItem = new MenuItem ("Show statistics by call stack");
menuItem.Activated += delegate {
menuItem.Activated += delegate (object sender, EventArgs e) {
explorer.FillStatisticsListWithCallStackData ();
};
menu.Add (menuItem);
Expand All @@ -141,7 +142,7 @@ class StatisticsNodeMenuHandlerForCallStacks : StatisticsNodeMenuHandler {
menu = new Menu ();
MenuItem menuItem;
menuItem = new MenuItem ("Filter current set by this call stack");
menuItem.Activated += delegate {
menuItem.Activated += delegate (object sender, EventArgs e) {
FilterCurrentSetByCurrentCallStack ();
};
menu.Add (menuItem);
Expand Down Expand Up @@ -226,15 +227,15 @@ public class StatisticsNode : Gtk.TreeNode {
public static void PrepareTreeViewForStatisticsDisplay (NodeView view) {
view.AppendColumn ("Description", new Gtk.CellRendererText (), delegate (TreeViewColumn column, CellRenderer cell, ITreeNode treeNode) {
StatisticsNode node = (StatisticsNode) treeNode;
((CellRendererText) cell).Markup = node.Description;
((CellRendererText) cell).Text = node.Description;
});
view.AppendColumn ("Object count", new Gtk.CellRendererText (), delegate (TreeViewColumn column, CellRenderer cell, ITreeNode treeNode) {
StatisticsNode node = (StatisticsNode) treeNode;
((CellRendererText) cell).Markup = node.ItemsCount.ToString ();
((CellRendererText) cell).Text = node.ItemsCount.ToString ();
});
view.AppendColumn ("Allocated bytes", new Gtk.CellRendererText (), delegate (TreeViewColumn column, CellRenderer cell, ITreeNode treeNode) {
StatisticsNode node = (StatisticsNode) treeNode;
((CellRendererText) cell).Markup = node.AllocatedBytes.ToString ();
((CellRendererText) cell).Text = node.AllocatedBytes.ToString ();
});
view.NodeStore = new Gtk.NodeStore (typeof (StatisticsNode));
}
Expand Down Expand Up @@ -497,7 +498,7 @@ public HeapSnapshotExplorer()
setColumn.SetCellDataFunc (setCell, delegate (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) {
HeapExplorerTreeModel.INode node = (HeapExplorerTreeModel.INode) model.GetValue (iter, 0);
CellRendererText textCell = (CellRendererText) cell;
textCell.Markup = node.Description;
textCell.Text = node.Description;
if (node != MarkedNode) {
textCell.Style = Pango.Style.Normal;
} else {
Expand All @@ -507,7 +508,7 @@ public HeapSnapshotExplorer()
countColumn.SetCellDataFunc (countCell, delegate (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) {
HeapExplorerTreeModel.INode node = (HeapExplorerTreeModel.INode) model.GetValue (iter, 0);
CellRendererText textCell = (CellRendererText) cell;
textCell.Markup = node.Count;
textCell.Text = node.Count;
if (node != MarkedNode) {
textCell.Style = Pango.Style.Normal;
} else {
Expand All @@ -517,7 +518,7 @@ public HeapSnapshotExplorer()
bytesColumn.SetCellDataFunc (bytesCell, delegate (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) {
HeapExplorerTreeModel.INode node = (HeapExplorerTreeModel.INode) model.GetValue (iter, 0);
CellRendererText textCell = (CellRendererText) cell;
textCell.Markup = node.AllocatedBytes;
textCell.Text = node.AllocatedBytes;
if (node != MarkedNode) {
textCell.Style = Pango.Style.Normal;
} else {
Expand Down
4 changes: 4 additions & 0 deletions Mono.Profiler/profiler-decoder-library/ChangeLog
@@ -1,3 +1,7 @@
2009-03-17 Massimiliano Mantione <massi@ximian.com>
* ObjectModel.cs: backport small fixes from trunk (make it like
r129643).

2009-01-17 Massimiliano Mantione <massi@ximian.com>
* BaseTypes.cs: Added "Region" property to IExecutableMemoryRegion, so
that it is possible to set the region when we load the elf file, and
Expand Down
6 changes: 4 additions & 2 deletions Mono.Profiler/profiler-decoder-library/ObjectModel.cs
Expand Up @@ -269,6 +269,8 @@ public class StackTrace : IHeapItemSetStatisticsSubject {
while (currentFrame != null) {
StackTrace nextFrame = currentFrame.Caller;
sb.Append (" ");
sb.Append (currentFrame.TopMethod.Class.Name);
sb.Append (".");
sb.Append (currentFrame.TopMethod.Name);
if (nextFrame != null) {
sb.Append ('\n');
Expand Down Expand Up @@ -648,7 +650,7 @@ public class LoadedMethod : BaseLoadedMethod<LoadedClass>, IStatisticalHitItem,

string IHeapItemSetStatisticsSubject.Description {
get {
return Name;
return Class.Name + "." + Name;
}
}

Expand Down Expand Up @@ -1805,7 +1807,7 @@ public class HeapItemSetFromComparison<HI,OHI> : HeapItemSet<HI> where HI : IHea
}
}

return new HeapItemSetFromComparison<HeapObject,HI>(objectSet, itemSet, result.ToArray (), "references item");
return new HeapItemSetFromComparison<HeapObject,HI>(objectSet, itemSet, result.ToArray (), "is referenced by item");
}

HeapItemSetFromComparison (HeapItemSet<HI> baseSet, HeapItemSet<OHI> otherSet, HI[] heapItems, string relation): base (buildShortDescription (otherSet, relation), buildLongDescription (otherSet, relation), heapItems, baseSet.ObjectAllocationsArePresent) {
Expand Down

0 comments on commit 432a15f

Please sign in to comment.