From b4fa5ed04f71310d3a3a98aa19c65893091e875d Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 10 May 2019 20:29:15 -0700 Subject: [PATCH] libsysprof: add helper to get process info array --- src/libsysprof/sysprof-helpers.c | 15 +++++++++++++++ src/libsysprof/sysprof-helpers.h | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/src/libsysprof/sysprof-helpers.c b/src/libsysprof/sysprof-helpers.c index 8958f6f7..e82c13f8 100644 --- a/src/libsysprof/sysprof-helpers.c +++ b/src/libsysprof/sysprof-helpers.c @@ -551,3 +551,18 @@ sysprof_helpers_authorize_finish (SysprofHelpers *self, return g_task_propagate_boolean (G_TASK (result), error); } + +gboolean +sysprof_helpers_get_process_info (SysprofHelpers *self, + const gchar *attributes, + GCancellable *cancellable, + GVariant **info, + GError **error) +{ + g_assert (SYSPROF_IS_HELPERS (self)); + g_assert (attributes != NULL); + g_assert (!cancellable || G_IS_CANCELLABLE (cancellable)); + g_assert (info != NULL); + + return ipc_service_call_get_process_info_sync (self->proxy, attributes, info, cancellable, error); +} diff --git a/src/libsysprof/sysprof-helpers.h b/src/libsysprof/sysprof-helpers.h index 988deb41..1469c2d2 100644 --- a/src/libsysprof/sysprof-helpers.h +++ b/src/libsysprof/sysprof-helpers.h @@ -68,6 +68,11 @@ gboolean sysprof_helpers_get_proc_file_finish (SysprofHelpers GAsyncResult *result, gchar **contents, GError **error); +gboolean sysprof_helpers_get_process_info (SysprofHelpers *self, + const gchar *attributes, + GCancellable *cancellable, + GVariant **info, + GError **error); #ifdef __linux__ gboolean sysprof_helpers_perf_event_open (SysprofHelpers *self, struct perf_event_attr *attr,