summaryrefslogtreecommitdiff
path: root/src/gpm-manager.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-07-11 17:06:15 +0200
committerraveit65 <[email protected]>2016-07-25 16:13:41 +0200
commitff8f84fbab62f3c3fdc875a2b61a6d8a0654b2dc (patch)
treea7ea4da804c5143462cc6df8d9176d91b7737889 /src/gpm-manager.c
parent85afd16cee70390540d73e0b66999b0d859d299e (diff)
downloadmate-power-manager-ff8f84fbab62f3c3fdc875a2b61a6d8a0654b2dc.tar.bz2
mate-power-manager-ff8f84fbab62f3c3fdc875a2b61a6d8a0654b2dc.tar.xz
Assign names to our idle sources when using newer versions of glib2
This makes it possible to profile more accurately using systemtap taken from: https://git.gnome.org/browse/gnome-power-manager/commit/?id=fbb075b5
Diffstat (limited to 'src/gpm-manager.c')
-rw-r--r--src/gpm-manager.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index bfbfa3a..ce2b695 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -239,6 +239,8 @@ gpm_manager_play_loop_start (GpmManager *manager, GpmManagerSound action, gboole
(GSourceFunc) gpm_manager_play_loop_timeout_cb,
manager);
+ g_source_set_name_by_id (manager->priv->critical_alert_timeout_id, "[GpmManager] play-loop");
+
/* play the sound, using sounds from the naming spec */
context = ca_gtk_context_get_for_screen (gdk_screen_get_default ());
retval = ca_context_play (context, 0,
@@ -1560,6 +1562,7 @@ gpm_manager_engine_charge_action_cb (GpmEngine *engine, UpDevice *device, GpmMan
gchar *icon = NULL;
UpDeviceKind kind;
GpmActionPolicy policy;
+ guint timer_id;
/* get device properties */
g_object_get (device,
@@ -1608,7 +1611,8 @@ gpm_manager_engine_charge_action_cb (GpmEngine *engine, UpDevice *device, GpmMan
}
/* wait 20 seconds for user-panic */
- g_timeout_add_seconds (20, (GSourceFunc) manager_critical_action_do, manager);
+ timer_id = g_timeout_add_seconds (20, (GSourceFunc) manager_critical_action_do, manager);
+ g_source_set_name_by_id (timer_id, "[GpmManager] battery critical-action");
} else if (kind == UP_DEVICE_KIND_UPS) {
/* TRANSLATORS: UPS is really, really, low */
@@ -1636,7 +1640,8 @@ gpm_manager_engine_charge_action_cb (GpmEngine *engine, UpDevice *device, GpmMan
}
/* wait 20 seconds for user-panic */
- g_timeout_add_seconds (20, (GSourceFunc) manager_critical_action_do, manager);
+ timer_id = g_timeout_add_seconds (20, (GSourceFunc) manager_critical_action_do, manager);
+ g_source_set_name_by_id (timer_id, "[GpmManager] ups critical-action");
}
@@ -1708,8 +1713,10 @@ gpm_manager_reset_just_resumed_cb (gpointer user_data)
static void
gpm_manager_control_resume_cb (GpmControl *control, GpmControlAction action, GpmManager *manager)
{
+ guint timer_id;
manager->priv->just_resumed = TRUE;
- g_timeout_add_seconds (1, gpm_manager_reset_just_resumed_cb, manager);
+ timer_id = g_timeout_add_seconds (1, gpm_manager_reset_just_resumed_cb, manager);
+ g_source_set_name_by_id (timer_id, "[GpmManager] just-resumed");
}
/**