mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 23:51:06 +00:00
sysprof: add indicator to allocations section
This commit is contained in:
@ -33,6 +33,15 @@ struct _SysprofMemorySection
|
|||||||
|
|
||||||
G_DEFINE_FINAL_TYPE (SysprofMemorySection, sysprof_memory_section, SYSPROF_TYPE_SECTION)
|
G_DEFINE_FINAL_TYPE (SysprofMemorySection, sysprof_memory_section, SYSPROF_TYPE_SECTION)
|
||||||
|
|
||||||
|
static char *
|
||||||
|
format_number (gpointer unused,
|
||||||
|
guint number)
|
||||||
|
{
|
||||||
|
if (number == 0)
|
||||||
|
return NULL;
|
||||||
|
return g_strdup_printf ("%'u", number);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sysprof_memory_section_dispose (GObject *object)
|
sysprof_memory_section_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
@ -53,6 +62,7 @@ sysprof_memory_section_class_init (SysprofMemorySectionClass *klass)
|
|||||||
|
|
||||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-memory-section.ui");
|
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-memory-section.ui");
|
||||||
gtk_widget_class_bind_template_child (widget_class, SysprofMemorySection, callgraph_view);
|
gtk_widget_class_bind_template_child (widget_class, SysprofMemorySection, callgraph_view);
|
||||||
|
gtk_widget_class_bind_template_callback (widget_class, format_number);
|
||||||
|
|
||||||
g_type_ensure (SYSPROF_TYPE_CHART);
|
g_type_ensure (SYSPROF_TYPE_CHART);
|
||||||
g_type_ensure (SYSPROF_TYPE_XY_SERIES);
|
g_type_ensure (SYSPROF_TYPE_XY_SERIES);
|
||||||
|
|||||||
@ -2,6 +2,17 @@
|
|||||||
<interface>
|
<interface>
|
||||||
<template class="SysprofMemorySection" parent="SysprofSection">
|
<template class="SysprofMemorySection" parent="SysprofSection">
|
||||||
<property name="title" translatable="yes">Memory Allocations</property>
|
<property name="title" translatable="yes">Memory Allocations</property>
|
||||||
|
<binding name="indicator">
|
||||||
|
<closure type="gchararray" function="format_number">
|
||||||
|
<lookup name="n-items" type="SysprofDocumentBitsetIndex">
|
||||||
|
<lookup name="allocations" type="SysprofDocument">
|
||||||
|
<lookup name="document" type="SysprofSession">
|
||||||
|
<lookup name="session">SysprofMemorySection</lookup>
|
||||||
|
</lookup>
|
||||||
|
</lookup>
|
||||||
|
</lookup>
|
||||||
|
</closure>
|
||||||
|
</binding>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user