]> granicus.if.org Git - sysstat/commitdiff
Make sadf -H display last CPU count in file
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 8 Feb 2014 14:35:00 +0000 (15:35 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 8 Feb 2014 14:35:00 +0000 (15:35 +0100)
sadf -H now displays the last CPU count recorded in the data file. This
is the value of the last_cpu_nr field saved in file's header, giving the
number of processors the machine had when the last sample of statistics
was appended to the file.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
sadf_misc.c

index c0446b356a059413926b621d8c971a44e3efc69f..9fb2a8ade9a92636e52c8923994c74dbfccb52f6 100644 (file)
@@ -633,6 +633,9 @@ __printf_funct_t print_hdr_header(int *tab, int action, char *dfile,
                                 file_hdr->sa_nodename, file_hdr->sa_machine,
                                 cpu_nr > 1 ? cpu_nr - 1 : 1);
                
+               printf(_("Number of CPU for last samples in file: %u\n"),
+                      file_hdr->last_cpu_nr > 1 ? file_hdr->last_cpu_nr - 1 : 1);
+               
                if ((loc_t = gmtime((const time_t *) &file_hdr->sa_ust_time)) != NULL) {
                        printf(_("File time: "));
                        strftime(cur_time, sizeof(cur_time), "%T", loc_t);