YESTERDAY variable can now be changed in the generic configuration file.
For people logging every 1 min, generating the summary at 23:53 is not good
enough: 7 minutes of data points are lost. What is needed is to generate
the summary early in the next day. In order to generate yesterday's
summary without recompiling you can now add the following line in config:
YESTERDAY="--date=yesterday"
Sebastien GODARD [Mon, 30 Mar 2015 16:42:03 +0000 (18:42 +0200)]
Make JSON output consistent with XML one
Use only header "cpu-load" for both "sar -u" and "sar -u ALL"
statistics (header "cpu-load-all" is removed). This is what is
done in XML output. So do the same here for JSON output.
Sebastien GODARD [Sun, 29 Mar 2015 15:27:31 +0000 (17:27 +0200)]
XML output modified to enable proper validation
XML document header modified so that it can be validated against the XSD
document.
Also always use cpu-load header for CPU activity (cpu-load-all has been
removed).
Sebastien GODARD [Sun, 29 Mar 2015 15:23:30 +0000 (17:23 +0200)]
DTD and XSD documents updated
DTD and XSD documents updated so that XML data, as displayed by sadf -x,
can now be properly validated against them.
Several typos have also been corrected.
Some missing elements or attributes (for memory activity, filesystem
activity) have been added.
Sebastien GODARD [Fri, 27 Mar 2015 15:52:27 +0000 (16:52 +0100)]
Use proper length for mountp string
We read 256 chars for the mountpoint name to (try to) be sure to get it
all, and so ths statvfs() function won't fail in read_filesystem()
function.
Yet only MAX_FS_LEN chars should be saved in stats_filesystem structure.
Sebastien GODARD [Thu, 19 Mar 2015 20:22:55 +0000 (21:22 +0100)]
Call chkconfig only if $(COPY_ONLY) is set to no
Call chkconfig (or create corresponding links) only if
$(COPY_ONLY) variable is set to no.
The chkconfig command doesn't take into account the $(DESTDIR) variable
contents, trying to create links outside the $(DESTDIR) tree, which can
be considered as a way to activate sysstat service.
Sebastien GODARD [Thu, 12 Mar 2015 20:39:58 +0000 (21:39 +0100)]
pidstat: Don't stop if gtime and cgtime fields are unavailable
With some old 2.6 kernels, fields "gtime" and "cgtime" (which are
expected to be read from /proc/#/stat file) may not be present.
pidstat used to stop should this case happens.
Fix this since these fields are not mandatory for pidstat to display its
statistics.
sysstat init script may sometimes be called rc.sysstat
In some distros sysstat init script is called rc.sysstat.
So use that name with chkconfig and when uninstalling, remove links with
names like S??rc.sysstat and K??rc.sysstat.
Peter Schiffer [Wed, 11 Feb 2015 18:21:12 +0000 (19:21 +0100)]
Portable way to detect 64 bit OS in configure script
Different architectures have different format of /proc/cpuinfo and also, only
i386 and x86_64 archs support cpu flags. Using "getconf LONG_BIT" command it's
possible to detect 64 bit OS on multiple different architectures. This patch was
successfully tested on i386, x86_64, s390x, ppc64 and aarch64 archs.
Sebastien GODARD [Tue, 27 Jan 2015 11:23:50 +0000 (12:23 +0100)]
Better handling of get_activity_position() return value
Function get_activity_position() can return -1 on error, ie. when
corresponding activity hasn't been found in array.
This return code was sometimes not tested because we knew that the
activity existed. So we directly used the return code as array index.
Strengthen things now: If such an activity is not found then display an
internal error message and exit.
Sebastien GODARD [Fri, 23 Jan 2015 20:33:52 +0000 (21:33 +0100)]
Add new sadc_options variable to configure script
Add a new variable (sadc_options) used by the configure script.
This option enables the user to enter parameters that will be passed to
sadc in the sa1 script. This can typically be used to select optional
activities that should be collected by sadc.
Sebastien GODARD [Wed, 21 Jan 2015 10:02:46 +0000 (11:02 +0100)]
Update sysstat spec file
RPM spec file for sysstat package has been updated:
1) Now use --disable-file-attr option with configure to allow a non
privileged user to build the package,
2) Remove %attr directive which cannot be applied on symlinks listed in
%files section.
Sebastien GODARD [Mon, 19 Jan 2015 20:40:33 +0000 (21:40 +0100)]
Rename --disable-man-group option to --disable-file-attr
This option was originally intended to prevent the configuration process
from setting the group ID for manual pages that were installed.
It is now also used to tell the build process to not set the user and
group of the /var/log/sa directory when it is created.
This option may be useful when creating an RPM package with a non
privileged user.
Sebastien GODARD [Sun, 16 Nov 2014 15:06:31 +0000 (16:06 +0100)]
sadc/sar: New /proc/meminfo fields to memory statistics
Five new fields have been added to memory statistics displayed by sar.
These new fields are part of A_MEMORY activity and will be displayed
using option "-r ALL" with sar.
No layout format incompatible change with this patch: The datafile
created by this version of sar can still be read by a previous version
of sar (though the new fields won't be displayed of course as they are
unknown by this old version).
Various outputs from sadf (JSON, XML, etc.) have been updated to take
into account these new metrics.
Originally suggested by Peter Portante (@portante).
Fix description of %util in iostat and sar manual pages
Description of %util in iostat manual page was not accurate, because it
is not percentage of CPU time, but percentage of elapsed time during
which I/O requesrt were issued to the device.
Also make sar manual page consistent with that of iostat.
sadc: Fix possible race condition in signal handler code
Commit 1b52f939 tried to stop sending SIGINT to init process.
But there may be very small time window between parent ID
validation and sending kill signal to parent. If sar dies
during this window (though the chance is very small) we end up
sending signal to init.
Sebastien GODARD [Sat, 18 Oct 2014 13:35:43 +0000 (15:35 +0200)]
sadc: Don't send signal if parent process is already dead
If sar (parent of sadc) dies before sadc completes its job
then init will become sadc parent. Now if we pass SIGINT to
sadc, it will pass that to init process and result in system
reboot.
This patch check parent process before sending signal.
Test case:
Run sar_test script in shell prompt and press ctrl+C twice.
cat sar_test
while true; do /usr/local/bin/sar -n DEV 1 3; sleep 3; done
Sebastien GODARD [Sat, 18 Oct 2014 13:03:07 +0000 (15:03 +0200)]
Add irqstat command
Add new "irqstat" command (contributed by Lance Shelton from
SanDisk/Fusion-io). This command monitors /proc/interrupts and is
designed for NUMA systems with many processors.
irqstat is currently a Python script that you can find in the contrib
directory.
Sebastien GODARD [Sun, 12 Oct 2014 13:07:26 +0000 (15:07 +0200)]
Add irqtop command
Add new "irqtop" command (contributed par Robert Elliott from HP).
This command monitors differences in /proc/interrupts and
/proc/softirqs per CPU, along with CPU statistics.
irqtop is currently a Perl script that you can find in the contrib
directory.
This patch makes sure that sadc doesn't count items several times.
Items here means CPU, network interfaces, etc.
sadc needs to count these items to allocate its structures for each
selected activity. But there are different activities based on the same
items (eg. A_CPU, A_PWR_CPUFREQ and A_PWR_WGHFREQ are all related to CPU
activities, or A_NET_DEV and A_NET_EDEV are related to network
interfaces). And so, when different activities based on the same
items were selected, the number of these items was counted several
times, which is inefficient.
cifsiostat/nfsiostat: Fix output on single core CPU
Uninitialized variable led to wrong numbers being displayed by
cifsiostat and nfsiostat on single core CPU. On multi core machines
reported numbers are correct.
Fix incomplete sar output when end time crosses 24H boundary
sar output was incomplete when used with a file containing data
from two consecutive days and end time crossed 24 hour boundary.
A typical invocation like:
sar -A -s 21:50:00 -e 01:30:00 -f /path/to/datafile
resulted in CPU statistics being displayed only.
This patch fixes the problem and all selected activities are now
displayed.
Sebastien GODARD [Sat, 16 Aug 2014 14:01:45 +0000 (16:01 +0200)]
Update sadf -H output
Update sadf -H output to:
1) display the date the file was created
2) tell whether this is a genuine sa datafile (ie. not converted from an
old datafile) or not.
Option -c added to sadf: Upgrade an old sa datafile
This patch adds option -c to sadf. This option enables the user to
upgrade ("convert") an old system activity datafile (version 9.1.6 and
later) to the up-to-date format (11.1.1 as of today).
Enter "sadf -c old_datafile >new_datafile".
Scheduling policies are defined in <linux/sched.h>. But old kernels lack
some policies added in more recent ones. So define them in pidstat.h if
they are unknown in <linux/sched.h>.
"sar -1 -f" output was different than "sar -f -1" one.
So now enforce options check more aggressively: You cannot enter a day
offset (eg. -1) together with option -f (which tells here to use the
standard sa datafile).