glib: Add SystemTap probe to g_source_add_child_source()

So that the relationships between parent and child GSources can be
probed using SystemTap.
This commit is contained in:
Philip Withnall 2016-09-23 22:46:30 -07:00
parent 1ff79690fb
commit 6014039cd1
3 changed files with 15 additions and 0 deletions

View File

@ -547,6 +547,18 @@ probe glib.source_set_priority = process("@ABS_GLIB_RUNTIME_LIBDIR@/libglib-2.0.
probestr = sprintf("glib.source_set_priority(%p, %p, %i)", source, context, priority);
}
/**
* probe glib.source_add_child_source - Called when a child #GSource is added to another
* @source: the parent #GSource
* @child_source: the child #GSource
*/
probe glib.source_add_child_source = process("@ABS_GLIB_RUNTIME_LIBDIR@/libglib-2.0.so.0.@LT_CURRENT@.@LT_REVISION@").mark("source__add_child_source")
{
source = $arg1;
child_source = $arg2;
probestr = sprintf("glib.source_add_child_source(%p, %p)", source, child_source);
}
/**
* probe glib.source_set_name - Called when the name is set for a #GSource
* @source: the #GSource

View File

@ -39,6 +39,7 @@ provider glib {
probe source__set_callback_indirect(void*, void*, void*, void*, void*);
probe source__set_ready_time(void*, unsigned int);
probe source__set_priority(void*, void*, unsigned int);
probe source__add_child_source(void*, void*);
probe source__set_name(void*, const char*);
probe source__before_free(void*, void*, void*);
probe thread__spawned(void*, void*, char*);

View File

@ -1461,6 +1461,8 @@ g_source_add_child_source (GSource *source,
if (context)
LOCK_CONTEXT (context);
TRACE (GLIB_SOURCE_ADD_CHILD_SOURCE (source, child_source));
source->priv->child_sources = g_slist_prepend (source->priv->child_sources,
g_source_ref (child_source));
child_source->priv->parent_source = source;