mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
wip: visualizers
This commit is contained in:
@ -1,10 +1,14 @@
|
||||
GtkPopover GtkListBox GtkListBoxRow,
|
||||
GtkPaned GtkListBox GtkListBoxRow,
|
||||
paned list row,
|
||||
popover list row {
|
||||
padding: 6px 10px 6px 10px;
|
||||
border-bottom: 1px solid alpha(@borders, 0.2);
|
||||
}
|
||||
|
||||
GtkPopover GtkListBox GtkListBoxRow:last-child,
|
||||
GtkPaned GtkListBox GtkListBoxRow:last-child,
|
||||
paned list row:last-child,
|
||||
popover list row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
@ -160,8 +160,34 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="SpCallgraphView" id="callgraph_view">
|
||||
<object class="GtkPaned">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="visible">true</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="min-content-height">75</property>
|
||||
<property name="max-content-height">225</property>
|
||||
<property name="visible">true</property>
|
||||
<child>
|
||||
<object class="GtkListBox" id="visualizer_rows">
|
||||
<property name="visible">true</property>
|
||||
<child>
|
||||
<object class="SpLineVisualizerRow" id="cpu_row">
|
||||
<property name="title" translatable="yes">CPU</property>
|
||||
<property name="height-request">75</property>
|
||||
<property name="selectable">false</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="SpCallgraphView" id="callgraph_view">
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">browsing</property>
|
||||
|
||||
@ -48,6 +48,7 @@ struct _SpWindow
|
||||
GtkLabel *stat_label;
|
||||
GtkLabel *title;
|
||||
GtkStack *view_stack;
|
||||
GtkListBox *visualizer_rows;
|
||||
|
||||
guint stats_handler;
|
||||
|
||||
@ -211,12 +212,16 @@ sp_window_build_profile_cb (GObject *object,
|
||||
}
|
||||
|
||||
sp_callgraph_view_set_profile (self->callgraph_view, SP_CALLGRAPH_PROFILE (profile));
|
||||
sp_window_set_state (self, SP_WINDOW_STATE_BROWSING);
|
||||
|
||||
if (sp_callgraph_view_get_n_functions (self->callgraph_view) == 0)
|
||||
sp_window_notify_user (self,
|
||||
GTK_MESSAGE_WARNING,
|
||||
_("Not enough samples were collected to generate a callgraph"));
|
||||
|
||||
gtk_container_foreach (GTK_CONTAINER (self->visualizer_rows),
|
||||
(GtkCallback)sp_visualizer_row_set_reader,
|
||||
self->reader);
|
||||
|
||||
sp_window_set_state (self, SP_WINDOW_STATE_BROWSING);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -362,6 +367,7 @@ static void
|
||||
sp_window_add_sources (SpWindow *window,
|
||||
SpProfiler *profiler)
|
||||
{
|
||||
g_autoptr(SpSource) host_source = NULL;
|
||||
g_autoptr(SpSource) proc_source = NULL;
|
||||
g_autoptr(SpSource) perf_source = NULL;
|
||||
|
||||
@ -373,6 +379,9 @@ sp_window_add_sources (SpWindow *window,
|
||||
|
||||
perf_source = sp_perf_source_new ();
|
||||
sp_profiler_add_source (profiler, perf_source);
|
||||
|
||||
host_source = sp_hostinfo_source_new ();
|
||||
sp_profiler_add_source (profiler, host_source);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -760,6 +769,7 @@ sp_window_class_init (SpWindowClass *klass)
|
||||
gtk_widget_class_bind_template_child (widget_class, SpWindow, subtitle);
|
||||
gtk_widget_class_bind_template_child (widget_class, SpWindow, title);
|
||||
gtk_widget_class_bind_template_child (widget_class, SpWindow, view_stack);
|
||||
gtk_widget_class_bind_template_child (widget_class, SpWindow, visualizer_rows);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user