mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof: add is_empty() helper
This can be bound easier should we support GIR in the future.
This commit is contained in:
@ -177,9 +177,11 @@ sysprof_callgraph_view_load (SysprofCallgraphView *self,
|
|||||||
if (!g_set_object (&priv->profile, profile))
|
if (!g_set_object (&priv->profile, profile))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(stash = sysprof_callgraph_profile_get_stash (profile)))
|
if (sysprof_callgraph_profile_is_empty (profile))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
stash = sysprof_callgraph_profile_get_stash (profile);
|
||||||
|
|
||||||
for (n = stack_stash_get_root (stash); n; n = n->siblings)
|
for (n = stack_stash_get_root (stash); n; n = n->siblings)
|
||||||
state.profile_size += n->total;
|
state.profile_size += n->total;
|
||||||
|
|
||||||
|
|||||||
@ -511,6 +511,14 @@ sysprof_callgraph_profile_get_stash (SysprofCallgraphProfile *self)
|
|||||||
return self->stash;
|
return self->stash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
sysprof_callgraph_profile_is_empty (SysprofCallgraphProfile *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (SYSPROF_IS_CALLGRAPH_PROFILE (self), FALSE);
|
||||||
|
|
||||||
|
return self->stash == NULL;
|
||||||
|
}
|
||||||
|
|
||||||
GQuark
|
GQuark
|
||||||
sysprof_callgraph_profile_get_tag (SysprofCallgraphProfile *self,
|
sysprof_callgraph_profile_get_tag (SysprofCallgraphProfile *self,
|
||||||
const gchar *symbol)
|
const gchar *symbol)
|
||||||
|
|||||||
@ -41,6 +41,8 @@ SysprofProfile *sysprof_callgraph_profile_new (void);
|
|||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
SysprofProfile *sysprof_callgraph_profile_new_with_selection (SysprofSelection *selection);
|
SysprofProfile *sysprof_callgraph_profile_new_with_selection (SysprofSelection *selection);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
|
gboolean sysprof_callgraph_profile_is_empty (SysprofCallgraphProfile *self);
|
||||||
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
gpointer sysprof_callgraph_profile_get_stash (SysprofCallgraphProfile *self);
|
gpointer sysprof_callgraph_profile_get_stash (SysprofCallgraphProfile *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
GQuark sysprof_callgraph_profile_get_tag (SysprofCallgraphProfile *self,
|
GQuark sysprof_callgraph_profile_get_tag (SysprofCallgraphProfile *self,
|
||||||
|
|||||||
Reference in New Issue
Block a user