diff --git a/src/sysprof/icons/scalable/actions/flamegraph-symbolic.svg b/src/sysprof/icons/scalable/actions/flamegraph-symbolic.svg
new file mode 100644
index 00000000..602e5975
--- /dev/null
+++ b/src/sysprof/icons/scalable/actions/flamegraph-symbolic.svg
@@ -0,0 +1,66 @@
+
+
diff --git a/src/sysprof/meson.build b/src/sysprof/meson.build
index a77f0043..7aa8b18e 100644
--- a/src/sysprof/meson.build
+++ b/src/sysprof/meson.build
@@ -20,6 +20,7 @@ sysprof_sources = [
'sysprof-energy-section.c',
'sysprof-entry-popover.c',
'sysprof-files-section.c',
+ 'sysprof-flame-graph.c',
'sysprof-frame-utility.c',
'sysprof-graphics-section.c',
'sysprof-greeter.c',
diff --git a/src/sysprof/sysprof-flame-graph.c b/src/sysprof/sysprof-flame-graph.c
new file mode 100644
index 00000000..a73af9d4
--- /dev/null
+++ b/src/sysprof/sysprof-flame-graph.c
@@ -0,0 +1,138 @@
+/* sysprof-flame-graph.c
+ *
+ * Copyright 2023 Christian Hergert
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#include "config.h"
+
+#include "sysprof-flame-graph.h"
+
+struct _SysprofFlameGraph
+{
+ GtkWidget parent_instance;
+
+ SysprofCallgraph *callgraph;
+};
+
+enum {
+ PROP_0,
+ PROP_CALLGRAPH,
+ N_PROPS
+};
+
+G_DEFINE_FINAL_TYPE (SysprofFlameGraph, sysprof_flame_graph, GTK_TYPE_WIDGET)
+
+static GParamSpec *properties [N_PROPS];
+
+static void
+sysprof_flame_graph_dispose (GObject *object)
+{
+ SysprofFlameGraph *self = (SysprofFlameGraph *)object;
+
+ g_clear_object (&self->callgraph);
+
+ G_OBJECT_CLASS (sysprof_flame_graph_parent_class)->dispose (object);
+}
+
+static void
+sysprof_flame_graph_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ SysprofFlameGraph *self = SYSPROF_FLAME_GRAPH (object);
+
+ switch (prop_id)
+ {
+ case PROP_CALLGRAPH:
+ g_value_set_object (value, sysprof_flame_graph_get_callgraph (self));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+sysprof_flame_graph_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ SysprofFlameGraph *self = SYSPROF_FLAME_GRAPH (object);
+
+ switch (prop_id)
+ {
+ case PROP_CALLGRAPH:
+ sysprof_flame_graph_set_callgraph (self, g_value_get_object (value));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+sysprof_flame_graph_class_init (SysprofFlameGraphClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->dispose = sysprof_flame_graph_dispose;
+ object_class->get_property = sysprof_flame_graph_get_property;
+ object_class->set_property = sysprof_flame_graph_set_property;
+
+ properties[PROP_CALLGRAPH] =
+ g_param_spec_object ("callgraph", NULL, NULL,
+ SYSPROF_TYPE_CALLGRAPH,
+ (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_properties (object_class, N_PROPS, properties);
+}
+
+static void
+sysprof_flame_graph_init (SysprofFlameGraph *self)
+{
+}
+
+GtkWidget *
+sysprof_flame_graph_new (void)
+{
+ return g_object_new (SYSPROF_TYPE_FLAME_GRAPH, NULL);
+}
+
+SysprofCallgraph *
+sysprof_flame_graph_get_callgraph (SysprofFlameGraph *self)
+{
+ g_return_val_if_fail (SYSPROF_IS_FLAME_GRAPH (self), NULL);
+
+ return self->callgraph;
+}
+
+void
+sysprof_flame_graph_set_callgraph (SysprofFlameGraph *self,
+ SysprofCallgraph *callgraph)
+{
+ g_return_if_fail (SYSPROF_IS_FLAME_GRAPH (self));
+ g_return_if_fail (!callgraph || SYSPROF_IS_CALLGRAPH (callgraph));
+
+ if (g_set_object (&self->callgraph, callgraph))
+ {
+ g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_CALLGRAPH]);
+ gtk_widget_queue_draw (GTK_WIDGET (self));
+ }
+}
diff --git a/src/sysprof/sysprof-flame-graph.h b/src/sysprof/sysprof-flame-graph.h
new file mode 100644
index 00000000..c8b67477
--- /dev/null
+++ b/src/sysprof/sysprof-flame-graph.h
@@ -0,0 +1,38 @@
+/* sysprof-flame-graph.h
+ *
+ * Copyright 2023 Christian Hergert
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include
+
+#include
+
+G_BEGIN_DECLS
+
+#define SYSPROF_TYPE_FLAME_GRAPH (sysprof_flame_graph_get_type())
+
+G_DECLARE_FINAL_TYPE (SysprofFlameGraph, sysprof_flame_graph, SYSPROF, FLAME_GRAPH, GtkWidget)
+
+GtkWidget *sysprof_flame_graph_new (void);
+SysprofCallgraph *sysprof_flame_graph_get_callgraph (SysprofFlameGraph *self);
+void sysprof_flame_graph_set_callgraph (SysprofFlameGraph *self,
+ SysprofCallgraph *callgraph);
+
+G_END_DECLS
diff --git a/src/sysprof/sysprof-samples-section.c b/src/sysprof/sysprof-samples-section.c
index b4e26c9f..96687b51 100644
--- a/src/sysprof/sysprof-samples-section.c
+++ b/src/sysprof/sysprof-samples-section.c
@@ -22,6 +22,7 @@
#include "sysprof-chart.h"
#include "sysprof-column-layer.h"
+#include "sysprof-flame-graph.h"
#include "sysprof-sampled-model.h"
#include "sysprof-samples-section.h"
#include "sysprof-session-model-item.h"
@@ -80,6 +81,7 @@ sysprof_samples_section_class_init (SysprofSamplesSectionClass *klass)
g_type_ensure (SYSPROF_TYPE_COLUMN_LAYER);
g_type_ensure (SYSPROF_TYPE_DOCUMENT_SAMPLE);
g_type_ensure (SYSPROF_TYPE_DOCUMENT_TRACEABLE);
+ g_type_ensure (SYSPROF_TYPE_FLAME_GRAPH);
g_type_ensure (SYSPROF_TYPE_SAMPLED_MODEL);
g_type_ensure (SYSPROF_TYPE_TIME_FILTER_MODEL);
g_type_ensure (SYSPROF_TYPE_TIME_SCRUBBER);
diff --git a/src/sysprof/sysprof-samples-section.ui b/src/sysprof/sysprof-samples-section.ui
index 7f9e100e..50839823 100644
--- a/src/sysprof/sysprof-samples-section.ui
+++ b/src/sysprof/sysprof-samples-section.ui
@@ -80,64 +80,91 @@
-
+
+
+ flamegraph-symbolic
+ Flame Graph
+
+
+
+
+
+
+
+
+
+
+ true
+ stack
diff --git a/src/sysprof/sysprof.gresource.xml b/src/sysprof/sysprof.gresource.xml
index 2077ada6..ab26820b 100644
--- a/src/sysprof/sysprof.gresource.xml
+++ b/src/sysprof/sysprof.gresource.xml
@@ -7,6 +7,7 @@
icons/scalable/actions/dbus-symbolic.svg
icons/scalable/actions/empty-symbolic.svg
icons/scalable/actions/energy-symbolic.svg
+ icons/scalable/actions/flamegraph-symbolic.svg
icons/scalable/actions/graphics-symbolic.svg
icons/scalable/actions/mark-chart-symbolic.svg
icons/scalable/actions/mark-table-symbolic.svg