| 240 | } |
| 241 | |
| 242 | void SystemStateInfo::ReadProcDiskStatsLine( |
| 243 | const string& disk_stats, DiskValues* result) { |
| 244 | stringstream ss(disk_stats); |
| 245 | |
| 246 | // Read the device IDs and name |
| 247 | string major, minor, disk_name; |
| 248 | ss >> major >> minor >> disk_name; |
| 249 | |
| 250 | if (!DiskInfo::is_known_disk(disk_name)) { |
| 251 | memset(result, 0, sizeof(*result)); |
| 252 | return; |
| 253 | } |
| 254 | |
| 255 | ReadIntArray(StringPiece(disk_stats).substr(ss.tellg()), NUM_DISK_VALUES, result); |
| 256 | } |
| 257 | |
| 258 | void SystemStateInfo::AddDiskValues(const DiskValues& a, DiskValues* b) { |
| 259 | for (int i = 0; i < NUM_DISK_VALUES; ++i) (*b)[i] += a[i]; |
nothing calls this directly
no test coverage detected