sadc didn't take into account properly a different number of CPU
When appending data to an existing file. This was because the number of
CPU recorded with the restart message was overwritten with that
originally saved in the file.
This patch fixes the problem.
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
* Since we are appending data to a file, set @nr_ini to the value of the file.
* Stats saved in file will all be 0 for that activity if no items exist on
* the machine.
+ * NB: We must preserve the value read for A_CPU when a LINUX RESTART is inserted.
*/
- act[p]->nr_ini = file_act[i].nr;
+ if (!ALWAYS_COUNT_ITEMS(act[p]->options) || !act[p]->nr_ini) {
+ act[p]->nr_ini = file_act[i].nr;
+ }
/*
* Force number of sub-items to that of the file, and reallocate structures.