MCPcopy Create free account
hub / github.com/apache/mesos / hierarchies

Function hierarchies

src/linux/cgroups.cpp:446–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444
445
446Try<set<string>> hierarchies()
447{
448 // Read currently mounted file systems from /proc/mounts.
449 Try<fs::MountTable> table = fs::MountTable::read("/proc/mounts");
450 if (table.isError()) {
451 return Error(table.error());
452 }
453
454 set<string> results;
455 foreach (const fs::MountTable::Entry& entry, table->entries) {
456 if (entry.type == "cgroup") {
457 Result<string> realpath = os::realpath(entry.dir);
458 if (!realpath.isSome()) {
459 return Error(
460 "Failed to determine canonical path of " + entry.dir + ": " +
461 (realpath.isError()
462 ? realpath.error()
463 : "No such file or directory"));
464 }
465 results.insert(realpath.get());
466 }
467 }
468
469 return results;
470}
471
472
473Result<string> hierarchy(const string& subsystems)

Callers 6

SetUpTestCaseMethod · 0.85
TearDownTestCaseMethod · 0.85
CgroupsFilterMethod · 0.85
SetUpTestCaseMethod · 0.85
hierarchyFunction · 0.85
mountedFunction · 0.85

Calls 4

readFunction · 0.70
errorMethod · 0.65
ErrorFunction · 0.50
isErrorMethod · 0.45

Tested by 4

SetUpTestCaseMethod · 0.68
TearDownTestCaseMethod · 0.68
CgroupsFilterMethod · 0.68
SetUpTestCaseMethod · 0.68