From 46782739582fbf5ac5f8508ec1c4ec9402557cef Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 10 May 2019 20:01:38 -0700 Subject: [PATCH] libsysprof: avoid remote call if we can --- src/libsysprof/sysprof-helpers.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libsysprof/sysprof-helpers.c b/src/libsysprof/sysprof-helpers.c index 72d5d515..8958f6f7 100644 --- a/src/libsysprof/sysprof-helpers.c +++ b/src/libsysprof/sysprof-helpers.c @@ -154,6 +154,13 @@ sysprof_helpers_list_processes (SysprofHelpers *self, g_return_val_if_fail (processes != NULL, FALSE); g_return_val_if_fail (n_processes != NULL, FALSE); + if (helpers_can_see_pids ()) + { + /* No need to query remote if we can see pids in this namespace */ + if (helpers_list_processes (processes, n_processes)) + return TRUE; + } + if (ipc_service_call_list_processes_sync (self->proxy, &fixed_ar, cancellable, NULL)) { const gint32 *data;