Commit 3d386d8b authored by Carla Guillen Carias's avatar Carla Guillen Carias
Browse files

Bug fix: aggregating into the right sensor when certain cpus are left out.

parent 0796f92d
......@@ -139,10 +139,18 @@ void MSRSensorGroup::read() {
reading_t aggregation;
aggregation.value = 0;
aggregation.timestamp = reading.timestamp;
unsigned int mincpu = _total_number_cpus;
for(unsigned int agg = cpu; agg < _total_number_cpus; agg+=_htAggregation){
aggregation.value += _sensorBins[agg].isActive() ? _sensorBins[agg].sensors[m]->getLatestValue().value : 0;
if(_sensorBins[agg].isActive()){
aggregation.value += _sensorBins[agg].sensors[m]->getLatestValue().value;
if(agg < mincpu){
mincpu = agg;
}
}
}
if(mincpu != _total_number_cpus){
_sensorBins[mincpu].sensors[m]->storeReadingGlobal(aggregation);//, 1, MSR_MAXIMUM_SIZE, _htAggregation);
}
_sensorBins[cpu].sensors[m]->storeReadingGlobal(aggregation);//, 1, MSR_MAXIMUM_SIZE, _htAggregation);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment