sysprof: add sample count as indicator

This commit is contained in:
Christian Hergert
2023-07-14 15:15:23 -07:00
parent 0afc861b16
commit d5cfd4866e
2 changed files with 19 additions and 0 deletions

View File

@ -36,6 +36,13 @@ struct _SysprofSamplesSection
G_DEFINE_FINAL_TYPE (SysprofSamplesSection, sysprof_samples_section, SYSPROF_TYPE_SECTION)
static char *
format_number (gpointer unused,
guint number)
{
return g_strdup_printf ("%'u", number);
}
static void
sysprof_samples_section_dispose (GObject *object)
{
@ -56,6 +63,7 @@ sysprof_samples_section_class_init (SysprofSamplesSectionClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-samples-section.ui");
gtk_widget_class_bind_template_child (widget_class, SysprofSamplesSection, callgraph_view);
gtk_widget_class_bind_template_callback (widget_class, format_number);
g_type_ensure (SYSPROF_TYPE_CHART);
g_type_ensure (SYSPROF_TYPE_XY_SERIES);

View File

@ -2,6 +2,17 @@
<interface>
<template class="SysprofSamplesSection" parent="SysprofSection">
<property name="title" translatable="yes">Time Profiler</property>
<binding name="indicator">
<closure type="gchararray" function="format_number">
<lookup name="n-items" type="SysprofDocumentBitsetIndex">
<lookup name="samples" type="SysprofDocument">
<lookup name="document" type="SysprofSession">
<lookup name="session">SysprofSamplesSection</lookup>
</lookup>
</lookup>
</lookup>
</closure>
</binding>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>