| 1951 | |
| 1952 | |
| 1953 | static Try<vector<Value>> readEntries( |
| 1954 | const string& hierarchy, |
| 1955 | const string& cgroup, |
| 1956 | const string& control) |
| 1957 | { |
| 1958 | Try<string> read = cgroups::read(hierarchy, cgroup, control); |
| 1959 | if (read.isError()) { |
| 1960 | return Error("Failed to read from '" + control + "': " + read.error()); |
| 1961 | } |
| 1962 | |
| 1963 | vector<Value> entries; |
| 1964 | |
| 1965 | foreach (const string& s, strings::tokenize(read.get(), "\n")) { |
| 1966 | Try<Value> value = Value::parse(s); |
| 1967 | if (value.isError()) { |
| 1968 | return Error("Failed to parse blkio value '" + s + "' from '" + |
| 1969 | control + "': " + value.error()); |
| 1970 | } |
| 1971 | |
| 1972 | entries.push_back(value.get()); |
| 1973 | } |
| 1974 | |
| 1975 | return entries; |
| 1976 | } |
| 1977 | |
| 1978 | |
| 1979 | namespace cfq { |
no test coverage detected