[sysprof/wip/chergert/sysprof-3] hostinfo: get proc fd from daemon



commit 418770d9dac72e3b22a28563c37f513bd4e5be20
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 24 00:51:55 2019 -0700

    hostinfo: get proc fd from daemon
    
    Current CPU speed is censored in various containers, so we need access to
    it from the daemon.

 src/libsysprof/sysprof-hostinfo-source.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/libsysprof/sysprof-hostinfo-source.c b/src/libsysprof/sysprof-hostinfo-source.c
index 1a0a599..2b39a05 100644
--- a/src/libsysprof/sysprof-hostinfo-source.c
+++ b/src/libsysprof/sysprof-hostinfo-source.c
@@ -29,6 +29,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include "sysprof-helpers.h"
 #include "sysprof-hostinfo-source.h"
 
 #define PROC_STAT_BUF_SIZE 4096
@@ -426,7 +427,9 @@ sysprof_hostinfo_source_prepare (SysprofSource *source)
           freq.max = g_ascii_strtoll (maxstr, NULL, 10);
         }
 
-      freq.stat_fd = g_open (cur_path, O_RDONLY);
+      freq.stat_fd = -1;
+      sysprof_helpers_get_proc_fd (sysprof_helpers_get_default (),
+                                   cur_path, NULL, &freq.stat_fd, NULL);
       g_array_append_val (self->freqs, freq);
 
       ctr->id = info.counter_base + 1;


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