[sysprof] libsysprof: better empty check



commit 59d40f4146d2e434ce71c8bfb836104545cdf89d
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 15 17:08:01 2019 -0700

    libsysprof: better empty check

 src/libsysprof/sysprof-callgraph-profile.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/libsysprof/sysprof-callgraph-profile.c b/src/libsysprof/sysprof-callgraph-profile.c
index 7caa5b8..72a5596 100644
--- a/src/libsysprof/sysprof-callgraph-profile.c
+++ b/src/libsysprof/sysprof-callgraph-profile.c
@@ -514,14 +514,18 @@ sysprof_callgraph_profile_get_stash (SysprofCallgraphProfile *self)
 gboolean
 sysprof_callgraph_profile_is_empty (SysprofCallgraphProfile *self)
 {
+  StackNode *root;
+
   g_return_val_if_fail (SYSPROF_IS_CALLGRAPH_PROFILE (self), FALSE);
 
-  return self->stash == NULL;
+  return (self->stash == NULL ||
+          !(root = stack_stash_get_root (self->stash)) ||
+          !root->total);
 }
 
 GQuark
 sysprof_callgraph_profile_get_tag (SysprofCallgraphProfile *self,
-                              const gchar        *symbol)
+                                   const gchar        *symbol)
 {
   g_return_val_if_fail (SYSPROF_IS_CALLGRAPH_PROFILE (self), 0);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]