3826: Add TODO comment on FindStat.
authorTom Clegg <tom@curoverse.com>
Tue, 14 Oct 2014 19:00:28 +0000 (15:00 -0400)
committerTom Clegg <tom@curoverse.com>
Tue, 14 Oct 2014 19:00:28 +0000 (15:00 -0400)
services/crunchstat/crunchstat.go

index 9590bbbf5c42a6e0fa8b4b6032a1ae9715d5daa7..0b3920c0d8b5e5903d2d1d9ec70fa619b5fe070c 100644 (file)
@@ -67,6 +67,13 @@ func OpenAndReadAll(filename string, log_chan chan<- string) ([]byte, error) {
 var reportedStatFile map[string]bool
 var reportedNoStatFile map[string]bool
 
 var reportedStatFile map[string]bool
 var reportedNoStatFile map[string]bool
 
+// Find the cgroup stats file in /sys/fs corresponding to the target
+// cgroup.
+//
+// TODO: Instead of trying all options, choose a process in the
+// container, and read /proc/PID/cgroup to determine the appropriate
+// cgroup root for the given statgroup. (This will avoid falling back
+// to host-level stats during container setup and teardown.)
 func FindStat(stderr chan<- string, cgroup Cgroup, statgroup string, stat string) string {
        if reportedStatFile == nil {
                reportedStatFile = make(map[string]bool)
 func FindStat(stderr chan<- string, cgroup Cgroup, statgroup string, stat string) string {
        if reportedStatFile == nil {
                reportedStatFile = make(map[string]bool)