]> granicus.if.org Git - sysstat/log
sysstat
5 years agofix tabs
steve kay [Sun, 25 Nov 2018 19:46:54 +0000 (19:46 +0000)]
fix tabs

5 years agofix configure typo : --enablle-copy-only -> --enable-copy-only
steve kay [Sun, 25 Nov 2018 19:38:35 +0000 (19:38 +0000)]
fix configure typo : --enablle-copy-only -> --enable-copy-only

5 years agoMerge pull request #198 from stevekay/master
GODARD Sebastien [Sun, 25 Nov 2018 17:16:13 +0000 (18:16 +0100)]
Merge pull request #198 from stevekay/master

Use memcpy rather than strncpy, in order to avoid truncation warning

5 years agoMerge pull request #200 from mator/master
GODARD Sebastien [Sun, 25 Nov 2018 17:02:51 +0000 (18:02 +0100)]
Merge pull request #200 from mator/master

sar: fix a small inconsistency in header of print_sar_restart function

5 years agosar: fix a small inconsistency in header of print_sar_restart function
Anatoly Pugachev [Fri, 23 Nov 2018 14:29:27 +0000 (17:29 +0300)]
sar: fix a small inconsistency in header of print_sar_restart function

file_hdr is used to report number of CPUs

Signed-off-by: Anatoly Pugachev <matorola@gmail.com>
5 years agoUse memcpy rather than strncpy, in order to avoid truncation warning
stevekay [Thu, 22 Nov 2018 22:38:45 +0000 (17:38 -0500)]
Use memcpy rather than strncpy, in order to avoid truncation warning

5 years agoiostat: Remove extra line between two samples
Sebastien GODARD [Sun, 18 Nov 2018 10:38:41 +0000 (11:38 +0100)]
iostat: Remove extra line between two samples

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoiostat: Add initial support for discard I/O
Sebastien GODARD [Fri, 16 Nov 2018 16:15:11 +0000 (17:15 +0100)]
iostat: Add initial support for discard I/O

Statistics for discard operations have been recently added to Linux
kernel 4.19. Previous kernels didn't separate discards from writes
in the block layer statistics.
This patch adds initial support for discard I/O tracking to iostat.
It adds several new metrics which are similar to those already existing
for reads and writes.
Reports are also modified so that the user can better choose how things
will be displayed, using switches like -s (to get a narrow output
fitting on a 80-characters wide screen) or -h (to get a human-friendly
output): See below.
This patch still needs to be tested (I don't have a 4.19 kernel yet!),
completed (e.g. JSON output) and documented (manual pages will be
updated in a coming patch).

Sample outputs:
$ iostat -d
Linux 4.18.17-200.fc28.x86_64 (linux-1.home)  11/16/2018  _x86_64_ (8 CPU)

Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
sda              18.96       176.95       335.75         0.00    1767999    3354672          0

$ iostat -ds
Linux 4.18.17-200.fc28.x86_64 (linux-1.home)  11/16/2018  _x86_64_ (8 CPU)

Device             tps    kB_read/s     kB_w+d/s    kB_read     kB_w+d
sda              18.80       175.46       332.95    1767999    3354896

$ iostat -dx
Linux 4.18.17-200.fc28.x86_64 (linux-1.home)  11/16/2018  _x86_64_ (8 CPU)

Device            r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz     w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz     d/s     dkB/s   drqm/s  %drqm d_await dareq-sz  aqu-sz  %util
sda              9.98    174.99     1.87  15.76    6.44    17.53    8.77    332.06    12.17  58.12   61.77    37.87    0.00      0.00     0.00   0.00    0.00     0.00    0.61   3.93

$ iostat -dxs
Linux 4.18.17-200.fc28.x86_64 (linux-1.home)  11/16/2018  _x86_64_ (8 CPU)

Device             tps      kB/s    rqm/s   await  areq-sz  aqu-sz  %util
sda              18.71    505.90    14.01   32.31    27.04    0.61   3.92

$ iostat -dxh
Linux 4.18.17-200.fc28.x86_64 (linux-1.home)  11/16/2018  _x86_64_ (8 CPU)

     r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz Device
    9.94    174.3k     1.86  15.8%    6.44    17.5k sda

     w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz Device
    8.74    330.7k    12.12  58.1%   61.71    37.8k sda

     d/s     dkB/s   drqm/s  %drqm d_await dareq-sz Device
    0.00      0.0k     0.00   0.0%    0.00     0.0k sda

  aqu-sz  %util Device
    0.61   3.9% sda

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosvctm: Update sar and iostat manual pages
Sebastien GODARD [Sun, 4 Nov 2018 09:14:56 +0000 (10:14 +0100)]
svctm: Update sar and iostat manual pages

Remove explanations for svctm metric from sar and iostat manual pages.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosvctm: Update DTD and XSD documents
Sebastien GODARD [Sun, 4 Nov 2018 09:11:02 +0000 (10:11 +0100)]
svctm: Update DTD and XSD documents

Make svctm field optional in DTD and XSD documents.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoiostat/sar: Remove service time (svctm) metric
Sebastien GODARD [Sun, 4 Nov 2018 09:04:00 +0000 (10:04 +0100)]
iostat/sar: Remove service time (svctm) metric

Service time value (displayed as svctm by sar and iostat) could no
longer be trusted and has been made obsolete for several years. So
remove it now from sar (sar -d) and iostat output.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoAdd new non regression tests
Sebastien GODARD [Thu, 1 Nov 2018 09:01:58 +0000 (10:01 +0100)]
Add new non regression tests

This patch adds new non regression tests for:
* sadf JSON and XML outputs: The output for sar -u is a bit different
than that for sar -u ALL and thus also needs to be tested,
* mpstat JSON output,
* iostat JSON output.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoMerge pull request #193 from stevekay/crontabfix
GODARD Sebastien [Sun, 28 Oct 2018 16:50:14 +0000 (17:50 +0100)]
Merge pull request #193 from stevekay/crontabfix

remove superfluous '&' within crontabs

5 years agoremove superfluous '&' within crontabs
Steve Kay [Sat, 27 Oct 2018 20:06:01 +0000 (21:06 +0100)]
remove superfluous '&' within crontabs

5 years agoAdd new non regression tests for XML output
Sebastien GODARD [Sun, 14 Oct 2018 15:02:28 +0000 (17:02 +0200)]
Add new non regression tests for XML output

Add two new non regression tests that check the XML output of
sadf -x against DTD and XSD documents.
The tests are run only if the xmllint command exists.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoMerge branch 'acdimalev-acdimalev-json-parse-test'
Sebastien GODARD [Sun, 14 Oct 2018 08:33:07 +0000 (10:33 +0200)]
Merge branch 'acdimalev-acdimalev-json-parse-test'

5 years agoImprove non regression test for JSON output
Sebastien GODARD [Sun, 14 Oct 2018 08:30:19 +0000 (10:30 +0200)]
Improve non regression test for JSON output

Look for two possible commands to test JSON output: json_verify and
json_pp.
Also make sure that one of them exists to run the non regression test.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoMerge branch 'acdimalev-json-parse-test' of https://github.com/acdimalev/sysstat...
Sebastien GODARD [Sun, 14 Oct 2018 07:40:39 +0000 (09:40 +0200)]
Merge branch 'acdimalev-json-parse-test' of https://github.com/acdimalev/sysstat into acdimalev-acdimalev-json-parse-test

5 years agoStarting sysstat-12.1.2
Sebastien GODARD [Sat, 13 Oct 2018 08:09:18 +0000 (10:09 +0200)]
Starting sysstat-12.1.2

Update sysstat version number in configure script.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosysstat-12.1.1 v12.1.1
Sebastien GODARD [Sat, 13 Oct 2018 07:49:36 +0000 (09:49 +0200)]
sysstat-12.1.1

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

This version mainly includes bugfixes.
The only noteworthy new feature is the addition of two new metrics to
sar -H (Hugepage activity): HugePages_Rsvd and HugePages_Surp.
Also sadf has been made more robust to corrupted datafiles, enabling it
to complete its job even if an unexpected end of datafile is met.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoUpdate NLS translations
Sebastien GODARD [Sat, 13 Oct 2018 07:41:03 +0000 (09:41 +0200)]
Update NLS translations

Sync with the Translation Project.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosar: Fix typo in manual page
Sebastien GODARD [Sat, 6 Oct 2018 16:12:54 +0000 (18:12 +0200)]
sar: Fix typo in manual page

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoAdd a JSON parse test
jamin [Thu, 27 Sep 2018 22:15:29 +0000 (15:15 -0700)]
Add a JSON parse test

5 years agoMerge pull request #191 from xcorail/master
GODARD Sebastien [Mon, 24 Sep 2018 18:05:26 +0000 (20:05 +0200)]
Merge pull request #191 from xcorail/master

Configure LGTM to exclude python code: declare as docs

5 years agoConfigure LGTM to exclude python code: declare as library
Xavier RENE-CORAIL [Mon, 24 Sep 2018 07:17:56 +0000 (09:17 +0200)]
Configure LGTM to exclude python code: declare as library

5 years agoConfigure LGTM to exclude python code: declare as docs
Xavier RENE-CORAIL [Mon, 24 Sep 2018 07:13:57 +0000 (09:13 +0200)]
Configure LGTM to exclude python code: declare as docs

5 years agoMake sure multiplication result won't overflow integer type
Sebastien GODARD [Sun, 23 Sep 2018 07:57:28 +0000 (09:57 +0200)]
Make sure multiplication result won't overflow integer type

Make sure that multiplication result won't overflow int type before it
is converted to size_t (which is unsigned int or unsigned long according
to GNU C library documentation)

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoUse thread-safe versions of gmtime() and localtime()
Sebastien GODARD [Fri, 21 Sep 2018 14:45:01 +0000 (16:45 +0200)]
Use thread-safe versions of gmtime() and localtime()

It is safer to use gmtime_r() and localtime_r() functions (which are
thread-safe) instead of gmtime() and localtime() ones, even though
sysstat's code doesn't use multiple threads.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoAdd LGTM.com code quality badges.
Sebastien GODARD [Fri, 21 Sep 2018 12:14:19 +0000 (14:14 +0200)]
Add LGTM.com code quality badges.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoMerge branch 'master' of https://github.com/xcorail/sysstat into xcorail-master
Sebastien GODARD [Fri, 21 Sep 2018 12:05:50 +0000 (14:05 +0200)]
Merge branch 'master' of https://github.com/xcorail/sysstat into xcorail-master

5 years agoFix #189: [: n: unexpected operator
Sebastien GODARD [Fri, 21 Sep 2018 11:44:45 +0000 (13:44 +0200)]
Fix #189: [: n: unexpected operator

On some systems, installing sysstat lead to the following error:

elif [ -d /etc ]; then \
        install -m 755 sysstat /etc/rc.sysstat; \
        if [ "n" == "n" ]; then \
                if [ -x "" ]; then \
                        cd /etc &&  --add rc.sysstat; \
                else \
                        [ -d /etc/rc2.d ] || mkdir -p /etc/rc2.d; \
                        [ -d /etc/rc3.d ] || mkdir -p /etc/rc3.d; \
                        [ -d /etc/rc5.d ] || mkdir -p /etc/rc5.d; \
                        cd /etc/rc2.d && ln -s -f ../rc.sysstat S01sysstat; \
                        cd /etc/rc3.d && ln -s -f ../rc.sysstat S01sysstat; \
                        cd /etc/rc5.d && ln -s -f ../rc.sysstat S01sysstat; \
                fi \
        fi \
fi
/bin/sh: 9: [: n: unexpected operator

This is because POSIX sh does not support == for string equality.
This is supported only by bash.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosadf: Make it more robust to corrupted datafiles
Sebastien GODARD [Fri, 21 Sep 2018 09:51:14 +0000 (11:51 +0200)]
sadf: Make it more robust to corrupted datafiles

When a system activity datafile has been corrupted, sadf may not be able
to do its job completely. For example reaching the end of file
unexpectedly will make sadf stop, preventing it from, e.g. displaying
its SVG output (sadf -g) or terminating its JSON or XML file properly
(sadf -j or sadf -x).
This patch tells sadf to keep on working even if the end of file has
been reached unexpectedly, enabling it to finish its job.

Note: sar is not really concerned by this problem because you can tell
it to stop before the problem occurs using its option -e.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosadf_misc.c: Remove unused external variable
Sebastien GODARD [Sun, 16 Sep 2018 14:15:13 +0000 (16:15 +0200)]
sadf_misc.c: Remove unused external variable

id_seq[] variable declared as external is unused in this source file.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoAdd LGTM.com code quality badges
Xavier RENE-CORAIL [Fri, 14 Sep 2018 11:01:54 +0000 (12:01 +0100)]
Add LGTM.com code quality badges

5 years agosar: Make sure a header line is always displayed
Sebastien GODARD [Wed, 29 Aug 2018 10:03:41 +0000 (12:03 +0200)]
sar: Make sure a header line is always displayed

Sometimes the header line for current statistics was not displayed in
sar report, e.g.:

$ sadc data 1 1
$ sadc data -C Hello
$ sadc data 1 1
$ sar -f data -C
Linux 4.17.18-200.fc28.x86_64 (linux.home)  08/29/2018  _x86_64_ (8 CPU)
12:06:25 PM  COM Hello
12:06:27 PM     all      0.41      0.00      0.50      0.06      0.00     99.03
Average:        all      0.41      0.00      0.50      0.06      0.00     99.03

The presence of a comment hides the header line. Expected result is:

Linux 4.17.18-200.fc28.x86_64 (linux.home)  08/29/2018  _x86_64_ (8 CPU)
12:06:25 PM  COM Hello

12:06:18 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
12:06:27 PM     all      0.41      0.00      0.50      0.06      0.00     99.03
Average:        all      0.41      0.00      0.50      0.06      0.00     99.03

This patch fixes the problem.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoAdd new non regression tests
Sebastien GODARD [Wed, 29 Aug 2018 09:45:14 +0000 (11:45 +0200)]
Add new non regression tests

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosadf: SVG: Add support for new huge pages metrics
Sebastien GODARD [Wed, 29 Aug 2018 08:52:43 +0000 (10:52 +0200)]
sadf: SVG: Add support for new huge pages metrics

Take into account new HugePages_Rsvd and HugePages_Surp metrics.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoUpdate sar manual page
Sebastien GODARD [Mon, 27 Aug 2018 12:25:16 +0000 (14:25 +0200)]
Update sar manual page

Explain new huge pages metrics.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoUpdate DTD and XSD documents to take into account new huge pages metrics
Sebastien GODARD [Mon, 27 Aug 2018 12:23:51 +0000 (14:23 +0200)]
Update DTD and XSD documents to take into account new huge pages metrics

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosa_conv.c: Fix typo in comment
Sebastien GODARD [Mon, 27 Aug 2018 08:26:25 +0000 (10:26 +0200)]
sa_conv.c: Fix typo in comment

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosadf: Take into account new huge pages metrics
Sebastien GODARD [Mon, 27 Aug 2018 08:24:16 +0000 (10:24 +0200)]
sadf: Take into account new huge pages metrics

Update various sadf formats (JSON, XML, raw, etc.) to take into account
new HugePages_Rsvd and HugePages_Surp metrics.
SVG output format will be updated later.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoNow collect HugePages_Rsvd and HugePages_Surp values in addition to
Sebastien GODARD [Mon, 27 Aug 2018 08:20:55 +0000 (10:20 +0200)]
Now collect HugePages_Rsvd and HugePages_Surp values in addition to
previous huge pages metrics.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosar: Update remap_struct() function prototype
Sebastien GODARD [Sun, 26 Aug 2018 14:15:10 +0000 (16:15 +0200)]
sar: Update remap_struct() function prototype

This commit should have been part of cb7f009.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosar: Fix timestamp format in report output
Sebastien GODARD [Sun, 26 Aug 2018 13:54:33 +0000 (15:54 +0200)]
sar: Fix timestamp format in report output

The contents of environment variable S_TIME_FORMAT was not taken into
account when displaying a RESTART or a COMMENT message if this message
was the first line displayed in the report by sar:

$ sar
Linux 4.17.11-200.fc28.x86_64 (xxx)  08/25/2018  _x86_64_ (8 CPU)

14:10:50     LINUX RESTART (8 CPU)

02:15:47 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
02:20:00 PM     all      6.27      0.00      2.17      3.85      0.00     87.71
...

This patch fixes the problem by testing the environment variable sooner.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosar: Fortify remap_struct() function
Sebastien GODARD [Sat, 25 Aug 2018 13:53:39 +0000 (15:53 +0200)]
sar: Fortify remap_struct() function

New metrics can be added to sar with new sysstat versions. These new
metrics correspond to new fields added to existing statistics
structures.
For compatibility reasons, sysstat assumes that these structures
(identified by their number of fields of different types: long long,
long and int) can only grow with newer sysstat versions. Yet commit c2f9d16
has fixed a longstanding bug regarding a wrong size used for structure
stats_huge. With this bugfix structure stats_huge has now a size smaller
than before. We need to update remap_struct() function to deal with
this. Else adding new fields to structure stats_huge will make sar
unable to read older binary datafiles and crash:

free(): invalid pointer
Aborted (core dumped)

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoUpdate FAQ
Sebastien GODARD [Mon, 6 Aug 2018 16:33:06 +0000 (18:33 +0200)]
Update FAQ

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosadc: Allow to unselect activities by name
Sebastien GODARD [Mon, 6 Aug 2018 16:28:10 +0000 (18:28 +0200)]
sadc: Allow to unselect activities by name

The idea here is to make it possible for the user to *unselect* an
activity which is collected by default by sadc.
For example, you can now choose to collect all
possible statistics except those for interrupts:

sadc -S XALL,-A_IRQ (...)

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosar: Fix wrong size for huge pages statistics structure
Sebastien GODARD [Mon, 6 Aug 2018 15:20:06 +0000 (17:20 +0200)]
sar: Fix wrong size for huge pages statistics structure

Oopss... Fix wrong size for stats_huge structure.
This would be laughable if it was not a (really) nasty bug... :-(

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoStarting sysstat-12.1.1
Sebastien GODARD [Fri, 3 Aug 2018 07:06:05 +0000 (09:06 +0200)]
Starting sysstat-12.1.1

Update sysstat version number in configure script.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosysstat-12.0.0 v12.0.0
Sebastien GODARD [Fri, 3 Aug 2018 06:53:57 +0000 (08:53 +0200)]
sysstat-12.0.0

sysstat version 12.0.0 final packaging.
lsm file updated.
Typo fixed in sadf.c.
Changelog added.

Version 12.0.0 mainly focuses on SVG output from the sadf command,
with a lot of bugfixes and the addition of a new option ("showtoc")
that will enable the user to quickly navigate through graphs.
Version 12.0.0 is also the first stable version that includes the new,
compact and flexible binary format for sar.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agospec file: Don't create a debug package
Sebastien GODARD [Fri, 3 Aug 2018 06:46:56 +0000 (08:46 +0200)]
spec file: Don't create a debug package

Update spec file to version 12.0.0.
Add an entry to prevent from creating a debug package (that we don't
need). Else we have the following error when creating the RPM packages:

RPM build errors:
    Empty %files file /home/seb/rpmbuild/BUILD/sysstat-12.0.0/debugsourcefiles.list
make: *** [Makefile:94: build] Error 1

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoUpdate NLS translations
Sebastien GODARD [Fri, 3 Aug 2018 06:19:45 +0000 (08:19 +0200)]
Update NLS translations

Sync with the Translation Project.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosar: Update manual page
Sebastien GODARD [Fri, 3 Aug 2018 06:01:05 +0000 (08:01 +0200)]
sar: Update manual page

Tell when using option -h may be useful.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosadf: SVG: Fix possible negative value in graph coordinate
Sebastien GODARD [Fri, 27 Jul 2018 16:25:11 +0000 (18:25 +0200)]
sadf: SVG: Fix possible negative value in graph coordinate

dt interval may sometimes be greater by one unit than the timetag
interval because of a previous rounding operation. See sadf.c line 694:

dt = itv / 100;
/* Correct rounding error for dt */
if ((itv % 100) >= 50) {
dt++;
}

When this happens, the coordinate gets a crazy value which is obviously
wrong, e.g.:

<rect x="18446744073709551615" y="0.00"...

So make a comparison between dt and timetag values, and use 0 if dt
happens to be greater than timetag.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoUpdate sysstat manual pages
Sebastien GODARD [Fri, 27 Jul 2018 07:00:45 +0000 (09:00 +0200)]
Update sysstat manual pages

Add link to github repository.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoUpdate README.md file
Sebastien GODARD [Fri, 27 Jul 2018 06:48:28 +0000 (08:48 +0200)]
Update README.md file

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoioconf.c: Fix more gcc format-truncation warnings
Sebastien GODARD [Mon, 23 Jul 2018 06:35:57 +0000 (08:35 +0200)]
ioconf.c: Fix more gcc format-truncation warnings

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosar.c: Fix gcc warning about possible variables overlap
Sebastien GODARD [Fri, 20 Jul 2018 15:20:36 +0000 (17:20 +0200)]
sar.c: Fix gcc warning about possible variables overlap

Fix gcc warning:
sar.c: In function ‘write_stats_avg’:
sar.c:372:2: warning: ‘strcpy’ accessing 1 byte at offsets [0, 64] and [0, 128] may overlap 1 byte at offset 0 [-Wrestrict]
  strcpy(timestamp[!curr], timestamp[curr]);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoiostat.c: Fix gcc format-truncation warning
Sebastien GODARD [Fri, 20 Jul 2018 07:38:38 +0000 (09:38 +0200)]
iostat.c: Fix gcc format-truncation warning

Resize buffers to avoid warnings from gcc:

iostat.c: In function ‘read_sysfs_dlist_part_stat’:
iostat.c:576:39: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 1023 [-Wformat-truncation=]
   snprintf(filename, MAX_PF_NAME, "%s/%s/%s", dfile, drd->d_name, S_STAT);
                                       ^~
iostat.c:576:3: note: ‘snprintf’ output between 7 and 1285 bytes into a destination of size 1024
   snprintf(filename, MAX_PF_NAME, "%s/%s/%s", dfile, drd->d_name, S_STAT);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosadf_misc.c: Fix gcc format-truncation warning
Sebastien GODARD [Fri, 20 Jul 2018 07:30:23 +0000 (09:30 +0200)]
sadf_misc.c: Fix gcc format-truncation warning

Resize buffers to avoid warnings from gcc:

sadf_misc.c: In function ‘print_dbppc_timestamp’:
sadf_misc.c:486:28: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
   snprintf(temp, 80, "%s%s ", pre, cur_date);
                            ^
sadf_misc.c:486:3: note: ‘snprintf’ output 2 or more bytes (assuming 81) into a destination of size 80
   snprintf(temp, 80, "%s%s ", pre, cur_date);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sadf_misc.c:491:25: warning: ‘%s’ directive output may be truncated writing up to 4 bytes into a region of size between 1 and 80 [-Wformat-truncation=]
  snprintf(pre, 80, "%s%s%s", temp, cur_time,
                         ^~
sadf_misc.c:491:2: note: ‘snprintf’ output 1 or more bytes (assuming 84) into a destination of size 80
  snprintf(pre, 80, "%s%s%s", temp, cur_time,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    strlen(cur_date) && utc ? " UTC" : "");
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosa_common.c: Fix pointer signedness difference warning from gcc
Sebastien GODARD [Fri, 20 Jul 2018 07:00:42 +0000 (09:00 +0200)]
sa_common.c: Fix pointer signedness difference warning from gcc

Remove "unsigned" attribute to avoid warning from gcc:

sa_common.c: In function ‘add_list_item’:
sa_common.c:2516:20: warning: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness [-Wpointer-sign]
  if ((e->item_name = (unsigned char *) malloc(len + 1)) == NULL) {
                    ^

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosvg_stats.c: Fix gcc format-truncation warning
Sebastien GODARD [Fri, 20 Jul 2018 06:55:59 +0000 (08:55 +0200)]
svg_stats.c: Fix gcc format-truncation warning

Resize data buffer to avoid warning from gcc:

svg_stats.c: In function ‘recappend’:
svg_stats.c:549:25: warning: ‘ L’ directive output may be truncated writing 2 bytes into a region of size between 1 and 128 [-Wformat-truncation=]
  snprintf(data, 128, "%s L%llu,%.2f%s", restart ? data1 : "", timetag, p_value,
                         ^~
svg_stats.c:549:2: note: ‘snprintf’ output between 9 and 591 bytes into a destination of size 128
  snprintf(data, 128, "%s L%llu,%.2f%s", restart ? data1 : "", timetag, p_value,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    p_value != value ? data2 : "");
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosa_conv.c: Use write_all() function instead of write()
Sebastien GODARD [Fri, 20 Jul 2018 06:41:53 +0000 (08:41 +0200)]
sa_conv.c: Use write_all() function instead of write()

Use write_all() function in sa_conv.c just like sadc.
write_all() function handles signal interruption which the plain write()
doesn't.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agosar/sadf: Devices list management code refactoring
Sebastien GODARD [Fri, 20 Jul 2018 06:20:20 +0000 (08:20 +0200)]
sar/sadf: Devices list management code refactoring

No longer use separate lists for devices entered on the command line
with options --dev, --iface and --fs.
Devices are now saved in the list @item_list which is part of structure
activity. This is a linked list whose number of elements is given by
@item_list_sz (also part of structure activity).

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
5 years agoioconf: Update constant values
Sebastien GODARD [Thu, 19 Jul 2018 05:53:13 +0000 (07:53 +0200)]
ioconf: Update constant values

Change constant values to avoid defining arrays size as
type array[CONSTANT_VALUE + 1];
This is error-prone and not consistent with the rest of sysstat code.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoRemove assignment from incompatible pointer type warnings
Sebastien GODARD [Sun, 15 Jul 2018 09:54:09 +0000 (11:54 +0200)]
Remove assignment from incompatible pointer type warnings

Remove warnings given by gcc, e.g.:

sadf_misc.c: In function ‘count_new_net_dev’:
sadf_misc.c:1033:6: warning: assignment to ‘void **’ from incompatible pointer type ‘struct interface_lst **’ [-Wincompatible-pointer-types]
    p = &(e->next);
      ^

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoRemove some format-overflow= warnings
Sebastien GODARD [Sun, 15 Jul 2018 09:27:26 +0000 (11:27 +0200)]
Remove some format-overflow= warnings

Resize strings to remove some gcc warnings about possible format
overflows.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Fix function used to assess canvas height
Sebastien GODARD [Fri, 13 Jul 2018 13:55:18 +0000 (15:55 +0200)]
sadf: SVG: Fix function used to assess canvas height

Make sure that we count all the items once and only once for those
which can be registered or unregistered by the system (network
interfaces, block devices...). This is needed to assess SVG canvas
height since each of them will have its own graph.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoRemove some "may be used uninitialized" warnings
Sebastien GODARD [Fri, 13 Jul 2018 08:37:44 +0000 (10:37 +0200)]
Remove some "may be used uninitialized" warnings

Explicitly set "item_name" variable before using it to avoid some
warnings by the compiler, e.g.:

svg_stats.c: In function ‘svg_print_net_dev_stats’:
svg_stats.c:2409:5: warning: ‘item_name’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     strncpy(item_name, sndc->interface, CHUNKSIZE);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Fix core dumped on buffers reallocation
Sebastien GODARD [Fri, 13 Jul 2018 08:27:02 +0000 (10:27 +0200)]
sadf: SVG: Fix core dumped on buffers reallocation

When buffers used to save graphs data needed to be extended to
accomodate for new devices, the new size was wrongly calculated
and a core dump was then created.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoRemove some format-truncation= warnings
Sebastien GODARD [Tue, 10 Jul 2018 19:28:48 +0000 (21:28 +0200)]
Remove some format-truncation= warnings

Check return code of some snprintf() functions to quiet gcc about
possible truncated output, e.g.:

12,18d11
< common.c: In function ‘get_dev_part_nr’:
< common.c:341:35: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 1023 [-Wformat-truncation=]
<    snprintf(line, MAX_PF_NAME, "%s/%s/%s", dfile, drd->d_name, S_STAT);
<                                    ^~
< common.c:341:3: note: ‘snprintf’ output between 7 and 1285 bytes into a destination of size 1024
<    snprintf(line, MAX_PF_NAME, "%s/%s/%s", dfile, drd->d_name, S_STAT);
<    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoRemove int-in-bool-context warnings
Sebastien GODARD [Mon, 9 Jul 2018 15:21:21 +0000 (17:21 +0200)]
Remove int-in-bool-context warnings

Recent gcc versions think the code used in SREALLOC() macro might be
wrong because we use the result of a multiplication as a boolean value:

In file included from sa.h:11,
                 from sadc.c:37:
sadc.c: In function ‘sa_sys_init’:
sadc.c:336:55: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
      (size_t) act[i]->msize * (size_t) act[i]->nr_ini * (size_t) act[i]->nr2);
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
common.h:125:16: note: in definition of macro ‘SREALLOC’
            if (SIZE) {       \
                ^~~~

Add a comparison to zero to make clear to gcc that the code is actually
fine.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Don't display "No data" over the table of contents
Sebastien GODARD [Mon, 9 Jul 2018 13:35:47 +0000 (15:35 +0200)]
sadf: SVG: Don't display "No data" over the table of contents

Sometimes, when all the selected activities have only zero values and
the skipempty option has been used with "sadf -g", the "No data" message
is displayed instead of the graphs.
In these conditions make sure that it doesn't get printed over the table
of contents entries.
Here is how to reproduce the problem on my system (I don't have any
network filesystems):

$ sadf -g -O showtoc,skipempty -- -n NFS,NFSD > output.svg

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Make sure gXX-0 id exists for memory activity
Sebastien GODARD [Mon, 9 Jul 2018 13:27:26 +0000 (15:27 +0200)]
sadf: SVG: Make sure gXX-0 id exists for memory activity

A_MEMORY activity (which has two possible outputs: memory statistics and
swap statistics) might have no "gXX-0" id in SVG file if memory
statistics hadn't been selected. This would break corresponding link in
the table of contents displayed by sadf with its option "showtoc", e.g.:

sadf -g -O showtoc -- -S > output.svg

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate description field for memory activity
Sebastien GODARD [Mon, 9 Jul 2018 13:18:19 +0000 (15:18 +0200)]
Update description field for memory activity

A_MEMORY activity may consist only of memory *or* swap statistics, not
necessarily both of them.
Description field in struct activity is used as an entry in the table of
contents displayed by "sadf -g" (SVG output).

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Don't insert a gap in SVG output if an activity is not
Sebastien GODARD [Fri, 6 Jul 2018 13:31:48 +0000 (15:31 +0200)]
sadf: SVG: Don't insert a gap in SVG output if an activity is not
displayed

In "packed" mode, we have to make sure that at least one graph for
current activity has been displayed before moving to next row.
Without this patch problem could happen with a command like:

$ sadf -g -O packed,skipempty -- -A > output.svg

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Always start id numbers at zero
Sebastien GODARD [Fri, 6 Jul 2018 13:02:56 +0000 (15:02 +0200)]
sadf: SVG: Always start id numbers at zero

For actvities with multiple items, make sure that the graph id number
for the first item being displayed is zero ("gXX-0").
If this is not the case then the link from the table of contents will
not work. This could happen when "skipempty" option was used and the
first item in the list didn't have a graph because all its stats were
zero.

$ sadf -g -O showtoc,skipempty -- -A > output.svg

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Don't insert id tag if activity not displayed
Sebastien GODARD [Fri, 6 Jul 2018 12:15:51 +0000 (14:15 +0200)]
sadf: SVG: Don't insert id tag if activity not displayed

When using both "showtoc" and "skipempty" options, e.g.:

$ sadf -g -O showtoc,skipempty -- -A > output.svg

clicking on the link pointing at an activity with no graphs displayed
(because all its statistics were zero) would move to the first
following graph... which is not the graph corresponding to the link!
This was because even if the graphs don't get displayed, sadf inserted
the id tag in the SVG file, e.g.:

<g id="g34-0" transform="translate(0,7870)">
</g>
<g id="g8-0" transform="translate(0,7870)">
<rect x="0" y="0" height="300" width="1050"/>

In the example above, clicking on the link to display graph whose id is
"g34-0" would display graph with id "g8-0" instead.

This patch fixes the problem.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Use SELECT_ACTIVITY() macro to select hugepages activity
Sebastien GODARD [Fri, 6 Jul 2018 09:27:44 +0000 (11:27 +0200)]
sar: Use SELECT_ACTIVITY() macro to select hugepages activity

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoCosmetic changes
Sebastien GODARD [Fri, 6 Jul 2018 09:23:16 +0000 (11:23 +0200)]
Cosmetic changes

Add some missing spaces...

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Better display graph for softnet stats when a CPU is offline
Sebastien GODARD [Sun, 17 Jun 2018 08:41:40 +0000 (10:41 +0200)]
sadf: SVG: Better display graph for softnet stats when a CPU is offline

Softnet statistics: Add a discontinuity in graph when corresponding CPU
is marked offline.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Clean code
Sebastien GODARD [Sun, 17 Jun 2018 08:39:34 +0000 (10:39 +0200)]
sadf: Clean code

Properly align code.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Update manual page
Sebastien GODARD [Sat, 16 Jun 2018 16:14:34 +0000 (18:14 +0200)]
sadf: Update manual page

Explain new option "showtoc".

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Add new option "showtoc"
Sebastien GODARD [Sat, 16 Jun 2018 15:52:06 +0000 (17:52 +0200)]
sadf: SVG: Add new option "showtoc"

Add new option "showtoc" aimed at displaying, at the beginning of the
SVG file, the list of activities for which there are graphs ("table of
contents"). Each entry consists of a link pointing at the corresponding
activity in the SVG file, enabling the user to quickly navigate through
graphs.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Add a description entry to activity structure
Sebastien GODARD [Fri, 15 Jun 2018 14:58:40 +0000 (16:58 +0200)]
sadf: SVG: Add a description entry to activity structure

Add a description field (.desc) to activity structure.
Use a consistent description for graphs titles displayed by sadf.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Don't take into account activites with no graphs
Sebastien GODARD [Fri, 15 Jun 2018 14:25:10 +0000 (16:25 +0200)]
sadf: SVG: Don't take into account activites with no graphs

In "packed" mode, activities which don't have a graph (e.g. USB devices)
should not be taken into account when calculating SVG canvas height.
Without this patch, a command like:

$ sadf -g -O packed -- -A > output.svg

created a SVG file with some unused white space at its end.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Display graphs for swap utilization in packed mode
Sebastien GODARD [Fri, 15 Jun 2018 14:11:36 +0000 (16:11 +0200)]
sadf: SVG: Display graphs for swap utilization in packed mode

When both memory and swap utilization were selected, graphs for swap
utilization weren't displayed by sadf if option "packed" had been
entered, e.g.:

$ sadf -g -O packed -- -rS > output.svg

This was because SVG canvas height was not big enough. Indeed,
sadf assumed that each activity only needed one row in "packed" mode,
which is wrong for A_MEMORY activity (which requires two rows: One for
memory utilization and one for swap utilization).
This patch fixes the problem.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Use activities identification number for id tags
Sebastien GODARD [Fri, 8 Jun 2018 08:09:53 +0000 (10:09 +0200)]
sadf: SVG: Use activities identification number for id tags

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Remove extra space from output file
Sebastien GODARD [Fri, 8 Jun 2018 07:31:30 +0000 (09:31 +0200)]
sadf: SVG: Remove extra space from output file

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Remove id tag from individual graphs
Sebastien GODARD [Fri, 8 Jun 2018 07:28:47 +0000 (09:28 +0200)]
sadf: SVG: Remove id tag from individual graphs

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoAdd PayPal button to README.md file
Sebastien GODARD [Fri, 8 Jun 2018 06:59:57 +0000 (08:59 +0200)]
Add PayPal button to README.md file

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoStarting sysstat-12.0.0
Sebastien GODARD [Fri, 1 Jun 2018 08:58:41 +0000 (10:58 +0200)]
Starting sysstat-12.0.0

Update sysstat version number in configure script.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosysstat-11.7.4 v11.7.4
Sebastien GODARD [Fri, 1 Jun 2018 08:46:07 +0000 (10:46 +0200)]
sysstat-11.7.4

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

This version adds several new options to control:

o the number of decimal places used by sysstat commands (sar,
cifsiostat, iostat, mpstat and pidstat),

o the network interfaces, block devices and filesystems for which
statistics shall be displayed by sar or sadf.

Note that this version also redefines the metric kbmemused (amount of
used memory displayed by sar) to be consistent with the output of
commands such as top(1) and free(1). See sar's manual page.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate NLS translations
Sebastien GODARD [Fri, 1 Jun 2018 08:29:24 +0000 (10:29 +0200)]
Update NLS translations

Sync with The Translation Project.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Remove unneeded test
Sebastien GODARD [Mon, 28 May 2018 06:42:00 +0000 (08:42 +0200)]
sadf: SVG: Remove unneeded test

Only the relevant devices have been saved. So we don't need to check if
current device actually belongs to the list before displaying it.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Fix coredump problem when --dev option used
Sebastien GODARD [Sat, 26 May 2018 15:47:18 +0000 (17:47 +0200)]
sadf: SVG: Fix coredump problem when --dev option used

Function svg_print_disk_stats() should allocate only the necessary
number of slots when a list of devices has been entered on the
command line with option "--dev=".

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadf: Move common code to new function
Sebastien GODARD [Sat, 26 May 2018 09:12:48 +0000 (11:12 +0200)]
sar/sadf: Move common code to new function

Create new function to get the name of the device.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadf: Update manual pages
Sebastien GODARD [Mon, 21 May 2018 14:37:25 +0000 (16:37 +0200)]
sar/sadf: Update manual pages

Explain new options "--dev=", "--fs=" and "--iface=".

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: SVG: Adjust canvas height
Sebastien GODARD [Sun, 20 May 2018 15:21:13 +0000 (17:21 +0200)]
sadf: SVG: Adjust canvas height

Canvas height used for SVG output (sadf -g) should be adjusted if a list
of devices has been entered on the command line.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Allow user to select filesystems to display
Sebastien GODARD [Sun, 20 May 2018 14:54:25 +0000 (16:54 +0200)]
sadf: Allow user to select filesystems to display

Add new option "--fs=<fs_list>". It has the same meaning as for
sar. This may be especially useful for SVG output for which it is
difficult to "grep" a particular device. Using this new option makes
it possible for the user to draw graphs only for the desired
block device(s) and not for all of them.

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