]> granicus.if.org Git - sysstat/commitdiff
Merge branch 'leitao-master'
authorSebastien GODARD <sysstat@users.noreply.github.com>
Mon, 31 Oct 2016 17:18:57 +0000 (18:18 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Mon, 31 Oct 2016 17:18:57 +0000 (18:18 +0100)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
1  2 
rd_stats.c

diff --cc rd_stats.c
index 1df4beffec026886e746d3170cbee4cdda7d74ea,704246e2b8629b75c9369d1d947d4b67bd80dba9..42188eb2637ce131e8d3217b553cbf141d62c49a
@@@ -1826,8 -1826,14 +1826,10 @@@ void read_cpuinfo(struct stats_pwr_cpuf
                        sscanf(strchr(line, ':') + 1, "%u", &proc_nb);
                }
  
-               else if (!strncmp(line, "cpu MHz\t", 8)) {
++              /* Entry in /proc/cpuinfo is different between Intel and Power architectures */
+               else if (!strncmp(line, "cpu MHz\t", 8) ||
+                        !strncmp(line, "clock\t", 6)) {
 -
 -                      if (strstr(line, "MHz"))
 -                              sscanf(strchr(line, ':') + 1, "%u.%uMHz", &ifreq, &dfreq);
 -                      else
 -                              sscanf(strchr(line, ':') + 1, "%u.%u", &ifreq, &dfreq);
 -
 +                      sscanf(strchr(line, ':') + 1, "%u.%u", &ifreq, &dfreq);
  
                        if (proc_nb < (nbr - 1)) {
                                /* Save current CPU frequency */