diff --git a/src/libsysprof-ui/sysprof-callgraph-view.c b/src/libsysprof-ui/sysprof-callgraph-view.c index cc0bb4c8..603450e5 100644 --- a/src/libsysprof-ui/sysprof-callgraph-view.c +++ b/src/libsysprof-ui/sysprof-callgraph-view.c @@ -211,6 +211,16 @@ sysprof_callgraph_view_load (SysprofCallgraphView *self, g_clear_object (&functions); } +void +_sysprof_callgraph_view_set_failed (SysprofCallgraphView *self) +{ + SysprofCallgraphViewPrivate *priv = sysprof_callgraph_view_get_instance_private (self); + + g_return_if_fail (SYSPROF_IS_CALLGRAPH_VIEW (self)); + + gtk_stack_set_visible_child_name (priv->stack, "empty-state"); +} + static void sysprof_callgraph_view_unload (SysprofCallgraphView *self) { diff --git a/src/libsysprof-ui/sysprof-capture-view.c b/src/libsysprof-ui/sysprof-capture-view.c index 9fcce3e2..4fd67a68 100644 --- a/src/libsysprof-ui/sysprof-capture-view.c +++ b/src/libsysprof-ui/sysprof-capture-view.c @@ -292,15 +292,16 @@ sysprof_capture_view_generate_callgraph_cb (GObject *object, g_assert (G_IS_ASYNC_RESULT (result)); g_assert (G_IS_TASK (task)); + self = g_task_get_source_object (task); + priv = sysprof_capture_view_get_instance_private (self); + if (!sysprof_profile_generate_finish (SYSPROF_PROFILE (callgraph), result, &error)) { + _sysprof_callgraph_view_set_failed (priv->callgraph_view); g_task_return_error (task, g_steal_pointer (&error)); return; } - self = g_task_get_source_object (task); - priv = sysprof_capture_view_get_instance_private (self); - sysprof_callgraph_view_set_profile (priv->callgraph_view, callgraph); g_task_return_boolean (task, TRUE); @@ -513,8 +514,11 @@ sysprof_capture_view_scan_finish (SysprofCaptureView *self, g_assert (SYSPROF_IS_CAPTURE_VIEW (self)); g_assert (G_IS_TASK (result)); - if (!priv->features.has_samples && priv->features.has_marks) - gtk_stack_set_visible_child_name (priv->stack, "timings"); + if (!priv->features.has_samples) + gtk_widget_hide (GTK_WIDGET (priv->callgraph_view)); + + if (!priv->features.has_marks) + gtk_widget_hide (GTK_WIDGET (priv->marks_view)); g_clear_pointer (&priv->mark_stats, g_hash_table_unref); if ((stats = g_object_get_data (G_OBJECT (result), "MARK_STAT"))) diff --git a/src/libsysprof-ui/sysprof-ui-private.h b/src/libsysprof-ui/sysprof-ui-private.h index 31e6fc3b..26e2353b 100644 --- a/src/libsysprof-ui/sysprof-ui-private.h +++ b/src/libsysprof-ui/sysprof-ui-private.h @@ -20,6 +20,7 @@ #pragma once +#include "sysprof-callgraph-view.h" #include "sysprof-marks-view.h" #include "sysprof-visualizer-view.h" @@ -46,6 +47,7 @@ void _sysprof_rounded_rectangle (cairo_t gint x_radius, gint y_radius); gchar *_sysprof_format_duration (gint64 duration); +void _sysprof_callgraph_view_set_failed (SysprofCallgraphView *self); G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofMarkStat, _sysprof_mark_stat_free) diff --git a/src/libsysprof-ui/ui/sysprof-callgraph-view.ui b/src/libsysprof-ui/ui/sysprof-callgraph-view.ui index d32d4b63..f3164f7b 100644 --- a/src/libsysprof-ui/ui/sysprof-callgraph-view.ui +++ b/src/libsysprof-ui/ui/sysprof-callgraph-view.ui @@ -197,7 +197,7 @@ computer-fail-symbolic Not Enough Samples More samples are necessary to display a callgraph. - true + false empty-state diff --git a/src/libsysprof-ui/ui/sysprof-display.ui b/src/libsysprof-ui/ui/sysprof-display.ui index cbda121b..a9af096f 100644 --- a/src/libsysprof-ui/ui/sysprof-display.ui +++ b/src/libsysprof-ui/ui/sysprof-display.ui @@ -4,7 +4,6 @@ false - crossfade true