Sebastien GODARD [Sat, 21 Jan 2017 08:30:37 +0000 (09:30 +0100)]
Add new regression tests
These tests make sure that sadf can convert a binary data file with an
old format to the up-to-date format, and also that sar can read old
datafiles (which may have been converted or not).
Sebastien GODARD [Sat, 21 Jan 2017 07:43:07 +0000 (08:43 +0100)]
Fix comment in /etc/sysconfig/sysstat file
When HISTORY is set to a value greater than 28, then logfiles are no
longer kept in multiple directories, but are named saYYYYMMDD providing
that sadc's option -D has been used.
Sebastien GODARD [Sun, 15 Jan 2017 13:24:47 +0000 (14:24 +0100)]
Remove isag support
isag (Interactive System Activity Grapher) is a script used to graph sar
data contributed by David Doubrava.
Though it is still included in sysstat package in the contrib directory,
it was no longer maintained and is now made deprecated by sadf and its
switch -g which can draw graphs in SVG format.
So remove all the options related to isag from Makefile and configure
scripts.
Sebastien GODARD [Sat, 14 Jan 2017 16:13:40 +0000 (17:13 +0100)]
Fix insecure data handling (Coverity CID#139643)
Quieten Coverity (CID#139643):
Copying hl without checking the length might overrun the 512-character
fixed-size string field. So use strncpy() function instead of strcpy().
Sebastien GODARD [Wed, 11 Jan 2017 12:23:12 +0000 (13:23 +0100)]
SVG: Give actual canvas height
Add a comment at the end of SVG output that indicates the actual canvas
height.
The actual height is frequently different (i.e. smaller) than that
indicated in the header of the SVG output. This is because some
activities have pre-allocated entries that don't result in graphs being
drawn, or because option 'skipempty' has been used.
Remove memory statistics from sar (those displayed by sar -R, not
sar -r!) I have always considered those data displayed by sar as a
"mistake from my youth". They are not related to the speed of any
specific device (except maybe CPU, but there are other means to
measure CPU speed...), so displaying data per second is just irrelevant.
Cast values to (unsigned long long) before calling pval()
pval() function, used by sadf for its raw output format, assumes values
type is unsigned long long. So cast the values to that type before
calling this function.
Sebastien GODARD [Sun, 18 Dec 2016 09:42:10 +0000 (10:42 +0100)]
sadf: Add new output format: raw (part 1)
Add a new output format to sadf to display statistics saved in a binary
data file in raw format. Counters values are displayed "as is", without
trying to calculate an average value over the elapsed time interval.
This is something I have selfishly wanted to have for a long time now,
mainly for debugging purpose.
This first patch adds all the necessary global functions, and implements
the raw format only for CPU and task creation/system switching
statistics.
When a newly registered device (network interface or disk) was
supernumerary (i.e. there was no slot left in the list to store it), it
would take the place of another device in the list. This other device
would also appear as new and its counters would jump as if starting from
zero. This patch fixes that.
Sebastien GODARD [Sun, 20 Nov 2016 18:06:54 +0000 (19:06 +0100)]
sar/mpstat: Allow selection of a range of IRQ/CPU
Update sar so that the user can now select a range of interrupts with
option -I (in addition to selecting individual interrupts).
E.g. "sar -I 2,5,10-16,400- (...)"
Keyword XALL is removed with option -I.
Keyword ALL selects all possible interrupts, including the sum of them.
Also update mpstat so that the user can select a range of processors
with option -P (in addition to selecting individual processors).
E.g. "mpstat -P all,0,5-7 (...)"
Sebastien GODARD [Sun, 20 Nov 2016 09:28:35 +0000 (10:28 +0100)]
mpstat: Rework option -P parsing
It is no longer possibe to specify individual CPUs and also to use
keyword ALL together (e.g. mpstat -P ALL,0,2) which is meaningless.
Also separate options "-P ALL" from "-P ON".
Sebastien GODARD [Sat, 19 Nov 2016 16:53:47 +0000 (17:53 +0100)]
sar: Allow selection of a range of CPU
Update sar so that the user can now select a range of CPUs with option -P
(in addition to selecting an individual CPU). It is also possible to
select CPU "all" which is the global average among all CPUs (not to be
confused with the "ALL" keyword which selects all the CPUs of the
machine).
E.g.:
sar -P 0,3-5,12- Selects CPUs #0, #3, #4, #5, and all the CPUs
from #12 and following.
sar -P all,1 Select CPU #1 and the global average CPU value
among all processors.
Sebastien GODARD [Thu, 17 Nov 2016 11:28:55 +0000 (12:28 +0100)]
iostat: Option -h also imply --human
Using option -h with iostat will also display sizes in human readable
format.
Option -h is already intended to make a report easier to read by a human
(especially when devices names are very long).
Sebastien GODARD [Thu, 17 Nov 2016 09:58:03 +0000 (10:58 +0100)]
sar: Display values in human readable format
Take into account new "--human" option to display values in human
readable format.
Functions cprintf_f() cprintf_u64() are modified to add the unit after
the value if requested.
Only a few options are concerned for sar.
Other commands are updated too, but the option will be activated in
separate patches.
Sebastien GODARD [Sat, 12 Nov 2016 17:21:33 +0000 (18:21 +0100)]
Move available free memory metric into default -r output
Move new "available free memory" metric into the default "sar -r"
output. (It was previously displayed with "sar -r ALL").
Update sar and sadf commands accordingly.
See comments in issue #133.
Breno Leitao [Mon, 31 Oct 2016 13:23:59 +0000 (09:23 -0400)]
sar: Improve cpuinfo read for POWER architecture
Currently CPU frequency is not being read properly on POWER archicture.
It shows the frequency as:
# sar -m CPU 1 5
...
06:30:28 AM CPU MHz
06:30:36 AM all 0.00
This is caused because /proc/cpuinfo is differently between Intel and
POWER.
This patch simply fix the parsing function (read_cpuinfo).
Update sar to display softnet statistics collected by sadc.
Also compute global statistics among all CPU (though these data are not
part of /proc/net/softnet_stat file).
Sebastien GODARD [Fri, 28 Oct 2016 14:48:07 +0000 (16:48 +0200)]
/proc/vmstat fix for Linux 4.8
The 4.8 kernel has some changes in /proc/vmstat which cause sysstat to
report zero values for {pgscank,pgscand}/s in sar -B. The attached
patch fixes this for 4.8 while retaining compatibility with older
kernels.
Sebastien GODARD [Fri, 21 Oct 2016 13:46:44 +0000 (15:46 +0200)]
mpstat, iostat: Use decimal point for FP values in JSON output
This patch sets LC_NUMERIC variable to "C" to make sure JSON output (as
displayed by mpstat and iostat commads) is locale-independent and
floating-point values use a decimal point.
This should make JSON output compliant with RFC7159.
Sebastien GODARD [Fri, 21 Oct 2016 12:52:04 +0000 (14:52 +0200)]
Fix #128: Use decimal point for FP values in JSON output
This patch sets LC_NUMERIC variable to "C" to make sure JSON output (as
displayed by sadf -j) is locale-independent and floating-point values
use a decimal point.
This should make JSON output compliant with RFC7159.
This patch read softnet statistics from the /proc/net/softnet_stat file.
Softnet stats will be collected by default by sadc: So set AO_COLLECTED
flag in corresponding activity structure.
Also metrics' type is unsigned int (%x) and not unsigned long long.
Sebastien GODARD [Fri, 14 Oct 2016 13:35:18 +0000 (15:35 +0200)]
sar: Add softnet statistics (part 1): Basic definitions and structures
Add new switch (-n SOFT) to sar. This option will tell sar to parse
/proc/net/softnet_stat file and display corresponding software-based
network processing statistics.
This first patch defines the needed structures, constants and functions
prototypes.
sar's help message is also updated.
pidstat: Use either short or full command line when looking for a pattern
Use either the command name string or the full command line when looking
for a substring with options -C or -G.
The full command line is used if option -l has been entered, otherwise we
use the short command name string.
Several buffers were used to hold timestamps, with different sizes
(sometimes 16, 32 or 64 characters).
Now define and use a single size for all of them (TIMESTAMP_LEN).