mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 08:00:53 +00:00
libsysprof: improve some defaults
This commit is contained in:
@ -336,7 +336,7 @@ sysprof_proxy_source_get_bus_cb (GObject *object,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->bus_name != NULL)
|
if (self->bus_name != NULL && self->bus_name[0])
|
||||||
{
|
{
|
||||||
sysprof_proxy_source_monitor (self, bus, self->bus_name);
|
sysprof_proxy_source_monitor (self, bus, self->bus_name);
|
||||||
return;
|
return;
|
||||||
@ -375,6 +375,12 @@ sysprof_proxy_source_start (SysprofSource *source)
|
|||||||
|
|
||||||
self->has_started = TRUE;
|
self->has_started = TRUE;
|
||||||
|
|
||||||
|
/* If we're doing subprocess monitoring, we don't need to do
|
||||||
|
* anything special here to connect to a bus.
|
||||||
|
*/
|
||||||
|
if (self->monitors->len > 0)
|
||||||
|
return;
|
||||||
|
|
||||||
g_bus_get (self->bus_type,
|
g_bus_get (self->bus_type,
|
||||||
self->cancellable,
|
self->cancellable,
|
||||||
sysprof_proxy_source_get_bus_cb,
|
sysprof_proxy_source_get_bus_cb,
|
||||||
@ -408,8 +414,6 @@ sysprof_proxy_source_complete_monitor (SysprofProxySource *self,
|
|||||||
g_assert (monitor != NULL);
|
g_assert (monitor != NULL);
|
||||||
g_assert (monitor->self == self);
|
g_assert (monitor->self == self);
|
||||||
|
|
||||||
g_print ("completing with FD: %d\n", monitor->fd);
|
|
||||||
|
|
||||||
if (!(reader = sysprof_capture_reader_new_from_fd (steal_fd (&monitor->fd), &error)))
|
if (!(reader = sysprof_capture_reader_new_from_fd (steal_fd (&monitor->fd), &error)))
|
||||||
g_warning ("Failed to load reader from peer FD: %s", error->message);
|
g_warning ("Failed to load reader from peer FD: %s", error->message);
|
||||||
else
|
else
|
||||||
@ -577,6 +581,7 @@ sysprof_proxy_source_init (SysprofProxySource *self)
|
|||||||
self->pids = g_array_new (FALSE, FALSE, sizeof (GPid));
|
self->pids = g_array_new (FALSE, FALSE, sizeof (GPid));
|
||||||
self->monitors = g_ptr_array_new_with_free_func ((GDestroyNotify) monitor_free);
|
self->monitors = g_ptr_array_new_with_free_func ((GDestroyNotify) monitor_free);
|
||||||
self->is_whole_system = TRUE;
|
self->is_whole_system = TRUE;
|
||||||
|
self->bus_type = G_BUS_TYPE_SESSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
SysprofSource *
|
SysprofSource *
|
||||||
@ -593,6 +598,9 @@ sysprof_proxy_source_new (GBusType bus_type,
|
|||||||
if (bus_name && !*bus_name)
|
if (bus_name && !*bus_name)
|
||||||
bus_name = NULL;
|
bus_name = NULL;
|
||||||
|
|
||||||
|
if (object_path && !*object_path)
|
||||||
|
object_path = NULL;
|
||||||
|
|
||||||
self = g_object_new (SYSPROF_TYPE_PROXY_SOURCE, NULL);
|
self = g_object_new (SYSPROF_TYPE_PROXY_SOURCE, NULL);
|
||||||
self->bus_type = bus_type;
|
self->bus_type = bus_type;
|
||||||
self->bus_name = g_strdup (bus_name);
|
self->bus_name = g_strdup (bus_name);
|
||||||
|
|||||||
Reference in New Issue
Block a user