needs to be displayed
When "sadf -H" is used, there is no need to check that activities exist
in file. This is all the more true now as even CPU statistics (A_CPU
activity) don't necessarily exist in file.
E.g.:
sadc -S 0,36 datafile 1 2
Then "sadf -H datafile" should not display error message "Requested
activities not available in file".
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
act[i]->options &= ~AO_SELECTED;
}
}
- if (!get_activity_nr(act, AO_SELECTED, COUNT_ACTIVITIES)) {
+
+ /*
+ * None of selected activities exist in file: Abort.
+ * NB: Error is ignored if we only want to display
+ * datafile header (sadf -H).
+ */
+ if (!get_activity_nr(act, AO_SELECTED, COUNT_ACTIVITIES) && !ignore) {
fprintf(stderr, _("Requested activities not available in file %s\n"),
dfile);
close(*ifd);