mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-09 22:50:54 +00:00
libsysprof-gtk: add columns for callers list
This commit is contained in:
@ -383,7 +383,9 @@ sysprof_callgraph_view_get_internal_child (GtkBuildable *buildable,
|
|||||||
GtkBuilder *builder,
|
GtkBuilder *builder,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
if (g_strcmp0 (name, "descendants_column_view") == 0)
|
if (g_strcmp0 (name, "callers_column_view") == 0)
|
||||||
|
return G_OBJECT (SYSPROF_CALLGRAPH_VIEW (buildable)->callers_column_view);
|
||||||
|
else if (g_strcmp0 (name, "descendants_column_view") == 0)
|
||||||
return G_OBJECT (SYSPROF_CALLGRAPH_VIEW (buildable)->descendants_column_view);
|
return G_OBJECT (SYSPROF_CALLGRAPH_VIEW (buildable)->descendants_column_view);
|
||||||
else if (g_strcmp0 (name, "functions_column_view") == 0)
|
else if (g_strcmp0 (name, "functions_column_view") == 0)
|
||||||
return G_OBJECT (SYSPROF_CALLGRAPH_VIEW (buildable)->functions_column_view);
|
return G_OBJECT (SYSPROF_CALLGRAPH_VIEW (buildable)->functions_column_view);
|
||||||
|
|||||||
@ -28,6 +28,11 @@ struct _SysprofWeightedCallgraphView
|
|||||||
{
|
{
|
||||||
SysprofCallgraphView parent_instance;
|
SysprofCallgraphView parent_instance;
|
||||||
|
|
||||||
|
GtkColumnViewColumn *callers_self_column;
|
||||||
|
GtkColumnViewColumn *callers_total_column;
|
||||||
|
GtkCustomSorter *callers_self_sorter;
|
||||||
|
GtkCustomSorter *callers_total_sorter;
|
||||||
|
|
||||||
GtkColumnViewColumn *descendants_self_column;
|
GtkColumnViewColumn *descendants_self_column;
|
||||||
GtkColumnViewColumn *descendants_total_column;
|
GtkColumnViewColumn *descendants_total_column;
|
||||||
GtkCustomSorter *descendants_self_sorter;
|
GtkCustomSorter *descendants_self_sorter;
|
||||||
@ -272,6 +277,14 @@ sysprof_weighted_callgraph_view_load (SysprofCallgraphView *view,
|
|||||||
gtk_custom_sorter_set_sort_func (self->functions_total_sorter,
|
gtk_custom_sorter_set_sort_func (self->functions_total_sorter,
|
||||||
functions_sort_by_total, root, NULL);
|
functions_sort_by_total, root, NULL);
|
||||||
|
|
||||||
|
gtk_custom_sorter_set_sort_func (self->callers_self_sorter,
|
||||||
|
functions_sort_by_self, root, NULL);
|
||||||
|
gtk_custom_sorter_set_sort_func (self->callers_total_sorter,
|
||||||
|
functions_sort_by_total, root, NULL);
|
||||||
|
|
||||||
|
gtk_column_view_sort_by_column (SYSPROF_CALLGRAPH_VIEW (self)->callers_column_view,
|
||||||
|
self->callers_total_column,
|
||||||
|
GTK_SORT_DESCENDING);
|
||||||
gtk_column_view_sort_by_column (SYSPROF_CALLGRAPH_VIEW (self)->descendants_column_view,
|
gtk_column_view_sort_by_column (SYSPROF_CALLGRAPH_VIEW (self)->descendants_column_view,
|
||||||
self->descendants_total_column,
|
self->descendants_total_column,
|
||||||
GTK_SORT_DESCENDING);
|
GTK_SORT_DESCENDING);
|
||||||
@ -292,6 +305,11 @@ sysprof_weighted_callgraph_view_class_init (SysprofWeightedCallgraphViewClass *k
|
|||||||
|
|
||||||
gtk_widget_class_set_template_from_resource (widget_class, "/libsysprof-gtk/sysprof-weighted-callgraph-view.ui");
|
gtk_widget_class_set_template_from_resource (widget_class, "/libsysprof-gtk/sysprof-weighted-callgraph-view.ui");
|
||||||
|
|
||||||
|
gtk_widget_class_bind_template_child (widget_class, SysprofWeightedCallgraphView, callers_self_column);
|
||||||
|
gtk_widget_class_bind_template_child (widget_class, SysprofWeightedCallgraphView, callers_total_column);
|
||||||
|
gtk_widget_class_bind_template_child (widget_class, SysprofWeightedCallgraphView, callers_self_sorter);
|
||||||
|
gtk_widget_class_bind_template_child (widget_class, SysprofWeightedCallgraphView, callers_total_sorter);
|
||||||
|
|
||||||
gtk_widget_class_bind_template_child (widget_class, SysprofWeightedCallgraphView, descendants_self_column);
|
gtk_widget_class_bind_template_child (widget_class, SysprofWeightedCallgraphView, descendants_self_column);
|
||||||
gtk_widget_class_bind_template_child (widget_class, SysprofWeightedCallgraphView, descendants_total_column);
|
gtk_widget_class_bind_template_child (widget_class, SysprofWeightedCallgraphView, descendants_total_column);
|
||||||
gtk_widget_class_bind_template_child (widget_class, SysprofWeightedCallgraphView, descendants_self_sorter);
|
gtk_widget_class_bind_template_child (widget_class, SysprofWeightedCallgraphView, descendants_self_sorter);
|
||||||
|
|||||||
@ -132,5 +132,72 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child internal-child="callers_column_view">
|
||||||
|
<object class="GtkColumnView">
|
||||||
|
<style>
|
||||||
|
<class name="data-table"/>
|
||||||
|
</style>
|
||||||
|
<child>
|
||||||
|
<object class="GtkColumnViewColumn" id="callers_self_column">
|
||||||
|
<property name="title" translatable="yes">Self</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="SysprofProgressCell" id="progress">
|
||||||
|
<binding name="fraction">
|
||||||
|
<closure type="gdouble" function="functions_get_self_fraction">
|
||||||
|
<lookup name="item">GtkListItem</lookup>
|
||||||
|
</closure>
|
||||||
|
</binding>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</template>
|
||||||
|
</interface>
|
||||||
|
]]>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
<property name="sorter">
|
||||||
|
<object class="GtkCustomSorter" id="callers_self_sorter">
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkColumnViewColumn" id="callers_total_column">
|
||||||
|
<property name="title" translatable="yes">Total</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="SysprofProgressCell" id="progress">
|
||||||
|
<binding name="fraction">
|
||||||
|
<closure type="gdouble" function="functions_get_total_fraction">
|
||||||
|
<lookup name="item">GtkListItem</lookup>
|
||||||
|
</closure>
|
||||||
|
</binding>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</template>
|
||||||
|
</interface>
|
||||||
|
]]>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
<property name="sorter">
|
||||||
|
<object class="GtkCustomSorter" id="callers_total_sorter">
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</template>
|
</template>
|
||||||
</interface>
|
</interface>
|
||||||
|
|||||||
Reference in New Issue
Block a user