mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
sysprof: bring back Hits column for descendants
This is helpful because it lets you know how reliable your percentages are.
This commit is contained in:
@ -98,6 +98,25 @@ augment_weight (SysprofCallgraph *callgraph,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gint64
|
||||||
|
get_total_hits (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));
|
||||||
|
AugmentWeight *sum = sysprof_callgraph_frame_get_augment (frame);
|
||||||
|
|
||||||
|
return sum->total;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static double
|
static double
|
||||||
get_total_fraction (GObject *item)
|
get_total_fraction (GObject *item)
|
||||||
{
|
{
|
||||||
@ -329,6 +348,7 @@ sysprof_weighted_callgraph_view_class_init (SysprofWeightedCallgraphViewClass *k
|
|||||||
|
|
||||||
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_hits);
|
||||||
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">Hits</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="gint64" function="get_total_hits">
|
||||||
|
<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