summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-07-10 20:09:34 -0400
committerMatthias Clasen <mclasen@redhat.com>2010-07-10 20:09:34 -0400
commitd2fe46b476a183168d57581c41b763b9e8f03c7c (patch)
tree79d372efee16292a084c5fdf6309d8e1f999a272
parent7568bb66f996bdf94da6963399333236f73adb1b (diff)
downloadglib-d2fe46b476a183168d57581c41b763b9e8f03c7c.tar.gz
Annotate all custom GIO GSource using g_source_set_name
Naming the sources allows easier debugging with e.g. SystemTap probes. https://bugzilla.gnome.org/show_bug.cgi?id=620536
-rw-r--r--gio/gsocket.c1
-rw-r--r--gio/gunixinputstream.c1
-rw-r--r--gio/gunixoutputstream.c1
-rw-r--r--gio/inotify/inotify-kernel.c1
-rw-r--r--glib/giounix.c1
-rw-r--r--glib/giowin32.c1
6 files changed, 6 insertions, 0 deletions
diff --git a/gio/gsocket.c b/gio/gsocket.c
index 298f5249e..e2ba788f1 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -2401,6 +2401,7 @@ socket_source_new (GSocket *socket,
condition |= G_IO_HUP | G_IO_ERR;
source = g_source_new (&socket_source_funcs, sizeof (GSocketSource));
+ g_source_set_name (source, "GSocket");
socket_source = (GSocketSource *)source;
socket_source->socket = g_object_ref (socket);
diff --git a/gio/gunixinputstream.c b/gio/gunixinputstream.c
index 2cd9aa48e..84422fb50 100644
--- a/gio/gunixinputstream.c
+++ b/gio/gunixinputstream.c
@@ -500,6 +500,7 @@ g_unix_input_stream_read_async (GInputStream *stream,
source = _g_fd_source_new (unix_stream->priv->fd,
G_IO_IN,
cancellable);
+ g_source_set_name (source, "GUnixInputStream");
g_source_set_callback (source, (GSourceFunc)read_async_cb, data, g_free);
g_source_attach (source, g_main_context_get_thread_default ());
diff --git a/gio/gunixoutputstream.c b/gio/gunixoutputstream.c
index 16315ca61..0a47dd66d 100644
--- a/gio/gunixoutputstream.c
+++ b/gio/gunixoutputstream.c
@@ -487,6 +487,7 @@ g_unix_output_stream_write_async (GOutputStream *stream,
source = _g_fd_source_new (unix_stream->priv->fd,
G_IO_OUT,
cancellable);
+ g_source_set_name (source, "GUnixOutputStream");
g_source_set_callback (source, (GSourceFunc)write_async_cb, data, g_free);
g_source_attach (source, g_main_context_get_thread_default ());
diff --git a/gio/inotify/inotify-kernel.c b/gio/inotify/inotify-kernel.c
index d6385f939..e0eccccab 100644
--- a/gio/inotify/inotify-kernel.c
+++ b/gio/inotify/inotify-kernel.c
@@ -208,6 +208,7 @@ gboolean _ik_startup (void (*cb)(ik_event_t *event))
g_io_channel_set_flags (inotify_read_ioc, G_IO_FLAG_NONBLOCK, NULL);
source = g_source_new (&ik_source_funcs, sizeof (GSource));
+ g_source_set_name (source, "GIO Inotify");
g_source_add_poll (source, &ik_poll_fd);
g_source_set_callback (source, ik_read_callback, NULL, NULL);
g_source_attach (source, NULL);
diff --git a/glib/giounix.c b/glib/giounix.c
index 7307a76fe..9d6364dae 100644
--- a/glib/giounix.c
+++ b/glib/giounix.c
@@ -343,6 +343,7 @@ g_io_unix_create_watch (GIOChannel *channel,
source = g_source_new (&g_io_watch_funcs, sizeof (GIOUnixWatch));
+ g_source_set_name (source, "GIOChannel (Unix)");
watch = (GIOUnixWatch *)source;
watch->channel = channel;
diff --git a/glib/giowin32.c b/glib/giowin32.c
index cabe2c94f..c632c59a5 100644
--- a/glib/giowin32.c
+++ b/glib/giowin32.c
@@ -1166,6 +1166,7 @@ g_io_win32_msg_create_watch (GIOChannel *channel,
GSource *source;
source = g_source_new (&g_io_watch_funcs, sizeof (GIOWin32Watch));
+ g_source_set_name (source, "GIOChannel (Win32)");
watch = (GIOWin32Watch *)source;
watch->channel = channel;