]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
add comment describing how we'll do uptime
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 18 Dec 2014 04:39:08 +0000 (22:39 -0600)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 18 Dec 2014 04:39:08 +0000 (22:39 -0600)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
lxcfs.c

diff --git a/lxcfs.c b/lxcfs.c
index e47d382bef53ae0dd25c52f80176c42919cb7ff9..5a3f11c94f643c8c491a1d02e469949c5c2cd2dc 100644 (file)
--- a/lxcfs.c
+++ b/lxcfs.c
@@ -1256,6 +1256,22 @@ static int proc_stat_read(char *buf, size_t size, off_t offset,
        return total_len;
 }
 
+/*
+ * How to guess what to present for uptime?
+ * One thing we could do would be to take the date on the caller's
+ * memory.usage_in_bytes file, which should equal the time of creation
+ * of his cgroup.  However, a task could be in a sub-cgroup of the
+ * container.  The same problem exists if we try to look at the ages
+ * of processes in the caller's cgroup.
+ *
+ * So we'll fork a task that will enter the caller's pidns, mount a
+ * fresh procfs, get the age of /proc/1, and pass that back over a pipe.
+ *
+ * For the second uptime #, we'll do as Stéphane had done, just copy
+ * the number from /proc/uptime.  Not sure how to best emulate 'idle'
+ * time.  Maybe someone can come up with a good algorithm and submit a
+ * patch.  Maybe something based on cpushare info?
+ */
 static int proc_uptime_read(char *buf, size_t size, off_t offset,
                struct fuse_file_info *fi)
 {