sadc: Make sure nr of items are always counted for certain activities
Commit f81fc24 modified sadc so that the number of items are counted
only for activities which are collected by sadc.
In fact certain activities need to be counted even if they are not
collected. This is the case for A_CPU: We need to know the number of CPU
for various reasons (from displaying the report header to saving it in
the header of a new saXX datafile).
So add a new flag (AO_ALWAYS_COUNTED) to indicate which activities
should always be counted, be they collected or not.
Huang Ying [Sun, 3 Mar 2019 06:11:29 +0000 (14:11 +0800)]
Fix missing "}" and "]" in JSON output when stopped by SIGINT
When mpstat is stopped by SIGINT, the JSON output will miss the
trailing "}" and "]" because SIGINT handler isn't called. Fixed this
via setup SIGINT handler for JSON output too.
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.