]> granicus.if.org Git - sysstat/log
sysstat
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 years agosar: Allow user to select filesystems to display
Sebastien GODARD [Sun, 20 May 2018 14:26:28 +0000 (16:26 +0200)]
sar: Allow user to select filesystems to display

Add new option "--fs=<fs_list>" to allow the user to specify which
filesystems to display. This option is to be used with option -F.
Sample output:

$ sar -F
Linux 4.4.14-200.fc22.x86_64 (home) 05/20/18 _x86_64_ (8 CPU)

16:15:20  [...] %fsused  %ufsused     Ifree     Iused %Iused FILESYSTEM
16:20:00          51.59     56.75   1673107    248253  12.92 /dev/sda11
16:20:00          14.74     21.56     63602       398   0.62 /dev/sda5
16:20:00           1.87      6.96  19056634    145414   0.76 /dev/sda7
16:20:00          26.54     31.64   6341145     64999   1.01 /dev/sda8
16:20:00           5.31     10.39  19201270       778   0.00 /dev/sda6
[...]

$ sar -F --fs=/dev/sda5,/dev/sda8
Linux 4.4.14-200.fc22.x86_64 (home) 05/20/18 _x86_64_ (8 CPU)

16:15:20  [...] %fsused  %ufsused     Ifree     Iused %Iused FILESYSTEM
16:20:00          14.74     21.56     63602       398   0.62 /dev/sda5
16:20:00          26.54     31.64   6341145     64999   1.01 /dev/sda8
[...]

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadf: "--iface=" option: Allocate only the necessary slots
Sebastien GODARD [Sat, 19 May 2018 14:24:12 +0000 (16:24 +0200)]
sar/sadf: "--iface=" option: Allocate only the necessary slots

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Allow user to select block devices to display
Sebastien GODARD [Wed, 16 May 2018 12:50:29 +0000 (14:50 +0200)]
sadf: Allow user to select block devices to display

Add new option "--dev=<dev_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>
6 years agosar: Allow user to select block devices to display
Sebastien GODARD [Wed, 16 May 2018 12:41:55 +0000 (14:41 +0200)]
sar: Allow user to select block devices to display

Add new option "--dev=<dev_list>" to allow the user to specify which
block devices to display. This option is to be used with option -d.
Sample output:

$ sar -dp
Linux 4.4.14-200.fc22.x86_64 (home) 05/12/18 _x86_64_ (8 CPU)

10:35:29          DEV       tps     rkB/s     wkB/s   areq-sz [...]
10:35:31          sda     17.00    142.00     14.00      9.18
10:35:31         sda1      0.00      0.00      0.00      0.00
10:35:31         sda2      0.00      0.00      0.00      0.00
10:35:31         sda3      0.00      0.00      0.00      0.00
10:35:31         sda4      0.00      0.00      0.00      0.00
10:35:31         sda5      0.00      0.00      0.00      0.00
10:35:31         sda6      0.00      0.00      0.00      0.00
10:35:31         sda7      0.00      0.00      0.00      0.00
10:35:31         sda8     15.50    142.00      4.00      9.42
10:35:31         sda9      0.00      0.00      0.00      0.00
10:35:31        sda10      0.00      0.00      0.00      0.00
10:35:31        sda11      1.50      0.00     10.00      6.67
[...]

$ sar -dp --dev=sda,sda8
Linux 4.4.14-200.fc22.x86_64 (home) 05/12/18 _x86_64_ (8 CPU)

10:35:29          DEV       tps     rkB/s     wkB/s   areq-sz [...]
10:35:31          sda     17.00    142.00     14.00      9.18
10:35:31         sda8     15.50    142.00      4.00      9.42
[...]

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar/sadf: "--iface=" option: Code refactoring
Sebastien GODARD [Wed, 16 May 2018 12:01:55 +0000 (14:01 +0200)]
sar/sadf: "--iface=" option: Code refactoring

Make code ready for the addition of future options ("--dev=",
"--fs="...)

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosadf: Allow user to select interfaces to display
Sebastien GODARD [Sun, 13 May 2018 13:58:33 +0000 (15:58 +0200)]
sadf: Allow user to select interfaces to display

Add new option "--iface=<iface_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
interface(s) and not for all of them.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: "--iface=" option: Small optimization
Sebastien GODARD [Sun, 13 May 2018 13:56:39 +0000 (15:56 +0200)]
sar: "--iface=" option: Small optimization

Don't look for previous statistics sample if current network device will
not be displayed.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Allow user to select interfaces to display
Sebastien GODARD [Sat, 12 May 2018 08:31:50 +0000 (10:31 +0200)]
sar: Allow user to select interfaces to display

Add new option "--iface=<iface_list>" to allow the user to specify which
network interfaces to display. This option is to be used with options
"-n DEV" and "-n EDEV".
Sample output:

$ sar -n DEV
Linux 4.4.14-200.fc22.x86_64 (home) 05/12/18 _x86_64_ (8 CPU)

10:35:29        IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s [...]
10:35:31           lo      0.00      0.00      0.00      0.00
10:35:31       virbr0      0.00      0.00      0.00      0.00
10:35:31       wlp5s0      0.00      0.00      0.00      0.00
10:35:31    virbr0-nic      0.00      0.00      0.00      0.00
10:35:31       enp6s0     49.00     41.00     29.17      6.47
10:35:33           lo      0.00      0.00      0.00      0.00
10:35:33       virbr0      0.00      0.00      0.00      0.00
10:35:33       wlp5s0      0.00      0.00      0.00      0.00
10:35:33    virbr0-nic      0.00      0.00      0.00      0.00
10:35:33       enp6s0   1033.50    608.50    993.34    116.88
[...]

$ sar -n DEV --iface=virbr0,enp6s0
Linux 4.4.14-200.fc22.x86_64 (home) 05/12/18 _x86_64_ (8 CPU)

10:35:29        IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s [...]
10:35:31       virbr0      0.00      0.00      0.00      0.00
10:35:31       enp6s0     49.00     41.00     29.17      6.47
10:35:33       virbr0      0.00      0.00      0.00      0.00
10:35:33       enp6s0   1033.50    608.50    993.34    116.88
[...]

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate manual pages
Sebastien GODARD [Thu, 10 May 2018 12:29:54 +0000 (14:29 +0200)]
Update manual pages

Explain new option: "--dec=..."

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoAllow user to select number of decimal places
Sebastien GODARD [Thu, 10 May 2018 12:23:22 +0000 (14:23 +0200)]
Allow user to select number of decimal places

Add new option: "--dec={0|1|2}" which can be used to specify the number
of decimal places.
This option can be used with sar, mpstat, iostat, pidstat and
cifsiostat.
Sample output:

$ sar -b
Linux 4.4.14-200.fc22.x86_64 (home) 05/10/18 _x86_64_ (8 CPU)

10:58:14     LINUX RESTART (8 CPU)

11:00:01          tps      rtps      wtps   bread/s   bwrtn/s
11:05:10        25.20     21.22      3.97   1884.87    644.03
11:10:10        10.02      8.60      1.42    633.84     33.87
11:15:10         0.89      0.16      0.73      2.11     73.44
11:20:04         5.65      3.27      2.37    102.24    104.44
[...]

$ sar -b --dec=1
Linux 4.4.14-200.fc22.x86_64 (home) 05/10/18 _x86_64_ (8 CPU)

10:58:14     LINUX RESTART (8 CPU)

11:00:01          tps      rtps      wtps   bread/s   bwrtn/s
11:05:10         25.2      21.2       4.0    1884.9     644.0
11:10:10         10.0       8.6       1.4     633.8      33.9
11:15:10          0.9       0.2       0.7       2.1      73.4
11:20:04          5.6       3.3       2.4     102.2     104.4
[...]

$ sar -b --dec=0
Linux 4.4.14-200.fc22.x86_64 (home) 05/10/18 _x86_64_ (8 CPU)

10:58:14     LINUX RESTART (8 CPU)

11:00:01          tps      rtps      wtps   bread/s   bwrtn/s
11:05:10           25        21         4      1885       644
11:10:10           10         9         1       634        34
11:15:10            1         0         1         2        73
11:20:04            6         3         2       102       104
[...]

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoUpdate sar manual page
Sebastien GODARD [Wed, 2 May 2018 09:27:49 +0000 (11:27 +0200)]
Update sar manual page

Indicate how the amount of memory used is calculated.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agosar: Change how memory used (kbmemused) is calculated
Sebastien GODARD [Wed, 2 May 2018 09:19:21 +0000 (11:19 +0200)]
sar: Change how memory used (kbmemused) is calculated

Previously sar calculed the amount of memory used as:
kbmemused = total installed memory - kbmemfree

This definition (which is not wrong per se) was a source of confusion
for many users who saw a different result with top(1) or free(1):

$ sar -r 0
Linux 4.4.14-200.fc22.x86_64 (kluane.home)  05/02/18  _x86_64_
(8 CPU)

11:23:48    kbmemfree   kbavail kbmemused  %memused kbbuffers ...
11:23:48      5212508   6581460   2943100     36.09    184272 ...

$ free
              total        used        free      shared  buff/cache...
Mem:        8155608     1242092     5213088       28288     1700428...
Swap:      16777212           0    16777212

This patch changes how sar calculates the amount of memory used to get
the same result as top(1) or free(1):

kbmemused = total installed memory - kbmemfree - kbbuffers - kbcached -
kbslab

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agopidstat: Fix typo in comment
Sebastien GODARD [Sat, 28 Apr 2018 14:07:55 +0000 (16:07 +0200)]
pidstat: Fix typo in comment

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoSmall update in README.md file
Sebastien GODARD [Thu, 26 Apr 2018 08:23:44 +0000 (10:23 +0200)]
Small update in README.md file

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoFix #179: pidstat displays incorrect thread names with -t and -l options
Sebastien GODARD [Thu, 26 Apr 2018 08:20:23 +0000 (10:20 +0200)]
Fix #179: pidstat displays incorrect thread names with -t and -l options

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
6 years agoStarting sysstat-11.7.4
Sebastien GODARD [Fri, 6 Apr 2018 12:54:06 +0000 (14:54 +0200)]
Starting sysstat-11.7.4

Update sysstat version number in configure script.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
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>