Sebastien GODARD [Sat, 23 Feb 2019 16:13:23 +0000 (17:13 +0100)]
sadf: Don't test for activities available in file if only the header
needs to be displayed
When only the header needs to be displayed with an output format like
e.g. XML then don't test for activities available in file.
E.g.:
sadc -S A_NULL,A_QUEUE datafile 1 2
Then "sadf -Hx datafile" should not display error message "Requested
activities not available in file".
Sebastien GODARD [Sat, 23 Feb 2019 10:15:25 +0000 (11:15 +0100)]
sadf: PCP: Initial support for A_QUEUE activity
This is the initial (and experimental) support for creating PCP archives
by sadf.
I used the work made by Steve Kay (@stevekay) to create this patch: See
issue #136.
At the present time, only A_QUEUE activity is supported (i.e. the
metrics displayed by "sar -q").
Sebastien GODARD [Sat, 23 Feb 2019 09:41:54 +0000 (10:41 +0100)]
sadf: PCP: Add new options "-l" and "pcparchive="
PCP (Performance CoPilot) will be a new output format for sadf.
Add new option "-l" to select this format. The keyword "pcparchive="
used with option -O will indicate the name of the PCP archive file to
create, e.g.:
Sebastien GODARD [Sat, 23 Feb 2019 09:15:55 +0000 (10:15 +0100)]
PCP: Add option --disable-pcp to configuration scripts
PCP (Performance CoPilot) will be suported by default by sysstat if PCP
development libraries are available.
Add a new option (--disable-pcp) to 'configure' script to allow user to
disable PCP support even if PCP libraries are installed.
Sebastien GODARD [Fri, 15 Feb 2019 09:43:39 +0000 (10:43 +0100)]
sysstat-12.1.3
sysstat version 12.1.3 final packaging.
lsm and spec files updated.
Changelog added.
Copyright year updated (2018 > 2019)
With this version, the user will be able to select different color
palettes to draw the SVG graphs with sadf. One of those palettes can be
fully customized using an environment variable (S_COLORS_PALETTE).
This version also adds a new flag (-f) to sadc to force fdatasync() use
when data are written (this feature has been contributed by Kyle
Walker).
Kyle Walker [Wed, 30 Jan 2019 12:50:55 +0000 (07:50 -0500)]
sadc: Add a -f flag to force fdatasync() use
For quite some time, the sadc utility has not used fdatasync() when writing
stat information to disk. This resulted in instances where data files could
be corrupted or entries lost if a system encountered a sudden reset
condition. This change adds a "-f" flag which can be used to bring back the
previous behaviour if end users require it.
Note, the fdatasync() lowers the likelihood of lost data, but does so at
the expense of performance within the write operation.
Sebastien GODARD [Sun, 20 Jan 2019 09:05:04 +0000 (10:05 +0100)]
sadf: SVG: Allow user to customize color palette
Add a new environment variable (S_COLORS_PALETTE) that can be used to
customize the color palette used by sadf to draw its graphs.
This variable is taken into account when the custom color palette has
been selected ("sadf -g -O customcol (...)").
The contents of this variable is a colon-separated list of six-digit,
three-byte hexadecimal numbers (hex triplets) that represent colors.
Detailed explanations will be given in sadf manual page.
Sebastien GODARD [Fri, 11 Jan 2019 15:31:30 +0000 (16:31 +0100)]
sadf: SVG: Add new "customcol" option
Add a new option to sadf SVG output.
Entering something like "sadf -g -O customcol (...)" enables the user to
select a second distinct color palette that will be used to draw the
graphs.
This second palette is intended to be fully customizable by the user.
Sebastien GODARD [Fri, 14 Dec 2018 14:36:19 +0000 (15:36 +0100)]
sysstat-12.1.2
sysstat version 12.1.2 final packaging.
lsm and spec files updated.
Changelog added.
This version adds support for discard I/O statistics to iostat and sar
commands. Discard I/Os have been separated from writes in Linux kernel
4.19.
This version also fixes several important bugs.
sadf: Add discard I/O metric to all "sar -b" output formats
In addition to "sar -d" statistics, new discard I/O metrics should also be
available for "sar -b" statistics. Add these metrics to sadf output
formats.
"sar -b" statistics are calculated as the sum of individual
statistics for each whole device in the system. Since discard I/Os are
now separated from writes in the kernel, take them into account when
calculating "sar -b" statistics.
New fields are added to "sar -b" output: dtps and bdscd/s.
Check that structure's size is greater than 0 even for
unknown activities.
Else trying to skip this unknown activity in read_file_stat_bunch()
function will decrease offset pointer in file and result in an
infinite loop:
rd_stats.h: Reorder fields in stats_disk structure
New field dc_ticks must be added *after* all other fields of same type
("unsigned int" here). This is compulsory to make older versions of
sar/sadf able to read this structure.
Todd Walton [Tue, 27 Nov 2018 19:24:40 +0000 (14:24 -0500)]
Clarify sadc(8) on using multiple -S keywords
I modified man/sadc.in to show the -S option being followed by
"keyword", and then listed the keywords. This allows the syntax to more
clearly show that multiple keywords can be specified by comma-separating
them. It also reflects the language used in sar(1) for the -n option.
Also, I modified the FAQ to call out that one can specify multiple
keywords for -S by comma-separating them.
Sebastien GODARD [Mon, 26 Nov 2018 13:32:05 +0000 (14:32 +0100)]
Fix #196 and #199: Out of bound reads security issues
Check args before calling memmove() and memset() in remap_struct()
function to avoid out of bound reads which would possibly lead to
unknown code execution and/or sadf command crash.
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).
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.
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.
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.
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.
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)
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.
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.
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.
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.
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:
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: