[sysprof] libsysprof: avoid remote call if we can
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] libsysprof: avoid remote call if we can
- Date: Wed, 29 May 2019 22:22:21 +0000 (UTC)
commit 46782739582fbf5ac5f8508ec1c4ec9402557cef
Author: Christian Hergert <chergert redhat com>
Date: Fri May 10 20:01:38 2019 -0700
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 72d5d51..8958f6f 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]