SVG: Draw txkB/s and rxkB/s network metrics to scale
The metrics are expressed in kB/s whereas the corresponding counters are
saved in B/s. So recalculate min and max values in kB/s before drawing
graphs.
Sebastien GODARD [Wed, 24 Feb 2016 10:47:07 +0000 (11:47 +0100)]
SVG: Explicitly pass structures to be compared
The structures which will be scanned to check for min/max values need to
be explicitly passed to save_extrema() function. Indeed, for activities
with several items (eg. network statistics), we will need to scan each
item structure independently.
Sebastien GODARD [Mon, 22 Feb 2016 17:26:34 +0000 (18:26 +0100)]
SVG: Init newly allocated strings
Graph definition is made of successive SVG "path" commands concatenated
together. Make sure that the strings allocated to receive these definitions
are initialized before being used.
Sebastien GODARD [Fri, 19 Feb 2016 09:37:05 +0000 (10:37 +0100)]
SVG: Add SVG output for task creation and system switching activity.
Update sadf's SVG ouptput to create graphs for task creation and system
switching activity (this corresponds to the output of sar -w).
This is just a proof of concept.
Try it with "sadf -g /your/sa/datafile -- -w > out.html" and open
the resulting HTML file in your web browser.
Sebastien GODARD [Mon, 15 Feb 2016 16:36:48 +0000 (17:36 +0100)]
Add new FO_NO_TRUE_TIME flag
Define a new flag indicating that the timestamp cannot be displayed in
the original local time of the data file creator.
This flag will be used by the SVG output format, which also means that
the user won't be able to use sadf's option -t with this format.
read_next_sample() function didn't fill the timestamp for special
records (COMMENT or RESTART ones) that had to be ignored.
So add a new flag (SET_TIMESTAMPS) to tell read_next_sample() function
to set the timestamps for special records when this is needed.
Sebastien GODARD [Tue, 26 Jan 2016 21:43:23 +0000 (22:43 +0100)]
JSON: Don't display fchosts tag when no stats exist
The JSON print function can be called for A_NET_FC (Fibre Channel)
activity even if no statistics exist. This is because this activity has
the AO_CLOSE_MARKUP flag used to close the "network" section of the
output. Anyway, in this case (when no stats exist), it should only do
that (close the network section) et not display the "fchost" tag.
Sebastien GODARD [Mon, 25 Jan 2016 07:24:17 +0000 (08:24 +0100)]
Move JSON specific code to its corresponding function
A bit of code was specific to JSON output. So move this code to the
f_timestamp function used by JSON output format, so that the main code
remains generic.
Sebastien GODARD [Fri, 22 Jan 2016 12:57:42 +0000 (13:57 +0100)]
Move format specific code to its corresponding function
Incrementing tab variable was specific to XML output. So move this code
to the f_timestamp function used by XML output format, so that thee main
code remains generic.
Sebastien GODARD [Sat, 26 Dec 2015 09:03:26 +0000 (10:03 +0100)]
Starting sysstat 11.3.1
Update sysstat number in configure script.
This version is the first one of the new 11.3 development series,
including all the new features in addition to the bugfixes included
in the 11.2 stable series.
Sebastien GODARD [Fri, 18 Dec 2015 08:23:22 +0000 (09:23 +0100)]
sadf: Fix bug preventing sadf from converting an old format datafile
Version 11.1.5 added a check on file_magic.header_size present in the
header of a data file.
An error message should not be displayed if this check is not successful
when sadf is used to convert the data file (sadf -c) or used to display
its header contents (sadf -H).
Sebastien GODARD [Sat, 12 Dec 2015 10:36:54 +0000 (11:36 +0100)]
sar: Check for items upper limit before reading a datafile
Commit 7ebfd7e added a check for items upper limit used by sadc before
appending data to a file.
This commit adds the same kind of check used by sar before reading a
data file.
Sebastien GODARD [Wed, 11 Nov 2015 17:38:46 +0000 (18:38 +0100)]
Fix default value for number of subitems for A_PWR_WGHFREQ activity
Default value should be -1 for nr2 field (number of different
frequencies for A_PWR_WGHFREQ activity).
A values of -1 means that the corresponding number has still not been
calculated by the f_count2() function.
This is consistent with default values used for nr field.
mpstat's option -I now accepts a list of comma-separated arguments (SUM,
CPU, SCPU, ALL).
Eg. "mpstat -I SUM,SCPU".
Previous syntax can still be used ("mpstat -I SUM -I SCPU").
Rework mpstat's code (especially code that handles per-CPU interrupts
statistics: mpstat -I { CPU | SCPU }).
This new code better deals with special cases than can occur for per
processor interrupts statistics:
1) If the last interrupt in list (ie. in file /proc/interrupts or
/proc/softirqs) was unregistered then the header line was not updated.
This is now fixed.
2) If at least two consecutive interrupts were unregistered in the same
time interval then the statistics for all the following interrupts
couldn't be calculated for one period (values were displayed as "N/A").
This is now fixed.
3) If at least two consecutive interrupts were newly registered in the
same time interval then the statistics for all the following interrupts
couldn't be calculated for one period (values were displayed as "N/A").
This is now fixed.
4) When a new interrupt was registered (ie. appeared in file
/proc/interrupts or /proc/softirqs) then its value was displayed as not
available (N/A) for the first period. Now assume that its counter has
started from zero so that a value can be displayed.
Sebastien GODARD [Sun, 25 Oct 2015 15:00:20 +0000 (16:00 +0100)]
sar: Check min size of sa data file header
The size of an sa data file header may be greater than expected (should
we read a data file from eg. a future sysstat version), but it cannot be
smaller than current version's header size (else we wouldn't be able to
interpret the header contents).
Sebastien GODARD [Sun, 25 Oct 2015 14:13:59 +0000 (15:13 +0100)]
sadc: Fix insecure data handling, really
Commit 7ebfd7e checked upper bounds of values read from a possibly
tainted data file.
Add a lower bounds check to really fix the insecure data handling.
CID #29720.
Sebastien GODARD [Fri, 16 Oct 2015 09:22:23 +0000 (11:22 +0200)]
sar/sadc: Check for items upper limits
Check for items upper limits before displaying stats or creating an sa
data file.
This is made necessary because we check for these same limits when we
read data from a possibly tainted sa data file.
Also rename constant names to indicate that their values are actually
the maximum number of items that sar/sadc can handle.
Sebastien GODARD [Sun, 11 Oct 2015 14:14:05 +0000 (16:14 +0200)]
sadc: Fix insecure data handling
In open_ofile() function in sadc.c: Some values were read from a
(possibly tainted) sa datafile then used to allocate memory without
being checked before.
So set some limits for each possible items, and check that their number
(as read from an sa datafile) doesn't exceed their corresponding limit.
Add new S_COLORS_SGR environment variable to give the user the
possibility to customize the colors used to display statistics for
iostat, mpstat and sar commands.