sar/sadf: Add extra flexibility in case of a change of file format
Add some extra code to sar and sadf so that they can read new
structures saved in daily binary data files. No changes in binary data
files are planned at the present time, but should a change happen in a
(hopefully) distant future, current sar and sadf commands will be able
to read this new format.
sar/sadc: Add stable identifier support for disks statistics
This patch adds new fields to stats_disk structure to save a stable
identifier for each block device (see issue #195).
A stable identifier is a name that should not change across reboots for
the same physical device.
At the present time this stable identifier is the WWN (World Wide Name)
id that is read from /dev/disk/by-id if it exists for the device.
If it doesn't exist then we fall back on using the pretty name (sda,
sda1, etc.).
The stable identifier is always collected by sadc when disks statistics
are collected (sadc option "-S DISK | XDISK").
It can be printed by sar (or sadf) with the option "-j SID" (SID stands
for Stable IDentifier).
Sebastien GODARD [Wed, 14 Aug 2019 16:35:09 +0000 (18:35 +0200)]
sysstat-12.1.6
sysstat version 12.1.6 final packaging.
lsm and spec files updated.
Changelog added.
In this version, the iostat command has been heavily modified for better
performance. In particular devices structures are now dynamically allocated
to make sure you won't miss a device if many of them are added to the
system while iostat is running. Also sysstat test environment now
includes a large set of non regression tests for iostat.
Sebastien GODARD [Tue, 13 Aug 2019 12:53:29 +0000 (14:53 +0200)]
Fix #230: Memory corruption bug due to Integer Overflow in remap_struct()
(See problem description in issue #230.)
Check that the number of fields (long long integers, long integers or
integers) as read from a system activity binary datafile multiplied by
its alignment width doesn't overflow, i.e. the result must not be
smaller than the number of fields.
iostat: Make sure that devices that have a slash in their name get
properly printed
Make sure that devices that have a slash in their name (e.g.
cciss/c0d0...) are displayed with their real name, not their name used
to save them in the linked list ('/' character is replaced with '!'
there).
iostat: Fix issue when a UUID is given on the command line
A command like "iostat -j UUID 2578463f-6947-48c7-8b09-876a4145cfb1 1 2"
didn't work because the UUID name was considered as the interval of time
to use. This patch fixes the problem.
This patch adds the following features:
* Structures for devices statistics are now dynamically allocated. It is
no longer possible to miss a device if many of them are added into the
system while iostat is running.
* Check for devices which are removed then inserted again into the
system. iostat will no longer display abormally high numbers in these
cases.
* Better handle devices entered on the command line, which may be
partitions and/or whole devices.
Sebastien GODARD [Fri, 28 Jun 2019 09:33:14 +0000 (11:33 +0200)]
simtest: sar: Add non regression tests for sensors statistics
Sensors statistics cannot be read in Travis CI environment because the
requested library is not available. But we can at least display sensors
statistics from a binary datafile already containing them.
Sebastien GODARD [Fri, 28 Jun 2019 07:23:51 +0000 (09:23 +0200)]
simtest: Try to simulate the addition of a new FB host
For this, we need to make sure that FB hosts will always be read in
the same order (and especially on Travis CI VM) though this may depend
on the underlying filesystem implementation.
Sebastien GODARD [Fri, 28 Jun 2019 06:54:36 +0000 (08:54 +0200)]
sar: Better handle the case when FB hosts are added to the system
If a new Fibre Channel host is registered in the system, now display its
statistics even for the interval during which it has been registered. In
this case, its initial counters values are considered as 0.
Sebastien GODARD [Fri, 28 Jun 2019 06:00:05 +0000 (08:00 +0200)]
simtest: Make it possible to use /dev/sdb in iostat test
/dev/sdb probably doesn't exist on Travis CI virtual machine, making
iostat non regression test using it fail.
Make sure we stay in our simulation environment by providing a
replacement function for realpath() system call.
Sebastien GODARD [Fri, 21 Jun 2019 15:48:44 +0000 (17:48 +0200)]
iostat: Fix wrong CPU stats displayed with option -y
CPU statistics written for the first sample was wrong when option -y was
used. This was because the interval of time used was that since system
startup whereas it should have been the interval of time since last
sample (which is not displayed with option -y).
In 789cd86fb0, read_net_icmp() obtained code to differentiate between
the old and new format of /proc/net/snmp, which differ by the addition
of "InCsumErrors" in the 3rd position. Add the exact same handling logic
to read_net_eicmp() as well
sar/sadf: Allow to select individual CPU/interrupts with option -A
Previously, using option -A with sar or sadf would display statistics
for all CPU and interrupts (i.e. using -A would also imply -P ALL -I
ALL).
Now this will be true only if the user didn't specify explicitly a list
of CPU or interrupts using options -P or -I.
Example: "sar -A -P1,4" will display all possible statistics but only those
concerning CPU 1 and 4 for CPU-related metrics.
Sebastien GODARD [Fri, 31 May 2019 07:00:08 +0000 (09:00 +0200)]
sysstat-12.1.5
sysstat version 12.1.5 final packaging.
lsm and spec files updated.
Changelog added.
This version completes the support for PCP (Performance Co-Pilote)
output format with sadf: All statistics collected by sar/sadc can now
be exported to a PCP archive file.
This version also includes now a simulation test environment. This makes
it possible to run non regression tests with reproducible results. The
tests are run in a simulated environment composed of kernel files with
predefined values.
For now, only non regression tests have been added for sar, sadc and
sadf commands. Yet they have permitted to identify several bugs which
have been fixed here and also backported to version 12.0.5.
Sebastien GODARD [Fri, 10 May 2019 16:23:00 +0000 (18:23 +0200)]
sadf: Fix PCP and SVG output for filesystem statistics
When the mount point had to be displayed instead of the filesystem name
with sar's option -F (i.e. the user entered "-F MOUNT" instead of just
"-F"), no data were found by sadf -g (SVG output) and sadf -l (PCP
output). This patch fixes the problem.
Sebastien GODARD [Fri, 10 May 2019 06:09:02 +0000 (08:09 +0200)]
iostat: Fix iostat regression for groups of devices
Device groups specified with iostat's option -g were no longer
displayed in the device report because of a regression introduced by
commit ccda26c. Fix that.
sadf: Time used by options -s/-e no longer depends on the timezone value
The time specified with options -s and -e used by sadf has no longer to
be expressed in local time. This time is now consistent with that
displayed by sadf, e.g.: If sadf displays its timestamps in local time
then the time specified with options -s/-e is considered as expressed in
local time. If sadf displays its timestamps in UTC then the time used
with options -s/-e is also considered as expressed in UTC.
sar: Use nanoseconds to distinguish between saDD and saYYYYMMDD
When no input datafile is specified, sar uses the most recent file
between saDD and saYYYYMMDD. The comparison had a precision of a second,
which is quite enough for normal use. Yet I needed more precision for
use in simulation tests. So use now a precision of the nanosecond.
The statistics will depend on the host where the tests are run. So
don't collect them.
They also should not appear in datafile header displayed by sadf -H.
Don't add another Fibre Channel host when running sysstat simulation
tests. The output displayed by sar and sadf will depend on the order in
which filenames are read, which is dependent on the underlying
filesystem implementation, thus making tests non reproducible.
This patch adds all the necessary files to be able to run non regression
tests with reproducible results. The tests run in a simulated
environment composed of kernel files with predefined values.