From b5790be7ad8855026b8b644e81dce4388deaba8e Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 24 Feb 2021 17:57:03 -0800 Subject: [PATCH] helpers: add ability to read /proc/$pid/cgroup file --- src/helpers.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/helpers.c b/src/helpers.c index 828f88f4..49167aef 100644 --- a/src/helpers.c +++ b/src/helpers.c @@ -506,6 +506,7 @@ helpers_get_process_info (const gchar *attributes) gboolean want_comm; gboolean want_maps; gboolean want_mountinfo; + gboolean want_cgroup; if (attributes == NULL) attributes = ""; @@ -515,6 +516,7 @@ helpers_get_process_info (const gchar *attributes) want_maps = !!strstr (attributes, "maps"); want_mountinfo = !!strstr (attributes, "mountinfo"); want_comm = !!strstr (attributes, "comm"); + want_cgroup = !!strstr (attributes, "cgroup"); g_variant_builder_init (&builder, G_VARIANT_TYPE ("aa{sv}")); @@ -543,6 +545,9 @@ helpers_get_process_info (const gchar *attributes) if (want_mountinfo) add_pid_proc_file_to (pid, "mountinfo", &dict, postprocess_rstrip); + if (want_cgroup) + add_pid_proc_file_to (pid, "cgroup", &dict, postprocess_rstrip); + g_variant_builder_add_value (&builder, g_variant_dict_end (&dict)); } }