]> granicus.if.org Git - sysstat/log
sysstat
6 years agosysstat-11.7.3 v11.7.3
Sebastien GODARD [Fri, 6 Apr 2018 12:30:23 +0000 (14:30 +0200)]
sysstat-11.7.3

sysstat version 11.7.3 final packaging.
lsm and spec files updated.
Changelog added.

This version has improved support for offline/online CPU (sar/sadf and
mpstat). It also adds a new option to sar (option "-z") to omit output
for any devices for which there was no activity during the sample
period (this option already existed for iostat).
Last it contains several important bug fixes, among them:

o  A possible crash related to the new binary format used by sar,
which could happen when buffers needed to be reallocated to accomodate
more devices added to the system,

o  The %CPU value displayed by pidstat for processes using more than
100% of a core.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate NLS translations
Sebastien GODARD [Fri, 6 Apr 2018 12:03:10 +0000 (14:03 +0200)]
Update NLS translations

Sync with The Translation Project.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoAdd extra check on CPU value read from the kernel
Sebastien GODARD [Wed, 4 Apr 2018 14:12:11 +0000 (16:12 +0200)]
Add extra check on CPU value read from the kernel

Make sure that CPU number read from /proc/stat in not negative (this
should never happen).

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadc: Fix use of uninitialized variable
Sebastien GODARD [Sun, 1 Apr 2018 06:25:28 +0000 (08:25 +0200)]
sadc: Fix use of uninitialized variable

Coverity CID#267242.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadf: Check for possible division by zero
Sebastien GODARD [Sun, 1 Apr 2018 06:24:16 +0000 (08:24 +0200)]
sar/sadf: Check for possible division by zero

Reassure Coverity by making sure that the total number of jiffies spent
by all processors is not zero.
This would be possible only if all processors were tickless.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agompstat: Check for possible division by zero
Sebastien GODARD [Sun, 1 Apr 2018 06:18:56 +0000 (08:18 +0200)]
mpstat: Check for possible division by zero

Reassure Coverity by making sure that the total number of jiffies spent
by all processors/nodes is not zero.
This would be possible only if all processors were tickless.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agopidstat: Report CPU usage for a process as the sum of all threads
Sebastien GODARD [Sat, 31 Mar 2018 08:15:04 +0000 (10:15 +0200)]
pidstat: Report CPU usage for a process as the sum of all threads

Commit 52977c4 introduced a new macro (SP_VALUE_100()) to limit CPU
usage value displayed by pidstat to 100%. This was intended to be a
workaround for some corner cases where inaccurate statistics could be
provided by the kernel.
Yet this macro also limits the value to 100% even when a process uses
more than 100% of a core, e.g. when it starts several threads loading
the system. This patch reverts commit 52977c4 and reports CPU usage
for a process as the sum of CPU usage for all its threads.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Softnet stats: Apply improved support for offline/online CPUs
Sebastien GODARD [Sun, 25 Mar 2018 07:55:13 +0000 (09:55 +0200)]
sadf: Softnet stats: Apply improved support for offline/online CPUs

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Softnet stats: Improve support for offline/online CPUs
Sebastien GODARD [Sat, 24 Mar 2018 09:33:20 +0000 (10:33 +0100)]
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>
6 years agompstat: Update manual page
Sebastien GODARD [Fri, 23 Mar 2018 11:28:00 +0000 (12:28 +0100)]
mpstat: Update manual page

Remove option "-P ON" from manual page.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agompstat: Remove option "-P ON"
Sebastien GODARD [Fri, 23 Mar 2018 11:25:44 +0000 (12:25 +0100)]
mpstat: Remove option "-P ON"

mpstat now doesn't display offline CPUs. So option "-P ON" used to
tell mpstat to display only online CPUs is no longer needed.
This is the same behavior as sar.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agompstat: Compute stats for node "all" as the sum of individual CPU
Sebastien GODARD [Fri, 23 Mar 2018 11:14:49 +0000 (12:14 +0100)]
mpstat: Compute stats for node "all" as the sum of individual CPU

Don't use global CPU stats from /proc/stat file for node "all".
Compute stats for node "all" as the sum of individual ones.
Also better handle CPUs that go offline or back online.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agompstat: Compute global CPU stats as the sum of individual ones
Sebastien GODARD [Thu, 22 Mar 2018 12:53:21 +0000 (13:53 +0100)]
mpstat: Compute global CPU stats as the sum of individual ones

Don't use global CPU statistics from the /proc/stat file any more.
Now compute them as the sum of each individual CPU.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf (SVG format): Apply new method for global CPU stats
Sebastien GODARD [Sun, 18 Mar 2018 10:42:11 +0000 (11:42 +0100)]
sadf (SVG format): Apply new method for global CPU stats

Compute global CPU stats used by sadf -g to generate graphs
as the sum of individual CPU statistics, just as this is done
for sar.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf (XML and JSON formats): Apply new method for global CPU stats
Sebastien GODARD [Sun, 18 Mar 2018 08:48:10 +0000 (09:48 +0100)]
sadf (XML and JSON formats): Apply new method for global CPU stats

Compute global CPU stats displayed by sadf -j/-x as the sum of
individual CPU statistics, just as this is done for sar.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf (ppc and db formats): Apply new method for global CPU stats
Sebastien GODARD [Sat, 17 Mar 2018 09:15:16 +0000 (10:15 +0100)]
sadf (ppc and db formats): Apply new method for global CPU stats

Compute global CPU stats displayed by sadf -d/-p as the sum of
individual CPU statistics, just as this is done for sar.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Move code used to compute global CPU stats to separate function
Sebastien GODARD [Sat, 17 Mar 2018 09:12:42 +0000 (10:12 +0100)]
sar: Move code used to compute global CPU stats to separate function

This function will be used by sadf for other formats.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate sysstat.ioconf devices list
Sebastien GODARD [Sat, 17 Mar 2018 07:49:43 +0000 (08:49 +0100)]
Update sysstat.ioconf devices list

Add new devices with major numbers greater than 255 to sysstat.ioconf
list.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoAdd support for major numbers > 255
Sebastien GODARD [Sat, 17 Mar 2018 07:46:01 +0000 (08:46 +0100)]
Add support for major numbers > 255

Add support for device major numbers up to 511.
Minor numbers are still limited to 255.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoRAW: Change output to a CSV-like format
Sebastien GODARD [Fri, 16 Mar 2018 11:38:14 +0000 (12:38 +0100)]
RAW: Change output to a CSV-like format

Raw output displayed by "sadf -r" was difficult to process automatically
by an external program. So display it now in a CSV-like format.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Compute global CPU stats as the sum of individual ones
Sebastien GODARD [Fri, 16 Mar 2018 09:58:37 +0000 (10:58 +0100)]
sar: Compute global CPU stats as the sum of individual ones

sar used to get statistics for CPU "all" from the first line of the
/proc/stat file giving global CPU utilization.

There are several problems with this:

1) With recent kernels (problem detected on a 4.4.14 kernel), the number
of jiffies spent in idle and iowait modes given by this file for global
CPU utilization goes crazy when a CPU is set offline or comes back
online. These counters may even not be monotonic, resulting in wrong
results being displayed by sar.
E.g.:

cat /proc/stat |grep "cpu "
cpu  8123 235 3359 1099139 15985 0 14 0 0 0

(Set a CPU offline)

cat /proc/stat |grep "cpu "
cpu  8146 235 3374 1168377 18919 0 14 0 0 0

(Set the CPU back online)

cat /proc/stat |grep "cpu "
cpu  8169 236 3391 1033989 15978 0 14 0 0 0

2) The updating of the /proc/stat global and individual values is not
done atomically. As a result there can be skew between the global and
individual values reported by sar.
E.g.:

01:46:12   CPU   %user   %nice  %system  %iowait  %steal  %idle
01:46:13   all    0.25    0.00    10.89     0.00    0.00  88.86
01:46:13     0    0.00    0.00    84.80     0.00    0.00  15.20
01:46:13     1    0.00    0.00    89.65     0.00    0.00  10.35
01:46:13     2    0.17    0.00    83.33     0.00    0.00  16.50
01:46:13     3    0.00    0.00    83.64     0.00    0.00  16.36

In the above case, the %system and %idle for "all" is wrongly
reported as 10.89%.

This patch fixes those problems by calculating the statistics for CPU
"all" (global CPU utilization) as the sum of each individual CPU.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoChange condition used in workaround for CPU coming back online
Sebastien GODARD [Sat, 10 Mar 2018 14:08:49 +0000 (15:08 +0100)]
Change condition used in workaround for CPU coming back online

Compare counter's value to ULLONG_MAX - 0x7ffff (and not ULLONG_MAX &
0x80000) to guess if it has overflown.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Better assess size of buffers that need to be reallocated
Sebastien GODARD [Sun, 4 Mar 2018 09:53:55 +0000 (10:53 +0100)]
sar: Better assess size of buffers that need to be reallocated

When a buffer needs to be reallocated, doubling its size may not be
enough to contain all the additional items.
Assess the needed size based on a value giving the minimum number of
items the buffer should be able to contain.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoRAW: Reorder values displayed in debug mode by sadf
Sebastien GODARD [Sun, 4 Mar 2018 09:22:22 +0000 (10:22 +0100)]
RAW: Reorder values displayed in debug mode by sadf

This is now:
nr of slots used/nr of slots allocated (intial number of slots)

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Test for zero value when reallocating all the buffers
Sebastien GODARD [Sun, 4 Mar 2018 09:02:52 +0000 (10:02 +0100)]
sar: Test for zero value when reallocating all the buffers

When sar reads the contents of a file and meets a LINUX RESTART, it
may have to reallocate the buffers used to save CPU statistics to match
the new number of CPU. If the number of CPU has increased it doubles the
size of its buffers.
There is a problem though if CPU activity was not included in file (or
if its format was unknown to current sysstat version). In this case the
buffer size was zero. So test this before reallocating buffers.

Below is a sample output before the patch was applied.
The file contains only A_PCSW activity then a LINUX RESTART message
(which cannot be displayed):

$ sar -f data0 -w

Linux 4.4.14-200.fc22.x86_64 (test.home)  03/04/18  _x86_64_
(8 CPU)

09:31:50       proc/s   cswch/s
09:31:51         0.00    402.00
09:31:52         0.00    356.00
Average:         0.00    379.00
srealloc <------------------------- Error!

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Allow options -h and -z to be coalesced
Sebastien GODARD [Sat, 3 Mar 2018 09:51:08 +0000 (10:51 +0100)]
sar: Allow options -h and -z to be coalesced

With this patch it is now possible to enter, e.g. "sar -dhz" instead of
"sar -d -h -z".

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadc: Use common code to display error messages
Sebastien GODARD [Mon, 19 Feb 2018 16:22:55 +0000 (17:22 +0100)]
sadc: Use common code to display error messages

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate sar manual page
Sebastien GODARD [Sun, 18 Feb 2018 15:26:30 +0000 (16:26 +0100)]
Update sar manual page

Reference new option (-z) in sar manual page.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Add new -z option
Sebastien GODARD [Sun, 18 Feb 2018 15:18:58 +0000 (16:18 +0100)]
sar: Add new -z option

Add new option to sar (-z). This option tells sar to omit output for any
devices for which there was no activity during the sample period.
This option applies for network interfaces, interrupts, block devices,
serial lines, filesystems, CPU (in softnet statistics).
Note: This option already existed for iostat.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoRename option used by sar to call sadc
Sebastien GODARD [Sun, 18 Feb 2018 13:39:55 +0000 (14:39 +0100)]
Rename option used by sar to call sadc

sar now calls sadc with option -Z instead of -z.
This option is used to tell sadc that it has been called by sar.
Option -z will be reused later.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadc: Compile out unneeded functions
Sebastien GODARD [Sat, 17 Feb 2018 17:54:27 +0000 (18:54 +0100)]
sadc: Compile out unneeded functions

Reduce size for sadc binary (30% smaller) by compiling out unneeded
functions.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoStarting sysstat 11.7.3
Sebastien GODARD [Mon, 12 Feb 2018 15:05:15 +0000 (16:05 +0100)]
Starting sysstat 11.7.3

Update sysstat version number in configure script.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosysstat-11.7.2 v11.7.2
Sebastien GODARD [Mon, 12 Feb 2018 14:54:01 +0000 (15:54 +0100)]
sysstat-11.7.2

sysstat version 11.7.2 final packaging.
lsm and spec files updated.
Changelog added.
Year updated in (C) message.

After one additional month of hard work, sysstat version 11.7.2 seems to
be quite stable on my machine. It should now be possible to use it
safely on production systems.
BTW I told you that sar's data files new binary format would be at least
25% smaller than with previous versions. I could have even said 30% to
45% smaller!
Version 11.7.2 also includes a rewritten function that will enable you
to convert your old data files (from versions 9.1.6 and later) to the
up-to-date format (11.7.2).

Please upload, test and tell me if anything goes wrong.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate NLS translations
Sebastien GODARD [Mon, 12 Feb 2018 14:34:57 +0000 (15:34 +0100)]
Update NLS translations

Sync with The Translation Project.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoIncrease NR_IRQS value (max number of interrupts)
Sebastien GODARD [Sun, 11 Feb 2018 17:23:56 +0000 (18:23 +0100)]
Increase NR_IRQS value (max number of interrupts)

The old value of 1024 appears to be too low for some systems.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadc: Add debug info in code
Sebastien GODARD [Sun, 11 Feb 2018 17:16:28 +0000 (18:16 +0100)]
sar/sadc: Add debug info in code

Info will be displayed in DEBUG mode, e.g.
./configure CFLAGS="-D DEBUG" && make

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoTravis CI: Make tests in DEBUG mode
Sebastien GODARD [Sun, 11 Feb 2018 17:14:16 +0000 (18:14 +0100)]
Travis CI: Make tests in DEBUG mode

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadf: Add checks on file's header size read from file
Sebastien GODARD [Sun, 11 Feb 2018 10:43:20 +0000 (11:43 +0100)]
sar/sadf: Add checks on file's header size read from file

sa_open_read_magic() reads file's magic structure and in particular the
size of the header structure to come.
header_size field in file_magic structure exists only with versions
10.3.1 and later. So checking bounds for header_size is done only for
those versions, based on the values of sysstat_version and
sysstat_patchlevel.
With a corrupted datafile (i.e. a file having the right FORMAT_MAGIC
value but values corresponding to older sysstat versions in
sysstat_version and sysstat_patchlevel), the test is not done.
So do it again in check_file_actlst() function.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoChange handle_invalid_sa_file() prototype
Sebastien GODARD [Sun, 11 Feb 2018 10:26:08 +0000 (11:26 +0100)]
Change handle_invalid_sa_file() prototype

No need to pass a pointer on file descriptor here.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadf: Add checks on number of items read from file
Sebastien GODARD [Sun, 11 Feb 2018 10:21:19 +0000 (11:21 +0100)]
sar/sadf: Add checks on number of items read from file

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadf: Use size_t type for size variable in read() syscall
Sebastien GODARD [Sun, 11 Feb 2018 09:37:59 +0000 (10:37 +0100)]
sar/sadf: Use size_t type for size variable in read() syscall

Use size_t type expected by read() system call to make sure size
variable cannot be negative or overflow integer capacity.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Add lower bound check before reading data
Sebastien GODARD [Sun, 11 Feb 2018 09:31:18 +0000 (10:31 +0100)]
sar: Add lower bound check before reading data

Check lower bound of value read from sadc before using it to read
statistics structures.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agord_stats.c: Fix possible out-of-bounds read
Sebastien GODARD [Sun, 11 Feb 2018 08:21:20 +0000 (09:21 +0100)]
rd_stats.c: Fix possible out-of-bounds read

Function read_stat_irq() might have overrun line[] array at byte offset
8192 by dereferencing pointer line + pos + 1.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosa_conv.c: Fix A_NET_DEV conversion
Sebastien GODARD [Sun, 11 Feb 2018 08:08:01 +0000 (09:08 +0100)]
sa_conv.c: Fix A_NET_DEV conversion

This part of code was logically dead code... Fix it.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoSVG: A_PWR_CPU activity: Fix for offline CPU
Sebastien GODARD [Wed, 7 Feb 2018 15:40:27 +0000 (16:40 +0100)]
SVG: A_PWR_CPU activity: Fix for offline CPU

Offline CPU should be ignored only when graphs are drawn and if they
have been offline on the whole period.
When graphs are created, offline CPU are useful: Their frequency value
(0) is used to make the graph go through 0.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate sar manual page
Sebastien GODARD [Wed, 7 Feb 2018 14:40:25 +0000 (15:40 +0100)]
Update sar manual page

Indicate that offline processors are no longer displayed by sar.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoSVG: A_PWR_CPU activity: Don't display offline CPU
Sebastien GODARD [Wed, 7 Feb 2018 14:24:22 +0000 (15:24 +0100)]
SVG: A_PWR_CPU activity: Don't display offline CPU

Offline CPU are no longer displayed.
This should also apply to CPU frequency statistics and its graphs.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoSVG: Don't create graph for offline CPU
Sebastien GODARD [Wed, 7 Feb 2018 14:08:41 +0000 (15:08 +0100)]
SVG: Don't create graph for offline CPU

Don't display a graph for CPUs which have been offline on the whole
period.
A CPU whose state alternates between offline and online still gets a
graph.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoSVG: Display grid on the whole width of the graph
Sebastien GODARD [Wed, 7 Feb 2018 13:29:05 +0000 (14:29 +0100)]
SVG: Display grid on the whole width of the graph

For very small files with just a few samples taken at a few seconds apart
(e.g. 15 samples taken at 1 second interval) the background grid was not
drawn on the whole width of the graph.
Fix this.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoSVG: Set minimum canvas height to 100
Sebastien GODARD [Wed, 7 Feb 2018 10:40:47 +0000 (11:40 +0100)]
SVG: Set minimum canvas height to 100

This is necessary so that at least the header title and possibly the "No
data" message are displayed.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoSVG: Make sure that "No data" is displayed when no graphs are created
Sebastien GODARD [Wed, 7 Feb 2018 10:36:16 +0000 (11:36 +0100)]
SVG: Make sure that "No data" is displayed when no graphs are created

If no graphs are detected (e.g. the file contains only a LINUX RESTART
message) then SVG file is empty and an error is displayed by the browser.
Make sure that "No data" is displayed in the browser window instead.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoTravis CI: Use sadc instead of sar to create test file
Sebastien GODARD [Wed, 7 Feb 2018 09:24:35 +0000 (10:24 +0100)]
Travis CI: Use sadc instead of sar to create test file

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoTravis CI: Try to fix "Cannot find data collector" error message
Sebastien GODARD [Wed, 7 Feb 2018 09:15:10 +0000 (10:15 +0100)]
Travis CI: Try to fix "Cannot find data collector" error message

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoAdd more tests for Travis CI
Sebastien GODARD [Wed, 7 Feb 2018 08:30:27 +0000 (09:30 +0100)]
Add more tests for Travis CI

Add several tests for continuous integration.
In particular some tests, which previously failed because of endianness
mismatch (see #145), are restored (sar should now be able to process
both endian formats).

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Fix CPU weighted frequency conversion
Sebastien GODARD [Mon, 5 Feb 2018 17:13:16 +0000 (18:13 +0100)]
sadf: Fix CPU weighted frequency conversion

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Don't display an error message when activity structure's
Sebastien GODARD [Sun, 4 Feb 2018 10:27:44 +0000 (11:27 +0100)]
sadf: Don't display an error message when activity structure's
composition has changed

sadf -H should not display an error message when it meets an
activity's structure whose composition has changed.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoCosmetic fix
Sebastien GODARD [Sun, 4 Feb 2018 10:26:06 +0000 (11:26 +0100)]
Cosmetic fix

Have "Unknown format" message properly aligned.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Fix A_SERIAL activity conversion
Sebastien GODARD [Sun, 4 Feb 2018 07:24:09 +0000 (08:24 +0100)]
sadf: Fix A_SERIAL activity conversion

@nr_ini shouldn't be modified by upgrade_stats_serial() function because
it is used to kwnow how many structures have to be read from the
original file.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Properly convert structures with compatible changes
Sebastien GODARD [Sat, 3 Feb 2018 17:20:03 +0000 (18:20 +0100)]
sadf: Properly convert structures with compatible changes

Some activity structures may have gained additional fields while keeping
their original magic number. This is because these changes were seen as
compatible for sar.
Anyway these structures have to be handled in a specific way when they
are converted since these additional fields didn't exist for all the
versions since 9.1.6.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Update conversion function
Sebastien GODARD [Sat, 3 Feb 2018 16:20:13 +0000 (17:20 +0100)]
sadf: Update conversion function

Update sadf function used to convert an old datafile (from version 9.1.6
and later) to the up-to-date format (11.7.2). This function corresponds
to sadf option -c ("sadf -c old_datafile > new_datafile").
It should work on both little endian and big endian data files.
The original endianness of the file is preserved.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Always normalize endianness of second part of file_magic structure
Sebastien GODARD [Sat, 3 Feb 2018 16:14:24 +0000 (17:14 +0100)]
sar: Always normalize endianness of second part of file_magic structure

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadf: Change magic numbers for other activities again
Sebastien GODARD [Sat, 3 Feb 2018 16:08:32 +0000 (17:08 +0100)]
sar/sadf: Change magic numbers for other activities again

The format for some activities has changed in version 11.7.1 because of
the new alignment used.
Their magic number should have been updated. Fix this.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Remove unused reference to extern variable
Sebastien GODARD [Mon, 29 Jan 2018 17:11:51 +0000 (18:11 +0100)]
sadf: Remove unused reference to extern variable

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadf: Change sa_open_read_magic() function prototype
Sebastien GODARD [Mon, 29 Jan 2018 17:09:13 +0000 (18:09 +0100)]
sar/sadf: Change sa_open_read_magic() function prototype

Add a new arg to tell whether endianness should be normalized or not.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Update manual page
Sebastien GODARD [Mon, 29 Jan 2018 17:04:53 +0000 (18:04 +0100)]
sadf: Update manual page

Rename option showhints to its new name (debug).

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadf: Change magic number for certain activities
Sebastien GODARD [Mon, 29 Jan 2018 17:02:51 +0000 (18:02 +0100)]
sar/sadf: Change magic number for certain activities

The format for some activities has changed in version 11.7.1.
Their magic number should have been updated. Fix this.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Rename option showhints to debug
Sebastien GODARD [Mon, 29 Jan 2018 17:00:53 +0000 (18:00 +0100)]
sadf: Rename option showhints to debug

Rename option showhints (used with sadf's option -O in RAW mode) to
debug since it is mainly used for debugging purpose.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosa_common.c: Use SYSSTAT_MAGIC constant instead of swapping bytes
Sebastien GODARD [Sat, 27 Jan 2018 06:52:11 +0000 (07:52 +0100)]
sa_common.c: Use SYSSTAT_MAGIC constant instead of swapping bytes

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoSave HZ as an unsigned long integer
Sebastien GODARD [Sat, 27 Jan 2018 06:47:55 +0000 (07:47 +0100)]
Save HZ as an unsigned long integer

Number of clock ticks per second is given as a long integer by sysconf()
function. It is also saved as an unsigned  long integer in sar's data
files (sa_hz).

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoiostat: Refresh device list properly
Sebastien GODARD [Mon, 22 Jan 2018 16:06:21 +0000 (17:06 +0100)]
iostat: Refresh device list properly

When running iostat to monitor disk activity,
disconnecting a USB drive from the system then reconnecting another one
didn't make the new one appear on the list.
This patch fixes the problem.

Reported-by: Robert Hoffmann <robert@noreply.servermasters.com>
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoRAW: Check return code from check_*_reg functions
Sebastien GODARD [Sat, 20 Jan 2018 19:54:41 +0000 (20:54 +0100)]
RAW: Check return code from check_*_reg functions

Distinguish between new devices and devices that have been unregistered
then registered again (this indication is displayed by "sadf -r" with
showhints option).

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Don't read statistics twice when displaying average since system
Sebastien GODARD [Fri, 19 Jan 2018 15:52:15 +0000 (16:52 +0100)]
sar: Don't read statistics twice when displaying average since system
startup

Entering something like "sar 0" to display statistics (here CPU) since
system startup made sadc read the statistics twice. One reading is
enough.
Before this patch, sar called sadc with interval=1 and count=-1.
Now sadc is called with interval=1 and count=1.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Display all items for USB and filesystems activities
Sebastien GODARD [Fri, 19 Jan 2018 15:10:14 +0000 (16:10 +0100)]
sar: Display all items for USB and filesystems activities

The summary displayed by sar for USB and filesystems activities didn't
include all the items. In pacticular, filesystems or USB devices that
had been unmounted were not displayed in the summary ending the report.
This patch fixes the problem.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate README file
Sebastien GODARD [Fri, 19 Jan 2018 08:50:28 +0000 (09:50 +0100)]
Update README file

This is mainly cosmetic...

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate sysstat's FAQ
Sebastien GODARD [Fri, 19 Jan 2018 08:25:59 +0000 (09:25 +0100)]
Update sysstat's FAQ

Explain how to collect and save in data file only the desired
activities.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Fix how activities are passed to sadc
Sebastien GODARD [Fri, 19 Jan 2018 08:23:32 +0000 (09:23 +0100)]
sar: Fix how activities are passed to sadc

Activities can no longer be passed by sar to sadc using numerical
values. Use activity names instead.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadc: Select activities by name
Sebastien GODARD [Wed, 17 Jan 2018 20:26:56 +0000 (21:26 +0100)]
sadc: Select activities by name

This patch enables the user to select exactly which activities will be
collected by sadc and saved into the binary data file.
Selected activities are entered following sadc's option -S using their
formal report name (these names are displayed by "sar --help").

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Enhance "sadf -H" output
Sebastien GODARD [Wed, 17 Jan 2018 20:04:29 +0000 (21:04 +0100)]
sadf: Enhance "sadf -H" output

"sadf -H" now displays all the header data of the binary data file.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agocifsiostat: Display device name at the end of line when option -h used
Sebastien GODARD [Wed, 17 Jan 2018 20:02:28 +0000 (21:02 +0100)]
cifsiostat: Display device name at the end of line when option -h used

Same change here for cifsiostat that that applied to iostat.
See commit f65dc29.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoiostat: Display device name at the end of line when option -h used
Sebastien GODARD [Wed, 17 Jan 2018 19:49:49 +0000 (20:49 +0100)]
iostat: Display device name at the end of line when option -h used

iostat's option -h was intended to make the output more easily readable
by a human, especially when some devices had a long name that would make
the whole output shift around. In fact it added a '\n' to split the line
and the result was not particularly easier to read.
This patch moves the device name at the end of the line when option -h
is used without inserting more lines.
Option -h still sets option --human to automatically select the right
unit to display.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Update help message
Sebastien GODARD [Wed, 17 Jan 2018 19:46:08 +0000 (20:46 +0100)]
sar: Update help message

Update message displayed by "sar --help": Print the report name
associated with each activity.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate sysstat's FAQ
Sebastien GODARD [Mon, 15 Jan 2018 17:00:04 +0000 (18:00 +0100)]
Update sysstat's FAQ

Add reference to sarjitsu application.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoAdd a comment with a warning in rd_stats.h
Sebastien GODARD [Mon, 15 Jan 2018 16:42:40 +0000 (17:42 +0100)]
Add a comment with a warning in rd_stats.h

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: RAW: Display activity name when showhints option used
Sebastien GODARD [Mon, 15 Jan 2018 16:38:27 +0000 (17:38 +0100)]
sadf: RAW: Display activity name when showhints option used

"sadf -r -O showhints..." now displays the name for each activity.
Also move the code displaying the number of structures used and allocated
from raw_stats.c to sadf.c.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Change some activities' name
Sebastien GODARD [Mon, 15 Jan 2018 16:34:53 +0000 (17:34 +0100)]
sar: Change some activities' name

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoStarting sysstat 11.7.2
Sebastien GODARD [Fri, 12 Jan 2018 11:16:52 +0000 (12:16 +0100)]
Starting sysstat 11.7.2

Update sysstat version number in configure script.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosysstat-11.7.1 v11.7.1
Sebastien GODARD [Fri, 12 Jan 2018 10:56:29 +0000 (11:56 +0100)]
sysstat-11.7.1

sysstat version 11.7.1 final packaging.
lsm and spec files updated.
Changelog added.

NOTE: Stable versions (11.2.14 [EOL], 11.4.8 and 11.6.2) also exist
and will be available for download from my web site:

http://pagesperso-orange.fr/sebastien.godard/

The stable versions include only the bug fixes added in sysstat 11.7.1
but not the new features.

Version 11.7.1 includes major changes concerning sar's binary data
file format and how sar works. Among them:

* A binary data file should take much less space on disk thanks
to new optimizations on how values are stowed in memory. The space saved
is estimated at least at 25% compared to previous format.

* Structures are no longer statically allocated, meaning that
the system can now register as many new devices (disks, network
interfaces, etc.) as needed and you will find all of them saved in your
saXX data file (provided that you have selected the corresponding
activities to collect). Previous version could lead to some devices
being ignored and going unnoticed if no free structures were left.

* Sar (and sadf) will now be able to read a binary data file
whatever its endianness is: Both big-endian and little-endian files can
be read by the same sar or sadf executable.

* More flexibility has been added to sar's binary data file
format. I cannot promise that the format won't change again in the
future but it should now be possible to add new metrics or activities
without making the format unreadable by older sar versions (starting
with version 11.7.1). Older versions will be able to read newer formats
but will display only the metrics they currently know.

Version 11.7.1 is a development version. As such, it is still NOT ready
for use in production. Yet I would really like to have it tested by the
maximum number of users and get feedback! :-)

NOTE: The function provided by sadf (option -c) to convert an old
data file to the up-to-date format has been temporarily inhibited. This
function will be working again in next sysstat version (11.7.2).

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoNLS updated
Sebastien GODARD [Fri, 12 Jan 2018 10:55:00 +0000 (11:55 +0100)]
NLS updated

Various translations updated.
Removed lsm and spec files.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate sar's manual page
Sebastien GODARD [Fri, 12 Jan 2018 09:18:09 +0000 (10:18 +0100)]
Update sar's manual page

Reference new option -h.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Add new option -h
Sebastien GODARD [Fri, 12 Jan 2018 09:15:40 +0000 (10:15 +0100)]
sar: Add new option -h

Add option -h to make sar's output easier to read by a human.
This option tells sar to display {devices, network interfaces} names at
the end of the line to make sure the output won't shift. This option
also enables implicitly --human and -p (pretty-print).

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate sar manual page
Sebastien GODARD [Fri, 12 Jan 2018 08:37:58 +0000 (09:37 +0100)]
Update sar manual page

Option -h has been renamed to --help.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Rename option -h to --help
Sebastien GODARD [Fri, 12 Jan 2018 08:35:20 +0000 (09:35 +0100)]
sar: Rename option -h to --help

Option --help displays a help message.
Option -h will be used to make sar's output easier to read by a human.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoSVG: Put queue and load average metrics back in order
Sebastien GODARD [Mon, 8 Jan 2018 16:54:19 +0000 (17:54 +0100)]
SVG: Put queue and load average metrics back in order

Commit 4a15362 changed the order of metrics in stats_queue structure.
This new order has also to be taken into account by corresdponding
rendering function in svg_stats.c.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoFiles dependencies: Global update
Sebastien GODARD [Sun, 7 Jan 2018 16:33:50 +0000 (17:33 +0100)]
Files dependencies: Global update

Update files included in source files.
Update Makefile to be consistent with files dependencies.
Move also some code from common.c to rd_stats.c.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoSmall fix in manual pages
Sebastien GODARD [Sun, 7 Jan 2018 11:07:34 +0000 (12:07 +0100)]
Small fix in manual pages

There is always one decimal place in numbers displayed with --human
option.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoVarious cosmetic changes
Sebastien GODARD [Sun, 7 Jan 2018 10:55:40 +0000 (11:55 +0100)]
Various cosmetic changes

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadf: Fix dependencies in Makefile
Sebastien GODARD [Sun, 7 Jan 2018 10:48:10 +0000 (11:48 +0100)]
sar/sadf: Fix dependencies in Makefile

File activity.c should depend on rd_stats.h and rd_sensors.h
for sadf and sar in addition to sadc.
Structures size (STATS_*_SIZE) is defined in these include files and
used in activity.c for all commands.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Fix how stats are displayed since boot time for some activities
Sebastien GODARD [Fri, 5 Jan 2018 10:55:38 +0000 (11:55 +0100)]
sar: Fix how stats are displayed since boot time for some activities

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Update functions to display unsigned unsigned long values
Sebastien GODARD [Fri, 5 Jan 2018 10:44:35 +0000 (11:44 +0100)]
sadf: Update functions to display unsigned unsigned long values

Some metrics's type is now unsigned long long instead of unsigned long.
So update functions used by sadf accordingly. Other metrics whose type
remains unsigned long can still be displayed.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Update functions to be consistent with new stats structures
Sebastien GODARD [Mon, 1 Jan 2018 15:46:04 +0000 (16:46 +0100)]
sar: Update functions to be consistent with new stats structures

Update functions used to read or write statistics to remain consistent
with structures' new types.
Some work has still to be done in rndr_stats.c and svg_stats.c

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