[sysprof] helpers: add ability to read /proc/$pid/cgroup file



commit b5790be7ad8855026b8b644e81dce4388deaba8e
Author: Christian Hergert <chergert redhat com>
Date:   Wed Feb 24 17:57:03 2021 -0800

    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 828f88f..49167ae 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));
         }
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]