]> granicus.if.org Git - sysstat/commit
sar: Softnet stats: Improve support for offline/online CPUs
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 24 Mar 2018 09:33:20 +0000 (10:33 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 24 Mar 2018 09:33:20 +0000 (10:33 +0100)
commit2f2276bc6a2f7dd0abcc62731e830a5c1210aff4
treee07a69d485e27ab9782abeba30ad7df89953c5ca
parenta002ea5b259343dbf67bedcc6fc3094c25156903
sar: Softnet stats: Improve support for offline/online CPUs

When a CPU goes offline, the corresponding line in the
/proc/net/softnet_stat file disappears. The problem is that there is no
immediate solution to know which line goes with which CPU.
To fix this, we now use the /proc/stat file to know which CPU are online
and which ones are not.
Moreover, when a CPU comes back online, its counters get their original
values, which makes sar think they have just jumped from 0:

This is what sar displayed before (in this example, CPU 5 goes offline):

10:19:39        CPU   total/s   dropd/s squeezd/s  rx_rps/s flw_lim/s
10:19:41        all      4.00      0.00      0.00      0.00      0.00
10:19:41          0      4.00      0.00      0.00      0.00      0.00
10:19:41          1      0.00      0.00      0.00      0.00      0.00
10:19:41          2      0.00      0.00      0.00      0.00      0.00
10:19:41          3      0.00      0.00      0.00      0.00      0.00
10:19:41          4      0.00      0.00      0.00      0.00      0.00
10:19:41          5      3.00      0.00      0.00      0.00      0.00
10:19:41          6 2147483647.50      0.00      0.00      0.00
0.00

There is a shift in the display resulting in wrong values displayed for
CPU 5 and 6. CPU 7 disappears from the list.

This commit fixes those problems.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
activity.c
pr_stats.c
rd_stats.c
rd_stats.h
sa.h
sa_common.c
sa_wrap.c