libsysprof-ui: add section for counter values

This commit is contained in:
Christian Hergert
2019-05-22 11:37:56 -07:00
parent b854a71804
commit bc21b47315
3 changed files with 31 additions and 1 deletions

View File

@ -56,6 +56,7 @@ typedef struct
GtkStack *stack;
SysprofCallgraphView *callgraph_view;
SysprofDetailsView *details_view;
SysprofMarksView *counters_view;
SysprofMarksView *marks_view;
SysprofVisualizerView *visualizer_view;
SysprofZoomManager *zoom_manager;
@ -455,6 +456,9 @@ sysprof_capture_view_scan_finish (SysprofCaptureView *self,
if (!priv->features.has_marks)
gtk_widget_hide (GTK_WIDGET (priv->marks_view));
if (!priv->features.has_counters)
gtk_widget_hide (GTK_WIDGET (priv->counters_view));
g_clear_pointer (&priv->mark_stats, g_hash_table_unref);
if ((stats = g_object_get_data (G_OBJECT (result), "MARK_STAT")))
priv->mark_stats = g_hash_table_ref (stats);
@ -576,6 +580,17 @@ sysprof_capture_view_load_scan_cb (GObject *object,
sysprof_visualizer_view_set_reader (priv->visualizer_view, state->reader);
if (priv->features.has_counters)
{
state->n_active++;
sysprof_marks_view_load_async (priv->counters_view,
state->reader,
state->selection,
g_task_get_cancellable (task),
sysprof_capture_view_load_marks_cb,
g_object_ref (task));
}
state->n_active++;
sysprof_marks_view_load_async (priv->marks_view,
state->reader,
@ -774,6 +789,7 @@ sysprof_capture_view_class_init (SysprofCaptureViewClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/ui/sysprof-capture-view.ui");
gtk_widget_class_bind_template_child_private (widget_class, SysprofCaptureView, callgraph_view);
gtk_widget_class_bind_template_child_private (widget_class, SysprofCaptureView, details_view);
gtk_widget_class_bind_template_child_private (widget_class, SysprofCaptureView, counters_view);
gtk_widget_class_bind_template_child_private (widget_class, SysprofCaptureView, marks_view);
gtk_widget_class_bind_template_child_private (widget_class, SysprofCaptureView, stack);
gtk_widget_class_bind_template_child_private (widget_class, SysprofCaptureView, stack_switcher);

View File

@ -361,10 +361,11 @@ cursor_foreach_cb (const SysprofCaptureFrame *frame,
item.end_time = frame->time;
item.group = ctr->category;
item.name = ctr->name;
item.value = values->values[j];
item.is_counter = TRUE;
item.counter_type = ctr->type;
memcpy (&item.value, &values->values[j], sizeof item.value);
g_array_append_val (self->items, item);
}
}

View File

@ -131,6 +131,7 @@
</child>
<child>
<object class="SysprofMarksView" id="marks_view">
<property name="kind">marks</property>
<property name="zoom-manager">zoom_manager</property>
<property name="visible">true</property>
</object>
@ -140,6 +141,18 @@
<property name="name">timings</property>
</packing>
</child>
<child>
<object class="SysprofMarksView" id="counters_view">
<property name="kind">counters</property>
<property name="zoom-manager">zoom_manager</property>
<property name="visible">true</property>
</object>
<packing>
<!-- translators: the _ is used to denote the accelerator key -->
<property name="title" translatable="yes">_Counters</property>
<property name="name">counters</property>
</packing>
</child>
<child>
<object class="SysprofDetailsView" id="details_view">
<property name="visible">true</property>