mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 23:51:06 +00:00
libsysprof-ui: use AdwPreferencesPage for memprof page
This commit is contained in:
@ -44,7 +44,6 @@
|
|||||||
#include "../stackstash.h"
|
#include "../stackstash.h"
|
||||||
|
|
||||||
#include "egg-paned-private.h"
|
#include "egg-paned-private.h"
|
||||||
#include "egg-three-grid.h"
|
|
||||||
|
|
||||||
#include "sysprof-cell-renderer-percent.h"
|
#include "sysprof-cell-renderer-percent.h"
|
||||||
#include "sysprof-memprof-page.h"
|
#include "sysprof-memprof-page.h"
|
||||||
@ -68,7 +67,6 @@ typedef struct
|
|||||||
GtkLabel *temp_allocs_count;
|
GtkLabel *temp_allocs_count;
|
||||||
GtkLabel *num_allocs;
|
GtkLabel *num_allocs;
|
||||||
GtkLabel *leaked_allocs;
|
GtkLabel *leaked_allocs;
|
||||||
GtkLabel *peak_allocs;
|
|
||||||
GtkListBox *by_size;
|
GtkListBox *by_size;
|
||||||
GtkWidget *callgraph;
|
GtkWidget *callgraph;
|
||||||
GtkWidget *summary_page;
|
GtkWidget *summary_page;
|
||||||
@ -226,7 +224,14 @@ update_summary (SysprofMemprofPage *self,
|
|||||||
title = gtk_label_new (NULL);
|
title = gtk_label_new (NULL);
|
||||||
subtitle = gtk_label_new (NULL);
|
subtitle = gtk_label_new (NULL);
|
||||||
prog = gtk_level_bar_new_for_interval (0, stats.n_allocs);
|
prog = gtk_level_bar_new_for_interval (0, stats.n_allocs);
|
||||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
|
box = g_object_new (GTK_TYPE_BOX,
|
||||||
|
"orientation", GTK_ORIENTATION_VERTICAL,
|
||||||
|
"spacing", 6,
|
||||||
|
"margin-top", 6,
|
||||||
|
"margin-start", 6,
|
||||||
|
"margin-bottom", 6,
|
||||||
|
"margin-end", 6,
|
||||||
|
NULL);
|
||||||
|
|
||||||
sizestr = g_format_size_full (stats.by_size[i].bucket, G_FORMAT_SIZE_IEC_UNITS);
|
sizestr = g_format_size_full (stats.by_size[i].bucket, G_FORMAT_SIZE_IEC_UNITS);
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
@ -1155,7 +1160,6 @@ sysprof_memprof_page_class_init (SysprofMemprofPageClass *klass)
|
|||||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, num_allocs);
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, num_allocs);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, leaked_allocs);
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, leaked_allocs);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, leaked_allocs_button);
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, leaked_allocs_button);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, peak_allocs);
|
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, loading_state);
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, loading_state);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, empty_state);
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, empty_state);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, summary_page);
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, summary_page);
|
||||||
@ -1167,7 +1171,6 @@ sysprof_memprof_page_class_init (SysprofMemprofPageClass *klass)
|
|||||||
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_Left, GDK_ALT_MASK, "go-previous", NULL);
|
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_Left, GDK_ALT_MASK, "go-previous", NULL);
|
||||||
|
|
||||||
g_type_ensure (EGG_TYPE_PANED);
|
g_type_ensure (EGG_TYPE_PANED);
|
||||||
g_type_ensure (EGG_TYPE_THREE_GRID);
|
|
||||||
g_type_ensure (SYSPROF_TYPE_CELL_RENDERER_PERCENT);
|
g_type_ensure (SYSPROF_TYPE_CELL_RENDERER_PERCENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,147 +55,65 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkStack" id="stack">
|
<object class="GtkStack" id="stack">
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkScrolledWindow" id="summary_page">
|
<object class="AdwPreferencesPage" id="summary_page">
|
||||||
<property name="hscrollbar-policy">never</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="AdwPreferencesGroup">
|
||||||
<property name="margin-top">16</property>
|
|
||||||
<property name="margin-bottom">16</property>
|
|
||||||
<property name="margin-start">16</property>
|
|
||||||
<property name="margin-end">16</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="EggThreeGrid">
|
<object class="AdwActionRow">
|
||||||
<property name="hexpand">true</property>
|
<property name="activatable">false</property>
|
||||||
<property name="row-spacing">6</property>
|
<property name="title" translatable="yes">Number of Allocations</property>
|
||||||
<property name="column-spacing">18</property>
|
<property name="subtitle" translatable="yes">Total number of allocation and free records</property>
|
||||||
<child>
|
<child type="suffix">
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="label">Peak Allocation</property>
|
|
||||||
<property name="halign">end</property>
|
|
||||||
<property name="visible">false</property>
|
|
||||||
<style>
|
|
||||||
<class name="dim-label"/>
|
|
||||||
</style>
|
|
||||||
<layout>
|
|
||||||
<property name="column">left</property>
|
|
||||||
<property name="row">0</property>
|
|
||||||
</layout>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="peak_allocs">
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="selectable">true</property>
|
|
||||||
<property name="visible">false</property>
|
|
||||||
<layout>
|
|
||||||
<property name="column">center</property>
|
|
||||||
<property name="row">0</property>
|
|
||||||
</layout>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="label">Number of Allocations</property>
|
|
||||||
<property name="halign">end</property>
|
|
||||||
<style>
|
|
||||||
<class name="dim-label"/>
|
|
||||||
</style>
|
|
||||||
<layout>
|
|
||||||
<property name="column">left</property>
|
|
||||||
<property name="row">1</property>
|
|
||||||
</layout>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="num_allocs">
|
<object class="GtkLabel" id="num_allocs">
|
||||||
<property name="xalign">0</property>
|
<property name="hexpand">true</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
<property name="selectable">true</property>
|
<property name="selectable">true</property>
|
||||||
<layout>
|
|
||||||
<property name="column">center</property>
|
|
||||||
<property name="row">1</property>
|
|
||||||
</layout>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
</object>
|
||||||
<object class="GtkLabel">
|
</child>
|
||||||
<property name="label">Leaked Allocations</property>
|
<child>
|
||||||
<property name="halign">end</property>
|
<object class="AdwActionRow">
|
||||||
<property name="visible">false</property>
|
<property name="activatable">false</property>
|
||||||
<style>
|
<property name="title" translatable="yes">Leaked Allocations</property>
|
||||||
<class name="dim-label"/>
|
<property name="subtitle" translatable="yes">Number of allocations without a free record</property>
|
||||||
</style>
|
<child type="suffix">
|
||||||
<layout>
|
|
||||||
<property name="column">left</property>
|
|
||||||
<property name="row">2</property>
|
|
||||||
</layout>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="leaked_allocs">
|
<object class="GtkLabel" id="leaked_allocs">
|
||||||
<property name="xalign">0</property>
|
<property name="hexpand">true</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
<property name="selectable">true</property>
|
<property name="selectable">true</property>
|
||||||
<property name="visible">false</property>
|
|
||||||
<layout>
|
|
||||||
<property name="column">center</property>
|
|
||||||
<property name="row">2</property>
|
|
||||||
</layout>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
</object>
|
||||||
<object class="GtkLabel">
|
</child>
|
||||||
<property name="label">Temporary Allocations</property>
|
<child>
|
||||||
<property name="halign">end</property>
|
<object class="AdwActionRow">
|
||||||
<style>
|
<property name="activatable">false</property>
|
||||||
<class name="dim-label"/>
|
<property name="title" translatable="yes">Temporary Allocations</property>
|
||||||
</style>
|
<property name="subtitle" translatable="yes">Number of allocations freed from similar stack trace</property>
|
||||||
<layout>
|
<child type="suffix">
|
||||||
<property name="column">left</property>
|
|
||||||
<property name="row">3</property>
|
|
||||||
</layout>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="temp_allocs_count">
|
<object class="GtkLabel" id="temp_allocs_count">
|
||||||
<property name="xalign">0</property>
|
<property name="hexpand">true</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
<property name="selectable">true</property>
|
<property name="selectable">true</property>
|
||||||
<property name="width-chars">50</property>
|
|
||||||
<layout>
|
|
||||||
<property name="column">center</property>
|
|
||||||
<property name="row">3</property>
|
|
||||||
</layout>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="label">Allocations by Size</property>
|
|
||||||
<property name="halign">end</property>
|
|
||||||
<property name="valign">start</property>
|
|
||||||
<style>
|
|
||||||
<class name="dim-label"/>
|
|
||||||
</style>
|
|
||||||
<layout>
|
|
||||||
<property name="column">left</property>
|
|
||||||
<property name="row">4</property>
|
|
||||||
</layout>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkFrame">
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBox" id="by_size">
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<layout>
|
|
||||||
<property name="column">center</property>
|
|
||||||
<property name="row">4</property>
|
|
||||||
</layout>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="AdwPreferencesGroup">
|
||||||
|
<property name="title" translatable="yes">Allocations by Size</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkListBox" id="by_size">
|
||||||
|
<style>
|
||||||
|
<class name="boxed-list"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
|||||||
Reference in New Issue
Block a user