sysprof: show mark name in waterfall marks

This makes is much easier to inspect waterfall marks, since we can spot
at a glance which marks are there, without having to hover each mark
individually with the cursor to see the tooltip.

This helps WebKit profiling in particular, which is a heavy user of
marks.
This commit is contained in:
Georges Basile Stavracas Neto
2024-08-07 11:18:03 -03:00
parent ad8fe5906d
commit 7cd51d1502
2 changed files with 22 additions and 2 deletions

View File

@ -42,6 +42,25 @@ struct _SysprofMarksSection
G_DEFINE_FINAL_TYPE (SysprofMarksSection, sysprof_marks_section, SYSPROF_TYPE_SECTION)
static char *
format_mark_label (gpointer unused,
SysprofDocumentMark *mark)
{
const char *message;
const char *name;
if (mark == NULL)
return NULL;
name = sysprof_document_mark_get_name (mark);
message = sysprof_document_mark_get_message (mark);
if (name && *name && message && *message)
return g_strdup_printf ("%s %s", name, message);
else
return g_strdup_printf ("%s", name);
}
static char *
format_number (gpointer unused,
guint number)
@ -74,6 +93,7 @@ sysprof_marks_section_class_init (SysprofMarksSectionClass *klass)
gtk_widget_class_bind_template_child (widget_class, SysprofMarksSection, mark_table);
gtk_widget_class_bind_template_child (widget_class, SysprofMarksSection, median_column);
gtk_widget_class_bind_template_child (widget_class, SysprofMarksSection, summary_column_view);
gtk_widget_class_bind_template_callback (widget_class, format_mark_label);
gtk_widget_class_bind_template_callback (widget_class, format_number);
g_type_ensure (SYSPROF_TYPE_CHART);

View File

@ -175,9 +175,9 @@
</object>
</property>
<property name="label-expression">
<lookup name="message" type="SysprofDocumentMark">
<closure type="gchararray" function="format_mark_label">
<lookup name="item" type="SysprofSessionModelItem"/>
</lookup>
</closure>
</property>
<property name="begin-time-expression">
<lookup name="time" type="SysprofDocumentMark">