mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-10 07:00:53 +00:00
sysprof: add allocated size column to memory callgraph
This commit is contained in:
@ -318,6 +318,25 @@ sysprof_memory_callgraph_view_load (SysprofCallgraphView *view,
|
|||||||
GTK_SORT_DESCENDING);
|
GTK_SORT_DESCENDING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
get_total_size (GObject *item)
|
||||||
|
{
|
||||||
|
g_autoptr(GObject) row = NULL;
|
||||||
|
|
||||||
|
g_object_get (item, "item", &row, NULL);
|
||||||
|
|
||||||
|
if (GTK_IS_TREE_LIST_ROW (row))
|
||||||
|
{
|
||||||
|
GtkTreeListRow *tree_row = GTK_TREE_LIST_ROW (row);
|
||||||
|
SysprofCallgraphFrame *frame = SYSPROF_CALLGRAPH_FRAME (gtk_tree_list_row_get_item (tree_row));
|
||||||
|
AugmentMemory *sum = sysprof_callgraph_frame_get_augment (frame);
|
||||||
|
|
||||||
|
return g_format_size (sum->total);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sysprof_memory_callgraph_view_class_init (SysprofMemoryCallgraphViewClass *klass)
|
sysprof_memory_callgraph_view_class_init (SysprofMemoryCallgraphViewClass *klass)
|
||||||
{
|
{
|
||||||
@ -347,6 +366,7 @@ sysprof_memory_callgraph_view_class_init (SysprofMemoryCallgraphViewClass *klass
|
|||||||
|
|
||||||
gtk_widget_class_bind_template_callback (widget_class, get_self_fraction);
|
gtk_widget_class_bind_template_callback (widget_class, get_self_fraction);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, get_total_fraction);
|
gtk_widget_class_bind_template_callback (widget_class, get_total_fraction);
|
||||||
|
gtk_widget_class_bind_template_callback (widget_class, get_total_size);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, functions_get_self_fraction);
|
gtk_widget_class_bind_template_callback (widget_class, functions_get_self_fraction);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, functions_get_total_fraction);
|
gtk_widget_class_bind_template_callback (widget_class, functions_get_total_fraction);
|
||||||
|
|
||||||
|
|||||||
@ -63,6 +63,36 @@
|
|||||||
</property>
|
</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkColumnViewColumn" id="descendants_hits_column">
|
||||||
|
<property name="title" translatable="yes">Size</property>
|
||||||
|
<property name="factory">
|
||||||
|
<object class="GtkBuilderListItemFactory">
|
||||||
|
<property name="bytes"><![CDATA[
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<template class="GtkListItem">
|
||||||
|
<property name="child">
|
||||||
|
<object class="GtkLabel" id="progress">
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
<binding name="label">
|
||||||
|
<closure type="gchararray" function="get_total_size">
|
||||||
|
<lookup name="item">GtkListItem</lookup>
|
||||||
|
</closure>
|
||||||
|
</binding>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="scale" value=".9"/>
|
||||||
|
</attributes>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</template>
|
||||||
|
</interface>
|
||||||
|
]]>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child internal-child="functions_column_view">
|
<child internal-child="functions_column_view">
|
||||||
|
|||||||
Reference in New Issue
Block a user