diff --git a/CHANGES b/CHANGES new file mode 100644 index 00000000..7782e69b --- /dev/null +++ b/CHANGES @@ -0,0 +1,1539 @@ +Changes: + +2010/09/12: Version 9.1.5 - Sebastien Godard (sysstat orange.fr) + * Added voltage inputs statistics to sar and sadc. + * Added %temp field to device temperature statistics (sar -m TEMP). + * Added drpm field to fan speed statistics (sar -m FAN). + * XSD and DTD documents updated. + * sar manual page updated. Indicate that svctm field should + no longer be trusted. + * Removed link to isag(1) from man pages. + * NLS updated. Czech translation added. + * Sample crontabs and sysstat init script: Don't collect disk + data by default. + * Code cleaned. + +2010/07/29: Version 9.1.4 - Sebastien Godard (sysstat orange.fr) + * [Jan Kaluza]: Added fan speed and device temperature + statistics to sar and sadc. + * [Jan Kaluza]: Configure script updated. Now check for + lm_sensors library. + * Configure script updated: Added --disable-sensors option. + * Configure script updated: Removed --enable-smp-race option. + * iconfig script updated. + * sar manual page updated. + * XSD and DTD documents updated. + * [Ivana Varekova]: sysstat init script updated. + * Default owner for sadc/sar crontab is now root. + * Various fixes in cifsiostat and nfsiostat manual pages. + * NLS updated. + +2010/06/27: Version 9.1.3 - Sebastien Godard (sysstat orange.fr) + * [Ivana Varekova]: Move NFS code out from iostat and create + the new nfsiostat command. + * [Ivana Varekova]: Added cifsiostat command. This command + displays CIFS statistics. + * [Mario Konrad]: Added regular expressions support to pidstat's + option -C. + * [Mario Konrad]: Added option -s to pidstat to display stack + statistics. + * [Ivana Varekova]: Fixed condition used by sar to distinguish + betwwen a counter reset by a newly registered device and a + counter overflow. + * [Jan Kaluza]: Added --debuginfo option to iostat. + * [Jan Kaluza]: Added --enable-debuginfo option to configure script. + * iconfig configuration script updated. + * iostat manual page updated. Indicate that svctm field should + no longer be trusted. + * pidstat manual page updated. + * autoconf script updated. + * NLS updated. + * README and CREDITS files updated. + +2010/05/23: Version 9.1.2 - Sebastien Godard (sysstat orange.fr) + * Added r_await and w_await fields to iostat's extended statistics. + * Added support for tickless CPUs in sar and mpstat. + * NLS was not taken into account when mpstat or sar were displaying + some null statistics. This is now fixed. + * sadc no longer syncs data with its output file contents. It + put a pain on flash devices as it undermined any tuning of + the vm's write behavior [DEBIAN Bug#559686]. + * NLS updated. Basque translation added. + * iostat, sar and sa1 manual pages updated. + * CREDITS file updated. + +2010/02/28: Version 9.1.1 - Sebastien Godard (sysstat orange.fr) + * Remove support for kernels older than 2.6.x. + * iostat now takes into account POSIXLY_CORRECT environment + variable. iostat default output for disk utilization is + expressed in kB/s, unless this variable is set (in which case + the output is expressed in blocks/s). + * mpstat can now display per processor software interrupts + statistics. This requires Linux kernel 2.6.31 or later. + * Because of a change in /proc/interrupts file format, mpstat + was no longer counting the proper number of interrupts. This + is now fixed. + * Manual pages updated. + * NLS updated. + * Code cleaned. + +2009/11/11: Version 9.0.6 - Sebastien Godard (sysstat orange.fr) + * "sadf -x" now takes into account options -s and -e (which + specify a starting and ending time) and also interval and + count parameters [DEBIAN bug#546259]. + * Option -C added to sadf. Use it to tell sadf to display comments + present in file (also works with XML format). + * sar and sadf sometimes didn't handle COMMENT records properly. + This is now fixed. + * XML output (displayed by sadf -x) modified for kernel tables + statistics. + * XSD and DTD documents updated. + * [Yibin Shen]: HZ variable was not explicitly set in sadc.c. This + is now fixed. + * [Lans Carstensen]: sargraph added (sargraph is a shell script + used to make graphs based on sadf XML output). + * sadf manual page updated. + * FAQ updated. + * NLS updated. + * CREDITS file updated. + +2009/09/20: Version 9.0.5 - Sebastien Godard (sysstat orange.fr) + * sysstat should now be able to pretty print device names whose + minor numbers are greater than or equal to 256. (Tests have + been made on a large 26TB RHEL5/PP Linux cluster.) + * sadc manual page updated. + * NLS updated. + * FAQ updated. + +2009/07/19: Version 9.0.4 - Sebastien Godard (sysstat orange.fr) + * [Jonathan Kamens]: Fix double free/memory corruption bug + with sadc. + * [Jeroen Roovers]: Get entirely rid of implicit rule for + libsyscom.a in Makefile to fix a problem with parallel + execution. + * sysstat.ioconf configuration file updated. + * NLS updated. + * CREDITS file updated. + +2009/05/24: Version 9.0.3 - Sebastien Godard (sysstat orange.fr) + * [Michael Blakeley]: Option -z added to iostat. This option + tells iostat to omit output for any devices for which there + was no activity during the sample period. + * [Tomasz Pala]: Fix mpstat where interrupt values should be + read as unsigned integers. + * sar -n ALL didn't select IPv6 statistics. This is now fixed. + * iostat, sar and mpstat manual pages updated. + * sadf -x now displays file creation date. + * XSD and DTD documents updated. + * NLS updated. Latvian translation added. + * CREDITS file updated. + * Code cleaned. + +2009/04/02: Version 9.0.2 - Sebastien Godard (sysstat orange.fr) + * sadc can now collect partition statistics in addition to disk ones. + Keywords XDISK and XALL have been added to -S option. + * Fixed a memory corruption in pidstat and iostat. This corruption + could happen when a list of comma-separated values following + option -p was entered on the command line. + * configure now takes into account a new variable named rcdir. + This variable may be used to specify the directory where + startup scripts will be installed. + * The value of directory for installing documentation files + can now be set with configure's --docdir option. + * Fixed a small bug in activity.c file, where there was a + missing semicolon between two fields. + * sar and sadc manual pages updated. + * NLS updated. + * CREDITS file updated. + +2009/03/07: Version 9.0.1 - Sebastien Godard (sysstat orange.fr) + * Fix a crash with sar where a pointer was freed twice. + * NLS updated. + * sar manual page updated. + * CREDITS file updated. + +2009/03/01: Version 9.0.0 - Sebastien Godard (sysstat orange.fr) + * Option -m added to sar. This option is intended to display + power management statistics. At the present time, only + CPU frequency statistics are available. + * sadc updated: Option "-S POWER" tells sadc to collect power + management statistics. + * sadf command updated to take into account power management + statistics. + * [Mike Harvey]: No longer truncate the interval of time to + 32 bits, as this may cause some problems when displaying + average values statistics on machines with hundreds of CPU. + * read_uptime(): Cast values read from /proc/uptime to + unsigned long long. + * Fixed a small bug in sar where it didn't parse arguments + properly when some options were entered in a specific order. + * sadc and sar manual pages updated. + * XSD and DTD documents updated. + * FAQ updated. + * NLS updated. + * Code cleaned. Makefile cleaned. + +2009/01/11: Version 8.1.8 - Sebastien Godard (sysstat orange.fr) + * IPv6 support added. A bunch of new metrics have been added to + sar, enabling the user to display statistics for IPv6 protocol + family (IPv6, ICMPv6, UDPv6 and network sockets). + * sadc updated: Option "-S IPV6" tells sadc to collect IPv6 + statistics. + * sadf command updated to take into account IPv6 statistics. + * Options -S (for sadc), -P (for mpstat, sar and sadf), -p (for + iostat and pidstat) and -n and -I (for sar) now accept a list of + comma-separated arguments. + * [Ivana Varekova]: Make iostat display statistics for devices only + (and not partitions) when not using its option -d. This was + no longer possible with kernels 2.6.25 and later because iostat + couldn't distinguish between devices and partitions any more. + * iostat's options -x and -p are no longer mutually exclusive: + Extended statistics are now available even for partitions with + recent kernels. + * iostat was unable to read stats from sysfs for devices who had + a slash in their names (for example, iostat -p /dev/cciss/c0d0 + didn't work properly before). This is now fixed. + * [Amir Rapson]: Fixed a bug in iostat where %CPU spent + servicing hard and soft irq were counted twice. This bug + was introduced in 8.1.5. + * DTD and XSD files updated. + * Manual pages updated. + * NLS updated. Maltese translation added. + * CREDITS file updated. + +2008/11/13: Version 8.1.7 - Sebastien Godard (sysstat orange.fr) + * Support for SNMP statistics added to sar. Several keywords + have been added to option "-n". The user can now display + statistics about IP, ICMP, TCP and UDP network traffic. + * sadc updated: Option "-S SNMP" tells sadc to collect SNMP + statistics. + * sadf command updated to take into account SNMP statistics. + * sadf -x now also displays number of CPU. + * DTD and XSD files updated. + * sar/sadc: Each item (like network interfaces) is now counted + once. + * [Eduardo Ferro Aldama]: Option -l added to pidstat. This + option enables the user to display the whole command line for + each process. + * Option -h added to sar. This option displays a short help message. + * Cosmetic change in sadf -x output for network statistics. + * sadf -H now displays the real name of each activity saved in file. + * Fixed some memory leaks detected by valgrind. + * pidstat, sar and sadc manual pages updated. + * FAQ updated. + * NLS updated. + * CREDITS file updated. + * Code cleaned. + +2008/09/30: Version 8.1.6 - Sebastien Godard (sysstat orange.fr) + * [David Alan Gilbert]: Option -h added to pidstat. This + option is used to display all activities horizontally on a + single line. + * Fixed a bug in pidstat: When pidstat was used to monitor a + process and all its threads (with pidstat's option -t), it + could display weird values if the thread group leader terminated. + * Header line displayed by sar, iostat, mpstat, pidstat and + sadf -H now includes the number of CPU. + * Use the correct word TGID instead of PID with pidstat -t. + * mpstat now displays stats for all interrupts, including NMI, + LOC, etc. + * sar and sadf now check that CPU activity is available in file. + * iostat's option -t now always displays the date and the time. + * Added option "--disable-documentation" to ./configure. Using + this option prevents documentation files (including manual + pages) from being installed. + * iconfig script updated. Now ask the user for documentation + and isag script installation. + * Manual pages updated. + * NLS updated. Indonesian and Chinese (traditional) translations + added. + * README-nls file updated. + * Makefile updated: There is now a dedicated target to install + or uninstall NLS files + * FAQ updated. + * CREDITS file updated. + * Code cleaned. + +2008/07/14: Version 8.1.5 - Sebastien Godard (sysstat orange.fr) + * Added virtual machine time accounting to "sar -u ALL" and + mpstat (%guest). + * pidstat has also been updated to be able to display time + spent in virtual machine for a task, and for a task and all + its children. + * Option -S added to sar: This options tells sar to display + swap space utilization. Option -r now only displays memory + utilization. + * Added %swpcad to sar -S (percentage of cached swap memory + in relation to the amount of used swap space). + * Added kbcommit and %commit to sar -r (amount and percentage + of memory needed for current workload). + * sadf -x now distinguishes between options -r and -R. + * sadf command updated to take into account new fields + (%guest, %swpcad, etc.) + * [Ivana Varekova]: iostat now displays the total number of + operations per second in the NFS report. + * Fixed iostat so that %system (percentage of CPU utilization + that occurred while executing at system level) also takes + into account time spent to service interrupts and softirqs. + * Added a missing header line for activities with multiple + outputs displayed by sar (eg. sar -rR ...). + * Makefile updated: There is now a dedicated target to install + or uninstall manual pages. + * Manual pages updated. + * Code cleaned. + * XSD and DTD documents updated. + * isag script updated. + +2008/06/22: Version 8.1.4 - Sebastien Godard (sysstat orange.fr) + * sar can now collect and display all CPU fields with its new + option "-u ALL". sadf has also been updated to be able to + display them. + * mpstat can now display per-CPU interrupts statistics with its + option "-I CPU". This was a feature available in sar that was + removed in previous sysstat version. + * mpstat uses now a separate option ("-I SUM") to display the + total number of interrupts for each processor. + * Option -A added to mpstat. This switch tells mpstat to display + all possible activities. + * NFS v4 support added to sar -n NFS(D). When both NFS v3 and + NFS v4 are used, stats from NFS v3 and NFS v4 are added + together [DEBIAN bug#434442]. + * Code cleaned: mpstat, iostat and pidstat now use the common + functions from rd_stats.c to read CPU stats from /proc/stat; + Computing extended disk statistics (service time, etc.) is now + done in one place (common function used by iostat, sar, sadf). + * All sysstat commands are made consistent with how parameters + are interpreted: "COMMAND " now generates a report + continusouly, "COMMAND 0" causes an error, + "COMMAND 0" displays a report since system startup + [DEBIAN bug#475707]. + * Changed XML output for processes and context switches displayed + by sadf -x to be consistent with output from sar. + * mpstat and sar manual pages updated. + * isag script updated. + * FAQ updated. + * DTD and XML Schema updated. + * NLS updated. + +2008/05/25: Version 8.1.3 - Sebastien Godard (sysstat orange.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x2170] + * sar, sadc and sadf heavily modified. It is now easier to add + (or remove) activities since sar and sadc have been rewritten + in a non-monolithic way with a generic design architecture. + * Option -c removed from sar. Task creation and context switch + activities are now merged and available with option -w. + * sar no longer displays interrupts per processor statistics. + This feature will be included in mpstat in next sysstat version. + * Option -S added to sadc. This option replaces previous options + -I or -d, and is used to select activities that should be + collected and saved in file. It is even possible to + select each activity collected by sadc. + * Format of data files created by sar/sadc heavily modified. + In some cases, it is now possible to add or remove activities + while keeping a compatible format that can be read by a previous + or future sysstat version. + * sadf now only displays activities that have been explicitly + selected. + * sar now checks that devices displayed by option -d are whole + devices (and not partitions) using sysstat.ioconf configuration + file. If this file is not found in its default directory, then + sysstat looks for it in current directory. + * gettextize entire usage() messages so that translators have + free scope to act. + * DTD and XML Schema updated. + * Manual pages updated. + * Crontab samples updated. + * FAQ updated. + * Code cleaned. + +2008/03/16: Version 8.1.2 - Sebastien Godard (sysstat orange.fr) + * [Ivana Varekova]: iostat now displays read and write operations + per second in the NFS report. + * [Tomas Mraz]: sadc now retries to write its buffers when the + write() call has been interrupted by a signal. + * Use setbuf() call instead of fflush() to indicate that data + should not be buffered to stdout. + * Option -h added to sadf. Used with options -d or -D, it + indicates that all activities should be displayed horizontally + on a single line of data. + * sadf -d and sadf -D now display the list of fields for easier + data reading. + * sadf and iostat manual pages updated. + * NLS updated: Chinese (simplified) translation added, other + translations updated. + +2008/02/10: Version 8.1.1 - Sebastien Godard (sysstat orange.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x216f] + * System activity data files now have extra header data that + enable to identify which version of sysstat created them. + * sadf -H now displays the version of sysstat used to create + a system activity data file. + * Machine architecture is now displayed in the reports header. + sadf -x also displays machine architecture. + * DTD and XML Schema documents updated. + * The number of processors was not properly calculated on + machines where a directory named cpuidle was present in the + /sys/devices/system/cpu directory [GENTOO bug# 207886]. + * Use __CPU_SETSIZE definition from instead of a + static definition for the maximum number of CPUs (NR_CPUS). + * Improved error messages displayed by sysstat's commands. + * NLS updated: Finnish translation added, Dutch translation + updated. + * FAQ updated. + * Code cleaned and documented. Linux-like style applied to + code source. Large functions split into smaller ones. + +2008/01/06: Version 8.0.4 - Sebastien Godard (sysstat orange.fr) + * Removed a 'packed' attribute in pidstat.h that generated + a warning with gcc 4.1.1. + * Take account of all memory zone types when calculating + pgscank, pgscand and pgsteal displayed by sar -B. + * XML Schema added. Useful with sadf option -x. + * sadc and sadf manual pages updated. + * NLS updated: Dutch translation added. + * NLS updated: Brazilian Portuguese translation added. + * NLS updated: Vietnamese translation added. + * NLS updated: Kirghiz translation added. + * NLS updated: Added a PO template file in nls directory. + Makefile modified to enable PO files update. + * sccsid string now also includes package name and version number. + * Makefile updated: Startup links are named S01xxx instead of S03xxx + to be consistent with chkconfig values. + * Various spelling fixes. + * CREDITS file updated. + +2007/11/19: Version 8.0.3 - Sebastien Godard (sysstat orange.fr) + * mpstat and sar didn't parse /proc/interrupts correctly when + some CPUs had been disabled. This is now fixed. + * Fixed a bug in pidstat where a confusion between PID and TID + could sometimes happen, resulting in erroneous statistics + values being displayed. + * iconfig script updated: Help for --enable-compress-manpg + parameter is now available, help for --enable-install-cron + parameter updated, added parameter cron_interval. + * sa2 shell script can now compress sar data files using bzip2. + * Makefile updated: Now also remove sysstat.crond.sample.in. + Documentation is installed in $prefix/share/doc/ instead of + $prefix/doc/ directory. + * isag updated. + * FAQ updated. + * CREDITS file updated. + * Sysstat's URL updated. + +2007/10/26: Version 8.0.2 - Sebastien Godard (sysstat orange.fr) + * Option -w added to pidstat. pidstat can now display task + switching activity. + * Fixed a memory leak in pidstat that was triggered when + reading stats for threads. + * Fixed a bug where device names were incorrectly displayed by + sar -d or sar -dp. Fixed also this bug for sadf. + * When using option -o, sar now saves by default all the + statistics into the file, including interrupts and disks + statistics. Interrupts and disks statistics remain optional + when using sadc. + * sysstat startup script updated. + * sar and pidstat manual pages updated. + * isag updated. + * NLS updated. + * Code cleaned. + * CREDITS file updated. + +2007/09/30: Version 8.0.1 - Sebastien Godard (sysstat orange.fr) + * Option -t added to pistat. pidstat can now display stats for + every thread (TID) of a process. + * pidstat's option -T CHILD now reports global statistics for + selected tasks and all their children (and not only for the + children). + * pidstat now reads VSZ and RSS values from /proc/#/stat instead + of /proc/#/status. + * Fixed a rare parallel make issue creating archive libsyscom.a + [GENTOO bug #193208]. + * pidstat manual page updated. + * SCCS identification string added to all commands. + * NLS updated. + * Code cleaned. + * CREDITS file updated. + +2007/09/02: Version 8.0.0 - Sebastien Godard (sysstat orange.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x216e] + * pidstat command improved. It is now able to report CPU and + page fault statistics for the child processes of a task. + * Option -T added to pidstat. This option tells pidstat if + statistics are to be reported for tasks (which is the default) + or for their children. + * Fixed a security flaw in sysstat startup script (CVE-2007-3852). + * Removed super*, dquot* and rtsig* fields from sar -v. + They were made obsolete in Linux kernels 2.6. + * Fields file-sz and inode-sz from sar -v renamed to file-nr + and inode-nr. + * Added field pty-nr (number of pseudo-terminals) to sar -v. + * Added field tcp-tw (number of sockets in TIME_WAIT state) + to sar -n SOCK. + * sar and sadf updated so that they can properly extract records + (with their options -s and -e) from a file containing data for + two consecutive days. + * Added option "--enable-install-isag" to "configure" to enable + the user to install isag script. + * Fixed a typo in iconfig script: The user was unable to specify + the crontab owner. + * Manual pages updated. + * Sysstat DTD file updated. + * isag updated. + * NLS updated. + * FAQ updated. + * CREDITS file updated. + * Author's email updated. + +2007/07/08: Version 7.1.6 - Sebastien Godard (sysstat wanadoo.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x216d] + * New VM paging metrics added to sar (option -B). + * Options -x and -X have been removed from sar. Use pidstat(1) + command instead. + * NR_CPUS increased to 16384 so that sysstat can be used on + very large systems. + * Fixed a bug in sadc.c where it was using a hardcoded 256 char + buffer to store lines read from /proc/interrupts. + * sar updated to avoid overflow when computing some average values. + * sar and mpstat manual pages updated. + * Sysstat DTD file updated. + * FAQ updated. + * NLS updated. + * CREDITS file updated. + +2007/06/07: Version 7.1.5 - Sebastien Godard (sysstat wanadoo.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x216c] + * Option -d added to pidstat: This option reports I/O statistics + for individual tasks. + * Option -C added to sadc: This option enables the user to insert + a timestamped comment in the binary data file. + * Option -C added to sar: This option tells sar to display + comments inserted in the binary data file by sadc. + * sadf updated to display comments. + * Fixed a bug that could happen while reading /proc/interrupts, + where irq numbers can now be 4 digits long in recent kernels. + * Fixed a possible buffer overflow in ioconf.c. + * Makefile updated: Remove previous manual pages before installing + new ones. + * pidstat, sar and sadc manual pages updated. + * Sysstat DTD file updated. + * Fixed DTD version in sadf.h. + * NLS updated. + * CREDITS file updated. + +2007/04/29: Version 7.1.4 - Sebastien Godard (sysstat wanadoo.fr) + * Addition of a new command "pidstat" aimed at displaying + per-process statistics. + * Option -N added to iostat. This option enables the user to + query any device-mapper devices for their registered device name + [bugzilla #177540]. + * Fixed a small memory leak in readp_uptime() function. + * Typo fixed in configure.in file + (s+INIT_DIR/etc/rc.d/init.d+INIT_DIR=/etc/rc.d/init.d+). + * Stricter syntax checking for iostat. + * sar -dp now displays the device as "devM-N" (instead of "nodev") + when it can't find its real name in sysstat.ioconf file. + * iostat -t now also takes into account the value of environment + variable S_TIME_FORMAT. + * Manual pages now take into account variables defined by + "configure". + * isag now takes into account variables defined by "configure". + * "configure" now determines automatically whether workaround for + SMP race is needed. This workaround is for SMP kernels 2.2.x with + x <= 15 only. + * pidstat manual page added. Other manual pages updated. + * Makefile updated. + * NLS updated. + * FAQ updated. + * Code cleaned again and again... + * Removed sargon from contrib directory since its features are + now included in sysstat by default. + +2007/03/27: Version 7.1.3 - Sebastien Godard (sysstat wanadoo.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x216b] + * Hotplug CPU support: Fixed a bug that happened when sar tried + to read a datafile created while a least one processor was + disabled. + * Better support for keeping sar logfiles for more than one month + (several bugs fixed in sa1 and sa2 scripts). + * Fixed a small bug in sa2 script, where obsolete log files would not + be deleted if system activity directory was a symbolic link to + some other directory. + * The new variable "conf_dir" now enables the user to specify sysstat + configuration directory. This variable is used by "configure". + * Added option "--enable-compress-manpg" to "configure" to enable the + user to compress manual pages during installation. + * Removed some 'packed' attributes in sa.h and iostat.h that + generated warnings with gcc 4.1.1. + * isag (Interactive System Activity Grapher) improved. + * CREDITS file updated. + * Code cleaned. + +2007/03/04: Version 7.1.2 - Sebastien Godard (sysstat wanadoo.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x216a] + * Better hotplug CPU support. Now sysstat no longer assumes that + CPU#0 can never be disabled. It uses /proc/uptime file to + compute time interval. + * Various structures realignment to save memory (and disk space). + * Make sar -n display network traffic in kilobytes instead of bytes. + * Make sysstat compile cleanly with gcc 4.0.2. + * sysstat DTD file updated. + * NLS updated: Danish translation added. + * Manual pages updated. + * CREDITS file updated. + +2007/02/21: Version 7.1.1 - Sebastien Godard (sysstat wanadoo.fr) + * Autoconf support added. + * iconfig (Interactive Configuration script) added. iconfig is + a front-end to ./configure. + * spec file updated. + * FAQ updated. + * sadf manual page updated. + * CREDITS file updated. + +2007/02/04: Version 7.0.4 - Sebastien Godard (sysstat wanadoo.fr) + * Removed linux/major.h from list of files included in ioconf.c. + It was actually not used and also prevented sysstat from being + compiled on GNU/kFreeBSD. + * Sysstat scripts (sa1, sa2, sysstat) modified to enable the user + to keep sar data for more than one month. + * New parameter (COMPRESSAFTER) added to /etc/sysconfig/sysstat. + It gives the number of days after which sar datafiles must be + compressed to save disk space. + * Replaced the word "Device" with "Filesystem" for iostat + NFS report. + * iostat manual page updated. + * Makefile updated: don't use a static list of languages to + compile NLS files. + * "make install" now always install sysstat configuration file + (default location is /etc/sysconfig). + * FAQ updated. + * Added my email address when displaying sysstat version. + * NLS updated. + +2006/12/03: Version 7.0.3 - Sebastien Godard (sysstat wanadoo.fr) + * iostat NFS statistics added. + * iostat manual page updated. + * Columns "r/s" and "w/s" enlarged for iostat -x. + * Minor change so that sar -u may fit in 80 columns. + * NLS updated. + * CREDITS file updated. + +2006/10/22: Version 7.0.2 - Sebastien Godard (sysstat wanadoo.fr) + * Hotplug CPU support added to sar and mpstat + * Use /sys to count the number of available processors. + /proc/stat is used for that only if /sys is not found. + * sysstat DTD updated. + * sysstat spec file updated (gettext is now required). + * NLS updated: Swedish translation added. + * Manual pages updated. + * Makefile updated. + * CREDITS file updated. + +2006/09/17: Version 7.0.1 - Sebastien Godard (sysstat wanadoo.fr) + * Use now sysconf() function to get the size of a memory page + instead of using header file . + * The time specified with sadf options -s and -e is now always + considered as given in local time. sadf output is now really + consistent with that of sar. + * Fixed a bug in the SREALLOC() macro which was causing sar to + exit unexpectedly with this message: "realloc: Success". + * Try to better guess when a stats title line has to be displayed + by sar. + * Makefile updated (SMP_RACE definition was no longer taken into + account when compiling sadc). + * sysstat spec file updated. + * sar and sadf manual pages updated. + * FAQ updated. + * CREDITS file updated. + +2006/07/09: Version 7.0.0 - Sebastien Godard (sysstat wanadoo.fr) + * S_TIME_DEF_TIME environment variable added for sar, sadc and + sadf. + * Use now sysconf() function to get the number of clock ticks + per second (HZ value) instead of using kernel include file + . + * Columns "Device", "rrqm/s" and "wrqm/s" enlarged for iostat -x. + * sysstat installation process updated to use chkconfig if + available. + * Manual pages updated. + * Makefile updated. + * sysstat web site address updated. + * Code cleaned. + * CREDITS file updated. + +2006/05/24: Version 6.1.3 - Sebastien Godard (sysstat wanadoo.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x2169] + * Option -P can now be used with sar even on SMP machines where + only one processor is available. + * Small bug fixed for mpstat, where explicitly specifying + processor 0 ("-P 0") could lead to incorrect output on UP + machines. + * Option -D added to sadf: this option displays the contents of + a data file in a database-friendly format with a timestamp + expressed in seconds from the epoch. + * sadf manual page updated. + * NLS updated. + * CREDITS file updated. + +2006/04/23: Version 6.1.2 - Sebastien Godard (sysstat wanadoo.fr) + * Fix incorrect NFS client and server statistics for sar. + * sar can now display stats for newly created processes when + option -x ALL or -X ALL is used. + * iostat -x was displaying redundant information. It now + displays amount of data read from or written to devices in + sectors, kilobytes or megabytes depending on the switch used. + * isag updated to keep up with current sar version. + * sar and mpstat manual pages updated. + * FAQ updated. + +2006/02/22: Version 6.1.1 - Sebastien Godard (sysstat wanadoo.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x2168] + * New field added to sar: %steal. + * The size of a long integer in now saved in the header of the + data file created by sar. This size can be displayed with + sadf -H. + * Replaced the keyword "FULL" by the keyword "ALL" for sar -n + to be consistent with remaining options. + * Makefile updated (use implicit rules). + * sar manual page updated. + * CREDITS and FAQ files updated. + +2005/11/28: Version 6.0.2 - Sebastien Godard (sysstat wanadoo.fr) + * New field added to mpstat and iostat: %steal. + * sar updated to take into account cpu steal time. + * Off-by-one error in ioc_conv which was corrupting device names + on 64-bit architecture [Debian bug #334305]. + * Binary RPM package now installs a sample crontab in /etc/cron.d. + * Makefile updated (remove sysstat.cron.* during make clean - + new target added: sysstat.crond.sample). + * sar now checks exit code from dup2() system calls. + * Option -V now only displays sysstat version number. + * NLS updated. + * FAQ updated. + * Manual pages updated. + +2005/06/25: Version 6.0.1 - Sebastien Godard (sysstat wanadoo.fr) + * Fixed a memory leak in ioconf parsing functions used by sar + and iostat. + * sar now displays its statistics to STDOUT in addition to saving + them into the file when option -o has been entered on the + command line. + * sar now recalculates number of system items (network interfaces, + disks, serial lines, etc.) when a file rotation happens. + * Make sar -b work again when used without option -d. + * Small changes so that sysstat can be compiled with gcc-4.0.1. + * sysstat updated so that it may be installed on Slackware. + * sar manual page updated. + * CREDITS file updated. + * Code cleaned. + +2005/05/14: Version 6.0.0 - Sebastien Godard (sysstat wanadoo.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x2167] + * Additional fields added to sar -y (TTY statistics). sar, sadf + and DTD updated. + * sar -d now only reports for used devices (devices with non zero + statistics). + * Stricter sadf syntax checking: various output formats are now + mutually exclusive. + * Stricter iostat syntax checking: -k and -m options are now + mutually exclusive. + * iostat: option -m is now taken into account even when + displaying extended statistics. + * Fixed a bug that prevented iostat from displaying stats about + devices that were unknown in sysstat.ioconf file. + * iostat might display bogus sectors values when the corresponding + kernel counters had overflown. This is now fixed. + * "sadf datafile -- -A" should also display individual interrupts + if available in datafile. + * Fixed a bug that prevented sar -x from displaying stats about a + process if it was after the first 256 processes in the process + list. + * Manual pages updated. + * sa1 script always uses option -d in crontab. + * sysstat.ioconf device configuration file updated. + * NLS updated. + * FAQ and CREDITS files updated. + * Code cleaned. + +2005/02/25: Version 5.1.5 - Sebastien Godard (sysstat wanadoo.fr) + * -x option added to sadf: it is now able to display the contents of + a sar datafile in XML. The corresponding DTD (Document Type + Definition) is included in the sysstat package. + * Small code change so that sysstat may be compiled with gcc-4.0. + * A few typos fixed in formulas used by sadf to display stats + on machines where HZ<>100 (typos appeared in sysstat 5.1.4). + * Fixed a bug in the stats displayed by sar -d. + * Removed a false workaround in iostat: better show that the kernel + is buggy rather than display a value that seems correct but which + is actually not... + * Fixed sar -i option which might not select records at the specified + interval on machines with multiple processors. + * NLS updated and cleaned. Do no longer translate fields names (sar, + iostat, etc.). Changed nb_NO.po and nn_NO.po files to nb.po and + nn.po. + * Bug fixed in spec file: when installing sysstat i586 RPM package, + sa1 and sa2 scripts were pointing to the wrong sadc location. + * Now sar and sadc display the magic number when they meet an + invalid system activity file. + * sadf manual page updated. + * sysstat RPM spec file is now included in source package. + * Code cleaned. + * FAQ, Makefile and CREDITS files updated. + +2005/01/02: Version 5.1.4 - Sebastien Godard (sysstat wanadoo.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x2166] + * NFS client and server statistics added to sar. + * sar -d now only reads stats for devices (and not partitions) + from /proc/partitions. (This is what it was already doing with + /proc/diskstats). + * Display routines from sadf merged, so that -ppc and -db + always output the same values. + * sadf updated to handle NFS statistics. + * sadf can now display the header of a data file (option -H). + * Define MAX_BLKDEV in ioconf.h if non-existent in . + * sar now looks for sadc in one directory only, specified at + compile time. Moreover it is now possible to have two different + sysstat versions installed: sar knows where its sadc counterpart + is located. + * sapath.in removed. SADC_PATH is defined in CONFIG file. + * sar and sadf manual pages updated. + * sysstat.ioconf file updated. + * Fixed a bug in i386 RPM package, where sadc location was not + consistent with that of sar. Spec file updated. + * Makefile updated. + * NLS updated. + * Various cosmetic changes (code and manual pages). Code cleaned. + * FAQ and CREDITS files updated. + +2004/11/22: Version 5.1.3 - Sebastien Godard (sysstat wanadoo.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x2165] + * Option -p added to sar: It enables sar (and also sadf) to + display device names as they appear in /dev. + * sysstat.ioconf support added. + * New fields added to sar -d (more disk activities displayed): + avgrq-sz, avgqu-sz, await, svctm, %util. + * sadf updated to handle new disk activities. + * I/O and transfer rate statistics as displayed by sar -b are + available whatever the version of the kernel is (i.e. even on + recent kernels). + * Disk stats are read by sadc from /proc/stat only if they cannot + be read from /proc/{partitions,diskstats}. + * sadc: Some variables declarations moved around. + * sar manual page updated. + * Added workaround for EMC PowerPath driver bug to enable iostat + to display proper device name. + * Makefile updated: Use $@ and $< everywhere; 'make {iostat,mpstat}' + work again; Create object files before linking; Removed unused + IOS_DFLAGS variable; Use DESTDIR variable everywhere; Create + libsysioc.a; Install sysstat.ioconf. + * NLS updated. + * README and CREDITS files updated. + +2004/11/05: Version 5.1.2 - Sebastien Godard (sysstat wanadoo.fr) + * sar -d now also uses /proc/partitions to get its data. + From now on sar -d looks in the following files in that order: + /proc/diskstats, /proc/partitions, /proc/stat. + * sadc writes disks data to file only if -d option is explicitly + set on the command line. + * sadc now reads individual interrupts data from /proc/stat only + if -I option was entered on the command line. + * 'sar -A' is now equivalent to 'sar -bBcdqrRuvwWy -I SUM -I XALL + -n FULL -P ALL' (i.e. individual interrupts are also included + in activities). + * Option -m now tells iostat to display statistics in megabytes + per second instead of blocks per second. + * Make history (number of days to keep log files) configurable + in /etc/sysconfig/sysstat file, which is used by sa2 script. + * Now use Vixie cron to launch sadc when possible. + * sadc, sa1 and sa2 may now be installed in another directory + than ${PREFIX}/lib/sa. This is useful on 64-bit systems where + the proper directory should be ${PREFIX}/lib64/sa. + * When uninstalling sysstat, always delete sysstat script, + config file and links in /etc tree. Also always delete + Vixie cron entry. + * sysstat script now returns real exit code. + * sar/sadc: Stricter syntax checking for -x and -X options use. + * sysstat "*.sh" files renamed in "*.in". + * Makefile updated. + * sadc and sar manual pages updated. + * NLS updated. + * FAQ updated. + * CREDITS and README files updated. + +2004/10/09: Version 5.1.1 - Sebastien Godard (sysstat wanadoo.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x2164] + * sar now reads CPU data, number of context switches, number + of sectors and total number of interrupts as 64-bit unsigned + values. It also reads the number of running processes as + unsigned long instead of unsigned int. + * sadf - System activity data formatter command added. + * Options -h and -H removed from sar. "sar -h" is replaced by + "sadf -p", and "sar -H" is replaced by "sadf -d". Read sadf + manual page, as its syntax is a bit different from that of sar. + * Common code for sar and sadf moved to sa_common.c file. + * pid_stats members don't need to be aligned since these stats + are not written to daily data files. Packing them saves some + memory on 32-bit architectures. + * No longer indicate that -x and -X are possible options for sadc. + They are only useful when used as options for sar, not sadc. + * Minor buffer overrun fixed in iostat. + * Updated CPU header for iostat and mpstat: CPU used while executing + at the system level is displayed as '%system' by iostat (like sar) + and as '%sys' by mpstat. + * sadf manual page added. Other manual pages updated. + * Updated the GPL notices (the address of the FSF was wrong). + * Makefile updated. + * NLS updated. + * README, FAQ and CREDITS files updated. + +2004/08/09: Version 5.0.6 - Sebastien Godard (sysstat wanadoo.fr) + * The value for file-sz reported by sar -v was a number of free + handles, and not a number of used ones! This is now fixed (and + this is really now a number of _used_ file handles). + * Now ask during config stage for the directory where sadc will + be located. This may be useful for some systems where sadc + needs to be installed in a specific location (e.g. on 64 bit + s390 systems, the proper directory should be /usr/lib64/sa). + * sa1 script updated: Use '-' to specify current daily data file + instead of guessing its name using current date. + * NLS updated: be consistent with GNU gettext standards. + * iostat manual page updated. + * FAQ updated. + * Makefile updated. + * CREDITS file updated. + +2004/06/08: Version 5.0.5 - Sebastien Godard (sysstat wanadoo.fr) + * Timestamp is no longer limited to 11 characters. This should + avoid problems with somes locales (for example Japanese locale, + where 'mojibake' used to be displayed by sar and mpstat sometimes). + * Fixed a bug in sysstat RPM spec file (symlinks to sysstat + script were wrong in /etc/rc.d directories). + * sar now checks parameters for options -n, -s and -e more + aggressively. + * NLS updated: Japanese translation added. + * Various typos fixed in several files (manual pages, README, etc.) + * CREDITS file updated. + +2004/05/20: Version 5.0.4 - Sebastien Godard (sysstat wanadoo.fr) + * When trying to lock file, sadc now checks for both EWOULDBLOCK + and EAGAIN error codes to be portable. + * sar could sometimes display a line whose time stamp was greater + than the limit set by -e option. This is no longer possible. + * The sadc command in sysstat.sh script had to be enclosed in + quotes to work when called via 'su -c'. + * The sysstat.sh script was sending the output of sadc command + to stdout instead of the standard system activity file. This + is now fixed. + * Outfile must now be explicitly set to "-" for sadc to use the + standard system activity file. + * FAQ updated. + * iostat manual page updated. Typo fixed in sadc manual page. + * Fixed the "Save picture" option of isag script. + +2004/04/07: Version 5.0.3 - Sebastien Godard (sysstat wanadoo.fr) + * iostat now reads the number of sectors in /proc/diskstats or + from sysfs as 64-bit unsigned values. + * iostat and mpstat now read CPU data and the number of + interrupts in /proc/stat as 64-bit unsigned values. + * sar uses "%u" instead of "%d" to read unsigned integer + values _everywhere_. + * sar and sadc are now a little bit more verbose when dealing + with invalid activity files. + * Network interface name size is now read from include file + . + * FAQ polished up. + * Slovak translation added. NLS updated. + * Typo fixed in iostat manual page. + * Makefile and CREDITS file updated. + * isag upgraded to version 1.26 (isag package release 0.81.0). + +2004/03/10: Version 5.0.2 - Sebastien Godard (sysstat wanadoo.fr) + * iostat will _again_ look for statistics in /proc/partitions if + available. Too many production servers are still using 2.2.x or + 2.4.x kernels and iostat must be able to display extended stats + also for them (/proc/partitions support was removed in sysstat + version 4.1.3). So now, iostat gets its statistics from the + following sources in that order: /proc/diskstats, sysfs, + /proc/partitions and then /proc/stat. + * statistics are now read by iostat and mpstat as unsigned long + instead of int to avoid integer overflow. + * iostat should now handle properly the case when the 'weighted + number of milliseconds spent doing I/Os' (read in sysfs or + /proc/{partitions,diskstats}) decreases with time. + * iostat manual page updated. + * Minor temporary file vulnerability fixed in isag command. + * README, FAQ and CREDITS files updated. + * Author's email changed. + +2004/02/02: Version 5.0.1 - Sebastien Godard + * -L option added to sadc. Enable sadc to lock its output file + to prevent multiple instances from writing to it at once. + * sa1 and sysstat scripts updated to take advantage of -L option. + * Handle the case where, under very special circumstances, STDOUT + may become unavailable, and sar, iostat and mpstat are no longer + able to display anything. + * sadc as called in sysstat script also uses -F option to force + the creation of daily data file. + * sar, sadc and mpstat manual pages updated. + * Code cleaned. + * FAQ and CREDITS files updated. + +2003/11/09: Version 5.0.0 - Sebastien Godard + * New fields added to mpstat: %irq (%time spent servicing + interrupts) and %soft (%time spent servicing softirqs). + * sar and iostat updated to take into account time spent servicing + interrupts and softirqs when displaying percentage of time + in system mode. + * By default iostat now displays only statistics information for + devices that are used by the system. You should now use the ALL + keyword to tell iostat to display statistics for every device + including those that have never been used. + * The file version.h is now dynamically created. sysstat's version + number is now only recorded in the Makefile. + * sar manual page updated: beginning with kernels 2.4 and later, + pgpgin and pgpgout statistics are in kilobytes and not in + blocks (see linux-2.4/fs/proc/proc_misc.c and + linux-2.6/mm/page_alloc.c). + * iostat and mpstat manual pages updated. + * Makefile updated: don't process NLS files if they are up-to-date. + * sysstat's RPM spec file updated to enable clean, non-root builds. + * NLS updated. + * FAQ and CREDITS files updated. + +2003/09/28: Version 4.1.7 - Sebastien Godard + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x2163] + * /proc/diskstats is now the preferred source for iostat to get its + statistics. If non-existent, iostat falls back on sysfs then + on /proc/stat. + * In addition to devices, partitions can also be entered on the + command line for iostat providing that option -x is not used. + * /dev prefix has been removed from device name displayed by iostat -x. + * sar -d now looks for disks statistics in /proc/diskstats with + post 2.5 kernels. + * sar uses /proc/vmstat file with post 2.5 kernels to find paging + and swapping statistics. + * activepg, inadtypg, inaclnpg and inatarpg stats removed from + sar -B report (they were not really useful). + * sar -B now displays the number of page faults made by the system + (pgfault/s and pgmajflt/s). + * Stat on shared memory removed from sar -r and sar -R (this stat + was no longer maintained by the kernel since 2.4 because of + performance problems). + * Cached swap statistic information added to sar -r. + * sar -d now displays separate statistics for sectors that are + read from or written to devices. + * %file-sz (percentage of used file handles) is no longer displayed + by sar -v, since the upper limit for the number of open files + will self-scale with 2.6 kernels. + * sar now looks more aggressively for network devices in /proc/net/dev. + * Heading spaces in network interface names removed (sar -n). + * Fixed a problem reading /proc/interrupts when there are a lot + of CPUs (mpstat, sadc). + * NR_IRQS value increased to 256, since IA64 supports 256 irqs + per CPU. + * Some stats counters are now read as unsigned long instead of + unsigned int (pgpgin, pgpgout, pswpin, pswpout, irq_sum). + * sar and iostat manual pages updated. + * FAQ, README and CREDITS files updated. + * NLS updated. + +2003/08/20: Version 4.1.6 - Sebastien Godard + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x2162] + * Machine uptime calculation is now optimized on SMP machines + to minimize the consequences if an overflow condition happens. + Especially useful when asking for stats since system boot. + * -F option added to sadc. Useful to force the creation of the + daily data file: an already existing file with a wrong format + will be truncated by sadc if this option is used. + * sa1 script now calls sadc with -F option. + * The processor number to which the process is attached was no + longer displayed by sar -x. Make it appear again. + * CPU usage for processes, as displayed by sar -x and sar -X, should + now be correct on machines where HZ <> 100 (e.g. IA64 architecture). + * iostat still assumed that jiffies were 100ths of a second in some + places. Now use Linux HZ definition *everywhere*. + * The average I/O requests queue length as displayed by iostat -x was + wrongly calculated. This is now fixed. + * Manual pages updated. + * NLS updated. + * Cosmetic changes in various parts of the code. + * FAQ, README and CREDITS files updated. + +2003/07/21: Version 4.1.5 - Sebastien Godard + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! Delete existing data files + in /var/log/sa directory! [0x2161] + * 'sar -x ' and 'sar -X ' work again. + * sar had a longstanding bug that prevented option -P from + working properly if the machine had more than 32 processors. + This is now fixed. + * Fixed a bug introduced in 4.1.2, which made some LINUX RESTART + messages to not be displayed by sar. + * sar now uses bitmap of char instead of int to avoid endianness + problems. + * sar can now handle a huge number of processors, serial lines and + network interfaces. + * FAQ updated. + +2003/07/01: Version 4.1.4 - Sebastien Godard + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! Delete existing data files + in /var/log/sa directory! [0x2160] + * Fixed the way overflow conditions were handled by sar for + interfaces counters. + * On really big machines with 100 GB of memory or more, the values + read by sadc in /proc/meminfo would get truncated and cause havoc + in the calculations. This is now fixed. + * iostat and sar can now read many more disk entries in /proc/stat if + necessary. + * Option "-x SUM" removed for sar. It was used to tell sar to display + the total number of minor and major faults made by the system. + Unfortunately, the calculation was tricky, and the results were + uncertain... + * NLS updated. Polish translation added. Also proper charset and + encoding declarations added to fix msgfmt warnings and allow + gettext to recode between various charsets (e.g. German + translation will be shown properly both with + LANG=de_DE.ISO-8859-1, and LANG=de_DE.UTF-8) + * Code 'sanitization'. + * Manual pages updated. + * README and FAQ files updated. + +2003/05/08: Version 4.1.3 - Sebastien Godard + * iostat should now be fully 2.5/2.6 kernel compliant. + * Disks arrays in iostat are now dynamically sized. + * iostat: sysfs is now used in preference to /proc/stat if available. + * iostat will no longer look for statistics in /proc/partitions. + sysfs filesystem must now be available for iostat to get its + extended stats (post 2.5 kernels). + * iostat: Devices for which statistics are requested can now be entered + on the command line even if option -x is not used. + * Usage messages updated. + * Manual pages updated. + * Code cleaned (dk_drive_sum removed in iostat, long lines folded, + functions split in smaller parts, etc.) + * NLS updated. Romanian translation added. + * isag upgraded to version 1.22. + +2003/01/24: Version 4.1.2 - Sebastien Godard + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! Delete existing data files + in /var/log/sa directory! [0x215f] + * sar -q now also displays load average for the past 15 minutes. + * -P option added to sar. This option enables sar to display + stats on a per processor basis. Options -U and '-I PROC' are + deprecated. 'sar -U ALL' is replaced by 'sar -u -P ALL', and + 'sar -I PROC' by 'sar -I SUM -P ALL'. + * Fixed iowait value displayed by sar on SMP machines with pre 2.5 + kernels. + * When displaying CPU utilization on SMP machines, sar now + recalculates the interval based on current CPU's tick count. + * Always check that the number of CPUs has not increased when + reading /proc/stat (sadc, mpstat). + * sadc: Don't assume that the first line in /proc/net/sockstat + concerns sockets. Check it! + * Serial lines are ignored by sadc for every kind of kernels + (UP, SMP...) if SMP_RACE is defined. + SMP_RACE is no longer defined by default in RPM packages. + * Code cleaned: Dead code removed in iostat.c, some lines longer + than 80 chars folded, etc. + * sar manual page updated. + * FAQ updated. + * NLS updated. + +2003/01/02: Version 4.1.1 - Sebastien Godard + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! Delete existing data files + in /var/log/sa directory! [0x215e] + * sar -u/-U, iostat and mpstat can now display time spent in + I/O wait mode (with 2.5 kernels and above). + * Values like -1 and -2 are no longer aliases for keywords + ALL and XALL (sar -U, sar -I, mpstat -P). + * Buglet fixed in iostat.h. + * LC_CTYPE needs to be set, or it will emit messages with ?????? only + on some locales, especially ja_JP.eucJP + * sar, mpstat and iostat manual pages updated. + * NLS updated. + * CREDITS file updated. + * Typo removed in FAQ file. + +2002/11/13: Version 4.0.7 - Sebastien Godard + * Make data for timestamp 00:00:00 appear in one of the daily data + files when sar/sadc rotates its output file. + * Take out check for non SMP configuration when asking for + mpstat -P. + * sargon script updated. + * FAQ updated. + +2002/08/04: Version 4.0.6 - Sebastien Godard + * mpstat now uses a bitmap of char instead of int to avoid endianness + problems. As a consequence, mpstat should now work on PowerMac + architectures. + * CPU activity as displayed by mpstat -P for a given processor was + in a wrong range on SMP machines (e.g. 0-50% for a dual processor + box). + * Missing bitmap initialization fixed in mpstat.c. + * Configuration script updated. + * FAQ updated. + +2002/05/12: Version 4.0.5 - Sebastien Godard + * Average wait times and service times as displayed by iostat -x + were wrong by a factor of 10. This is now fixed. + * Linux RESTART messages must now be in the interval specified by + -s/-e options to be displayed by sar. + * Fixed a small bug that affected the timestamp for RESTART messages + displayed by sar -h when option -t was used. + * sar -H now displays its data in local time instead of UTC when + option -t is used. + * sargon shell script added. + * Created a contrib directory, including sargon and isag commands. + * NLS updated. + * FAQ updated. + * Makefile updated. + * sar manual page updated. + +2002/04/07: Version 4.0.4 - Sebastien Godard + * iostat is now able to display I/O activity in kB/s with 2.4.x + kernels (option -k). + * Fixed a typo in 'sar -W -h' output. + * Try to handle the case when some parameters in /proc/net/dev + may overflow ULONG_MAX. + * 'sar -d' now displays sectors per second instead of blocks + per second. + * iostat and sar manual pages updated. + * Added a FAQ. + * NLS updated: Russian translation added. + +2002/01/27: Version 4.0.3 - Sebastien Godard + * iostat now displays statistics in kB/s when option -x is used. + * Configuration script updated. + * sar and iostat manual pages updated. + * umask also set in sa1 shell script. + * Various sanity checks added. + * Fixed potential segmentation faults that could happen with some + locales. + * KB (standing for kilobytes) replaced with kB in various places. + * NLS updated: Italian translation added. + +2001/09/22: Version 4.0.2 - Sebastien Godard + * CPU usage, as displayed by iostat, mpstat and sar, should now + be OK on machines where HZ <> 100 (e.g. IA64 architecture). + * MAX_PART constant set to 256 in iostat.h. + * "-H" database friendly option added to sar. + * Better disks and network interfaces management (both may be + registered dynamically). + * Made options "-s" and "-e" work when option "-h" is used. + * isag upgraded to version 1.17. + * isag installation is now optional and can be chosen at config stage. + * Now try to install man pages in ${PREFIX}/share/man instead of + ${PREFIX}/man. + * sa2 shell script updated. + * Configuration script updated. + * sar manual page updated. + * NLS updated: Norwegian translation added. + +2001/06/24: Version 4.0.1 - Sebastien Godard + * Files created by sa2 shell script were world writable. This is + now fixed. + * sa2.sh shell script updated: only remove sa?? and sar?? files. + * Don't use PAGE_SHIFT since it no longer necessarily exists in + . Compute it using page size instead. + * Cosmetic changes for iostat. + * NLS updated: Afrikaans translation added. + +2001/04/08: Version 4.0.0 - Sebastien Godard + * Better network interfaces handling. Now take into account the + fact that they may be registered/unregistered dynamically. + * Changed formula used to display statistics in order to avoid + overflow conditions. + * Fixed a bug in iostat, where the %util value scaled incorrectly. + * Better long file names management by iostat. + * mpstat and sar no longer periodically display the title line when + stdout has been redirected to a pipe or a file. + * sa2.sh shell script updated: Now exec sadc. + * Configuration script updated. + * NLS updated. + * Makefile updated. + * Manual pages updated. + * isag command updated. + +2001/03/04: Version 3.3.6 - Sebastien Godard + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! Delete existing data files + in /var/log/sa directory! [0x215d] + * New paging statistics added (sar -B). Kernel 2.4 only. + * Load averages and queue length statistics added (option -q for sar). + * Per device statistics added (option -d for sar). Kernel 2.4 only. + * Better accuracy when computing average for some statistics. + * Display all the contents of a daily data file when the count + parameter is not given on the command line. + * Check sar command line options more aggressively. + * iostat no longer freezes if -c and -d options are used together. + * Fixed a bug that prevented iostat from displaying more than an + average of three devices with 2.4 kernels (a buffer was too small). + * Check added to ensure that sar and sadc commands are consistent. + * sar manual page updated. + * NLS updated. + * Code cleaned (use smaller subroutines). + * Makefile updated. + * isag command updates. + +2001/02/11: Version 3.3.5 - Sebastien Godard + * iostat command improved. Take now full advantage of Stephen + Tweedie's I/O accounting patch to display extended statistics + (option -x). + * The default value for the count parameter of the sar command is + now 1 (this is how sar works with other Un*xes...). A value of + 0 will indicate that reports are to be generated continuously. + * Code cleaned: Now always use 'double' numbers instead of the + INT_PART, INT_VAL, DEC_PART and DEC_VAL macros. + * Don't assume that jiffies are 100ths of a second. Use Linux + HZ definition instead. + * NLS updated (small fix). + * sar and iostat manual pages updated. + * isag (Interactive System Activity Graph) command added. + * Makefile updated. + +2001/01/26: Version 3.3.4 - Sebastien Godard + * Disk I/O statistics for the last device were counted twice when + reading /proc/stat file with 2.4 kernels (sar -b). This is now + fixed. + * iostat command is no longer able to save its data to a file. + In fact, iostat has never been supposed to work that way, and I + have never really maintained this option. + * iostat now also works with 2.4 kernels. It can handle the format + of the /proc/stat file for both 2.2 and 2.4 kernels. + * sar now reports statistics on allocated disk quotas entries + instead of on used ones (sar -v). + * Manual pages updated for sar and iostat. + +2000/12/31: Version 3.3.3 - Sebastien Godard + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! Delete existing data files + in /var/log/sa directory! + * Disk usage displayed by iostat on SMP machines was wrong. This + is now fixed. + * iostat command cleaned: All the statistics not implemented in + the standard Linux kernel have been removed (tty, iowait...). + * sar can now handle I/O and transfer rate statistics with both + 2.2.x and 2.4.x Linux kernels (-b option). + * Removed %inode-sz that was displayed by sar -v, since the file + inode-max in /proc/sys/fs no longer exists in Linux 2.4. + The new 2.4.x kernels now seem to be able to allocate inode + structures dynamically, and to free them when necessary (see + linux/fs/inode.c). + * Removed statistics on highest in-used sockets. Relevant + counters have disappeared from sockstat file in /proc/net + for 2.4 kernels (sar -n SOCK). + * Added statistics on IP datagram fragments (sar -n SOCK). + Only available for 2.4 kernels. + +2000/11/19: Version 3.3.2 - Sebastien Godard + * sar now saves timestamps in its daily data files both in UST + and in the user's timezone formats. + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! + * sar now displays timestamps in locale time when reading data + from its daily data files. -t option has been added to sar, + to enable it to display timestamps in the original locale + time of the data file creator. + * Size of various buffers made larger. + * Number of interrupts per second for 'all' CPU displayed by the + mpstat command was wrong. This is now fixed. + * Makefile updated. + * Usage message updated. + +2000/09/17: Version 3.3.1 - Sebastien Godard + * mpstat command added. + * Manual page added for mpstat. + * Option -h added, enabling sar to display data from a daily data + file in a format that can easily be handled with pattern + processing commands like awk. + * Manual page updated for sar. + * iostat now writes KB (for kilobytes) instead of Kb, which could + have been interpreted as kilobits... + * Disk accounting patch for iostat removed. + * NLS updated. + +2000/08/06: Version 3.2.4 - Sebastien Godard + * Fixed a bug that prevented sar from reading its daily data files + when they had been created using -I option. + * Network statistics averages were sometimes wrong when reading + data from a file. This is now fixed. + * README-patch file updated. + * Configuration script updated to deal with Debian directories. + +2000/06/25: Version 3.2.3 - Sebastien Godard + * Configuration scripts updated. Can now print a help message. + * Workaround for SMP race in Linux serial driver added. + This workaround is enabled by default in RPM binary packages. + * sar manual page updated. + * Added iostat disk accounting patch against 2.2.16 linux kernel. + * Removed a few typos in the comments of the source code. + +2000/06/11: Version 3.2.2 - Sebastien Godard + * Now handle interrupts per processor better. Output improved. + * Makefile modified to comply with redhat good packaging. + * sysstat initialization script updated (don't su to root when + we are already root). + * sar now looks for sadc data collector in more places. + * NLS is now enabled by default. + * Silly bug in iostat disk accounting patch fixed. + * Added iostat disk accounting patch against 2.2.15 linux kernel. + +2000/04/02: Version 3.2 - Sebastien Godard + * sadc no longer complains when daily data files have a null length. + * Configuration script added (make config). + * Statistics on sockets in use added. + * Got rid of various limits (maximum number of serial lines, + maximum number of network interfaces). + * Better management of dynamic files contents. + * Cosmetic change for timestamp display. + * Manual pages updated. + * Documentation added in ${PREFIX}/doc/sysstat-x.y. + +2000/02/20: Version 3.1 - Sebastien Godard + * Fixed a bug that made average numbers wrong for some statistics + when reading them from a system activity file. + * Fixed a bug that prevented the user from retrieving some + statistics when reading them from a system activity file. + * sadc no longer core-dumps on UP machines with SMP support enabled + in the kernel. + * System activity files are now readable by everybody. + * Average statistics since boot time are now printed when interval + parameter is set to 0. If interval and count parameters are not + set on the command line, sar selects requested activities from + the current system activity daily data file. + * sadc, sa1 and sa2 manual pages moved to chapter 8 instead of 1m. + * iostat disk accounting patch modified to work with md drivers. + +2000/01/30: Version 3.0 - Sebastien Godard + * sadc - system activity data collector added. + * sa1, sa2 and sysstat.sh shell scripts added. + * Manual pages added for sadc, sa1, sa2. + * sar heavily modified to use stats sent by sadc. + * System activity data file now records system restarts. + * Every records in the iostat and system activity data files have + their own timestamp now. + * sar and iostat largely modified to use structures when reading or + writing data files. + * Per-process statistics added. + * System minor and major fault statistics added. + * TTY device statistics added. + * Memory and swap space utilization statistics added. + * Per-processor interrupt statistics added. + * Statistics for kernel parameters (dcache, inodes, superblocks, etc.) + added. + * Network device statistics added. + * S_TIME_FORMAT environment variable added. + * Meaning of -i option has changed for sar. + * -d option removed for sar since it is no longer needed (we have + sadc now). + * sar now uses keywords such as ALL, SUM, etc. instead of numerical + parameters. + * iostat disk accounting patch improved. + * 'page' field in /proc/stat is no longer used by iostat (was + unreliable). + * Workaround for buggy RTC (or kernels?) added. Used when the number + of jiffies spent by the system in the idle task is decreasing in + /proc/stat. + * Manual pages updated. + * NLS updated: Portuguese translation added. + * Makefile updated. + +1999/11/28: Version 2.2 - Sebastien Godard + * Option -d added to sar to enable it to be started as a daemon. + * sar initialization script updated to use -d option. + * Option -V added to sar and iostat (print version number and usage). + * Fixed a bug that made CPU utilization displayed by iostat wrong on + SMP machines. + * Manual pages updated and moved to chapter 1 instead of 8. + * sar '-m' option renamed to '-r'. + * Display improved for iostat. + * NLS updated: Spanish translation added. + * Patch against kernel 2.2.13 added for iostat. + +1999/10/24: Version 2.1 - Sebastien Godard + * The sar and iostat commands can now work on non SMP-machines even + if the kernel is compiled with SMP support enabled. + * Fixed a bug that made the time displayed by iostat wrong when + reading stats back from a file. + * Added memory statistics: free/shared/buffer/cached pages (sar -m). + * Option -h added to sar to print its header periodically. + * Set unavailable fields to zero when writing iostat file. + * sar now displays 'proc/s' instead of 'fork/s' since exec'ed + processes are also taken into account. + * Manual pages updated. + * sysstat is now available in RPM format. + * Code cleaned up and made safer. + +1999/09/19: Version 2.0 - Sebastien Godard + * iostat now displays logical block I/O stats for each IDE device, or + global Kb/s rate for all the block devices. Stats in Kb/s for each + block device are not available for standard kernels due to Linux + poor disk accounting... Anyway a patch is provided in this version + of 'sysstat' in the 'patch' directory to fix that. + * System uptime is no longer read in /proc/uptime but computed from + the cpu line in /proc/stat. + * When stats are read from a file (option -f of iostat and sar), + values are now computed in accordance with the interval given by + the user on the command line. + * Old '-o' option for iostat removed. Now iostat can save data + into a file in a binary format and re-read them later (options + '-o' and '-f') in the same way sar does. + * Number of available processors now taken into account when + retrieving CPU usage from /proc/stat. + * Removed a bug that prevented 'sar -U' to work on SMP machines. + * Fixed a bug that made per-CPU average usage wrong on SMP machines. + * Use of option -U is now possible for sar when reading from a file + even if the machine is not an SMP one. + * Fixed a bug that prevented sar from re-reading stats saved in a file + when -I or -U option had been used. + * iostat modified to work on SMP machines. + * Changed the formula used to display stats in order not to get + numbers greater than UINT_MAX. + * System name, release number and hostname are now saved in + system activity files. + * iostat now displays system name, release number and hostname + when invoked. + * Daily system activity file rotation added for sar. + * Improved 64-bit system support. + * CREDITS file added. + * NLS updated: German translation added. + * Manual pages updated. + * Makefile updated: Do not call msgfmt if NLS is not enabled. + +1999/06/25: Version 1.2 - Sebastien Godard + * Better NLS support (date, time and numerical values, NLS enabled + for sar, etc.). + * System activity daily file structure changed: Is now independent of + the locale and is more compact. + * sar updated to support SMP machines (per CPU accounting). + * Code cleaned, man pages updated... + +1999/05/28: Version 1.1 - Sebastien Godard + * NLS support added. French translation started but needs to be + completed. + * sar updated to support more than 16 interrupts (potential APIC + interrupt sources). + * A few typos removed (man pages, etc.). + * Author email address updated :-) + * Tested on kernel 2.2.5. + +1999/03/06: Version 1.0 - Sebastien Godard + * Initial Revision. Tested on kernel 2.0.36. diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..a43ea212 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/CREDITS b/CREDITS new file mode 100644 index 00000000..37a20d0d --- /dev/null +++ b/CREDITS @@ -0,0 +1,217 @@ +The following people have contributed to 'sysstat' in one way or another: + + First I would like to thank Michael : He is the + very first person to have given me feedback about sysstat, and to + point out to me that certain fields in /proc/stat didn't have the + meaning I thought they had. This was in 1999! + + Many thanks to the translators involved in sysstat: + + * Birko Bergt for his translation into + German, + * Fernando Félix Redondo for his + translation into Spanish (now maintained by Muralito + ), + * Frederic L. W. Meunier <0 [at] pervalidus.net> for the + Portuguese translation. + * Gert Brits for the translation + into Afrikaans. + * Roy Sigurd Karlsbakk for the Norwegian + translation. + * Stefano Barni for the translation + into Italian. + * Dennis Selsky for the Russian translation. + * Eugen Hoanca for the Romanian + translation. + * Robert Luberda for the translation into + Polish. + * Miroslav David for the Slovak + translation. + * Hideki Yamane for the translation into + Japanese. + * Daniel Nylander for the Swedish + translation. + * John Damm Sørensen for the Danish + translation. + * Bram Schoenmakers for the Dutch + translation. + + Carl-Christian Weber helped me to make sar + work on SMP machines. + + Stefan Majer provided me with a patch to + rotate daily system activity files. + + Klaus Franken created the RPM + packages. He also included a short initialization script for sar + to start it as a daemon on boot. + + Jason (Jay) R. Fink set up and maintained the + first web site for sysstat. + + Preston Brown sent me the RedHat patch to + enable good packaging. + + David Doubrava created the isag + command (Interactive System Activity Graph). + + Rik van Riel explained me the meaning + of several fields that were added in Linux kernel 2.4 + /proc/meminfo file. + + Hubert Nueckel sent me a patch to + fix CPU utilization displayed by sar, iostat and mpstat commands + on IA64 machines. + + Victor Hazlewood sent me a patch to implement + a database friendly option for sar (option -H). + + Christopher Blizzard added the ability to + display kB/s transfers to devices in iostat reporting when + option -x is used. + + John Caruso wrote the sargon script + shell as a replacement for sa1/sa2 files. + + Wilhelm Nuesser sent me a patch to + fix average wait times and service times displayed by iostat -x. + + Rick Lindsley has played a great part in + making sysstat work on kernels 2.5 and above. + + John Salmon wrote a patch to enable file + locking for sadc (option -L). + + Jim W. Jaszewski fixed several typos in + sysstat FAQ! + + Charlie Bennett sent me several patches to + fix known problems with sysstat. He also added the sysstat.ioconf + file support, and the -p option to sar. + + Thomas Polliard helped me define the XML + output format for sadf. He also wrote the corresponding DTD. + + Dwight Tovey updated sysstat so that + it may be installed on Slackware. + + Bryce Harrington helped me to add support for + hotplug CPU to sysstat. + + Ivana Varekova added support for iostat + NFS statistics. Ivana also added support for autoconf, and created + cifsiostat command. + + Nils Philippsen made history configurable. + + Robert Luberda brought a few improvements + to sysstat's code, and also reported several bugs. + + Jeroen Roovers sent me a patch to fix a rare + parallel make issue creating archive libsyscom.a. + + Livio Soares sent me a patch to fix + a bug where mpstat didn't parse /proc/interrupts correctly when + some CPUs had been set offline. + + Emil Glatz wrote the XML Schema + to be used with sadf option -x. + + Eduardo Ferro Aldama added + option -l to pidstat to display the process command name and + arguments. + + Mario Konrad added regular expressions + support to pidstat'x option -C. He also added option -s to pidstat + to display task stack statistics. + + Jan Kaluza contributed several patches + to sysstat. Among them, he added some more power management + statistics to sar. + +I would also thank the following people for their hints or bug reports +(in alphabetical order): + + Des Atkinson + Sravan Bhamidipati + Chuck Blake + Michael Blakeley + Pascal Bleser + Jesse Brandeburg + Xavier Bru + Jason Burnett + Mark J. Cox + Jean Dagenais + Nicolas Denis + Andrew Donkin + Greg Edwards + Tony Ernst + Chris Evans + Damien Faure + Dr. David Alan Gilbert + David Gesswein + Ladislav Hagara + Don Harrop + Tatsuo Ito + David S. Jackson + Erik Jacobson + Jordan + Jurriaan + Jonathan Kamens + Ilya Katsnelson + Mike Kobler + Byeong-taek Lee + Ivo Letzas + Neculai Macarie + Robert Macaulay + Pierre Machard + Jérôme Marchand + Alan Matsuoka + Rodney J. Mertz + Roy Millar <100044.14@com[...].com> + Chris Minshull + Pascal Monschein + Chris Morrow + David J. Morse + Hariprasad Nellitheertha + Giulio Orsero + Edouard G. Parmelan + Oliver Paukstadt + Plattner(?) + Gerardo Exequiel Pozzi + ReDragon + Amir Rapson + Paul Rivoli + Scott Rochford + Rolphin + Pavol Rusnak + Joseph E. Sacco + Sachin Sant + Eivind Sarto + Danilo Sartori + Tan Shao Yi + Yibin Shen + Lee Schermerhorn + Benno Schulenberg + Michel Simoni + Gabrielle Singleton + Rod Skinner + Kevin C. Smallwood + Dick Snippe + Graham Swallow + Mike Sweger + Don Totten + Stephen Tweedie + Thomas Weber + Yongjun Wei + Stefan Wild + Thomas Winn + Holger Wolf + Urban Widmark + Yu Yongcong + Peter Zaitsev + +-- +Sebastien Godard (sysstat orange.fr) is the author and the current +maintainer of this package. + diff --git a/FAQ b/FAQ new file mode 100644 index 00000000..197f6bf6 --- /dev/null +++ b/FAQ @@ -0,0 +1,663 @@ +This is sysstat's Frequently Asked Questions! +Be sure to read this carefully before asking for help... +If you don't find the solution to your problem here then send me an email +(please remember to include sysstat's version number, a sample output +showing the bug, and the contents of the /proc/stat file for your system. +Also tell me what version your kernel is). + + +1. GENERAL QUESTIONS + +1.1. When I compile sysstat, it fails with the following message: + "make: msgfmt: Command not found". +1.2. When I try to compile sysstat, it fails and says it cannot find some + include files. +1.3. I don't understand why sysstat displays the time sometimes as HH:MM:SS + and sometimes as HH:MM:SS AM/PM... + +2. QUESTIONS RELATING TO SAR/SADC/SADF + +2.1. The sar command complains with the following message: + "Invalid system activity file: ...". +2.2. The sar command complains with the following message: + "Cannot append data to that file (...)". +2.3. The sar command complains with the following message: + "Invalid data format". +2.4. I get the following error message when I try to run sar: + "Cannot open /var/log/sa/sa30: No such file or directory". +2.5. Are sar daily data files fully compatible with Sun Solaris format + sar files? +2.6. I have some trouble running sar on my SMP box. My server crashes + with a kernel oops. +2.7. The "Average:" results from the sar command are just rubbish... +2.8. My database (e.g. MySQL) doesn't appear to understand the time zone + displayed by 'sadf -d'... +2.9. I tried to use the -p option of the sadf command, together with the + options -s and -e. Unfortunately, I have nothing displayed at all. +2.10. I cannot see all my disks when I use the sar -d command... +2.11. Do you know a tool which can graphically plot the data collected by sar? +2.12. When I launch sadc, I get the error message: + "flock: Resource temporarily unavailable". +2.13. How should I run sysstat / sar so that I get a reading for 00:00:00? +2.14. The sar command complains with the following message: + "Requested activities not available in file ...". +2.15. Does sar need a lot of resources to run? +2.16. Are the measurements gathered by sadc cumulative or instantaneous? +2.17. Some fields are always displayed as 0.00 when I use the sar -d + command. +2.18. The sar command complains with the following message: + "Requested activities not available". +2.19. How can I keep sar data for more than one month? +2.20. How can I load sar data into an Oracle database for performance + analysis and capacity planning? +2.21. The sar command displays some weird output values... +2.22. What happened to sar's options -h, -H, -x and -X? +2.23. What is the exact meaning of the parameter for sar and sadc? + +3. QUESTIONS RELATING TO IOSTAT + +3.1. I can't see all my disks when I use the iostat command... +3.2. iostat -x doesn't report disk I/O statistics... +3.3. Why can't iostat display extended statistics for partitions with + 2.6.x kernels? +3.4. I don't understand the output of iostat. It doesn't match what I expect + it to be... +3.5. Why values displayed by iostat are so different in the first report + from those displayed in subsequent ones? +3.6. iostat -x displays huge numbers for some fields... + +4. QUESTIONS RELATING TO PIDSTAT + +4.1. pidstat -d doesn't report task I/O statistics... +4.2. The pidstat command complains with the following message: + "Requested activities not available". +4.3. pidstat doesn't display statistics for process (task) xyz... + + +1. GENERAL QUESTIONS +#################### + +1.1. When I compile sysstat, it fails with the following message: +make: msgfmt: Command not found +make: ***[locales] Error 127 + +The msgfmt command belongs to the GNU gettext package. +If you don't have it on your system, just configure sysstat with +NLS disabled like this: + +$ ./configure --disable-nls + +or answer 'y' (for "yes") to the question +"Disable National Language Support (NLS)? (y/n) [--disable-nls]" +if you use the Interactive Configuration script (iconfig), +then compile sysstat as usual (make ; make install). +Please read the README-nls file included in sysstat source package to learn +some more about National Language Support. + +~~~ + +1.2. When I try to compile sysstat, it fails and says it cannot find some +include files: +In file included from /usr/include/bits/errno.h:25, + from /usr/include/errno.h:36, + from common.c:26: +/usr/include/linux/errno.h:4: asm/errno.h: No such file or directory + +common.c: In function `get_kb_shift': +common.c:180: `PAGE_SIZE' undeclared (first use in this function) +common.c:178: warning: `size' might be used uninitialized in this function +make: *** [common.o] Error 1 + +Make sure that you have the Linux kernel sources installed in +/usr/src/linux. Also make sure that the symbolic link exists in the +/usr/src/linux/include directory and points to the right architecture, e.g.: + +# ll /usr/src/linux/include/asm +lrwxrwxrwx 1 root root 8 May 5 18:31 /usr/src/linux/include/asm -> asm-i386 + +In fact, only the Linux kernel headers should be necessary to be able +to compile sysstat. + +~~~ + +1.3. I don't understand why sysstat displays the time sometimes as HH:MM:SS +and sometimes as HH:MM:SS AM/PM... + +The time format used by sysstat tools depends on the locale of your system. +The locale is defined by several environment variables, among which the LANG +variable is perhaps the most widely used. See the following example: + +$ export LANG=en_US +$ sar +Linux 2.4.9 (brooks.seringas.fr) 07/20/04 + +04:32:11 PM LINUX RESTART + +05:00:00 PM CPU %user %nice %system %iowait %idle +05:10:00 PM all 0.24 0.00 89.64 0.00 10.12 +Average: all 0.24 0.00 89.64 0.00 10.12 + +$ export LANG=fr_FR +$ sar +Linux 2.4.9 (brooks.seringas.fr) 20.07.2004 + +16:32:11 LINUX RESTART + +17:00:00 CPU %user %nice %system %iowait %idle +17:10:00 all 0,24 0,00 89,64 0,00 10,12 +Moyenne: all 0,24 0,00 89,64 0,00 10,12 + +As you can notice, the time format but also the date, the decimal point, and +even some words (like "Average") have changed according to the specified +locale. + + +2. QUESTIONS RELATING TO SAR/SADC/SADF +###################################### + +2.1. The sar command complains with the following message: +Invalid system activity file: ... + +You are trying to use a file which is not a system activity file, or +whose format is no longer compatible with that of files created by +current version of sar. +If you were trying to use the standard system activity files located in the +/var/log/sa directory then the solution is easy: just log in as root and +remove by hand all the files located in the /var/log/sa directory: + +# rm /var/log/sa/sa?? + +With recent versions of sysstat (8.1.1 and later), it is now possible to +know which version of sar or sadc has been used to create a data file. +Just enter the following command: + +$ sadf -H /your/datafile | grep sysstat +File created using sar/sadc from sysstat version 8.1.7 + +~~~ + +2.2. The sar command complains with the following message: +Cannot append data to that file (...) + +The internal structure of the data file does not allow sar to append +data to it. The data file may come from another machine, or the components +of the current box, such as the number of processors, may have changed. +Use another data file, or delete the current daily data file, and try again. + +~~~ + +2.3. The sar command complains with the following message: +Invalid data format + +This error message means that sadc (the system activity data collector that +sar is using) is not consistent with the sar command. In most cases this is +because the sar and sadc commands do not belong to the same release of the +sysstat package. Remember that sar may search for sadc in predefined +directories (/usr/local/lib/sa, /usr/lib/sa, ...) before looking in the +current directory! + +~~~ + +2.4. I get the following error message when I try to run sar: +Cannot open /var/log/sa/sa30: No such file or directory + +Please read the sar(1) manual page! Daily data files are created in the +/var/log/sa directory using the data collector (sadc) or using option +-o with sar. Once they are created, sar can display statistics saved +in those files. +But sar can also display statistics collected "on the fly": just enter +the proper option on the command line to indicate which statistics are +to be displayed, and also specify an and number. +E.g.: + +# sar 2 5 --> will report CPU utilization every two seconds, five times. +# sar -n DEV 3 0 --> will report network device utilization every +3 seconds, in an infinite loop. + +~~~ + +2.5. Are sar daily data files fully compatible with Sun Solaris format +sar files? + +No, the format of the binary data files created by sysstat's sar command +is not compatible with formats from other Unixes, because it contains +data which are closely linked to Linux. +For the same reason, sysstat cannot work on platforms other than Linux... + +~~~ + +2.6. I have some trouble running sar on my SMP box. My server crashes +with a kernel oops: +Feb 17 04:05:00 bolums1 kernel: Unable to handle kernel paging request +at virtual address fffffc1c +Feb 17 04:05:00 bolums1 kernel: current->tss.cr3 = 19293000, %cr3 = 19293000 +Feb 17 04:05:00 bolums1 kernel: *pde = 0026b067 +Feb 17 04:05:00 bolums1 kernel: *pte = 00000000 +Feb 17 04:05:00 bolums1 kernel: Oops: 0000 +Feb 17 04:05:00 bolums1 kernel: CPU: 0 +Feb 17 04:05:00 bolums1 kernel: EIP: +<...> + +The trouble you have is triggered by a *Linux* kernel bug, not a sysstat +one... The best solution is to upgrade your kernel to the latest stable +release. +Also, if you cannot upgrade your box, try to configure sysstat with the +SMP race workaround: + +$ ./configure --enable-smp-race + +or answer 'y' to the question: +"Linux SMP race in serial driver workaround? (y/n) [--enable-smp-race]" +if you use the Interactive Configuration script (iconfig). +Indeed, we found that 2.2.x kernels (with x <= 15) have an SMP race +condition, which the sar command may trigger when it reads the +/proc/tty/driver/serial file. + +~~~ + +2.7. The "Average:" results from the sar command are just rubbish... +E.g.: + 11:00:00 AM CPU %user %nice %system %idle + 11:10:00 AM all 0.54 0.00 0.89 98.57 + 11:20:01 AM all 3.02 8.05 22.85 66.08 + 11:30:01 AM all 8.15 0.00 2.31 89.54 + 11:40:01 AM all 8.03 0.00 2.42 89.55 + 11:50:01 AM all 16.04 0.00 2.81 81.16 + 12:00:00 PM all 21.11 0.00 3.23 75.66 + 03:40:01 PM all 100.01 100.01 100.01 0.00 + 04:40:00 PM all 100.00 0.00 100.00 0.00 + 04:50:00 PM all 5.87 0.00 1.26 92.87 + 05:00:00 PM all 4.70 0.00 1.48 93.82 + 05:10:00 PM all 4.93 0.00 1.29 93.78 + Average: all 100.22 100.20 100.13 0.00 + +Your sar command was not installed properly. Whenever your computer +is restarted (as it is the case here between 12:00:00 PM and 03:40:01 PM), +the 'sysstat' shell script must be called by the system, so that the +LINUX RESTART message can be inserted into the daily data file, indicating +that the relevant kernel counters have been reinitialized... +You can install the 'sysstat' script by hand in the relevant startup +directory, or you can ask sysstat to do it for you during configuration +stage by entering: + +$ ./configure --enable-install-cron + +Or you can answer 'y' to the question: +"Set crontab to start sar automatically? (y/n) [--enable-install-cron]" +if you use the Interactive Configuration script (iconfig). +Then compile sysstat as usual and run 'make install' as the last stage. + +~~~ + +2.8. My database (e.g. MySQL) doesn't appear to understand the time zone +displayed by 'sadf -d'... + +The format includes the timezone detail in the output. This is to make +sure it is communicated clearly that UTC is how the data is always +converted and printed. Moreover we don't depend on the TZ environment +variable and we don't have some data converted to a different timezone +for any reason, known or unknown. +When you deal with raw accounting data you always want it in UTC. +Of course, you want it to all be the same when loading into a database. +If your database can't deal with timezones, you should write a short script +to strip the "UTC" characters from the data being loaded into the database. + +~~~ + +2.9. I tried to use the -p option of the sadf command, together with the +options -s and -e. Unfortunately, I have nothing displayed at all. + +This is because no data belong to the specified time interval! +With versions older than 7.0.1, the time specified by options -s or -e +may be considered as given in UTC (Coordinated Universal Time) or local +time depending on whether sadf displays its output in UTC or local time. +Option -p makes sadf display its timestamp in UTC, as indicated in the +manual page. The UTC value may be different from the value that sar +(or sadf without option -p) displays. The same remark applies to the +use of -d option. + +~~~ + +2.10. I cannot see all my disks when I use the sar -d command... + +See question 3.1 below. + +~~~ + +2.11. Do you know a tool which can graphically plot the data collected by sar? + +Several such tools are lying around on the internet. I haven't tested all of +them and there must still be some way for improvement... +First, some tools are included in the sysstat package: isag (a Perl script) +or sargraph (a shell script). +You can also find: kSar, sarvant, sar2gp, loadgraph, SysStat Charts, sarplot... +rrd.cgi (http://haroon.sis.utoronto.ca/rrd/scripts/) is a perl front-end for +rrdtool and can be used to make some graphs (see a demo at +http://haroon.sis.utoronto.ca/perl/rrd.cgi/sar_stats/). +I've also heard of commercial tools which use sysstat: PerfMan comes to mind, +among others. +If you find others which you think are of real interest, please let me know +so that I can update this list. + +~~~ + +2.12. When I launch sadc, I get the error message: +flock: Resource temporarily unavailable + +You are launching sadc using -L option. With this option, sadc tries to +get an exclusive lock on the output file. The above error message indicates +that another sadc process was running and had already locked the same output +file. Stop all sadc instances and try again. + +~~~ + +2.13. I have sysstat setup to run via cron: +0 * * * * /usr/local/lib/sa/sa1 600 6 & +so that I get an activity report every 10 minutes. +When I use sar to get my output, there is no reading for 00:00:00. This +means that at midnight every night there is a spike, or dip, in the graphs. +How should I run sysstat / sar so that I get a reading for 00:00:00? + +Sysstat does get its data at midnight, but two data samples are needed to +display the values. +When there is a "file rotation" (beginning of a new day), sadc writes its data +at the end of the previous daily data file (/var/log/sa/sa
) *and* at the +beginning of the new one (/var/log/sa/sa). Please note that '-' must be +used to specify the output file for sadc to be able to detect such a file +rotation. So a crontab like the following one should enable you to get the +data for midnight at the end of each daily data file: + +# Activity reports every 10 minutes from 01:00:00 to 22:50:00 +0 1-22 * * * /usr/local/lib/sa/sa1 600 6 & +# Activity reports every 10 minutes from 23:00:00 to 00:00:00 +# Reporting until 00:00:00 ensures that a file rotation will be detected +# by sadc +0 23 * * * /usr/local/lib/sa/sa1 600 7 & +# Activity reports every 10 minutes from 00:10:00 to 00:50:00 +10 0 * * * /usr/local/lib/sa/sa1 600 5 & + +Another possible crontab would be: + +*/10 1-22 * * * /usr/lib/sa/sa1 -d 1 1 +0,10,20,30,40 23 * * * /usr/lib/sa/sa1 -d 1 1 +50 23 * * * /usr/lib/sa/sa1 -d 600 2 +10,20,30,40,50 0 * * * /usr/lib/sa/sa1 -d 1 1 + +~~~ + +2.14. The sar command complains with the following message: +Requested activities not available in file ... + +This error message means that you are trying to extract non-existent activities +from the data file. Usually sadc reads all the available activities from the +system and stores them in the data file. However, to prevent data files from +taking too much space on disk, some activities must be explicitly set on the +command line to be read by sadc. +To tell sadc that an optional activity should be collected, use switch -S +followed by the keyword corresponding to that activity (see sadc(8) manual page). +As of this writing, optional activities are: interrupts, disks, SNMP, IPv6 and +power management statistics. +IMPORTANT NOTE: The list of activities that are saved in a file can no longer +be modified once the file has been created. So it is important to use the proper +options the first time sadc is called (whether via a crontab, a script like +sa1 or even the script used to insert a RESTART message when the machine is +rebooted). +NB: If the sar command complains with the error message: +"Requested activities not available" (without mentioning "in file"), +then see question 2.18 below. + +~~~ + +2.15. Does sar need a lot of resources to run? + +No, sar doesn't need a lot of CPU to run, nor does it make your system slow, +contrary to what some people think. In the first place, it only runs every ten +minutes by default. Secondly, when it does run, it is over and done very +quickly. Try: + +$ time /usr/lib/sa/sa1 + +to verify that for yourself. +Nor do you have to be concerned about using up all your disk space. +sar will use a few hundred kilobytes for a whole day's worth of data, and it +normally only stores one week worth (this can be configured via the HISTORY +variable in the /etc/sysconfig/sysstat file). It is entirely self limiting. +Moreover, you can ask sar to compress its datafiles older than a certain +number of days: see the COMPRESSAFTER parameter in the /etc/sysconfig/sysstat +configuration file. + +~~~ + +2.16. Are the measurements gathered by sadc cumulative or instantaneous values? + +Each counter maintained by the kernel is cumulative since system boot. As a +consequence the measurements gathered by sadc are cumulative values. +Moreover all per-second statistics displayed by sar are average values on the +given time interval. So the value for counter foo at time T is calculated as: +foo/s = [foo(T) - foo(T-dt)] / dt +where dt is the interval given on the command line. + +~~~ + +2.17. Some fields are always displayed as 0.00 when I use the sar -d +command. + +See question 3.2 below. + +~~~ + +2.18. The sar command complains with the following message: +Requested activities not available + +This error message means that you are trying to display activities that the +kernel itself is unable to provide. +When this error message is displayed while trying to save the data into an +existing file ("sar -o datafile ..."), this may also be because the target +file cannot accept the requested activities. In this case, just try to use +another file or create a new one. See also question 2.14 above. + +~~~ + +2.19. How can I keep sar data for more than one month? + +By default sar saves its data in the standard system activity data file, +the /var/log/sa/sa
file, where
is the current day in the month. +To prevent sar from overwriting any existing files, just set the variable +HISTORY in /etc/sysconfig/sysstat to the number of days during which data +must be kept. When this variable has a value greater than 28, sa1 script +uses a month-by-month directory structure; datafiles are named YYYYMM/saDD +and the script maintains links to these datafiles to mimic the standard +sar datafile structure. +However please note that pre-existing datafiles will be deleted as links +will be created and replace them. + +~~~ + +2.20. How can I load sar data into an Oracle database for performance +analysis and capacity planning? + +The simplest way for that is to use sadf (a command included in sysstat +package) with its option -d. It displays sar data in a format that can +easily be ingested by a relational database system (fields are separated +by a semicolon). It should then be easy for a tool like SQL*Loader to +load the data into the Oracle database. + +~~~ + +2.21. The sar command displays some weird CPU values... +E.g.: +10:50:01 AM CPU %user %nice %system %iowait %idle +11:00:01 AM all 90.90 0.00 5.17 3.93 0.00 +11:00:01 AM 0 39.40 0.00 2.37 2.07 56.17 +11:00:01 AM 1 29.71 0.00 1.73 1.17 67.39 +11:00:01 AM 2 42.69 0.00 2.34 1.11 53.85 +11:00:01 AM 3 26.24 0.00 1.41 1.61 70.74 +... + +Sysstat may have met an overflow condition while reading CPU usage from +your /proc/stat file. This condition is all the more likely to happen as +your machine uptime is high and/or there are many processors. +Sysstat up to version 5.0.6 uses 32-bit integer variables to store CPU usage. +Then, beginning with version 5.1.1, sysstat has shifted to 64-bit variables, +which has fixed the problem. So try to upgrade your version of sysstat to +the latest stable release and check that the problem has gone. + +~~ + +2.22. What happened to sar's options -h, -H, -x and -X? + +These old options have been removed from sar because new commands have been +made available. You should now use the sadf command instead of sar -h or +sar -H, and the pidstat command instead of sar -x or sar -X. Please read +their manual page to learn some more about their respective options. + +~~ + +2.23. What is the exact meaning of the parameter for sar and sadc? + +For sadc, is the number of data samples collected. +For sar, is the number of records to display (a record contains +the average values for counters over the given time interval - See 2.16). + +Starting with an empty file : + +sadc 1 6 will write 6 data samples to file. +sar -f 1 6 6 is invalid because there are only 5 intervals. + +Based on the value entered for sadc the "valid" values for +sar are 1 through 5. Any value greater than 5 for sar will give the +same output as 5 in this example. So entering sar -f 1 2000 +for a file populated with the output of sadc 1 6 will give the +same output as sar -f 1 5. Note that it all depends on the number +of data samples pre-existing in the data file. If the file is empty +when first running sadc then the above is true. + +3. QUESTIONS RELATING TO IOSTAT +############################### + +3.1. I can't see all my disks when I use the iostat command... + +Yes. This is a kernel limit. Old kernels (2.2.x for instance) used to +maintain stats for the first four devices. +The accounting code has changed in 2.4 kernels, and the result may (or +may not) be better for your system. Indeed, Linux 2.4 maintains the stats +in a two dimensional array, with a maximum of 16 devices (DK_MAX_DISK +in the kernel sources). Moreover, if the device major number exceeds +DK_MAX_MAJOR (whose value also defaults to 16 in the kernel sources), +then stats for this device will not be collected. +So, a solution may be simply to change the values of these limits in +linux/include/linux/kernel_stat.h and recompile your kernel. +You should no longer have any problem with post 2.5 kernels, since +statistics are maintained by the kernel for all the devices. +In the particular case of iostat, also be sure to use the ALL keyword +on the command line to display statistical information relating to +every device, including those that are defined but have never been used +by the system. + +~~~ + +3.2. iostat -x doesn't report disk I/O statistics... + +For 'iostat -x' to be able to report extended disk I/O statistics, +it is better to use a recent version of the Linux kernel (2.6.x). +Indeed, iostat tries to read data from the /proc/diskstats file or +from the sysfs filesystem for that. +But iostat may also be able to display extended statistics with +older kernels (e.g. 2.4.x) providing that all the necessary +statistical information is available in the /proc/partitions file, +which requires that a patch be applied to the kernel (this is +often done on kernels included in various distros). In recent 2.4.x +kernels, the /proc/partitions file has all the necessary data +providing that the kernel has been compiled with CONFIG_BLK_STATS=y. + +~~~ + +3.3. Why can't iostat display extended statistics for partitions with + some 2.6.x kernels? + +Because the kernel maintains these stats only for devices, and not for +partitions! Here is an excerpt from the document iostats.txt written by +Rick Lindsley (ricklind@us.ibm.com) and included in the kernel source +documentation: +"There were significant changes between 2.4 and 2.6 in the I/O subsystem. +As a result, some statistic information disappeared. The translation from +a disk address relative to a partition to the disk address relative to +the host disk happens much earlier. All merges and timings now happen +at the disk level rather than at both the disk and partition level as +in 2.4. Consequently, you'll see a different statistics output on 2.6 for +partitions from that for disks." +Extended I/O statistics for partitions are available again with kernels +2.6.25 and later. + +~~~ + +3.4. I don't understand the output of iostat. It doesn't match what I expect it +to be... + +By default iostat displays I/O activity in blocks per second. With old +kernels (i.e. older than 2.4.x) a block is of indeterminate size and therefore +the displayed values are not useful. +With recent kernels (kernels 2.4 and later), iostat is now able to get disk +activities from the kernel expressed in a number of sectors. If you take a +look at the kernel code, the sector size is actually allowed to vary although +I have never seen anything other than 512 bytes. + +~~~ + +3.5. Why values displayed by iostat are so different in the first report + from those displayed in subsequent ones? + +Probably because, as written in the manual page, the first report generated +by iostat concerns the time since system startup, whereas subsequent ones +cover only the time since the previous report (that is to say, the interval +of time entered on the command line). + +~~~ + +3.6. iostat -x displays huge numbers for some fields... + +Because of a Linux kernel bug, iostat -x may display huge I/O response times +(svctm) and a bandwidth utilization (%util) of 100% for some devices. Indeed +these devices have a value for the field #9 (beginning after the device name) +in /proc/{partitions,diskstats} which is always different from 0, and even +negative sometimes. Yet this field should go to zero, since it gives the +number of I/Os currently in progress (it is incremented as requests are +submitted, and decremented as they finish). +To (temporarily) fix the problem, you should reboot your system to reset the +counters in /proc/{partitions,diskstats}. + + +4. QUESTIONS RELATING TO PIDSTAT +################################ + +4.1. pidstat -d doesn't report task I/O statistics... + +For pidstat -d to be able to report I/O statistics for tasks, you need +a recent Linux kernel (2.6.20 or later) with the option +CONFIG_TASK_IO_ACCOUNTING compiled in. + +~~~ + +4.2. The pidstat command complains with the following message: + "Requested activities not available". + +This message is displayed when the pidstat command is unable to display +the statistics you have requested. This may happen when you try to display +statistics for child processes (option -T CHILD) because all options of +pidstat don't necessarily work for child processes. Read the manual page +to know which statistics are available for child processes. + +~~~ + +4.3. pidstat doesn't display statistics for process (task) xyz... + +This must be because pidstat only displays statistics for active tasks +by default. If you don't use option -p on the command line, then pidstat +will display only tasks with non-zero statistics. For example, "pidstat -u" +will display only tasks that have actually used some CPU resources since +system startup. You should enter "pidstat -u -p ALL" to make sure that all +the processes are listed in the report. + +-- +Sebastien Godard (sysstat orange.fr) is the author and the current +maintainer of this package. diff --git a/INSTALL b/INSTALL new file mode 100644 index 00000000..54caf7c1 --- /dev/null +++ b/INSTALL @@ -0,0 +1,229 @@ +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software +Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 00000000..5dac5c7f --- /dev/null +++ b/Makefile.in @@ -0,0 +1,599 @@ +# Makefile to build sysstat commands +# # (C) 1999-2009 Sebastien GODARD (sysstat orange.fr) + +# Version and package name +VERSION = @PACKAGE_VERSION@ +PACKAGE = @PACKAGE_NAME@ +# Needed by docdir +PACKAGE_TARNAME = $(PACKAGE)-$(VERSION) + +# Compiler to use +CC = @CC@ + +# Other commands +CHMOD = @CHMOD@ +CHOWN = @CHOWN@ +LN_S = @LN_S@ +AR = @AR@ +# Full path to prevent from using aliases +CP = @PATH_CP@ + +CHKCONFIG = @PATH_CHKCONFIG@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_BIN = @INSTALL_BIN@ + +# Directories +ifndef PREFIX +PREFIX = @prefix@ +endif +ifndef DESTDIR +DESTDIR = $(RPM_BUILD_ROOT) +endif +# These two variables are needed by other ones (eg bindir) +prefix = $(PREFIX) +exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ + +ifndef SA_LIB_DIR +SA_LIB_DIR = @SA_LIB_DIR@ +endif +SADC_PATH = $(SA_LIB_DIR)/sadc +ifndef SA_DIR +SA_DIR = @SA_DIR@ +endif +BIN_DIR = @bindir@ + +ifndef MAN_DIR +# With recent versions of autoconf, mandir defaults to ${datarootdir}/man +# (i.e. $prefix/share/man) which is not necessarily in man path! +# MAN_DIR = @mandir@ +MAN_DIR = @AuxMandir@ +endif +MAN1_DIR = $(MAN_DIR)/man1 +MAN8_DIR = $(MAN_DIR)/man8 + +ifndef DOC_DIR +DOC_DIR = @docdir@ +endif + +NLS_DIR = $(PREFIX)/share/locale +SYSCONFIG_DIR = @SYSCONFIG_DIR@ + +# Compiler flags +CFLAGS = @CFLAGS@ -Wall -Wstrict-prototypes -pipe -O2 +DFLAGS = @DFLAGS@ +LFLAGS = -s +DFLAGS += -DSA_DIR=\"$(SA_DIR)\" -DSADC_PATH=\"$(SADC_PATH)\" + +# Commands +ifndef MSGFMT +MSGFMT = @MSGFMT@ +endif +ifndef XGETTEXT +XGETTEXT = @XGETTEXT@ +endif +ifndef MSGMERGE +MSGMERGE = @MSGMERGE@ +endif +ifndef ZIP +ZIP = @ZIP@ +endif + +# Settings +NLS = @NLS@ +ifeq ($(NLS),y) +REQUIRE_NLS = -DUSE_NLS -DPACKAGE=\"$(PACKAGE)\" -DLOCALEDIR=\"$(NLS_DIR)\" +endif +ifdef REQUIRE_NLS + DFLAGS += $(REQUIRE_NLS) +endif +INSTALL_CRON = @INSTALL_CRON@ +CRON_OWNER = @CRON_OWNER@ + +MAN_GROUP = @MAN_GROUP@ +ifndef IGNORE_MAN_GROUP +IGNORE_MAN_GROUP = @IGNORE_MAN_GROUP@ +endif +ifeq ($(IGNORE_MAN_GROUP),y) +MANGRPARG = +else +MANGRPARG = -g $(MAN_GROUP) +endif +ifndef CLEAN_SA_DIR +CLEAN_SA_DIR = @CLEAN_SA_DIR@ +endif +ifndef COMPRESS_MANPG +COMPRESS_MANPG = @COMPRESS_MANPG@ +endif +ifndef INSTALL_ISAG +INSTALL_ISAG = @INSTALL_ISAG@ +endif +ifndef INSTALL_DOC +INSTALL_DOC = @INSTALL_DOC@ +endif + +# Run-command directories +ifndef RC_DIR +RC_DIR = @RC_DIR@ +endif +RC0_DIR = $(RC_DIR)/rc0.d +RC1_DIR = $(RC_DIR)/rc1.d +RC2_DIR = $(RC_DIR)/rc2.d +RC3_DIR = $(RC_DIR)/rc3.d +RC4_DIR = $(RC_DIR)/rc4.d +RC5_DIR = $(RC_DIR)/rc5.d +RC6_DIR = $(RC_DIR)/rc6.d +ifndef INIT_DIR +INIT_DIR = @INIT_DIR@ +endif +ifndef INITD_DIR +INITD_DIR = @INITD_DIR@ +endif + +NLSPO= $(wildcard nls/*.po) +NLSGMO= $(NLSPO:.po=.gmo) +NLSPOT= $(NLSPO:.po=.pot) + +%.gmo: %.po + $(MSGFMT) -o $@ $< + +%.pot: %.po + $(MSGMERGE) -U $< nls/sysstat.pot + +%.o: %.c + $(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $< + +% : %.o + $(CC) -o $@ $(CFLAGS) $^ $(LFLAGS) + +all: sadc sar sadf iostat mpstat pidstat nfsiostat cifsiostat locales + +common.o: common.c version.h common.h ioconf.h sysconfig.h + +sa_common.o: sa_common.c sa.h common.h ioconf.h sysconfig.h rd_stats.h + +ioconf.o: ioconf.c ioconf.h common.h sysconfig.h + +act_sadc.o: activity.c sa.h rd_stats.h + $(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $< + +act_sar.o: activity.c sa.h pr_stats.h + $(CC) -o $@ -c $(CFLAGS) -DSOURCE_SAR $(DFLAGS) $< + +act_sadf.o: activity.c sa.h prf_stats.h + $(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADF $(DFLAGS) $< + +rd_stats.o: rd_stats.c common.h rd_stats.h ioconf.h sysconfig.h + +pr_stats.o: pr_stats.c sa.h ioconf.h sysconfig.h pr_stats.h + +prf_stats.o: prf_stats.c sa.h ioconf.h sysconfig.h prf_stats.h + +sa_wrap.o: sa_wrap.c sa.h rd_stats.h + +# Explicit rules needed to prevent possible file corruption +# when using parallel execution. +libsyscom.a: common.o ioconf.o + $(AR) rvs $@ $? + +librdstats.a: librdstats.a(rd_stats.o) + +sadc.o: sadc.c sa.h version.h common.h ioconf.h sysconfig.h rd_stats.h + +sadc: sadc.o act_sadc.o sa_wrap.o sa_common.o librdstats.a libsyscom.a + +sar.o: sar.c sa.h version.h common.h ioconf.h pr_stats.h sysconfig.h + +sar: sar.o act_sar.o sa_common.o pr_stats.o libsyscom.a + +sadf.o: sadf.c sadf.h version.h sa.h common.h ioconf.h sysconfig.h prf_stats.h + +sadf: sadf.o act_sadf.o prf_stats.o sa_common.o libsyscom.a + +iostat.o: iostat.c iostat.h version.h common.h ioconf.h sysconfig.h rd_stats.h + +iostat: iostat.o librdstats.a libsyscom.a + +pidstat.o: pidstat.c pidstat.h version.h common.h rd_stats.h + +pidstat: pidstat.o librdstats.a libsyscom.a + +mpstat.o: mpstat.c mpstat.h version.h common.h rd_stats.h + +mpstat: mpstat.o librdstats.a libsyscom.a + +nfsiostat.o: nfsiostat.c nfsiostat.h version.h common.h + +nfsiostat: nfsiostat.o librdstats.a libsyscom.a + +cifsiostat.o: cifsiostat.c cifsiostat.h version.h common.h + +cifsiostat: cifsiostat.o librdstats.a libsyscom.a + +ifdef REQUIRE_NLS +locales: $(NLSGMO) +else +locales: +endif + +nls/sysstat.pot: $(wildcard *.c) + $(XGETTEXT) -o $@ -k_ --msgid-bugs-address="sysstat orange.fr" $^ + +# Phony targets +.PHONY: clean distclean install install_base install_all uninstall \ + uninstall_base uninstall_all dist bdist + +install_man: man/sadc.8 man/sar.1 man/sadf.1 man/sa1.8 man/sa2.8 +ifeq ($(INSTALL_DOC),y) + mkdir -p $(DESTDIR)$(MAN1_DIR) + mkdir -p $(DESTDIR)$(MAN8_DIR) + rm -f $(DESTDIR)$(MAN8_DIR)/sa1.8* + $(INSTALL_DATA) $(MANGRPARG) man/sa1.8 $(DESTDIR)$(MAN8_DIR) + rm -f $(DESTDIR)$(MAN8_DIR)/sa2.8* + $(INSTALL_DATA) $(MANGRPARG) man/sa2.8 $(DESTDIR)$(MAN8_DIR) + rm -f $(DESTDIR)$(MAN8_DIR)/sadc.8* + $(INSTALL_DATA) $(MANGRPARG) man/sadc.8 $(DESTDIR)$(MAN8_DIR) + rm -f $(DESTDIR)$(MAN1_DIR)/sar.1* + $(INSTALL_DATA) $(MANGRPARG) man/sar.1 $(DESTDIR)$(MAN1_DIR) + rm -f $(DESTDIR)$(MAN1_DIR)/sadf.1* + $(INSTALL_DATA) $(MANGRPARG) man/sadf.1 $(DESTDIR)$(MAN1_DIR) + rm -f $(DESTDIR)$(MAN1_DIR)/iostat.1* + $(INSTALL_DATA) $(MANGRPARG) man/iostat.1 $(DESTDIR)$(MAN1_DIR) + rm -f $(DESTDIR)$(MAN1_DIR)/mpstat.1* + $(INSTALL_DATA) $(MANGRPARG) man/mpstat.1 $(DESTDIR)$(MAN1_DIR) + rm -f $(DESTDIR)$(MAN1_DIR)/pidstat.1* + $(INSTALL_DATA) $(MANGRPARG) man/pidstat.1 $(DESTDIR)$(MAN1_DIR) + rm -f $(DESTDIR)$(MAN1_DIR)/nfsiostat.1* + $(INSTALL_DATA) $(MANGRPARG) man/nfsiostat.1 $(DESTDIR)$(MAN1_DIR) + rm -f $(DESTDIR)$(MAN1_DIR)/cifsiostat.1* + $(INSTALL_DATA) $(MANGRPARG) man/cifsiostat.1 $(DESTDIR)$(MAN1_DIR) +ifeq ($(INSTALL_ISAG),y) + $(INSTALL_DATA) $(MANGRPARG) contrib/isag/isag.1 $(DESTDIR)$(MAN1_DIR) +endif +ifeq ($(COMPRESS_MANPG),y) + $(ZIP) $(DESTDIR)$(MAN8_DIR)/sa1.8 + $(ZIP) $(DESTDIR)$(MAN8_DIR)/sa2.8 + $(ZIP) $(DESTDIR)$(MAN8_DIR)/sadc.8 + $(ZIP) $(DESTDIR)$(MAN1_DIR)/sar.1 + $(ZIP) $(DESTDIR)$(MAN1_DIR)/sadf.1 + $(ZIP) $(DESTDIR)$(MAN1_DIR)/iostat.1 + $(ZIP) $(DESTDIR)$(MAN1_DIR)/mpstat.1 + $(ZIP) $(DESTDIR)$(MAN1_DIR)/pidstat.1 + $(ZIP) $(DESTDIR)$(MAN1_DIR)/nfsiostat.1 + $(ZIP) $(DESTDIR)$(MAN1_DIR)/cifsiostat.1 +ifeq ($(INSTALL_ISAG),y) + $(ZIP) $(DESTDIR)$(MAN1_DIR)/isag.1 +endif +endif +endif + +install_nls: locales +ifdef REQUIRE_NLS + mkdir -p $(DESTDIR)$(NLS_DIR)/af/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/cs/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/da/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/de/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/es/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/eu/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/fi/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/fr/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/id/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/it/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/ja/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/ky/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/lv/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/mt/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/nb/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/nl/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/nn/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/pl/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/pt/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/pt_BR/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/ro/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/ru/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/sk/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/sv/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/vi/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/zh_CN/LC_MESSAGES + mkdir -p $(DESTDIR)$(NLS_DIR)/zh_TW/LC_MESSAGES + $(INSTALL_DATA) nls/af.gmo $(DESTDIR)$(NLS_DIR)/af/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/cs.gmo $(DESTDIR)$(NLS_DIR)/cs/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/da.gmo $(DESTDIR)$(NLS_DIR)/da/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/de.gmo $(DESTDIR)$(NLS_DIR)/de/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/es.gmo $(DESTDIR)$(NLS_DIR)/es/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/eu.gmo $(DESTDIR)$(NLS_DIR)/eu/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/fi.gmo $(DESTDIR)$(NLS_DIR)/fi/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/fr.gmo $(DESTDIR)$(NLS_DIR)/fr/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/id.gmo $(DESTDIR)$(NLS_DIR)/id/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/it.gmo $(DESTDIR)$(NLS_DIR)/it/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/ja.gmo $(DESTDIR)$(NLS_DIR)/ja/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/ky.gmo $(DESTDIR)$(NLS_DIR)/ky/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/lv.gmo $(DESTDIR)$(NLS_DIR)/lv/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/mt.gmo $(DESTDIR)$(NLS_DIR)/mt/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/nb.gmo $(DESTDIR)$(NLS_DIR)/nb/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/nl.gmo $(DESTDIR)$(NLS_DIR)/nl/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/nn.gmo $(DESTDIR)$(NLS_DIR)/nn/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/pl.gmo $(DESTDIR)$(NLS_DIR)/pl/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/pt.gmo $(DESTDIR)$(NLS_DIR)/pt/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/pt_BR.gmo $(DESTDIR)$(NLS_DIR)/pt_BR/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/ro.gmo $(DESTDIR)$(NLS_DIR)/ro/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/ru.gmo $(DESTDIR)$(NLS_DIR)/ru/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/sk.gmo $(DESTDIR)$(NLS_DIR)/sk/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/sv.gmo $(DESTDIR)$(NLS_DIR)/sv/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/vi.gmo $(DESTDIR)$(NLS_DIR)/vi/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/zh_CN.gmo $(DESTDIR)$(NLS_DIR)/zh_CN/LC_MESSAGES/$(PACKAGE).mo + $(INSTALL_DATA) nls/zh_TW.gmo $(DESTDIR)$(NLS_DIR)/zh_TW/LC_MESSAGES/$(PACKAGE).mo +endif + +install_base: all sa1 sa2 sysstat.sysconfig install_man install_nls \ + contrib/isag/isag + mkdir -p $(DESTDIR)$(SA_LIB_DIR) + mkdir -p $(DESTDIR)$(SA_DIR) +ifeq ($(CLEAN_SA_DIR),y) + find $(DESTDIR)$(SA_DIR) \( -name 'sar??' -o -name 'sa??' -o -name 'sar??.gz' -o -name 'sa??.gz' \) \ + -exec rm -f {} \; + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(SA_DIR)/[0-9]????? +endif + mkdir -p $(DESTDIR)$(BIN_DIR) + mkdir -p $(DESTDIR)$(DOC_DIR) + mkdir -p $(DESTDIR)$(SYSCONFIG_DIR) + $(INSTALL_BIN) sa1 $(DESTDIR)$(SA_LIB_DIR) + $(INSTALL_BIN) sa2 $(DESTDIR)$(SA_LIB_DIR) + $(INSTALL_BIN) sadc $(DESTDIR)$(SA_LIB_DIR) + $(INSTALL_BIN) sar $(DESTDIR)$(BIN_DIR) + $(INSTALL_BIN) sadf $(DESTDIR)$(BIN_DIR) + $(INSTALL_BIN) iostat $(DESTDIR)$(BIN_DIR) + $(INSTALL_BIN) mpstat $(DESTDIR)$(BIN_DIR) + $(INSTALL_BIN) pidstat $(DESTDIR)$(BIN_DIR) + $(INSTALL_BIN) nfsiostat $(DESTDIR)$(BIN_DIR) + $(INSTALL_BIN) cifsiostat $(DESTDIR)$(BIN_DIR) +ifeq ($(INSTALL_ISAG),y) + $(INSTALL_BIN) contrib/isag/isag $(DESTDIR)$(BIN_DIR) +endif + $(INSTALL_DATA) sysstat.ioconf $(DESTDIR)$(SYSCONFIG_DIR) + $(INSTALL_DATA) sysstat.sysconfig $(DESTDIR)$(SYSCONFIG_DIR)/sysstat +ifeq ($(INSTALL_DOC),y) + $(INSTALL_DATA) CHANGES $(DESTDIR)$(DOC_DIR) + $(INSTALL_DATA) COPYING $(DESTDIR)$(DOC_DIR) + $(INSTALL_DATA) CREDITS $(DESTDIR)$(DOC_DIR) + $(INSTALL_DATA) README $(DESTDIR)$(DOC_DIR) + $(INSTALL_DATA) FAQ $(DESTDIR)$(DOC_DIR) + $(INSTALL_DATA) *.lsm $(DESTDIR)$(DOC_DIR) +endif + +install_all: install_base crontab sysstat \ + sysstat.crond sysstat.cron.daily sysstat.cron.hourly + $(CHOWN) $(CRON_OWNER) $(DESTDIR)$(SA_DIR) + if [ -d $(DESTDIR)/etc/cron.d ]; then \ + $(INSTALL_DATA) sysstat.crond $(DESTDIR)/etc/cron.d/sysstat; \ + elif [ -d $(DESTDIR)/etc/cron.hourly -a -d $(DESTDIR)/etc/cron.daily ]; then \ + $(INSTALL_BIN) sysstat.cron.hourly $(DESTDIR)/etc/cron.hourly/sysstat; \ + $(INSTALL_BIN) sysstat.cron.daily $(DESTDIR)/etc/cron.daily/sysstat; \ + else \ + su $(CRON_OWNER) -c "crontab -l > /tmp/crontab-$(CRON_OWNER).save"; \ + $(CP) -a /tmp/crontab-$(CRON_OWNER).save ./crontab-$(CRON_OWNER).`date '+%Y%m%d.%H%M%S'`.save; \ + echo "USER'S PREVIOUS CRONTAB SAVED IN CURRENT DIRECTORY (USING .save SUFFIX)."; \ + su $(CRON_OWNER) -c "crontab crontab"; \ + fi + if [ -d $(DESTDIR)$(INIT_DIR) ]; then \ + $(INSTALL_BIN) sysstat $(DESTDIR)$(INIT_DIR)/sysstat; \ + if [ -x $(CHKCONFIG) ]; then \ + cd $(DESTDIR)$(INIT_DIR) && $(CHKCONFIG) --add sysstat; \ + else \ + cd $(DESTDIR)$(RC2_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \ + cd $(DESTDIR)$(RC3_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \ + cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \ + fi \ + elif [ -d $(DESTDIR)$(RC_DIR) ]; then \ + $(INSTALL_BIN) sysstat $(DESTDIR)$(RC_DIR)/rc.sysstat; \ + if [ -x $(CHKCONFIG) ]; then \ + cd $(DESTDIR)$(RC_DIR) && $(CHKCONFIG) --add sysstat; \ + else \ + [ -d $(DESTDIR)$(RC2_DIR) ] || mkdir -p $(DESTDIR)$(RC2_DIR); \ + [ -d $(DESTDIR)$(RC3_DIR) ] || mkdir -p $(DESTDIR)$(RC3_DIR); \ + [ -d $(DESTDIR)$(RC5_DIR) ] || mkdir -p $(DESTDIR)$(RC5_DIR); \ + cd $(DESTDIR)$(RC2_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \ + cd $(DESTDIR)$(RC3_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \ + cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \ + fi \ + fi + +uninstall_man: +ifeq ($(INSTALL_DOC),y) + rm -f $(DESTDIR)$(MAN8_DIR)/sadc.8* + rm -f $(DESTDIR)$(MAN8_DIR)/sa1.8* + rm -f $(DESTDIR)$(MAN8_DIR)/sa2.8* + rm -f $(DESTDIR)$(MAN1_DIR)/sar.1* + rm -f $(DESTDIR)$(MAN1_DIR)/sadf.1* + rm -f $(DESTDIR)$(MAN1_DIR)/iostat.1* + rm -f $(DESTDIR)$(MAN1_DIR)/mpstat.1* + rm -f $(DESTDIR)$(MAN1_DIR)/pidstat.1* + rm -f $(DESTDIR)$(MAN1_DIR)/nfsiostat.1* + rm -f $(DESTDIR)$(MAN1_DIR)/cifsiostat.1* +ifeq ($(INSTALL_ISAG),y) + rm -f $(DESTDIR)$(MAN1_DIR)/isag.1 +endif +endif + +uninstall_nls: +ifdef REQUIRE_NLS + rm -f $(DESTDIR)$(PREFIX)/share/locale/af/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/cs/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/da/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/de/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/es/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/eu/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/fi/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/fr/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/id/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/it/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/ja/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/ky/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/lv/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/mt/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/nb/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/nl/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/nn/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/pl/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/pt/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/pt_BR/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/ro/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/ru/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/sk/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/sv/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/vi/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/zh_CN/LC_MESSAGES/$(PACKAGE).mo + rm -f $(DESTDIR)$(PREFIX)/share/locale/zh_TW/LC_MESSAGES/$(PACKAGE).mo + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/af/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/cs/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/da/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/de/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/es/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/eu/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/fi/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/fr/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/id/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/it/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/ja/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/ky/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/lv/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/mt/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/nb/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/nl/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/nn/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/pl/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/pt/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/pt_BR/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/ro/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/ru/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/sk/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/sv/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/vi/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/zh_CN/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/zh_TW/LC_MESSAGES + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/af + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/cs + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/da + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/de + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/es + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/eu + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/fi + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/fr + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/id + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/it + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/ja + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/ky + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/lv + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/mt + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/nb + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/nl + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/nn + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/pl + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/pt + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/pt_BR + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/ro + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/ru + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/sk + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/sv + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/vi + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/zh_CN + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/zh_TW +endif + +uninstall_base: uninstall_man uninstall_nls + rm -f $(DESTDIR)$(SA_LIB_DIR)/sadc + rm -f $(DESTDIR)$(SA_LIB_DIR)/sa1 + rm -f $(DESTDIR)$(SA_LIB_DIR)/sa2 + rm -f $(DESTDIR)$(BIN_DIR)/sar + rm -f $(DESTDIR)$(BIN_DIR)/sadf + rm -f $(DESTDIR)$(BIN_DIR)/iostat + rm -f $(DESTDIR)$(BIN_DIR)/mpstat + rm -f $(DESTDIR)$(BIN_DIR)/pidstat + rm -f $(DESTDIR)$(BIN_DIR)/nfsiostat + rm -f $(DESTDIR)$(BIN_DIR)/cifsiostat +ifeq ($(INSTALL_ISAG),y) + rm -f $(DESTDIR)$(BIN_DIR)/isag +endif + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(SA_LIB_DIR) + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(SA_DIR)/[0-9]????? + -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(SA_DIR) +# No need to keep sysstat scripts, config files and links since +# the binaries have been deleted. + rm -f $(DESTDIR)$(INIT_DIR)/sysstat + rm -f $(DESTDIR)$(RC_DIR)/rc.sysstat + rm -f $(DESTDIR)$(SYSCONFIG_DIR)/sysstat + rm -f $(DESTDIR)$(SYSCONFIG_DIR)/sysstat.ioconf + rm -f $(DESTDIR)$(RC2_DIR)/S??sysstat + rm -f $(DESTDIR)$(RC3_DIR)/S??sysstat + rm -f $(DESTDIR)$(RC5_DIR)/S??sysstat +# Delete possible kill entries installed by chkconfig + rm -f $(DESTDIR)$(RC0_DIR)/K??sysstat + rm -f $(DESTDIR)$(RC1_DIR)/K??sysstat + rm -f $(DESTDIR)$(RC4_DIR)/K??sysstat + rm -f $(DESTDIR)$(RC6_DIR)/K??sysstat +# Vixie cron entries also can be safely deleted here + rm -f $(DESTDIR)/etc/cron.d/sysstat +# Id. for Slackware cron entries + rm -f $(DESTDIR)/etc/cron.hourly/sysstat + rm -f $(DESTDIR)/etc/cron.daily/sysstat +ifeq ($(INSTALL_DOC),y) + rm -f $(DESTDIR)$(DOC_DIR)/* + -rmdir $(DESTDIR)$(DOC_DIR) +endif + @echo "Please ignore the errors above, if any." + +uninstall_all: uninstall_base + -su $(CRON_OWNER) -c "crontab -l > /tmp/crontab-$(CRON_OWNER).old" + -$(CP) -a /tmp/crontab-$(CRON_OWNER).old ./crontab-$(CRON_OWNER).`date '+%Y%m%d.%H%M%S'`.old + @echo "USER CRONTAB SAVED IN CURRENT DIRECTORY (WITH .old SUFFIX)." + -su $(CRON_OWNER) -c "crontab -r" + +ifeq ($(INSTALL_CRON),y) +uninstall: uninstall_all +else +uninstall: uninstall_base +endif + +ifeq ($(INSTALL_CRON),y) +install: install_all +else +install: install_base +endif + +ifdef REQUIRE_NLS +po-files: nls/sysstat.pot $(NLSPOT) +else +po-files: +endif + +clean: + rm -f sadc sar sadf iostat mpstat pidstat nfsiostat cifsiostat *.o *.a core TAGS + find nls -name "*.gmo" -exec rm -f {} \; + +almost-distclean: clean nls/sysstat.pot + rm -f sa1 sa2 sysstat crontab version.h sysconfig.h + rm -f sysstat.sysconfig sysstat.crond sysstat.cron.daily + rm -f sysstat.cron.hourly sysstat.crond.sample sysstat.crond.sample.in + rm -f contrib/isag/isag + rm -f man/sa1.8 man/sa2.8 man/sadc.8 man/sadf.1 man/sar.1 man/iostat.1 + rm -f *.log config.status + rm -rf autom4te.cache + rm -f *.save *.old .*.swp data + find . -name "*~" -exec rm -f {} \; + +distclean: almost-distclean + rm -f Makefile + +maintainer-clean: distclean + rm -f configure + +dist: almost-distclean + cd .. && (tar --exclude=Makefile -cvf - sysstat-$(VERSION) | gzip -v9 > sysstat-$(VERSION).tar.gz) + +bdist: almost-distclean + cd .. && (tar --exclude=Makefile -cvf - sysstat-$(VERSION) | bzip2 > sysstat-$(VERSION).tar.bz2) + +tags: + etags ./*.[hc] + diff --git a/README b/README new file mode 100644 index 00000000..550a681b --- /dev/null +++ b/README @@ -0,0 +1,131 @@ +sysstat: System performance tools for the Linux operating system... +-- +(C) 1999-2010 Sebastien Godard (sysstat orange.fr) + +The latest version of sysstat can always be found on my web site at: + +http://pagesperso-orange.fr/sebastien.godard/ + +sysstat package is also available at ibiblio's Linux archive +in the following directory: + +ftp://ibiblio.org/pub/Linux/system/status/ + +See the CHANGES file to know the new features/improvements/bug fixes added +in this release of sysstat. + + +INSTALLATION +------------ + +The sysstat utilities are a collection of performance monitoring tools for +Linux. These include mpstat, iostat, nfsiostat, cifsiostat, pidstat, sar, +sadc, sadf and sa tools. + +The first stage is to configure sysstat for your system: + + ./configure + +You can set several variables and parameters on the command line. +Please enter "./configure --help" to display them. +There is another way to configure sysstat instead of entering "./configure": +this is the Interactive Configuration script (iconfig) which will ask you +for the value of the main sysstat variables and parameters. +Enter "./iconfig" then answer the questions or enter Return to accept +the (sane) default values. For yes/no questions, please answer 'y' or 'n' +(without the quotes): It is case sensitive! You can also enter '?' to get +a help message that will explain the meaning of each variable or parameter. + +The next stage is to build the various binary files. Enter: + + make + +Then log in as root and enter: + + make install + +(see next section to know the files that are installed). +That's all! + +Of course tell me if there are any problems. This is the only way I can improve +'sysstat'. Please also remember to read the FAQ included in this package. + +Patches and suggestions for improvements are always welcome! +Send them to (sysstat orange.fr). + + +FILES THAT ARE INSTALLED +------------------------ + +I _hate_ when packages install files everywhere on my disk and I don't know +where... +So here is the list of files installed by sysstat, when you ask for a +complete installation. +${PREFIX} is the value of the PREFIX variable defined in the Makefile +(usually set to /usr/local or /usr). + +${PREFIX}/lib/sa/sadc +${PREFIX}/lib/sa/sa1 +${PREFIX}/lib/sa/sa2 +${PREFIX}/bin/sar +${PREFIX}/bin/sadf +${PREFIX}/bin/iostat +${PREFIX}/bin/mpstat +${PREFIX}/bin/pidstat +${PREFIX}/bin/nfsiostat +${PREFIX}/bin/cifsiostat +${PREFIX}(/share)/man/man8/sadc.8 +${PREFIX}(/share)/man/man8/sa1.8 +${PREFIX}(/share)/man/man8/sa2.8 +${PREFIX}(/share)/man/man1/sar.1 +${PREFIX}(/share)/man/man1/sadf.1 +${PREFIX}(/share)/man/man1/iostat.1 +${PREFIX}(/share)/man/man1/mpstat.1 +${PREFIX}(/share)/man/man1/pidstat.1 +${PREFIX}(/share)/man/man1/nfsiostat.1 +${PREFIX}(/share)/man/man1/cifsiostat.1 +${PREFIX}/share/locale/*/LC_MESSAGES/sysstat.mo +${PREFIX}/share/doc/sysstat-x.y.z/* +/var/log/sa +${INIT_DIR}/sysstat +/etc/sysconfig/sysstat +/etc/sysconfig/sysstat.ioconf +/etc/cron.d/sysstat +/etc/rc.d/rc.sysstat for [SLACKWARE] +${RC_DIR}/rc2.d/S03sysstat +${RC_DIR}/rc3.d/S03sysstat +${RC_DIR}/rc5.d/S03sysstat + +with: + +${INIT_DIR}=/etc/rc.d/init.d/ for [REDHAT] [CALDERA] [MANDRIVA] [TURBOLINUX] [KONDARA] +${INIT_DIR}=/sbin/init.d/ for [SUSE <= 7.0] +${INIT_DIR}=/etc/init.d/ for [SUSE >= 7.1] [DEBIAN] +${RC_DIR}=/etc/rc.d/ for [REDHAT] [CALDERA] [MANDRIVA] [TURBOLINUX] [KONDARA] [SLACKWARE] +${RC_DIR}=/sbin/init.d/ for [SUSE <= 7.0] +${RC_DIR}=/etc/init.d/ for [SUSE >= 7.1] +${RC_DIR}=/etc/ for [DEBIAN] + +sysstat may also install some links in ${RC_DIR}/rc[0146].d/ directory +if chkconfig is used. + +MISCELLANEOUS +------------- + +The sysstat commands are only front-ends to the kernel proc filesystem... +They cannot display statistics that Linux does not +provide, nor can they be more accurate than Linux is. +The sysstat package now only supports 2.6.x kernels. +Note that all kernels do not necessarily have all the statistics that +sysstat commands can display, depending on their version or their +configuration options. + +It has been designed with National Language Support (NLS) in mind, using +the GNU gettext package (available at http://www.gnu.org). +sysstat has been translated into several languages. +Anyway you are welcome if you want to make other translations available ;-) +Please read the README-nls file in the nls directory before. + +-- +Sebastien Godard (sysstat orange.fr) + diff --git a/TODO b/TODO new file mode 100644 index 00000000..b1730527 --- /dev/null +++ b/TODO @@ -0,0 +1,14 @@ +Here are the things I would like (or I should) do for the next releases: + +* Add more power management statistics (CPU temperature, fan speed, etc.). I need help + for this! + +* Add more statistics to sar and mpstat (and iostat) when available in Linux + kernels. + +* Add a real web-based graphical front-end to sar. I need help for this! + +* Add support for hotplug memory? + +* Dynamically allocate structures for IRQs (just like for CPUs). + diff --git a/activity.c b/activity.c new file mode 100644 index 00000000..a1ee28e1 --- /dev/null +++ b/activity.c @@ -0,0 +1,974 @@ +/* + * activity.c: Define system activities available for sar/sadc. + * (C) 1999-2010 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include "sa.h" + +#ifdef SOURCE_SADC +#include "rd_stats.h" +#endif + +#ifdef SOURCE_SAR +#include "pr_stats.h" +#endif + +#ifdef SOURCE_SADF +#include "prf_stats.h" +#endif + +/* + *************************************************************************** + * Definitions of system activities. + * See sa.h file for activity structure definition. + *************************************************************************** + */ + +/* + * Bitmaps needed by activities. + * Remember to allocate them before use! + */ + +/* CPU bitmap */ +struct act_bitmap cpu_bitmap = { + .b_array = NULL, + .b_size = NR_CPUS +}; + +/* Interrupts bitmap */ +struct act_bitmap irq_bitmap = { + .b_array = NULL, + .b_size = NR_IRQS +}; + + +/* + * CPU statistics. + * This is the only activity which *must* be collected by sadc + * so that uptime can be filled. + */ +struct activity cpu_act = { + .id = A_CPU, + .options = AO_COLLECTED + AO_REMANENT + AO_GLOBAL_ITV + AO_MULTIPLE_OUTPUTS, +#ifdef SOURCE_SADC + .f_count = wrap_get_cpu_nr, + .f_read = wrap_read_stat_cpu, +#endif +#ifdef SOURCE_SAR + .f_print = print_cpu_stats, + .f_print_avg = print_cpu_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_cpu_stats, + .f_xml_print = xml_print_cpu_stats, + .hdr_line = "CPU;%user;%nice;%system;%iowait;%steal;%idle|" + "CPU;%usr;%nice;%sys;%iowait;%steal;%irq;%soft;%guest;%idle", + .name = "A_CPU", +#endif + .nr = -1, + .fsize = STATS_CPU_SIZE, + .msize = STATS_CPU_SIZE, + .opt_flags = AO_F_CPU_DEF, + .buf = {NULL, NULL, NULL}, + .bitmap = &cpu_bitmap +}; + +/* Process (task) creation and context switch activity */ +struct activity pcsw_act = { + .id = A_PCSW, + .options = AO_COLLECTED, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_stat_pcsw, +#endif +#ifdef SOURCE_SAR + .f_print = print_pcsw_stats, + .f_print_avg = print_pcsw_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_pcsw_stats, + .f_xml_print = xml_print_pcsw_stats, + .hdr_line = "proc/s;cswch/s", + .name = "A_PCSW", +#endif + .nr = 1, + .fsize = STATS_PCSW_SIZE, + .msize = STATS_PCSW_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* Interrupts statistics */ +struct activity irq_act = { + .id = A_IRQ, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = wrap_get_irq_nr, + .f_read = wrap_read_stat_irq, +#endif +#ifdef SOURCE_SAR + .f_print = print_irq_stats, + .f_print_avg = print_irq_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_irq_stats, + .f_xml_print = xml_print_irq_stats, + .hdr_line = "INTR;intr/s", + .name = "A_IRQ", +#endif + .nr = -1, + .fsize = STATS_IRQ_SIZE, + .msize = STATS_IRQ_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = &irq_bitmap +}; + +/* Swapping activity */ +struct activity swap_act = { + .id = A_SWAP, + .options = AO_COLLECTED, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_swap, +#endif +#ifdef SOURCE_SAR + .f_print = print_swap_stats, + .f_print_avg = print_swap_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_swap_stats, + .f_xml_print = xml_print_swap_stats, + .hdr_line = "pswpin/s;pswpout/s", + .name = "A_SWAP", +#endif + .nr = 1, + .fsize = STATS_SWAP_SIZE, + .msize = STATS_SWAP_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* Paging activity */ +struct activity paging_act = { + .id = A_PAGE, + .options = AO_COLLECTED, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_paging, +#endif +#ifdef SOURCE_SAR + .f_print = print_paging_stats, + .f_print_avg = print_paging_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_paging_stats, + .f_xml_print = xml_print_paging_stats, + .hdr_line = "pgpgin/s;pgpgout/s;fault/s;majflt/s;" + "pgfree/s;pgscank/s;pgscand/s;pgsteal/s;%vmeff", + .name = "A_PAGE", +#endif + .nr = 1, + .fsize = STATS_PAGING_SIZE, + .msize = STATS_PAGING_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* I/O and transfer rate activity */ +struct activity io_act = { + .id = A_IO, + .options = AO_COLLECTED, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_io, +#endif +#ifdef SOURCE_SAR + .f_print = print_io_stats, + .f_print_avg = print_io_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_io_stats, + .f_xml_print = xml_print_io_stats, + .hdr_line = "tps;rtps;wtps;bread/s;bwrtn/s", + .name = "A_IO", +#endif + .nr = 1, + .fsize = STATS_IO_SIZE, + .msize = STATS_IO_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* Memory and swap space utilization activity */ +struct activity memory_act = { + .id = A_MEMORY, + .options = AO_COLLECTED + AO_MULTIPLE_OUTPUTS, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_meminfo, +#endif +#ifdef SOURCE_SAR + .f_print = print_memory_stats, + .f_print_avg = print_avg_memory_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_memory_stats, + .f_xml_print = xml_print_memory_stats, + .hdr_line = "frmpg/s;bufpg/s;campg/s|" + "kbmemfree;kbmemused;%memused;kbbuffers;kbcached;kbcommit;%commit|" + "kbswpfree;kbswpused;%swpused;kbswpcad;%swpcad", + .name = "A_MEMORY", +#endif + .nr = 1, + .fsize = STATS_MEMORY_SIZE, + .msize = STATS_MEMORY_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* Kernel tables activity */ +struct activity ktables_act = { + .id = A_KTABLES, + .options = AO_COLLECTED, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_kernel_tables, +#endif +#ifdef SOURCE_SAR + .f_print = print_ktables_stats, + .f_print_avg = print_avg_ktables_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_ktables_stats, + .f_xml_print = xml_print_ktables_stats, + .hdr_line = "dentunusd;file-nr;inode-nr;pty-nr", + .name = "A_KTABLES", +#endif + .nr = 1, + .fsize = STATS_KTABLES_SIZE, + .msize = STATS_KTABLES_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* Queue and load activity */ +struct activity queue_act = { + .id = A_QUEUE, + .options = AO_COLLECTED, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_loadavg, +#endif +#ifdef SOURCE_SAR + .f_print = print_queue_stats, + .f_print_avg = print_avg_queue_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_queue_stats, + .f_xml_print = xml_print_queue_stats, + .hdr_line = "runq-sz;plist-sz;ldavg-1;ldavg-5;ldavg-15", + .name = "A_QUEUE", +#endif + .nr = 1, + .fsize = STATS_QUEUE_SIZE, + .msize = STATS_QUEUE_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* Serial lines activity */ +struct activity serial_act = { + .id = A_SERIAL, + .options = AO_COLLECTED, +#ifdef SOURCE_SADC + .f_count = wrap_get_serial_nr, + .f_read = wrap_read_tty_driver_serial, +#endif +#ifdef SOURCE_SAR + .f_print = print_serial_stats, + .f_print_avg = print_serial_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_serial_stats, + .f_xml_print = xml_print_serial_stats, + .hdr_line = "TTY;rcvin/s;txmtin/s;framerr/s;prtyerr/s;brk/s;ovrun/s", + .name = "A_SERIAL", +#endif + .nr = -1, + .fsize = STATS_SERIAL_SIZE, + .msize = STATS_SERIAL_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* Block devices activity */ +struct activity disk_act = { + .id = A_DISK, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = wrap_get_disk_nr, + .f_read = wrap_read_disk, +#endif +#ifdef SOURCE_SAR + .f_print = print_disk_stats, + .f_print_avg = print_disk_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_disk_stats, + .f_xml_print = xml_print_disk_stats, + .hdr_line = "DEV;tps;rd_sec/s;wr_sec/s;avgrq-sz;avgqu-sz;await;svctm;%util", + .name = "A_DISK", +#endif + .nr = -1, + .fsize = STATS_DISK_SIZE, + .msize = STATS_DISK_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* Network interfaces activity */ +struct activity net_dev_act = { + .id = A_NET_DEV, + .options = AO_COLLECTED, +#ifdef SOURCE_SADC + .f_count = wrap_get_iface_nr, + .f_read = wrap_read_net_dev, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_dev_stats, + .f_print_avg = print_net_dev_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_dev_stats, + .f_xml_print = xml_print_net_dev_stats, + .hdr_line = "IFACE;rxpck/s;txpck/s;rxkB/s;txkB/s;rxcmp/s;txcmp/s;rxmcst/s", + .name = "A_NET_DEV", +#endif + .nr = -1, + .fsize = STATS_NET_DEV_SIZE, + .msize = STATS_NET_DEV_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* Network interfaces activity */ +struct activity net_edev_act = { + .id = A_NET_EDEV, + .options = AO_COLLECTED, +#ifdef SOURCE_SADC + .f_count = wrap_get_iface_nr, + .f_read = wrap_read_net_edev, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_edev_stats, + .f_print_avg = print_net_edev_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_edev_stats, + .f_xml_print = xml_print_net_edev_stats, + .hdr_line = "IFACE;rxerr/s;txerr/s;coll/s;rxdrop/s;txdrop/s;" + "txcarr/s;rxfram/s;rxfifo/s;txfifo/s", + .name = "A_NET_EDEV", +#endif + .nr = -1, + .fsize = STATS_NET_EDEV_SIZE, + .msize = STATS_NET_EDEV_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* NFS client activity */ +struct activity net_nfs_act = { + .id = A_NET_NFS, + .options = AO_COLLECTED, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_nfs, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_nfs_stats, + .f_print_avg = print_net_nfs_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_nfs_stats, + .f_xml_print = xml_print_net_nfs_stats, + .hdr_line = "call/s;retrans/s;read/s;write/s;access/s;getatt/s", + .name = "A_NET_NFS", +#endif + .nr = 1, + .fsize = STATS_NET_NFS_SIZE, + .msize = STATS_NET_NFS_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* NFS server activity */ +struct activity net_nfsd_act = { + .id = A_NET_NFSD, + .options = AO_COLLECTED, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_nfsd, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_nfsd_stats, + .f_print_avg = print_net_nfsd_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_nfsd_stats, + .f_xml_print = xml_print_net_nfsd_stats, + .hdr_line = "scall/s;badcall/s;packet/s;udp/s;tcp/s;hit/s;miss/s;" + "sread/s;swrite/s;saccess/s;sgetatt/s", + .name = "A_NET_NFSD", +#endif + .nr = 1, + .fsize = STATS_NET_NFSD_SIZE, + .msize = STATS_NET_NFSD_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* Network sockets activity */ +struct activity net_sock_act = { + .id = A_NET_SOCK, + .options = AO_COLLECTED, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_sock, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_sock_stats, + .f_print_avg = print_avg_net_sock_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_sock_stats, + .f_xml_print = xml_print_net_sock_stats, + .hdr_line = "totsck;tcpsck;udpsck;rawsck;ip-frag;tcp-tw", + .name = "A_NET_SOCK", +#endif + .nr = 1, + .fsize = STATS_NET_SOCK_SIZE, + .msize = STATS_NET_SOCK_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* IP network traffic activity */ +struct activity net_ip_act = { + .id = A_NET_IP, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_ip, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_ip_stats, + .f_print_avg = print_net_ip_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_ip_stats, + .f_xml_print = xml_print_net_ip_stats, + .hdr_line = "irec/s;fwddgm/s;idel/s;orq/s;asmrq/s;asmok/s;fragok/s;fragcrt/s", + .name = "A_NET_IP", +#endif + .nr = 1, + .fsize = STATS_NET_IP_SIZE, + .msize = STATS_NET_IP_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* IP network traffic (errors) activity */ +struct activity net_eip_act = { + .id = A_NET_EIP, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_eip, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_eip_stats, + .f_print_avg = print_net_eip_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_eip_stats, + .f_xml_print = xml_print_net_eip_stats, + .hdr_line = "ihdrerr/s;iadrerr/s;iukwnpr/s;idisc/s;odisc/s;onort/s;asmf/s;fragf/s", + .name = "A_NET_EIP", +#endif + .nr = 1, + .fsize = STATS_NET_EIP_SIZE, + .msize = STATS_NET_EIP_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* ICMP network traffic activity */ +struct activity net_icmp_act = { + .id = A_NET_ICMP, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_icmp, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_icmp_stats, + .f_print_avg = print_net_icmp_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_icmp_stats, + .f_xml_print = xml_print_net_icmp_stats, + .hdr_line = "imsg/s;omsg/s;iech/s;iechr/s;oech/s;oechr/s;itm/s;itmr/s;otm/s;" + "otmr/s;iadrmk/s;iadrmkr/s;oadrmk/s;oadrmkr/s", + .name = "A_NET_ICMP", +#endif + .nr = 1, + .fsize = STATS_NET_ICMP_SIZE, + .msize = STATS_NET_ICMP_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* ICMP network traffic (errors) activity */ +struct activity net_eicmp_act = { + .id = A_NET_EICMP, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_eicmp, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_eicmp_stats, + .f_print_avg = print_net_eicmp_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_eicmp_stats, + .f_xml_print = xml_print_net_eicmp_stats, + .hdr_line = "ierr/s;oerr/s;idstunr/s;odstunr/s;itmex/s;otmex/s;" + "iparmpb/s;oparmpb/s;isrcq/s;osrcq/s;iredir/s;oredir/s", + .name = "A_NET_EICMP", +#endif + .nr = 1, + .fsize = STATS_NET_EICMP_SIZE, + .msize = STATS_NET_EICMP_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* TCP network traffic activity */ +struct activity net_tcp_act = { + .id = A_NET_TCP, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_tcp, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_tcp_stats, + .f_print_avg = print_net_tcp_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_tcp_stats, + .f_xml_print = xml_print_net_tcp_stats, + .hdr_line = "active/s;passive/s;iseg/s;oseg/s", + .name = "A_NET_TCP", +#endif + .nr = 1, + .fsize = STATS_NET_TCP_SIZE, + .msize = STATS_NET_TCP_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* TCP network traffic (errors) activity */ +struct activity net_etcp_act = { + .id = A_NET_ETCP, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_etcp, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_etcp_stats, + .f_print_avg = print_net_etcp_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_etcp_stats, + .f_xml_print = xml_print_net_etcp_stats, + .hdr_line = "atmptf/s;estres/s;retrans/s;isegerr/s;orsts/s", + .name = "A_NET_ETCP", +#endif + .nr = 1, + .fsize = STATS_NET_ETCP_SIZE, + .msize = STATS_NET_ETCP_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* UDP network traffic activity */ +struct activity net_udp_act = { + .id = A_NET_UDP, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_udp, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_udp_stats, + .f_print_avg = print_net_udp_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_udp_stats, + .f_xml_print = xml_print_net_udp_stats, + .hdr_line = "idgm/s;odgm/s;noport/s;idgmerr/s", + .name = "A_NET_UDP", +#endif + .nr = 1, + .fsize = STATS_NET_UDP_SIZE, + .msize = STATS_NET_UDP_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* IPv6 sockets activity */ +struct activity net_sock6_act = { + .id = A_NET_SOCK6, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_sock6, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_sock6_stats, + .f_print_avg = print_avg_net_sock6_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_sock6_stats, + .f_xml_print = xml_print_net_sock6_stats, + .hdr_line = "tcp6sck;udp6sck;raw6sck;ip6-frag", + .name = "A_NET_SOCK6", +#endif + .nr = 1, + .fsize = STATS_NET_SOCK6_SIZE, + .msize = STATS_NET_SOCK6_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* IPv6 network traffic activity */ +struct activity net_ip6_act = { + .id = A_NET_IP6, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_ip6, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_ip6_stats, + .f_print_avg = print_net_ip6_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_ip6_stats, + .f_xml_print = xml_print_net_ip6_stats, + .hdr_line = "irec6/s;fwddgm6/s;idel6/s;orq6/s;asmrq6/s;asmok6/s;" + "imcpck6/s;omcpck6/s;fragok6/s;fragcr6/s", + .name = "A_NET_IP6", +#endif + .nr = 1, + .fsize = STATS_NET_IP6_SIZE, + .msize = STATS_NET_IP6_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* IPv6 network traffic (errors) activity */ +struct activity net_eip6_act = { + .id = A_NET_EIP6, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_eip6, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_eip6_stats, + .f_print_avg = print_net_eip6_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_eip6_stats, + .f_xml_print = xml_print_net_eip6_stats, + .hdr_line = "ihdrer6/s;iadrer6/s;iukwnp6/s;i2big6/s;idisc6/s;odisc6/s;" + "inort6/s;onort6/s;asmf6/s;fragf6/s;itrpck6/s", + .name = "A_NET_EIP6", +#endif + .nr = 1, + .fsize = STATS_NET_EIP6_SIZE, + .msize = STATS_NET_EIP6_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* ICMPv6 network traffic activity */ +struct activity net_icmp6_act = { + .id = A_NET_ICMP6, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_icmp6, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_icmp6_stats, + .f_print_avg = print_net_icmp6_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_icmp6_stats, + .f_xml_print = xml_print_net_icmp6_stats, + .hdr_line = "imsg6/s;omsg6/s;iech6/s;iechr6/s;oechr6/s;igmbq6/s;igmbr6/s;ogmbr6/s;" + "igmbrd6/s;ogmbrd6/s;irtsol6/s;ortsol6/s;irtad6/s;inbsol6/s;onbsol6/s;" + "inbad6/s;onbad6/s", + .name = "A_NET_ICMP6", +#endif + .nr = 1, + .fsize = STATS_NET_ICMP6_SIZE, + .msize = STATS_NET_ICMP6_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* ICMPv6 network traffic (errors) activity */ +struct activity net_eicmp6_act = { + .id = A_NET_EICMP6, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_eicmp6, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_eicmp6_stats, + .f_print_avg = print_net_eicmp6_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_eicmp6_stats, + .f_xml_print = xml_print_net_eicmp6_stats, + .hdr_line = "ierr6/s;idtunr6/s;odtunr6/s;itmex6/s;otmex6/s;" + "iprmpb6/s;oprmpb6/s;iredir6/s;oredir6/s;ipck2b6/s;opck2b6/s", + .name = "A_NET_EICMP6", +#endif + .nr = 1, + .fsize = STATS_NET_EICMP6_SIZE, + .msize = STATS_NET_EICMP6_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* UDPv6 network traffic activity */ +struct activity net_udp6_act = { + .id = A_NET_UDP6, + .options = AO_CLOSE_MARKUP, +#ifdef SOURCE_SADC + .f_count = NULL, + .f_read = wrap_read_net_udp6, +#endif +#ifdef SOURCE_SAR + .f_print = print_net_udp6_stats, + .f_print_avg = print_net_udp6_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_net_udp6_stats, + .f_xml_print = xml_print_net_udp6_stats, + .hdr_line = "idgm6/s;odgm6/s;noport6/s;idgmer6/s", + .name = "A_NET_UDP6", +#endif + .nr = 1, + .fsize = STATS_NET_UDP6_SIZE, + .msize = STATS_NET_UDP6_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* CPU frequency */ +struct activity pwr_cpufreq_act = { + .id = A_PWR_CPUFREQ, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = wrap_get_cpu_nr, + .f_read = wrap_read_cpuinfo, +#endif +#ifdef SOURCE_SAR + .f_print = print_pwr_cpufreq_stats, + .f_print_avg = print_avg_pwr_cpufreq_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_pwr_cpufreq_stats, + .f_xml_print = xml_print_pwr_cpufreq_stats, + .hdr_line = "CPU;MHz", + .name = "A_PWR_CPUFREQ", +#endif + .nr = -1, + .fsize = STATS_PWR_CPUFREQ_SIZE, + .msize = STATS_PWR_CPUFREQ_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = &cpu_bitmap +}; + +/* Fan */ +struct activity pwr_fan_act = { + .id = A_PWR_FAN, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = wrap_get_fan_nr, + .f_read = wrap_read_fan, +#endif +#ifdef SOURCE_SAR + .f_print = print_pwr_fan_stats, + .f_print_avg = print_avg_pwr_fan_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_pwr_fan_stats, + .f_xml_print = xml_print_pwr_fan_stats, + .hdr_line = "device;FAN;rpm;drpm", + .name = "A_PWR_FAN", +#endif + .nr = -1, + .fsize = STATS_PWR_FAN_SIZE, + .msize = STATS_PWR_FAN_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* Temperature */ +struct activity pwr_temp_act = { + .id = A_PWR_TEMP, + .options = AO_NULL, +#ifdef SOURCE_SADC + .f_count = wrap_get_temp_nr, + .f_read = wrap_read_temp, +#endif +#ifdef SOURCE_SAR + .f_print = print_pwr_temp_stats, + .f_print_avg = print_avg_pwr_temp_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_pwr_temp_stats, + .f_xml_print = xml_print_pwr_temp_stats, + .hdr_line = "device;TEMP;degC;%temp", + .name = "A_PWR_TEMP", +#endif + .nr = -1, + .fsize = STATS_PWR_TEMP_SIZE, + .msize = STATS_PWR_TEMP_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + +/* Voltage inputs */ +struct activity pwr_in_act = { + .id = A_PWR_IN, + .options = AO_CLOSE_MARKUP, +#ifdef SOURCE_SADC + .f_count = wrap_get_in_nr, + .f_read = wrap_read_in, +#endif +#ifdef SOURCE_SAR + .f_print = print_pwr_in_stats, + .f_print_avg = print_avg_pwr_in_stats, +#endif +#ifdef SOURCE_SADF + .f_render = render_pwr_in_stats, + .f_xml_print = xml_print_pwr_in_stats, + .hdr_line = "device;IN;inV;%in", + .name = "A_PWR_IN", +#endif + .nr = -1, + .fsize = STATS_PWR_IN_SIZE, + .msize = STATS_PWR_IN_SIZE, + .opt_flags = 0, + .buf = {NULL, NULL, NULL}, + .bitmap = NULL +}; + + +/* + * Array of activities. + */ +struct activity *act[NR_ACT] = { + &cpu_act, + &pcsw_act, + &irq_act, + &swap_act, + &paging_act, + &io_act, + &memory_act, + &ktables_act, + &queue_act, + &serial_act, + &disk_act, + &net_dev_act, + &net_edev_act, + &net_nfs_act, + &net_nfsd_act, + &net_sock_act, + &net_ip_act, + &net_eip_act, + &net_icmp_act, + &net_eicmp_act, + &net_tcp_act, + &net_etcp_act, + &net_udp_act, + &net_sock6_act, + &net_ip6_act, + &net_eip6_act, + &net_icmp6_act, + &net_eicmp6_act, + &net_udp6_act, + &pwr_cpufreq_act, + &pwr_fan_act, + &pwr_temp_act, + &pwr_in_act +}; diff --git a/build/Ask.sh b/build/Ask.sh new file mode 100644 index 00000000..2abc3140 --- /dev/null +++ b/build/Ask.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Ask a question and return the answer + +QUESTION=$1 +PARM=$2 +TEXT_FILE=$3 +while :; do + echo -n "${QUESTION} [${PARM}] " >/dev/tty + read ANSWER + if [ "${ANSWER}" = "" ]; then + break + elif [ "${ANSWER}" = "?" ]; then + cat build/${TEXT_FILE} >/dev/tty + else + echo ${ANSWER} + break + fi +done + diff --git a/build/clean-sa-dir b/build/clean-sa-dir new file mode 100644 index 00000000..e02b6441 --- /dev/null +++ b/build/clean-sa-dir @@ -0,0 +1,11 @@ + +Answer y if you want to remove existing daily data files from +system activity directory that were created by a previous +version of sysstat. +Removing those files may be compulsory if they have been created +with a format which is no longer compatible with that of current +sysstat version. +Default answer is n (files are not deleted). +You can still remove them by hand afterwards if sar yields the +following error: "Invalid system activity file". + diff --git a/build/compress-manpg b/build/compress-manpg new file mode 100644 index 00000000..aa77171a --- /dev/null +++ b/build/compress-manpg @@ -0,0 +1,5 @@ + +Answer y if you want sysstat manual pages to be compressed (using bzip2 or +gzip) when they are installed. +Default answer is n here. + diff --git a/build/compressafter b/build/compressafter new file mode 100644 index 00000000..6904c3d7 --- /dev/null +++ b/build/compressafter @@ -0,0 +1,8 @@ + +To prevent sar daily datafiles from taking to much space on disk, you can +ask the sa2 shell script to compress them (using gzip or bzip2) after a +certain amount of time. +Answer here the number of days after which datafiles are to be compressed +(default value is 10 days). +Note that this parameter is saved in the /etc/sysconfig/sysstat file. + diff --git a/build/conf_dir b/build/conf_dir new file mode 100644 index 00000000..0e79e021 --- /dev/null +++ b/build/conf_dir @@ -0,0 +1,6 @@ + +This is the directory where sysstat configuration files will +be installed. Default location is /etc/sysconfig. The directory +will be automatically created during installation stage if +necessary. Press Enter to accept this default location. + diff --git a/build/cron_interval b/build/cron_interval new file mode 100644 index 00000000..9330c780 --- /dev/null +++ b/build/cron_interval @@ -0,0 +1,7 @@ + +You may enter here the sampling interval (in minutes) that the configuration +script will use to customize the crontab. +Defaut value is 10. This means that sadc (the system activity data collector +called by sar) will take a snapshot of the system counters every 10 minutes. +Other reasonable values could be 5, 15 or 20 minutes. + diff --git a/build/cron_owner b/build/cron_owner new file mode 100644 index 00000000..0b9a359a --- /dev/null +++ b/build/cron_owner @@ -0,0 +1,7 @@ + +This is the user the crontab will belong to. Be careful that sysstat may +need to replace his original crontab (after having saved it in sysstat +directory) if you use an old version of cron (i.e. if /etc/cron.d directory +doesn't exist). +Default user is root here. + diff --git a/build/debuginfo b/build/debuginfo new file mode 100644 index 00000000..c905177b --- /dev/null +++ b/build/debuginfo @@ -0,0 +1,3 @@ +Answer y to include debug information in some sysstat's commands. +This is usually unneeded, so you can safely answer n. + diff --git a/build/history b/build/history new file mode 100644 index 00000000..99e6b2a9 --- /dev/null +++ b/build/history @@ -0,0 +1,9 @@ + +The sa2 shell script creates daily reports, saved in /var/log/sa directory +(default location). +It also removes daily data files and reports which are older than a number +of days. This number defaults to 7 (one week of data history). +Answer here the number of days during which a daily data file or a report +should be kept. +Note that this parameter is saved in the /etc/sysconfig/sysstat file. + diff --git a/build/ignore-man-group b/build/ignore-man-group new file mode 100644 index 00000000..03dfbbdc --- /dev/null +++ b/build/ignore-man-group @@ -0,0 +1,6 @@ + +Here again, don't bother too much with that. When set, this parameter tells +the configuration process not to take into account the contents of the +man_group variable. +This parameter is only used by some distros to package sysstat. + diff --git a/build/install-cron b/build/install-cron new file mode 100644 index 00000000..a1559284 --- /dev/null +++ b/build/install-cron @@ -0,0 +1,9 @@ + +Answer y if you want to automate sar reporting. In this case, a crontab will +be created to periodically start the data collector. System activity daily +data files will then be created in the /var/log/sa directory. +You can find various crontab templates in sysstat directory. By default +sysstat will try to use sysstat.crond template and install it in the +/etc/cron.d directory. +Default answer is n here. + diff --git a/build/install-doc b/build/install-doc new file mode 100644 index 00000000..1bb296c4 --- /dev/null +++ b/build/install-doc @@ -0,0 +1,6 @@ + +Answer y if you don't want to install sysstat's documentation files. +Those are primarily manual pages for sysstat's commands. They also +include a few other files like the FAQ or README files. +Default answer is n here (documentation files ARE installed). + diff --git a/build/install-isag b/build/install-isag new file mode 100644 index 00000000..43e2747c --- /dev/null +++ b/build/install-isag @@ -0,0 +1,8 @@ + +Answer y if you want to install the isag command. +isag, the Interactive System Activity Grapher, is a graphical frontend +to sar. It graphically displays the system activity data stored +in a binary data file by a previous sar run. +Although included in the sysstat package (in the contrib directory), isag is +not necessarily kept in sync with sar. That's why it is not installed by default. + diff --git a/build/man_group b/build/man_group new file mode 100644 index 00000000..f8465cb1 --- /dev/null +++ b/build/man_group @@ -0,0 +1,6 @@ + +This is the group name that will be used for each manual page file saved on +your disk. +Don't bother too much with this. The default answer ("man" if it exists) +should be OK. + diff --git a/build/nls b/build/nls new file mode 100644 index 00000000..88458d7b --- /dev/null +++ b/build/nls @@ -0,0 +1,9 @@ + +NLS stands for National Language Support. +With NLS enabled, the sysstat utilities will behave in accordance with your +current locale. Sysstat messages will be translated into the language specified +by the LANG environment variable, among other. +Read the nls/README-nls file for more information. +So you should not disable NLS support by default. +Note that NLS needs the GNU gettext package to work. + diff --git a/build/prefix b/build/prefix new file mode 100644 index 00000000..fc7d02a0 --- /dev/null +++ b/build/prefix @@ -0,0 +1,7 @@ + +This is the base directory used for installation. +System administrators would rather install softwares that are added to +an already existing system into /usr/local, since /usr is sometimes +mounted read-only. +/usr/local is the default answer here. + diff --git a/build/rcdir b/build/rcdir new file mode 100644 index 00000000..abdd6a4d --- /dev/null +++ b/build/rcdir @@ -0,0 +1,7 @@ + +This is the directory where sysstat's startup scripts and links +will be installed. The usual location is /etc/rc.d. +Note that if this directory doesn't exist, startup scripts and +links won't be installed. +Just press Enter to let configure guess the proper value. + diff --git a/build/sa_dir b/build/sa_dir new file mode 100644 index 00000000..309d4aed --- /dev/null +++ b/build/sa_dir @@ -0,0 +1,7 @@ + +This is the directory where daily data files will be stored. +Those files contain statistics reported by the sar command. +The usual location is /var/log/sa. The directory will be +automatically created during installation stage if necessary. +Just press Enter to accept this usual location. + diff --git a/build/sa_lib_dir b/build/sa_lib_dir new file mode 100644 index 00000000..b941583f --- /dev/null +++ b/build/sa_lib_dir @@ -0,0 +1,6 @@ + +This is the directory where sadc, the system activity data +collector called by sar, will be located (usually PREFIX/lib/sa). +sa1 and sa2 shell scripts will also be saved in that directory. +Letting ./configure guess the proper location for them should be a safe bet. + diff --git a/build/sensors b/build/sensors new file mode 100644 index 00000000..bcb98c99 --- /dev/null +++ b/build/sensors @@ -0,0 +1,7 @@ + +Answering y here disable sensors support. Sysstat commands +will not be linked against sensors library even if this library +is installed on your system. +Without sensors support, some statistics related to power management +will not be available (fan speed, device temperature, etc.) + diff --git a/build/yesterday b/build/yesterday new file mode 100644 index 00000000..383376eb --- /dev/null +++ b/build/yesterday @@ -0,0 +1,8 @@ + +The sa2 shell script uses a daily data file to create a daily report. +By default it uses current daily data file (that is to say +the daily data file created today). +Yet it may be sometimes useful to tell it to use the daily data file +of the day before (that is to say the one created yesterday), for +example if sa2 is started at, say, 02:00 AM. In this case, answer y. + diff --git a/cifsiostat.c b/cifsiostat.c new file mode 100644 index 00000000..96219458 --- /dev/null +++ b/cifsiostat.c @@ -0,0 +1,597 @@ +/* + * cifsiostat: Report I/O statistics for CIFS filesystems. + * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved + * Written by Ivana Varekova + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "version.h" +#include "cifsiostat.h" +#include "common.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__ +char *sccsid(void) { return (SCCSID); } + +unsigned long long uptime[2] = {0, 0}; +unsigned long long uptime0[2] = {0, 0}; +struct cifs_stats *st_cifs[2]; +struct io_hdr_stats *st_hdr_cifs; + +int cifs_nr = 0; /* Nb of CIFS mounted directories found */ +int cpu_nr = 0; /* Nb of processors on the machine */ +int flags = 0; /* Flag for common options and system state */ + +long interval = 0; +char timestamp[64]; + + +/* + *************************************************************************** + * Print usage and exit. + * + * IN: + * @progname Name of sysstat command. + *************************************************************************** + */ +void usage(char *progname) +{ + fprintf(stderr, _("Usage: %s [ options ] [ [ ] ]\n"), + progname); + + fprintf(stderr, _("Options are:\n" + "[ -h ] [ -k | -m ] [ -t ] [ -V ]\n")); + exit(1); +} + +/* + *************************************************************************** + * SIGALRM signal handler. + * + * IN: + * @sig Signal number. Set to 0 for the first time, then to SIGALRM. + *************************************************************************** + */ +void alarm_handler(int sig) +{ + signal(SIGALRM, alarm_handler); + alarm(interval); +} + +/* + *************************************************************************** + * Find number of CIFS-mounted points that are registered in + * /proc/fs/cifs/Stats. + * + * RETURNS: + * Number of CIFS-mounted points. + *************************************************************************** + */ +int get_cifs_nr(void) +{ + FILE *fp; + char line[128]; + int cifs = 0; + + if ((fp = fopen(CIFSSTATS, "r")) == NULL) + /* File non-existent */ + return 0; + + while (fgets(line, 128, fp) != NULL) { + + if (!strncmp(line, "Share (unique mount targets): ", 30)) { + sscanf(line + 30, "%d", &cifs); + break; + } + } + + /* Close file */ + fclose(fp); + + return cifs; +} + +/* + *************************************************************************** + * Set every cifs_io entry to inactive state (unregistered). + *************************************************************************** + */ +void set_entries_inactive(void) +{ + int i; + struct io_hdr_stats *shi = st_hdr_cifs; + + for (i = 0; i < cifs_nr; i++, shi++) { + shi->active = FALSE; + } +} + +/* + *************************************************************************** + * Free inactive entries (mark them as unused). + *************************************************************************** + */ +void free_inactive_entries(void) +{ + int i; + struct io_hdr_stats *shi = st_hdr_cifs; + + for (i = 0; i < cifs_nr; i++, shi++) { + if (!shi->active) { + shi->used = FALSE; + } + } +} + +/* + *************************************************************************** + * Allocate and init structures, according to system state. + *************************************************************************** + */ +void io_sys_init(void) +{ + int i; + + /* How many processors on this machine? */ + cpu_nr = get_cpu_nr(~0); + + /* Get number of CIFS directories in /proc/fs/cifs/Stats */ + if ((cifs_nr = get_cifs_nr()) > 0) { + cifs_nr += NR_CIFS_PREALLOC; + } + st_hdr_cifs = (struct io_hdr_stats *) calloc(cifs_nr, IO_HDR_STATS_SIZE); + + /* Allocate structures for number of CIFS directories found */ + for (i = 0; i < 2; i++) { + if ((st_cifs[i] = + (struct cifs_stats *) calloc(cifs_nr, CIFS_STATS_SIZE)) == NULL) { + perror("malloc"); + exit(4); + } + } +} + +/* + *************************************************************************** + * Free various structures. + *************************************************************************** +*/ +void io_sys_free(void) +{ + int i; + + /* Free CIFS directories structures */ + for (i = 0; i < 2; i++) { + + if (st_cifs[i]) { + free(st_cifs[i]); + } + } + + if (st_hdr_cifs) { + free(st_hdr_cifs); + } +} + +/* + *************************************************************************** + * Save stats for current CIFS filesystem. + * + * IN: + * @name Name of CIFS filesystem. + * @curr Index in array for current sample statistics. + * @st_io Structure with CIFS statistics to save. + *************************************************************************** + */ +void save_stats(char *name, int curr, struct cifs_stats *st_io) +{ + int i; + struct io_hdr_stats *st_hdr_cifs_i; + struct cifs_stats *st_cifs_i; + + /* Look for CIFS directory in data table */ + for (i = 0; i < cifs_nr; i++) { + st_hdr_cifs_i = st_hdr_cifs + i; + if (!strcmp(st_hdr_cifs_i->name, name)) { + break; + } + } + + if (i == cifs_nr) { + /* + * This is a new filesystem: Look for an unused entry to store it. + */ + for (i = 0; i < cifs_nr; i++) { + st_hdr_cifs_i = st_hdr_cifs + i; + if (!st_hdr_cifs_i->used) { + /* Unused entry found... */ + st_hdr_cifs_i->used = TRUE; /* Indicate it is now used */ + strcpy(st_hdr_cifs_i->name, name); + st_cifs_i = st_cifs[!curr] + i; + memset(st_cifs_i, 0, CIFS_STATS_SIZE); + break; + } + } + } + if (i < cifs_nr) { + st_hdr_cifs_i = st_hdr_cifs + i; + st_hdr_cifs_i->active = TRUE; + st_cifs_i = st_cifs[curr] + i; + *st_cifs_i = *st_io; + } + /* + * else it was a new CIFS directory + * but there was no free structure to store it. + */ +} + +/* + *************************************************************************** + * Read CIFS-mount directories stats from /proc/fs/cifs/Stats. + * + * IN: + * @curr Index in array for current sample statistics. + *************************************************************************** + */ +void read_cifs_stat(int curr) +{ + FILE *fp; + char line[256]; + char aux[32]; + int start = 0; + char cifs_name[MAX_NAME_LEN]; + char name_tmp[MAX_NAME_LEN]; + struct cifs_stats scifs; + + /* Every CIFS entry is potentially unregistered */ + set_entries_inactive(); + + if ((fp = fopen(CIFSSTATS, "r")) == NULL) + return; + + sprintf(aux, "%%%ds %%10s %%10s", + MAX_NAME_LEN < 200 ? MAX_NAME_LEN : 200); + + while (fgets(line, 256, fp) != NULL) { + + /* Read CIFS directory name */ + if (isdigit((unsigned char) line[0]) && sscanf(line, "%*d) %s", name_tmp) == 1) { + if (start) { + save_stats(cifs_name, curr, &scifs); + } + else { + start = 1; + } + strcpy(cifs_name, name_tmp); + } + else { + if (!strncmp(line, "Reads:", 6)) { + sscanf(line, "Reads: %llu Bytes: %llu", &scifs.rd_ops, &scifs.rd_bytes); + } + if (!strncmp(line, "Writes:", 7)) { + sscanf(line, "Writes: %llu Bytes: %llu", &scifs.wr_ops, &scifs.wr_bytes); + } + if (!strncmp(line, "Opens:", 6)) { + sscanf(line, "Opens: %llu Closes:%llu Deletes: %llu", + &scifs.fopens, &scifs.fcloses, &scifs.fdeletes); + } + } + } + + if (start) { + save_stats(cifs_name, curr, &scifs); + } + + fclose(fp); + + /* Free structures corresponding to unregistered filesystems */ + free_inactive_entries(); +} + +/* + *************************************************************************** + * Display CIFS stats header. + * + * OUT: + * @fctr Conversion factor. + *************************************************************************** + */ +void write_cifs_stat_header(int *fctr) +{ + printf("Filesystem: "); + if (DISPLAY_KILOBYTES(flags)) { + printf(" rkB/s wkB/s"); + *fctr = 1024; + } + else if (DISPLAY_MEGABYTES(flags)) { + printf(" rMB/s wMB/s"); + *fctr = 1024 * 1024; + } + else { + printf(" rB/s wB/s"); + *fctr = 1; + } + printf(" rops/s wops/s fo/s fc/s fd/s\n"); +} + +/* + *************************************************************************** + * Write CIFS stats read from /proc/fs/cifs/Stats. + * + * IN: + * @curr Index in array for current sample statistics. + * @itv Interval of time. + * @fctr Conversion factor. + * @shi Structures describing the CIFS filesystems. + * @ioi Current sample statistics. + * @ioj Previous sample statistics. + *************************************************************************** + */ +void write_cifs_stat(int curr, unsigned long long itv, int fctr, + struct io_hdr_stats *shi, struct cifs_stats *ioni, + struct cifs_stats *ionj) +{ + if (DISPLAY_HUMAN_READ(flags)) { + printf("%-22s\n%23s", shi->name, ""); + } + else { + printf("%-22s ", shi->name); + } + /* rB/s wB/s fo/s fc/s fd/s*/ + printf("%12.2f %12.2f %9.2f %9.2f %12.2f %12.2f %12.2f \n", + S_VALUE(ionj->rd_bytes, ioni->rd_bytes, itv) / fctr, + S_VALUE(ionj->wr_bytes, ioni->wr_bytes, itv) / fctr, + S_VALUE(ionj->rd_ops, ioni->rd_ops, itv), + S_VALUE(ionj->wr_ops, ioni->wr_ops, itv), + S_VALUE(ionj->fopens, ioni->fopens, itv), + S_VALUE(ionj->fcloses, ioni->fcloses, itv), + S_VALUE(ionj->fdeletes, ioni->fdeletes, itv)); +} + +/* + *************************************************************************** + * Print everything now (stats and uptime). + * + * IN: + * @curr Index in array for current sample statistics. + * @rectime Current date and time. + *************************************************************************** + */ +void write_stats(int curr, struct tm *rectime) +{ + int i, fctr = 1; + unsigned long long itv; + struct io_hdr_stats *shi; + struct cifs_stats *ioni, *ionj; + + /* Test stdout */ + TEST_STDOUT(STDOUT_FILENO); + + /* Print time stamp */ + if (DISPLAY_TIMESTAMP(flags)) { + if (DISPLAY_ISO(flags)) { + strftime(timestamp, sizeof(timestamp), "%FT%T%z", rectime); + } + else { + strftime(timestamp, sizeof(timestamp), "%x %X", rectime); + } + printf("%s\n", timestamp); + } + + /* Interval is multiplied by the number of processors */ + itv = get_interval(uptime[!curr], uptime[curr]); + + if (cpu_nr > 1) { + /* On SMP machines, reduce itv to one processor (see note above) */ + itv = get_interval(uptime0[!curr], uptime0[curr]); + } + + shi = st_hdr_cifs; + + /* Display CIFS stats header */ + write_cifs_stat_header(&fctr); + + for (i = 0; i < cifs_nr; i++, shi++) { + if (shi->used) { + ioni = st_cifs[curr] + i; + ionj = st_cifs[!curr] + i; + write_cifs_stat(curr, itv, fctr, shi, ioni, ionj); + } + } + printf("\n"); +} + +/* + *************************************************************************** + * Main loop: Read stats from the relevant sources and display them. + * + * IN: + * @count Number of lines of stats to print. + * @rectime Current date and time. + *************************************************************************** + */ +void rw_io_stat_loop(long int count, struct tm *rectime) +{ + int curr = 1; + + /* Don't buffer data if redirected to a pipe */ + setbuf(stdout, NULL); + + do { + if (cpu_nr > 1) { + /* + * Read system uptime (only for SMP machines). + * Init uptime0. So if /proc/uptime cannot fill it, + * this will be done by /proc/stat. + */ + uptime0[curr] = 0; + read_uptime(&(uptime0[curr])); + } + + /* Read CIFS stats */ + read_cifs_stat(curr); + + /* Get time */ + get_localtime(rectime); + + /* Print results */ + write_stats(curr, rectime); + + if (count > 0) { + count--; + } + if (count) { + curr ^= 1; + pause(); + } + } + while (count); +} + +/* + *************************************************************************** + * Main entry to the cifsiostat program. + *************************************************************************** + */ +int main(int argc, char **argv) +{ + int it = 0; + int opt = 1; + int i; + long count = 1; + struct utsname header; + struct tm rectime; + +#ifdef USE_NLS + /* Init National Language Support */ + init_nls(); +#endif + + /* Get HZ */ + get_HZ(); + + /* Process args... */ + while (opt < argc) { + + if (!strncmp(argv[opt], "-", 1)) { + for (i = 1; *(argv[opt] + i); i++) { + + switch (*(argv[opt] + i)) { + + case 'h': + /* Display an easy-to-read CIFS report */ + flags |= I_D_HUMAN_READ; + break; + + case 'k': + if (DISPLAY_MEGABYTES(flags)) { + usage(argv[0]); + } + /* Display stats in kB/s */ + flags |= I_D_KILOBYTES; + break; + + case 'm': + if (DISPLAY_KILOBYTES(flags)) { + usage(argv[0]); + } + /* Display stats in MB/s */ + flags |= I_D_MEGABYTES; + break; + + case 't': + /* Display timestamp */ + flags |= I_D_TIMESTAMP; + break; + + case 'V': + /* Print version number and exit */ + print_version(); + break; + + default: + usage(argv[0]); + } + } + opt++; + } + + else if (!it) { + interval = atol(argv[opt++]); + if (interval < 0) { + usage(argv[0]); + } + count = -1; + it = 1; + } + + else if (it > 0) { + count = atol(argv[opt++]); + if ((count < 1) || !interval) { + usage(argv[0]); + } + it = -1; + } + else { + usage(argv[0]); + } + } + + if (!interval) { + count = 1; + } + + /* Init structures according to machine architecture */ + io_sys_init(); + + get_localtime(&rectime); + + /* Get system name, release number and hostname */ + uname(&header); + if (print_gal_header(&rectime, header.sysname, header.release, + header.nodename, header.machine, cpu_nr)) { + flags |= I_D_ISO; + } + printf("\n"); + + /* Set a handler for SIGALRM */ + alarm_handler(0); + + /* Main loop */ + rw_io_stat_loop(count, &rectime); + + /* Free structures */ + io_sys_free(); + + return 0; +} diff --git a/cifsiostat.h b/cifsiostat.h new file mode 100644 index 00000000..6c84d0a2 --- /dev/null +++ b/cifsiostat.h @@ -0,0 +1,50 @@ +/* + * cifsiostat: Report CIFS statistics + * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved + * Written by Ivana Varekova + */ + +#ifndef _CIFSIOSTAT_H +#define _CIFSIOSTAT_H + +#include "common.h" + +#define CIFSSTATS "/proc/fs/cifs/Stats" + +/* I_: iostat - D_: Display - F_: Flag */ +#define I_D_TIMESTAMP 0x001 +#define I_D_KILOBYTES 0x002 +#define I_D_MEGABYTES 0x004 +#define I_D_ISO 0x008 +#define I_D_HUMAN_READ 0x010 + +#define DISPLAY_TIMESTAMP(m) (((m) & I_D_TIMESTAMP) == I_D_TIMESTAMP) +#define DISPLAY_KILOBYTES(m) (((m) & I_D_KILOBYTES) == I_D_KILOBYTES) +#define DISPLAY_MEGABYTES(m) (((m) & I_D_MEGABYTES) == I_D_MEGABYTES) +#define DISPLAY_ISO(m) (((m) & I_D_ISO) == I_D_ISO) +#define DISPLAY_HUMAN_READ(m) (((m) & I_D_HUMAN_READ) == I_D_HUMAN_READ) + +/* Preallocation constats */ +#define NR_CIFS_PREALLOC 2 + +struct cifs_stats { + unsigned long long rd_bytes __attribute__ ((aligned (8))); + unsigned long long wr_bytes __attribute__ ((packed)); + unsigned long long rd_ops __attribute__ ((packed)); + unsigned long long wr_ops __attribute__ ((packed)); + unsigned long long fopens __attribute__ ((packed)); + unsigned long long fcloses __attribute__ ((packed)); + unsigned long long fdeletes __attribute__ ((packed)); +}; + +#define CIFS_STATS_SIZE (sizeof(struct cifs_stats)) + +struct io_hdr_stats { + unsigned int active __attribute__ ((aligned (4))); + unsigned int used __attribute__ ((packed)); + char name[MAX_NAME_LEN]; +}; + +#define IO_HDR_STATS_SIZE (sizeof(struct io_hdr_stats)) + +#endif /* _CIFSIOSTAT_H */ diff --git a/common.c b/common.c new file mode 100644 index 00000000..0df2ee8a --- /dev/null +++ b/common.c @@ -0,0 +1,600 @@ +/* + * sar, sadc, sadf, mpstat and iostat common routines. + * (C) 1999-2009 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include /* For STDOUT_FILENO, among others */ +#include +#include +#include + +#include "version.h" +#include "common.h" +#include "ioconf.h" +#include "rd_stats.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +/* Number of ticks per second */ +unsigned int hz; +/* Number of bit shifts to convert pages to kB */ +unsigned int kb_shift; + +/* + *************************************************************************** + * Print sysstat version number and exit. + *************************************************************************** + */ +void print_version(void) +{ + fprintf(stderr, _("sysstat version %s\n"), VERSION); + fprintf(stderr, "(C) Sebastien Godard (sysstat orange.fr)\n"); + exit(1); +} + +/* + *************************************************************************** + * Get local date and time. + * + * OUT: + * @rectime Current local date and time. + * + * RETURNS: + * Value of time in seconds since the Epoch. + *************************************************************************** + */ +time_t get_localtime(struct tm *rectime) +{ + time_t timer; + struct tm *ltm; + + time(&timer); + ltm = localtime(&timer); + + *rectime = *ltm; + return timer; +} + +/* + *************************************************************************** + * Get date and time expressed in UTC. + * + * OUT: + * @rectime Current date and time expressed in UTC. + * + * RETURNS: + * Value of time in seconds since the Epoch. + *************************************************************************** + */ +time_t get_gmtime(struct tm *rectime) +{ + time_t timer; + struct tm *ltm; + + time(&timer); + ltm = gmtime(&timer); + + *rectime = *ltm; + return timer; +} + +/* + *************************************************************************** + * Get date and time and take into account variable. + * + * OUT: + * @rectime Current date and time. + * + * RETURNS: + * Value of time in seconds since the Epoch. + *************************************************************************** + */ +time_t get_time(struct tm *rectime) +{ + static int utc = 0; + char *e; + + if (!utc) { + /* Read environment variable value once */ + if ((e = getenv(ENV_TIME_DEFTM)) != NULL) { + utc = !strcmp(e, K_UTC); + } + utc++; + } + + if (utc == 2) + return get_gmtime(rectime); + else + return get_localtime(rectime); +} + +/* + *************************************************************************** + * Count number of comma-separated values in arguments list. For example, + * the number will be 3 for the list "foobar -p 1 -p 2,3,4 2 5". + * + * IN: + * @arg_c Number of arguments in the list. + * @arg_v Arguments list. + * + * RETURNS: + * Number of comma-separated values in the list. + *************************************************************************** + */ +int count_csvalues(int arg_c, char **arg_v) +{ + int opt = 1; + int nr = 0; + char *t; + + while (opt < arg_c) { + if (strchr(arg_v[opt], ',')) { + for (t = arg_v[opt]; t; t = strchr(t + 1, ',')) { + nr++; + } + } + opt++; + } + + return nr; +} + +/* + *************************************************************************** + * Look for partitions of a given block device in /sys filesystem. + * + * IN: + * @dev_name Name of the block device. + * + * RETURNS: + * Number of partitions for the given block device. + *************************************************************************** + */ +int get_dev_part_nr(char *dev_name) +{ + DIR *dir; + struct dirent *drd; + char dfile[MAX_PF_NAME], line[MAX_PF_NAME]; + int part = 0; + + snprintf(dfile, MAX_PF_NAME, "%s/%s", SYSFS_BLOCK, dev_name); + dfile[MAX_PF_NAME - 1] = '\0'; + + /* Open current device directory in /sys/block */ + if ((dir = opendir(dfile)) == NULL) + return 0; + + /* Get current file entry */ + while ((drd = readdir(dir)) != NULL) { + if (!strcmp(drd->d_name, ".") || !strcmp(drd->d_name, "..")) + continue; + snprintf(line, MAX_PF_NAME, "%s/%s/%s", dfile, drd->d_name, S_STAT); + line[MAX_PF_NAME - 1] = '\0'; + + /* Try to guess if current entry is a directory containing a stat file */ + if (!access(line, R_OK)) { + /* Yep... */ + part++; + } + } + + /* Close directory */ + closedir(dir); + + return part; +} + +/* + *************************************************************************** + * Look for block devices present in /sys/ filesystem: + * Check first that sysfs is mounted (done by trying to open /sys/block + * directory), then find number of devices registered. + * + * IN: + * @display_partitions Set to TRUE if partitions must also be counted. + * + * RETURNS: + * Total number of block devices (and partitions if @display_partitions was + * set). + *************************************************************************** + */ +int get_sysfs_dev_nr(int display_partitions) +{ + DIR *dir; + struct dirent *drd; + char line[MAX_PF_NAME]; + int dev = 0; + + /* Open /sys/block directory */ + if ((dir = opendir(SYSFS_BLOCK)) == NULL) + /* sysfs not mounted, or perhaps this is an old kernel */ + return 0; + + /* Get current file entry in /sys/block directory */ + while ((drd = readdir(dir)) != NULL) { + if (!strcmp(drd->d_name, ".") || !strcmp(drd->d_name, "..")) + continue; + snprintf(line, MAX_PF_NAME, "%s/%s/%s", SYSFS_BLOCK, drd->d_name, S_STAT); + line[MAX_PF_NAME - 1] = '\0'; + + /* Try to guess if current entry is a directory containing a stat file */ + if (!access(line, R_OK)) { + /* Yep... */ + dev++; + + if (display_partitions) { + /* We also want the number of partitions for this device */ + dev += get_dev_part_nr(drd->d_name); + } + } + } + + /* Close /sys/block directory */ + closedir(dir); + + return dev; +} + +/* + *************************************************************************** + * Print banner. + * + * IN: + * @rectime Date and time to display. + * @sysname System name to display. + * @release System release number to display. + * @nodename Hostname to display. + * @machine Machine architecture to display. + * @cpu_nr Number of CPU. + * + * RETURNS: + * TRUE if S_TIME_FORMAT is set to ISO, or FALSE otherwise. + *************************************************************************** + */ +int print_gal_header(struct tm *rectime, char *sysname, char *release, + char *nodename, char *machine, int cpu_nr) +{ + char cur_date[64]; + char *e; + int rc = 0; + + if (((e = getenv(ENV_TIME_FMT)) != NULL) && !strcmp(e, K_ISO)) { + strftime(cur_date, sizeof(cur_date), "%Y-%m-%d", rectime); + rc = 1; + } + else { + strftime(cur_date, sizeof(cur_date), "%x", rectime); + } + + printf("%s %s (%s) \t%s \t_%s_\t(%d CPU)\n", sysname, release, nodename, + cur_date, machine, cpu_nr); + + return rc; +} + +#ifdef USE_NLS +/* + *************************************************************************** + * Init National Language Support. + *************************************************************************** + */ +void init_nls(void) +{ + setlocale(LC_MESSAGES, ""); + setlocale(LC_CTYPE, ""); + setlocale(LC_TIME, ""); + setlocale(LC_NUMERIC, ""); + + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); +} +#endif + +/* + *************************************************************************** + * Get number of rows for current window. + * + * RETURNS: + * Number of rows. + *************************************************************************** + */ +int get_win_height(void) +{ + struct winsize win; + /* + * This default value will be used whenever STDOUT + * is redirected to a pipe or a file + */ + int rows = 3600 * 24; + + if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) != -1) { + if (win.ws_row > 2) { + rows = win.ws_row - 2; + } + } + return rows; +} + +/* + *************************************************************************** + * Remove /dev from path name. + * + * IN: + * @name Device name (may begins with "/dev/") + * + * RETURNS: + * Device basename. + *************************************************************************** + */ +char *device_name(char *name) +{ + if (!strncmp(name, "/dev/", 5)) + return name + 5; + + return name; +} + +/* + *************************************************************************** + * Test whether given name is a device or a partition, using sysfs. + * This is more straightforward that using ioc_iswhole() function from + * ioconf.c which should be used only with kernels that don't have sysfs. + * + * IN: + * @name Device or partition name. + * + * RETURNS: + * TRUE if @name is a (whole) device. + *************************************************************************** + */ +int is_device(char *name) +{ + char syspath[PATH_MAX]; + char *slash; + + /* Some devices may have a slash in their name (eg. cciss/c0d0...) */ + while ((slash = strchr(name, '/'))) { + *slash = '!'; + } + snprintf(syspath, sizeof(syspath), "%s/%s", SYSFS_BLOCK, name); + + return !(access(syspath, F_OK)); +} + +/* + *************************************************************************** + * Get page shift in kB. + *************************************************************************** + */ +void get_kb_shift(void) +{ + int shift = 0; + long size; + + /* One can also use getpagesize() to get the size of a page */ + if ((size = sysconf(_SC_PAGESIZE)) == -1) { + perror("sysconf"); + } + + size >>= 10; /* Assume that a page has a minimum size of 1 kB */ + + while (size > 1) { + shift++; + size >>= 1; + } + + kb_shift = (unsigned int) shift; +} + +/* + *************************************************************************** + * Get number of clock ticks per second. + *************************************************************************** + */ +void get_HZ(void) +{ + long ticks; + + if ((ticks = sysconf(_SC_CLK_TCK)) == -1) { + perror("sysconf"); + } + + hz = (unsigned int) ticks; +} + +/* + *************************************************************************** + * Handle overflow conditions properly for counters which are read as + * unsigned long long, but which can be unsigned long long or + * unsigned long only depending on the kernel version used. + * @value1 and @value2 being two values successively read for this + * counter, if @value2 < @value1 and @value1 <= 0xffffffff, then we can + * assume that the counter's type was unsigned long and has overflown, and + * so the difference @value2 - @value1 must be casted to this type. + * NOTE: These functions should no longer be necessary to handle a particular + * stat counter when we can assume that everybody is using a recent kernel + * (defining this counter as unsigned long long). + *************************************************************************** + */ +double ll_sp_value(unsigned long long value1, unsigned long long value2, + unsigned long long itv) +{ + if ((value2 < value1) && (value1 <= 0xffffffff)) + /* Counter's type was unsigned long and has overflown */ + return ((double) ((value2 - value1) & 0xffffffff)) / itv * 100; + else + return SP_VALUE(value1, value2, itv); +} + +double ll_s_value(unsigned long long value1, unsigned long long value2, + unsigned long long itv) +{ + if ((value2 < value1) && (value1 <= 0xffffffff)) + /* Counter's type was unsigned long and has overflown */ + return ((double) ((value2 - value1) & 0xffffffff)) / itv * HZ; + else + return S_VALUE(value1, value2, itv); +} + +/* + *************************************************************************** + * Compute time interval. + * + * IN: + * @prev_uptime Previous uptime value in jiffies. + * @curr_uptime Current uptime value in jiffies. + * + * RETURNS: + * Interval of time in jiffies. + *************************************************************************** + */ +unsigned long long get_interval(unsigned long long prev_uptime, + unsigned long long curr_uptime) +{ + unsigned long long itv; + + /* prev_time=0 when displaying stats since system startup */ + itv = curr_uptime - prev_uptime; + + if (!itv) { /* Paranoia checking */ + itv = 1; + } + + return itv; +} + +/* + *************************************************************************** + * Since ticks may vary slightly from CPU to CPU, we'll want + * to recalculate itv based on this CPU's tick count, rather + * than that reported by the "cpu" line. Otherwise we + * occasionally end up with slightly skewed figures, with + * the skew being greater as the time interval grows shorter. + * + * IN: + * @scc Current sample statistics for current CPU. + * @scp Previous sample statistics for current CPU. + * + * RETURNS: + * Interval of time based on current CPU. + *************************************************************************** + */ +unsigned long long get_per_cpu_interval(struct stats_cpu *scc, + struct stats_cpu *scp) +{ + /* Don't take cpu_guest into account because cpu_user already includes it */ + return ((scc->cpu_user + scc->cpu_nice + + scc->cpu_sys + scc->cpu_iowait + + scc->cpu_idle + scc->cpu_steal + + scc->cpu_hardirq + scc->cpu_softirq) - + (scp->cpu_user + scp->cpu_nice + + scp->cpu_sys + scp->cpu_iowait + + scp->cpu_idle + scp->cpu_steal + + scp->cpu_hardirq + scp->cpu_softirq)); +} + +/* + *************************************************************************** + * Unhandled situation: Panic and exit. + * + * IN: + * @function Function name where situation occured. + * @error_code Error code. + *************************************************************************** + */ +void sysstat_panic(const char *function, int error_code) +{ + fprintf(stderr, "sysstat: %s[%d]: Last chance handler...\n", + function, error_code); + exit(1); +} + +/* + *************************************************************************** + * Count number of bits set in an array. + * + * IN: + * @ptr Pointer to array. + * @size Size of array in bytes. + * + * RETURNS: + * Number of bits set in the array. + *************************************************************************** +*/ +int count_bits(void *ptr, int size) +{ + int nr = 0, i, k; + char *p; + + p = ptr; + for (i = 0; i < size; i++, p++) { + k = 0x80; + while (k) { + if (*p & k) + nr++; + k >>= 1; + } + } + + return nr; +} + +/* + *************************************************************************** + * Compute "extended" device statistics (service time, etc.). + * + * IN: + * @sdc Structure with current device statistics. + * @sdp Structure with previous device statistics. + * @itv Interval of time in jiffies. + * + * OUT: + * @xds Structure with extended statistics. + *************************************************************************** +*/ +void compute_ext_disk_stats(struct stats_disk *sdc, struct stats_disk *sdp, + unsigned long long itv, struct ext_disk_stats *xds) +{ + double tput + = ((double) (sdc->nr_ios - sdp->nr_ios)) * HZ / itv; + + xds->util = S_VALUE(sdp->tot_ticks, sdc->tot_ticks, itv); + xds->svctm = tput ? xds->util / tput : 0.0; + /* + * Kernel gives ticks already in milliseconds for all platforms + * => no need for further scaling. + */ + xds->await = (sdc->nr_ios - sdp->nr_ios) ? + ((sdc->rd_ticks - sdp->rd_ticks) + (sdc->wr_ticks - sdp->wr_ticks)) / + ((double) (sdc->nr_ios - sdp->nr_ios)) : 0.0; + xds->arqsz = (sdc->nr_ios - sdp->nr_ios) ? + ((sdc->rd_sect - sdp->rd_sect) + (sdc->wr_sect - sdp->wr_sect)) / + ((double) (sdc->nr_ios - sdp->nr_ios)) : 0.0; +} diff --git a/common.h b/common.h new file mode 100644 index 00000000..f206e5f7 --- /dev/null +++ b/common.h @@ -0,0 +1,194 @@ +/* + * sysstat: System performance tools for Linux + * (C) 1999-2010 by Sebastien Godard (sysstat orange.fr) + */ + +#ifndef _COMMON_H +#define _COMMON_H + +/* Maximum length of sensors device name */ +#define MAX_SENSORS_DEV_LEN 20 + +#include +#include /* For __CPU_SETSIZE */ +#include "rd_stats.h" + + +/* + *************************************************************************** + * Various keywords and constants + *************************************************************************** + */ + +#define FALSE 0 +#define TRUE 1 + +#define DISP_HDR 1 + +/* Maximum number of CPUs */ +#ifdef __CPU_SETSIZE +#define NR_CPUS __CPU_SETSIZE +#else +#define NR_CPUS 1024 +#endif + +/* Maximum number of interrupts */ +#define NR_IRQS 256 + +/* Size of /proc/interrupts line, CPU data excluded */ +#define INTERRUPTS_LINE 128 + +/* Keywords */ +#define K_ISO "ISO" +#define K_ALL "ALL" +#define K_UTC "UTC" + +/* Files */ +#define STAT "/proc/stat" +#define UPTIME "/proc/uptime" +#define PPARTITIONS "/proc/partitions" +#define DISKSTATS "/proc/diskstats" +#define INTERRUPTS "/proc/interrupts" +#define MEMINFO "/proc/meminfo" +#define SYSFS_BLOCK "/sys/block" +#define SYSFS_DEVCPU "/sys/devices/system/cpu" +#define S_STAT "stat" +#define DEVMAP_DIR "/dev/mapper" + +#define MAX_FILE_LEN 256 +#define MAX_PF_NAME 1024 +#define DEVMAP_MAJOR 253 +#define MAX_NAME_LEN 72 + +#define NR_DISKS 4 + +/* Environment variables */ +#define ENV_TIME_FMT "S_TIME_FORMAT" +#define ENV_TIME_DEFTM "S_TIME_DEF_TIME" + +#define DIGITS "0123456789" + + +/* + *************************************************************************** + * Macro functions definitions. + *************************************************************************** + */ + +/* Allocate and init structure */ +#define SREALLOC(S, TYPE, SIZE) do { \ + TYPE *_p_; \ + _p_ = S; \ + if (SIZE) { \ + if ((S = (TYPE *) realloc(S, (SIZE))) == NULL) { \ + perror("realloc"); \ + exit(4); \ + } \ + /* If the ptr was null, then it's a malloc() */ \ + if (!_p_) \ + memset(S, 0, (SIZE)); \ + } \ + } while (0) + +/* + * Macros used to display statistics values. + * + * NB: Define SP_VALUE() to normalize to %; + * HZ is 1024 on IA64 and % should be normalized to 100. + */ +#define S_VALUE(m,n,p) (((double) ((n) - (m))) / (p) * HZ) +#define SP_VALUE(m,n,p) (((double) ((n) - (m))) / (p) * 100) + +/* + * Under very special circumstances, STDOUT may become unavailable. + * This is what we try to guess here + */ +#define TEST_STDOUT(_fd_) do { \ + if (write(_fd_, "", 0) == -1) { \ + perror("stdout"); \ + exit(6); \ + } \ + } while (0) + + +#define MINIMUM(a,b) ((a) < (b) ? (a) : (b)) + +#define PANIC(m) sysstat_panic(__FUNCTION__, m) + + +/* Number of ticks per second */ +#define HZ hz +extern unsigned int hz; + +/* Number of bit shifts to convert pages to kB */ +extern unsigned int kb_shift; + +/* + * kB <-> number of pages. + * Page size depends on machine architecture (4 kB, 8 kB, 16 kB, 64 kB...) + */ +#define KB_TO_PG(k) ((k) >> kb_shift) +#define PG_TO_KB(k) ((k) << kb_shift) + +/* + *************************************************************************** + * Structures definitions + *************************************************************************** + */ + +/* Structure used for extended disk statistics */ +struct ext_disk_stats { + double util; + double await; + double svctm; + double arqsz; +}; + + +/* + *************************************************************************** + * Functions prototypes + *************************************************************************** + */ + +extern void + compute_ext_disk_stats(struct stats_disk *, struct stats_disk *, + unsigned long long, struct ext_disk_stats *); +extern int + count_bits(void *, int); +extern int + count_csvalues(int, char **); +extern char * + device_name(char *); +extern void + get_HZ(void); +extern unsigned long long + get_interval(unsigned long long, unsigned long long); +extern void + get_kb_shift(void); +extern time_t + get_localtime(struct tm *); +extern time_t + get_time(struct tm *); +unsigned long long + get_per_cpu_interval(struct stats_cpu *, struct stats_cpu *); +extern int + get_sysfs_dev_nr(int); +extern int + get_win_height(void); +extern void + init_nls(void); +extern int + is_device(char *); +extern double + ll_s_value(unsigned long long, unsigned long long, unsigned long long); +extern double + ll_sp_value(unsigned long long, unsigned long long, unsigned long long); +extern int + print_gal_header(struct tm *, char *, char *, char *, char *, int); +extern void + print_version(void); +extern void + sysstat_panic(const char *, int); + +#endif /* _COMMON_H */ diff --git a/configure b/configure new file mode 100755 index 00000000..27e19f47 --- /dev/null +++ b/configure @@ -0,0 +1,8949 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.63 for sysstat 9.1.5. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME='sysstat' +PACKAGE_TARNAME='sysstat' +PACKAGE_VERSION='9.1.5' +PACKAGE_STRING='sysstat 9.1.5' +PACKAGE_BUGREPORT='' + +ac_unique_file="ioconf.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='LTLIBOBJS +LIBOBJS +DFLAGS +WITH_DEBUG +AuxMandir +INSTALL_DOC +REM_CHOWN +QUOTE +CRON_COUNT +CRON_INTERVAL_SEC +CRON_INTERVAL +SU_C_OWNER +CRON_OWNER +cron_interval +cron_owner +INSTALL_CRON +CLEAN_SA_DIR +INSTALL_ISAG +COMPRESS_MANPG +IGNORE_MAN_GROUP +MAN_GROUP +man_group +COMPRESSAFTER +compressafter +HISTORY +history +YESTERDAY +NLS +SYSCONFIG_DIR +conf_dir +SA_DIR +sa_dir +SA_LIB_DIR +sa_lib_dir +INITD_DIR +INIT_DIR +RC_DIR +rcdir +HAVE_SENSORS +PATH_CHKCONFIG +PATH_CP +INSTALL_BIN +INSTALL_DATA +ZIP +MSGMERGE +XGETTEXT +MSGFMT +INSTALL +AR +CHOWN +CHMOD +LN_S +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_sensors +enable_largefile +enable_nls +enable_yesterday +enable_man_group +enable_compress_manpg +enable_install_isag +enable_clean_sa_dir +enable_install_cron +enable_documentation +enable_debuginfo +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +rcdir +sa_lib_dir +sa_dir +conf_dir +history +compressafter +man_group +cron_owner +cron_interval' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures sysstat 9.1.5 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/sysstat] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of sysstat 9.1.5:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-sensors disable sensors support + --disable-largefile omit support for large files + --disable-nls disable National Language Support + --enable-yesterday tell sa2 to use data file of the day before + --disable-man-group ignore man_group variable value + --enable-compress-manpg compress sysstat manual pages + --enable-install-isag install isag script + --enable-clean-sa-dir clean system activity directory + --enable-install-cron install a crontab to start sar + --disable-documentation do not install documentation + --enable-debuginfo enable debug output (--debuginfo option) + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + rcdir run-commands directory + sa_lib_dir sadc directory + sa_dir system activity directory + conf_dir sysstat configuration directory + history number of daily data files to keep (default value is 7) + compressafter + number of days after which data files are compressed (default + value is 10) + man_group group for manual pages + cron_owner crontab owner + cron_interval + crontab interval + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +sysstat configure 9.1.5 +generated by GNU Autoconf 2.63 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by sysstat $as_me 9.1.5, which was +generated by GNU Autoconf 2.63. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test -r "$ac_site_file"; then + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Ensure that a recent enough version of Autoconf is being used + + +# Check whether the configure script is in the right dir + + +# Check programs +echo . +echo Check programs: +echo . + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } + +# Provide some information about the compiler. +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +if test -z "$ac_file"; then + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } + fi + fi +fi +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } +fi + +rm -f conftest$ac_cv_exeext +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + if test "${ac_cv_header_minix_config_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 +$as_echo_n "checking minix/config.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 +$as_echo_n "checking minix/config.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_minix_config_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } + +fi +if test "x$ac_cv_header_minix_config_h" = x""yes; then + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_SOURCE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_1_SOURCE 2 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _MINIX 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_safe_to_define___extensions__=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_safe_to_define___extensions__=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _TANDEM_SOURCE 1 +_ACEOF + + +{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + + +# Extract the first word of "chmod", so it can be a program name with args. +set dummy chmod; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CHMOD+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CHMOD"; then + ac_cv_prog_CHMOD="$CHMOD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CHMOD="chmod" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CHMOD=$ac_cv_prog_CHMOD +if test -n "$CHMOD"; then + { $as_echo "$as_me:$LINENO: result: $CHMOD" >&5 +$as_echo "$CHMOD" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "chown", so it can be a program name with args. +set dummy chown; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CHOWN+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CHOWN"; then + ac_cv_prog_CHOWN="$CHOWN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CHOWN="chown" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CHOWN=$ac_cv_prog_CHOWN +if test -n "$CHOWN"; then + { $as_echo "$as_me:$LINENO: result: $CHOWN" >&5 +$as_echo "$CHOWN" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="ar" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "install", so it can be a program name with args. +set dummy install; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_INSTALL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$INSTALL"; then + ac_cv_prog_INSTALL="$INSTALL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_INSTALL="install" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +INSTALL=$ac_cv_prog_INSTALL +if test -n "$INSTALL"; then + { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_MSGFMT+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$MSGFMT"; then + ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MSGFMT="msgfmt" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +MSGFMT=$ac_cv_prog_MSGFMT +if test -n "$MSGFMT"; then + { $as_echo "$as_me:$LINENO: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_XGETTEXT+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$XGETTEXT"; then + ac_cv_prog_XGETTEXT="$XGETTEXT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_XGETTEXT="xgettext" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +XGETTEXT=$ac_cv_prog_XGETTEXT +if test -n "$XGETTEXT"; then + { $as_echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_MSGMERGE+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$MSGMERGE"; then + ac_cv_prog_MSGMERGE="$MSGMERGE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MSGMERGE="msgmerge" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +MSGMERGE=$ac_cv_prog_MSGMERGE +if test -n "$MSGMERGE"; then + { $as_echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +$as_echo "$MSGMERGE" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +for ac_prog in bzip2 gzip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ZIP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ZIP"; then + ac_cv_prog_ZIP="$ZIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ZIP="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ZIP=$ac_cv_prog_ZIP +if test -n "$ZIP"; then + { $as_echo "$as_me:$LINENO: result: $ZIP" >&5 +$as_echo "$ZIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ZIP" && break +done +test -n "$ZIP" || ZIP="gzip" + +INSTALL_DATA="\${INSTALL} -m 644" + +INSTALL_BIN="\${INSTALL} -m 755" + + +for ac_prog in cp +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PATH_CP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $PATH_CP in + [\\/]* | ?:[\\/]*) + ac_cv_path_PATH_CP="$PATH_CP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PATH_CP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +PATH_CP=$ac_cv_path_PATH_CP +if test -n "$PATH_CP"; then + { $as_echo "$as_me:$LINENO: result: $PATH_CP" >&5 +$as_echo "$PATH_CP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PATH_CP" && break +done +test -n "$PATH_CP" || PATH_CP="cp" + +for ac_prog in chkconfig +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PATH_CHKCONFIG+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $PATH_CHKCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PATH_CHKCONFIG="$PATH_CHKCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PATH_CHKCONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +PATH_CHKCONFIG=$ac_cv_path_PATH_CHKCONFIG +if test -n "$PATH_CHKCONFIG"; then + { $as_echo "$as_me:$LINENO: result: $PATH_CHKCONFIG" >&5 +$as_echo "$PATH_CHKCONFIG" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PATH_CHKCONFIG" && break +done +test -n "$PATH_CHKCONFIG" || PATH_CHKCONFIG="chkconfig" + + +# Check libraries + +# Check header files +echo . +echo Check header files: +echo . +HAVE_LIBINTL_H= +HAVE_LOCALE_H= +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + + + + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if test "${ac_cv_search_opendir+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_search_opendir=$ac_res +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if test "${ac_cv_search_opendir+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_search_opendir=$ac_res +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + + +for ac_header in ctype.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in errno.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in libintl.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + HAVE_LIBINTL_H=1 +fi + +done + + +for ac_header in locale.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + HAVE_LOCALE_H=1 +fi + +done + + +for ac_header in net/if.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in regex.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in signal.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in stdio.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/file.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/ioctl.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/stat.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +echo . +echo Check typedefs, structures and compiler characteristics: +echo . +{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } +if test "${ac_cv_type_signal+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_signal=int +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_signal=void +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } +if test "${ac_cv_type_size_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_size_t=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((size_t))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +$as_echo "$ac_cv_type_size_t" >&6; } +if test "x$ac_cv_type_size_t" = x""yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ $as_echo "$as_me:$LINENO: checking for off_t" >&5 +$as_echo_n "checking for off_t... " >&6; } +if test "${ac_cv_type_off_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_off_t=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof (off_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((off_t))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_off_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +$as_echo "$ac_cv_type_off_t" >&6; } +if test "x$ac_cv_type_off_t" = x""yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + + +echo . +echo Check library functions: +echo . + +for ac_func in strchr +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in strcspn +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in strspn +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in strstr +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Should we check for lm_sensors? +{ $as_echo "$as_me:$LINENO: checking for sensors support" >&5 +$as_echo_n "checking for sensors support... " >&6; } +# Check whether --enable-sensors was given. +if test "${enable_sensors+set}" = set; then + enableval=$enable_sensors; SENSORS=$enableval +else + SENSORS=yes +fi + +if test $SENSORS != "yes"; then + CFSENSORS="" + DFSENSORS="" +else + CFSENSORS="-lsensors" + DFSENSORS="-DHAVE_SENSORS" +fi +{ $as_echo "$as_me:$LINENO: result: $SENSORS" >&5 +$as_echo "$SENSORS" >&6; } + +# Check for lm_sensors +HAVE_SENSORS=no +DFLAGS="" +{ $as_echo "$as_me:$LINENO: checking for sensors_get_detected_chips in -lsensors" >&5 +$as_echo_n "checking for sensors_get_detected_chips in -lsensors... " >&6; } +if test "${ac_cv_lib_sensors_sensors_get_detected_chips+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsensors $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sensors_get_detected_chips (); +int +main () +{ +return sensors_get_detected_chips (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_sensors_sensors_get_detected_chips=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_sensors_sensors_get_detected_chips=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_sensors_sensors_get_detected_chips" >&5 +$as_echo "$ac_cv_lib_sensors_sensors_get_detected_chips" >&6; } +if test "x$ac_cv_lib_sensors_sensors_get_detected_chips" = x""yes; then + CFLAGS="${CFLAGS} ${CFSENSORS}" +fi + +{ $as_echo "$as_me:$LINENO: checking for sensors lib" >&5 +$as_echo_n "checking for sensors lib... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +sensors_cleanup(); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + HAVE_SENSORS=yes; DFLAGS="${DFLAGS} ${DFSENSORS}" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + HAVE_SENSORS=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $HAVE_SENSORS" >&5 +$as_echo "$HAVE_SENSORS" >&6; } + + +echo . +echo Check system services: +echo . +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_largefile_CC=' -n32'; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + $as_echo_n "(cached) " >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=no; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=64; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then + $as_echo_n "(cached) " >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=1; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi +fi + + +echo . +echo Check configuration: +echo . +# Check arguments used +# +# Optional Features: +# --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +# --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +# --disable-largefile omit support for large files +# --disable-nls disable National Language Support +# --enable-yesterday tell sa2 to use "yesterday" data files +# --disable-man-group ignore man_group variable value +# --enable-install-cron tell sysstat to install cron scripts +# --enable-clean-sa-dir clean system activity directory +# --enable-compress-manpg compress manual pages +# --enable-install-isag install isag script +# --enable-debuginfo enable debug output (--debuginfo option) +# --disable-documentation do not install documentation (man pages...) +# --disable-sensors do not link against libsensors even if available +# +# Some influential environment variables: +# rcdir directory where startup scripts are installed +# sa_lib_dir sadc, sa1 and sa2 directory +# sa_dir system activity daily datafiles directory +# conf_dir sysstat configuration directory (default is /etc/sysconfig) +# history number of daily datafiles to keep (default value is 7) +# compressafter number of days after which datafiles are compressed +# man_group group for man pages +# cron_owner crontab owner +# cron_interval crontab sampling interval +# +# Fine tuning the installation directories: +# --mandir=DIR man documentation directory [PREFIX/man] +# --docdir=DIR other documentation directory [PREFIX/share/doc] +# +# Installation directories: +# --prefix=PREFIX install architecture-independent files in PREFIX +# [/usr/local] +# --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX +# [PREFIX] + +# Set directories +if test -d /etc/init.d && test ! -L /etc/init.d; then + if test -d /etc/init.d/rc2.d; then + RC_DIR=/etc/init.d + INITD_DIR=. + else + RC_DIR=/etc + INITD_DIR=init.d + fi + INIT_DIR=/etc/init.d +elif test -d /sbin/init.d; then + RC_DIR=/sbin/init.d + INIT_DIR=/sbin/init.d + INITD_DIR=. +else + RC_DIR=/etc/rc.d + INIT_DIR=/etc/rc.d/init.d + INITD_DIR=init.d +fi + +{ $as_echo "$as_me:$LINENO: checking run-commands directory" >&5 +$as_echo_n "checking run-commands directory... " >&6; } + +if test x$rcdir != x""; then + # Override previous rc directories values + RC_DIR=$rcdir + INIT_DIR=$rcdir/init.d + INITD_DIR=init.d +fi +{ $as_echo "$as_me:$LINENO: result: $RC_DIR" >&5 +$as_echo "$RC_DIR" >&6; } +if test ! -d $RC_DIR; then + echo "INFO: Directory ${RC_DIR} doesn't exist." + echo "INFO: Startup scripts won't be installed." +fi + + + + + +# Set sadc directory +if test $prefix != "NONE"; then + AuxPrefix=$prefix +else + AuxPrefix=/usr/local +fi + +if test -d $AuxPrefix/lib; then + SADC_DIR=$AuxPrefix/lib +elif test -d $AuxPrefix/lib64; then + SADC_DIR=$AuxPrefix/lib64 +else + SADC_DIR=$AuxPrefix/lib +fi + +{ $as_echo "$as_me:$LINENO: checking sadc directory" >&5 +$as_echo_n "checking sadc directory... " >&6; } + +if test x$sa_lib_dir != x""; then + SA_LIB_DIR=$sa_lib_dir +else + SA_LIB_DIR=$SADC_DIR/sa +fi +{ $as_echo "$as_me:$LINENO: result: $SA_LIB_DIR" >&5 +$as_echo "$SA_LIB_DIR" >&6; } +if test ! -d $SA_LIB_DIR; then + echo "INFO: Directory ${SA_LIB_DIR} will be created during installation stage." +fi + + +# Set system activity directory +{ $as_echo "$as_me:$LINENO: checking system activity directory" >&5 +$as_echo_n "checking system activity directory... " >&6; } + +if test x$sa_dir != x""; then + SA_DIR=$sa_dir +else + SA_DIR=/var/log/sa +fi +{ $as_echo "$as_me:$LINENO: result: $SA_DIR" >&5 +$as_echo "$SA_DIR" >&6; } +if test ! -d $SA_DIR; then + echo "INFO: Directory ${SA_DIR} will be created during installation stage." +fi + + +# Set configuration directory +{ $as_echo "$as_me:$LINENO: checking sysstat configuration directory" >&5 +$as_echo_n "checking sysstat configuration directory... " >&6; } + +if test x$conf_dir != x""; then + SYSCONFIG_DIR=$conf_dir +else + SYSCONFIG_DIR=/etc/sysconfig +fi +{ $as_echo "$as_me:$LINENO: result: $SYSCONFIG_DIR" >&5 +$as_echo "$SYSCONFIG_DIR" >&6; } +if test ! -d $SYSCONFIG_DIR; then + echo "INFO: Directory ${SYSCONFIG_DIR} will be created during installation stage." +fi + + +# National Language Support +{ $as_echo "$as_me:$LINENO: checking National Language Support" >&5 +$as_echo_n "checking National Language Support... " >&6; } +# Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then + enableval=$enable_nls; AUX_NLS=$enableval +else + AUX_NLS=yes +fi + +if test $AUX_NLS != "no" && test $HAVE_LIBINTL_H && test $HAVE_LOCALE_H; then + AUX_NLS="yes" + NLS="y" +else + AUX_NLS="no" + NLS="n" +fi +{ $as_echo "$as_me:$LINENO: result: $AUX_NLS" >&5 +$as_echo "$AUX_NLS" >&6; } + +if test $AUX_NLS = "yes" && test x$MSGFMT != x"msgfmt"; then + echo "WARNING: msgfmt command not found!" +fi +if test $AUX_NLS = "yes" && test x$XGETTEXT != x"xgettext"; then + echo "WARNING: xgettext command not found!" +fi +if test $AUX_NLS = "yes" && test x$MSGMERGE != x"msgmerge"; then + echo "WARNING: msgmerge command not found!" +fi + +# Check whether sa2 should process data file of the day before +{ $as_echo "$as_me:$LINENO: checking whether sa2 should process data file of the day before" >&5 +$as_echo_n "checking whether sa2 should process data file of the day before... " >&6; } +# Check whether --enable-yesterday was given. +if test "${enable_yesterday+set}" = set; then + enableval=$enable_yesterday; AUX_YESTERDAY=$enableval +else + AUX_YESTERDAY=no +fi + +if test $AUX_YESTERDAY = "yes"; then + YESTERDAY="--date=yesterday" + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + YESTERDAY="" + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Data history to keep by sa2 +{ $as_echo "$as_me:$LINENO: checking number of daily data files to keep" >&5 +$as_echo_n "checking number of daily data files to keep... " >&6; } + +if test x$history = x""; then + HISTORY=7 +else + HISTORY=$history +fi +{ $as_echo "$as_me:$LINENO: result: $HISTORY" >&5 +$as_echo "$HISTORY" >&6; } + + +# Number of days after which datafiles are compressed +{ $as_echo "$as_me:$LINENO: checking number of days after which data files are compressed" >&5 +$as_echo_n "checking number of days after which data files are compressed... " >&6; } + +if test x$compressafter = x""; then + COMPRESSAFTER=10 +else + COMPRESSAFTER=$compressafter +fi +{ $as_echo "$as_me:$LINENO: result: $COMPRESSAFTER" >&5 +$as_echo "$COMPRESSAFTER" >&6; } + + +# Manual page group +if `grep ^man: /etc/group >/dev/null 2>&1`; then + GRP=man +else + GRP=root +fi + +{ $as_echo "$as_me:$LINENO: checking group for manual pages" >&5 +$as_echo_n "checking group for manual pages... " >&6; } + +if test x$man_group = x""; then + MAN_GROUP=$GRP + { $as_echo "$as_me:$LINENO: result: $MAN_GROUP" >&5 +$as_echo "$MAN_GROUP" >&6; } +else + if !(`grep ^$man_group: /etc/group >/dev/null 2>&1`); then + MAN_GROUP=$GRP + { $as_echo "$as_me:$LINENO: result: $MAN_GROUP" >&5 +$as_echo "$MAN_GROUP" >&6; } + echo "WARNING: Group ${man_group} not found: Using ${GRP} instead" + else + MAN_GROUP=$man_group + { $as_echo "$as_me:$LINENO: result: $MAN_GROUP" >&5 +$as_echo "$MAN_GROUP" >&6; } + fi +fi + + +# Ignore manual pages group? +{ $as_echo "$as_me:$LINENO: checking whether man_group variable should be ignored" >&5 +$as_echo_n "checking whether man_group variable should be ignored... " >&6; } +# Check whether --enable-man-group was given. +if test "${enable_man_group+set}" = set; then + enableval=$enable_man_group; AUX_IMG=$enableval +else + AUX_IMG=no +fi + +if test $AUX_IMG != "yes"; then + IGNORE_MAN_GROUP=n + AUX_IMG=no +else + IGNORE_MAN_GROUP=y +fi +{ $as_echo "$as_me:$LINENO: result: $AUX_IMG" >&5 +$as_echo "$AUX_IMG" >&6; } + + +# Compress manual pages? +{ $as_echo "$as_me:$LINENO: checking whether manual pages should be compressed" >&5 +$as_echo_n "checking whether manual pages should be compressed... " >&6; } +# Check whether --enable-compress-manpg was given. +if test "${enable_compress_manpg+set}" = set; then + enableval=$enable_compress_manpg; AUX_MPG=$enableval +else + AUX_MPG=no +fi + +if test $AUX_MPG != "yes"; then + COMPRESS_MANPG=n + AUX_MPG=no +else + COMPRESS_MANPG=y +fi +{ $as_echo "$as_me:$LINENO: result: $AUX_MPG" >&5 +$as_echo "$AUX_MPG" >&6; } + + +# Check whether isag should be installed +{ $as_echo "$as_me:$LINENO: checking whether isag script should be installed" >&5 +$as_echo_n "checking whether isag script should be installed... " >&6; } +# Check whether --enable-install-isag was given. +if test "${enable_install_isag+set}" = set; then + enableval=$enable_install_isag; AUX_IIS=$enableval +else + AUX_IIS=no +fi + +if test $AUX_IIS != "yes"; then + INSTALL_ISAG=n + AUX_IIS=no +else + INSTALL_ISAG=y +fi +{ $as_echo "$as_me:$LINENO: result: $AUX_IIS" >&5 +$as_echo "$AUX_IIS" >&6; } + + +# Check whether sa directory should be cleaned +{ $as_echo "$as_me:$LINENO: checking whether system activity directory should be cleaned" >&5 +$as_echo_n "checking whether system activity directory should be cleaned... " >&6; } +# Check whether --enable-clean-sa-dir was given. +if test "${enable_clean_sa_dir+set}" = set; then + enableval=$enable_clean_sa_dir; AUX_CSD=$enableval +else + AUX_CSD=no +fi + +if test $AUX_CSD != "yes"; then + CLEAN_SA_DIR=n + AUX_CSD=no +else + CLEAN_SA_DIR=y +fi +{ $as_echo "$as_me:$LINENO: result: $AUX_CSD" >&5 +$as_echo "$AUX_CSD" >&6; } + + +# Crontab +{ $as_echo "$as_me:$LINENO: checking whether cron should start sar automatically" >&5 +$as_echo_n "checking whether cron should start sar automatically... " >&6; } +# Check whether --enable-install-cron was given. +if test "${enable_install_cron+set}" = set; then + enableval=$enable_install_cron; INSTALL_CRON=$enableval +else + INSTALL_CRON=n +fi + +if test $INSTALL_CRON != "yes"; then + INSTALL_CRON=n + AUX_CRON=no +else + INSTALL_CRON=y + AUX_CRON=yes +fi +{ $as_echo "$as_me:$LINENO: result: $AUX_CRON" >&5 +$as_echo "$AUX_CRON" >&6; } + + +CUSR="root" +if test $INSTALL_CRON = "y"; then + { $as_echo "$as_me:$LINENO: checking crontab owner" >&5 +$as_echo_n "checking crontab owner... " >&6; } + + if test x$cron_owner = x""; then + CRON_OWNER=$CUSR + { $as_echo "$as_me:$LINENO: result: $CRON_OWNER" >&5 +$as_echo "$CRON_OWNER" >&6; } + else + if !(`grep ^$cron_owner: /etc/passwd >/dev/null 2>&1`); then + CRON_OWNER=$CUSR; + { $as_echo "$as_me:$LINENO: result: $CRON_OWNER" >&5 +$as_echo "$CRON_OWNER" >&6; } + echo "WARNING: User ${cron_owner} not found: Using ${CUSR} instead." + else + CRON_OWNER=$cron_owner + { $as_echo "$as_me:$LINENO: result: $CRON_OWNER" >&5 +$as_echo "$CRON_OWNER" >&6; } + fi + fi + echo "INFO: Crontab for ${CRON_OWNER} will be saved in current directory if necessary" + if test $CRON_OWNER = "root"; then + SU_C_OWNER="" + QUOTE="" + REM_CHOWN="# REM_CHOWN" + else + SU_C_OWNER="su $CRON_OWNER -c " + QUOTE=\" + # " (ignore this line) + REM_CHOWN=$CHOWN + fi + + { $as_echo "$as_me:$LINENO: checking crontab interval" >&5 +$as_echo_n "checking crontab interval... " >&6; } + + if test x$cron_interval = x""; then + CRON_INTERVAL=10 + else + CRON_INTERVAL=$cron_interval + fi + { $as_echo "$as_me:$LINENO: result: $CRON_INTERVAL" >&5 +$as_echo "$CRON_INTERVAL" >&6; } + CRON_INTERVAL_SEC=`expr ${CRON_INTERVAL} \* 60` + CRON_COUNT=`expr 60 / ${CRON_INTERVAL}` +else + CRON_OWNER="root" + SU_C_OWNER="" + QUOTE="" + REM_CHOWN="# REM_CHOWN" + CRON_INTERVAL=10 + CRON_INTERVAL_SEC=600 + CRON_COUNT=6 +fi + + + + + + + + +# Check whether documentation should be installed +{ $as_echo "$as_me:$LINENO: checking whether documentation should be installed" >&5 +$as_echo_n "checking whether documentation should be installed... " >&6; } +# Check whether --enable-documentation was given. +if test "${enable_documentation+set}" = set; then + enableval=$enable_documentation; AUX_DOC=$enableval +else + AUX_DOC=yes +fi + +if test $AUX_DOC != "no"; then + AUX_DOC="yes" + INSTALL_DOC="y" +else + AUX_DOC="no" + INSTALL_DOC="n" +fi +{ $as_echo "$as_me:$LINENO: result: $AUX_DOC" >&5 +$as_echo "$AUX_DOC" >&6; } + + +# Set directory for installing manual pages (see comment in Makefile) +if test $mandir != "\${datarootdir}/man"; then + AuxMandir=$mandir +else + AuxMandir=$AuxPrefix/man +fi + + +# Check whether --debuginfo options should be allowed +# Check whether --enable-debuginfo was given. +if test "${enable_debuginfo+set}" = set; then + enableval=$enable_debuginfo; WITH_DEBUG=yes ; DFLAGS="$DFLAGS -DDEBUG" +else + WITH_DEBUG=no +fi + + + + +# Create files +echo . +echo Now create files: +echo . +ac_config_files="$ac_config_files sa1" + # Permissions must be changed +ac_config_files="$ac_config_files sa2" + # Permissions must be changed +ac_config_files="$ac_config_files crontab:crontab.sample" + # File must be renamed +ac_config_files="$ac_config_files sysstat.sysconfig" + +ac_config_files="$ac_config_files version.h:version.in" + # File must be renamed +ac_config_files="$ac_config_files sysconfig.h:sysconfig.in" + # File must be renamed +ac_config_files="$ac_config_files sysstat.cron.daily" + +ac_config_files="$ac_config_files sysstat.cron.hourly" + +ac_config_files="$ac_config_files sysstat.crond" + +ac_config_files="$ac_config_files sysstat.crond.sample.in:sysstat.crond.in" + +ac_config_files="$ac_config_files sysstat" + # Permissions must be changed +ac_config_files="$ac_config_files man/sa1.8:man/sa1.in" + # File must be renamed +ac_config_files="$ac_config_files man/sa2.8:man/sa2.in" + # File must be renamed +ac_config_files="$ac_config_files man/sadc.8:man/sadc.in" + # File must be renamed +ac_config_files="$ac_config_files man/sadf.1:man/sadf.in" + # File must be renamed +ac_config_files="$ac_config_files man/sar.1:man/sar.in" + # File must be renamed +ac_config_files="$ac_config_files man/iostat.1:man/iostat.in" + # File must be renamed +ac_config_files="$ac_config_files contrib/isag/isag" + # Permissions must be changed + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by sysstat $as_me 9.1.5, which was +generated by GNU Autoconf 2.63. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTION]... [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_version="\\ +sysstat config.status 9.1.5 +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { $as_echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "sa1") CONFIG_FILES="$CONFIG_FILES sa1" ;; + "sa2") CONFIG_FILES="$CONFIG_FILES sa2" ;; + "crontab") CONFIG_FILES="$CONFIG_FILES crontab:crontab.sample" ;; + "sysstat.sysconfig") CONFIG_FILES="$CONFIG_FILES sysstat.sysconfig" ;; + "version.h") CONFIG_FILES="$CONFIG_FILES version.h:version.in" ;; + "sysconfig.h") CONFIG_FILES="$CONFIG_FILES sysconfig.h:sysconfig.in" ;; + "sysstat.cron.daily") CONFIG_FILES="$CONFIG_FILES sysstat.cron.daily" ;; + "sysstat.cron.hourly") CONFIG_FILES="$CONFIG_FILES sysstat.cron.hourly" ;; + "sysstat.crond") CONFIG_FILES="$CONFIG_FILES sysstat.crond" ;; + "sysstat.crond.sample.in") CONFIG_FILES="$CONFIG_FILES sysstat.crond.sample.in:sysstat.crond.in" ;; + "sysstat") CONFIG_FILES="$CONFIG_FILES sysstat" ;; + "man/sa1.8") CONFIG_FILES="$CONFIG_FILES man/sa1.8:man/sa1.in" ;; + "man/sa2.8") CONFIG_FILES="$CONFIG_FILES man/sa2.8:man/sa2.in" ;; + "man/sadc.8") CONFIG_FILES="$CONFIG_FILES man/sadc.8:man/sadc.in" ;; + "man/sadf.1") CONFIG_FILES="$CONFIG_FILES man/sadf.1:man/sadf.in" ;; + "man/sar.1") CONFIG_FILES="$CONFIG_FILES man/sar.1:man/sar.in" ;; + "man/iostat.1") CONFIG_FILES="$CONFIG_FILES man/iostat.1:man/iostat.in" ;; + "contrib/isag/isag") CONFIG_FILES="$CONFIG_FILES contrib/isag/isag" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + $as_echo "$as_me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + + + + esac + + + case $ac_file$ac_mode in + "sa1":F) chmod +x sa1 ;; + "sa2":F) chmod +x sa2 ;; + "sysstat.crond.sample.in":F) sed s/^/#/ sysstat.crond.sample.in > sysstat.crond.sample ;; + "sysstat":F) chmod +x sysstat ;; + "contrib/isag/isag":F) chmod +x contrib/isag/isag ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +echo " + Sysstat version: $PACKAGE_VERSION + Installation prefix: $prefix + rc directory: ${RC_DIR} + Init directory: ${INIT_DIR} + Configuration directory: ${SYSCONFIG_DIR} + Man pages directory: $AuxMandir + Compiler: $CC + Compiler flags: $CFLAGS +" + diff --git a/configure.in b/configure.in new file mode 100644 index 00000000..4bf3a913 --- /dev/null +++ b/configure.in @@ -0,0 +1,528 @@ +# configure.in +# +# (C) 2007 - Ivana Varekova +# Modified by Sebastien Godard (sysstat orange.fr) + +# Initialization of $PACKAGE_VERSION and $PACKAGE_NAME variables +AC_INIT(sysstat, 9.1.5) + +# Ensure that a recent enough version of Autoconf is being used +AC_PREREQ(2.53) + +# Check whether the configure script is in the right dir +AC_CONFIG_SRCDIR(ioconf.h) + +# Check programs +echo . +echo Check programs: +echo . + +AC_PROG_CC +AC_GNU_SOURCE +AC_PROG_LN_S + +AC_CHECK_PROG(CHMOD, chmod, chmod) +AC_CHECK_PROG(CHOWN, chown, chown) +AC_CHECK_PROG(AR, ar, ar) +AC_CHECK_PROG(INSTALL, install, install) +AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt) +AC_CHECK_PROG(XGETTEXT, xgettext, xgettext) +AC_CHECK_PROG(MSGMERGE, msgmerge, msgmerge) +AC_CHECK_PROGS(ZIP, bzip2 gzip, gzip, /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin) +INSTALL_DATA="\${INSTALL} -m 644" +AC_SUBST(INSTALL_DATA) +INSTALL_BIN="\${INSTALL} -m 755" +AC_SUBST(INSTALL_BIN) + +AC_PATH_PROGS(PATH_CP, cp, cp, /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin) +AC_PATH_PROGS(PATH_CHKCONFIG, chkconfig, chkconfig, /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin) + +# Check libraries + +# Check header files +echo . +echo Check header files: +echo . +HAVE_LIBINTL_H= +HAVE_LOCALE_H= +AC_HEADER_STDC +AC_HEADER_DIRENT +AC_CHECK_HEADERS(ctype.h) +AC_CHECK_HEADERS(errno.h) +AC_CHECK_HEADERS(libintl.h, HAVE_LIBINTL_H=1) +AC_CHECK_HEADERS(locale.h, HAVE_LOCALE_H=1) +AC_CHECK_HEADERS(net/if.h) +AC_CHECK_HEADERS(regex.h) +AC_CHECK_HEADERS(signal.h) +AC_CHECK_HEADERS(stdio.h) +AC_CHECK_HEADERS(sys/file.h) +AC_CHECK_HEADERS(sys/ioctl.h) +AC_CHECK_HEADERS(sys/stat.h) + +echo . +echo Check typedefs, structures and compiler characteristics: +echo . +AC_TYPE_SIGNAL +AC_TYPE_SIZE_T +AC_TYPE_OFF_T + +echo . +echo Check library functions: +echo . +AC_CHECK_FUNCS(strchr) +AC_CHECK_FUNCS(strcspn) +AC_CHECK_FUNCS(strspn) +AC_CHECK_FUNCS(strstr) + +# Should we check for lm_sensors? +AC_MSG_CHECKING(for sensors support) +AC_ARG_ENABLE(sensors, + AC_HELP_STRING([--disable-sensors], + [disable sensors support]), + SENSORS=$enableval,SENSORS=yes) +if test $SENSORS != "yes"; then + CFSENSORS="" + DFSENSORS="" +else + CFSENSORS="-lsensors" + DFSENSORS="-DHAVE_SENSORS" +fi +AC_MSG_RESULT($SENSORS) + +# Check for lm_sensors +HAVE_SENSORS=no +DFLAGS="" +AC_CHECK_LIB(sensors, sensors_get_detected_chips, CFLAGS="${CFLAGS} ${CFSENSORS}") +AC_MSG_CHECKING(for sensors lib) +AC_TRY_COMPILE(#include +#include + , sensors_cleanup();,HAVE_SENSORS=yes; DFLAGS="${DFLAGS} ${DFSENSORS}", HAVE_SENSORS=no) +AC_MSG_RESULT($HAVE_SENSORS) +AC_SUBST(HAVE_SENSORS) + +echo . +echo Check system services: +echo . +AC_SYS_LARGEFILE + +echo . +echo Check configuration: +echo . +# Check arguments used +# +# Optional Features: +# --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +# --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +# --disable-largefile omit support for large files +# --disable-nls disable National Language Support +# --enable-yesterday tell sa2 to use "yesterday" data files +# --disable-man-group ignore man_group variable value +# --enable-install-cron tell sysstat to install cron scripts +# --enable-clean-sa-dir clean system activity directory +# --enable-compress-manpg compress manual pages +# --enable-install-isag install isag script +# --enable-debuginfo enable debug output (--debuginfo option) +# --disable-documentation do not install documentation (man pages...) +# --disable-sensors do not link against libsensors even if available +# +# Some influential environment variables: +# rcdir directory where startup scripts are installed +# sa_lib_dir sadc, sa1 and sa2 directory +# sa_dir system activity daily datafiles directory +# conf_dir sysstat configuration directory (default is /etc/sysconfig) +# history number of daily datafiles to keep (default value is 7) +# compressafter number of days after which datafiles are compressed +# man_group group for man pages +# cron_owner crontab owner +# cron_interval crontab sampling interval +# +# Fine tuning the installation directories: +# --mandir=DIR man documentation directory [PREFIX/man] +# --docdir=DIR other documentation directory [PREFIX/share/doc] +# +# Installation directories: +# --prefix=PREFIX install architecture-independent files in PREFIX +# [/usr/local] +# --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX +# [PREFIX] + +# Set directories +if test -d /etc/init.d && test ! -L /etc/init.d; then + if test -d /etc/init.d/rc2.d; then + RC_DIR=/etc/init.d + INITD_DIR=. + else + RC_DIR=/etc + INITD_DIR=init.d + fi + INIT_DIR=/etc/init.d +elif test -d /sbin/init.d; then + RC_DIR=/sbin/init.d + INIT_DIR=/sbin/init.d + INITD_DIR=. +else + RC_DIR=/etc/rc.d + INIT_DIR=/etc/rc.d/init.d + INITD_DIR=init.d +fi + +AC_MSG_CHECKING(run-commands directory) +AC_ARG_VAR([rcdir],[run-commands directory]) +if test x$rcdir != x""; then + # Override previous rc directories values + RC_DIR=$rcdir + INIT_DIR=$rcdir/init.d + INITD_DIR=init.d +fi +AC_MSG_RESULT($RC_DIR) +if test ! -d $RC_DIR; then + echo "INFO: Directory ${RC_DIR} doesn't exist." + echo "INFO: Startup scripts won't be installed." +fi + +AC_SUBST(RC_DIR) +AC_SUBST(INIT_DIR) +AC_SUBST(INITD_DIR) + +# Set sadc directory +if test $prefix != "NONE"; then + AuxPrefix=$prefix +else + AuxPrefix=/usr/local +fi + +if test -d $AuxPrefix/lib; then + SADC_DIR=$AuxPrefix/lib +elif test -d $AuxPrefix/lib64; then + SADC_DIR=$AuxPrefix/lib64 +else + SADC_DIR=$AuxPrefix/lib +fi + +AC_MSG_CHECKING(sadc directory) +AC_ARG_VAR([sa_lib_dir],[sadc directory]) +if test x$sa_lib_dir != x""; then + SA_LIB_DIR=$sa_lib_dir +else + SA_LIB_DIR=$SADC_DIR/sa +fi +AC_MSG_RESULT($SA_LIB_DIR) +if test ! -d $SA_LIB_DIR; then + echo "INFO: Directory ${SA_LIB_DIR} will be created during installation stage." +fi +AC_SUBST(SA_LIB_DIR) + +# Set system activity directory +AC_MSG_CHECKING(system activity directory) +AC_ARG_VAR([sa_dir],[system activity directory]) +if test x$sa_dir != x""; then + SA_DIR=$sa_dir +else + SA_DIR=/var/log/sa +fi +AC_MSG_RESULT($SA_DIR) +if test ! -d $SA_DIR; then + echo "INFO: Directory ${SA_DIR} will be created during installation stage." +fi +AC_SUBST(SA_DIR) + +# Set configuration directory +AC_MSG_CHECKING(sysstat configuration directory) +AC_ARG_VAR([conf_dir],[sysstat configuration directory]) +if test x$conf_dir != x""; then + SYSCONFIG_DIR=$conf_dir +else + SYSCONFIG_DIR=/etc/sysconfig +fi +AC_MSG_RESULT($SYSCONFIG_DIR) +if test ! -d $SYSCONFIG_DIR; then + echo "INFO: Directory ${SYSCONFIG_DIR} will be created during installation stage." +fi +AC_SUBST(SYSCONFIG_DIR) + +# National Language Support +AC_MSG_CHECKING(National Language Support) +AC_ARG_ENABLE(nls, + AC_HELP_STRING([--disable-nls], + [disable National Language Support]), + AUX_NLS=$enableval,AUX_NLS=yes) +if test $AUX_NLS != "no" && test $HAVE_LIBINTL_H && test $HAVE_LOCALE_H; then + AUX_NLS="yes" + NLS="y" +else + AUX_NLS="no" + NLS="n" +fi +AC_MSG_RESULT($AUX_NLS) +AC_SUBST(NLS) +if test $AUX_NLS = "yes" && test x$MSGFMT != x"msgfmt"; then + echo "WARNING: msgfmt command not found!" +fi +if test $AUX_NLS = "yes" && test x$XGETTEXT != x"xgettext"; then + echo "WARNING: xgettext command not found!" +fi +if test $AUX_NLS = "yes" && test x$MSGMERGE != x"msgmerge"; then + echo "WARNING: msgmerge command not found!" +fi + +# Check whether sa2 should process data file of the day before +AC_MSG_CHECKING(whether sa2 should process data file of the day before) +AC_ARG_ENABLE(yesterday, + AC_HELP_STRING([--enable-yesterday], + [tell sa2 to use data file of the day before]), + AUX_YESTERDAY=$enableval,AUX_YESTERDAY=no) +if test $AUX_YESTERDAY = "yes"; then + YESTERDAY="--date=yesterday" + AC_MSG_RESULT(yes) +else + YESTERDAY="" + AC_MSG_RESULT(no) +fi +AC_SUBST(YESTERDAY) + +# Data history to keep by sa2 +AC_MSG_CHECKING(number of daily data files to keep) +AC_ARG_VAR([history],[number of daily data files to keep (default value is 7)]) +if test x$history = x""; then + HISTORY=7 +else + HISTORY=$history +fi +AC_MSG_RESULT($HISTORY) +AC_SUBST(HISTORY) + +# Number of days after which datafiles are compressed +AC_MSG_CHECKING(number of days after which data files are compressed) +AC_ARG_VAR([compressafter],[number of days after which data files are compressed (default value is 10)]) +if test x$compressafter = x""; then + COMPRESSAFTER=10 +else + COMPRESSAFTER=$compressafter +fi +AC_MSG_RESULT($COMPRESSAFTER) +AC_SUBST(COMPRESSAFTER) + +# Manual page group +if `grep ^man: /etc/group >/dev/null 2>&1`; then + GRP=man +else + GRP=root +fi + +AC_MSG_CHECKING(group for manual pages) +AC_ARG_VAR([man_group],[group for manual pages]) +if test x$man_group = x""; then + MAN_GROUP=$GRP + AC_MSG_RESULT($MAN_GROUP) +else + if !(`grep ^$man_group: /etc/group >/dev/null 2>&1`); then + MAN_GROUP=$GRP + AC_MSG_RESULT($MAN_GROUP) + echo "WARNING: Group ${man_group} not found: Using ${GRP} instead" + else + MAN_GROUP=$man_group + AC_MSG_RESULT($MAN_GROUP) + fi +fi +AC_SUBST(MAN_GROUP) + +# Ignore manual pages group? +AC_MSG_CHECKING(whether man_group variable should be ignored) +AC_ARG_ENABLE(man-group, + AC_HELP_STRING([--disable-man-group], + [ignore man_group variable value]), + AUX_IMG=$enableval,AUX_IMG=no) +if test $AUX_IMG != "yes"; then + IGNORE_MAN_GROUP=n + AUX_IMG=no +else + IGNORE_MAN_GROUP=y +fi +AC_MSG_RESULT($AUX_IMG) +AC_SUBST(IGNORE_MAN_GROUP) + +# Compress manual pages? +AC_MSG_CHECKING(whether manual pages should be compressed) +AC_ARG_ENABLE(compress-manpg, + AC_HELP_STRING([--enable-compress-manpg], + [compress sysstat manual pages]), + AUX_MPG=$enableval,AUX_MPG=no) +if test $AUX_MPG != "yes"; then + COMPRESS_MANPG=n + AUX_MPG=no +else + COMPRESS_MANPG=y +fi +AC_MSG_RESULT($AUX_MPG) +AC_SUBST(COMPRESS_MANPG) + +# Check whether isag should be installed +AC_MSG_CHECKING(whether isag script should be installed) +AC_ARG_ENABLE(install-isag, + AC_HELP_STRING([--enable-install-isag], + [install isag script]), + AUX_IIS=$enableval,AUX_IIS=no) +if test $AUX_IIS != "yes"; then + INSTALL_ISAG=n + AUX_IIS=no +else + INSTALL_ISAG=y +fi +AC_MSG_RESULT($AUX_IIS) +AC_SUBST(INSTALL_ISAG) + +# Check whether sa directory should be cleaned +AC_MSG_CHECKING(whether system activity directory should be cleaned) +AC_ARG_ENABLE(clean-sa-dir, + AC_HELP_STRING([--enable-clean-sa-dir], + [clean system activity directory]), + AUX_CSD=$enableval,AUX_CSD=no) +if test $AUX_CSD != "yes"; then + CLEAN_SA_DIR=n + AUX_CSD=no +else + CLEAN_SA_DIR=y +fi +AC_MSG_RESULT($AUX_CSD) +AC_SUBST(CLEAN_SA_DIR) + +# Crontab +AC_MSG_CHECKING(whether cron should start sar automatically) +AC_ARG_ENABLE(install-cron, + AC_HELP_STRING([--enable-install-cron], + [install a crontab to start sar]), + INSTALL_CRON=$enableval,INSTALL_CRON=n) +if test $INSTALL_CRON != "yes"; then + INSTALL_CRON=n + AUX_CRON=no +else + INSTALL_CRON=y + AUX_CRON=yes +fi +AC_MSG_RESULT($AUX_CRON) +AC_SUBST(INSTALL_CRON) + +CUSR="root" +if test $INSTALL_CRON = "y"; then + AC_MSG_CHECKING(crontab owner) + AC_ARG_VAR([cron_owner],[crontab owner]) + if test x$cron_owner = x""; then + CRON_OWNER=$CUSR + AC_MSG_RESULT($CRON_OWNER) + else + if !(`grep ^$cron_owner: /etc/passwd >/dev/null 2>&1`); then + CRON_OWNER=$CUSR; + AC_MSG_RESULT($CRON_OWNER) + echo "WARNING: User ${cron_owner} not found: Using ${CUSR} instead." + else + CRON_OWNER=$cron_owner + AC_MSG_RESULT($CRON_OWNER) + fi + fi + echo "INFO: Crontab for ${CRON_OWNER} will be saved in current directory if necessary" + if test $CRON_OWNER = "root"; then + SU_C_OWNER="" + QUOTE="" + REM_CHOWN="# REM_CHOWN" + else + SU_C_OWNER="su $CRON_OWNER -c " + QUOTE=\" + # " (ignore this line) + REM_CHOWN=$CHOWN + fi + + AC_MSG_CHECKING(crontab interval) + AC_ARG_VAR([cron_interval],[crontab interval]) + if test x$cron_interval = x""; then + CRON_INTERVAL=10 + else + CRON_INTERVAL=$cron_interval + fi + AC_MSG_RESULT($CRON_INTERVAL) + CRON_INTERVAL_SEC=`expr ${CRON_INTERVAL} \* 60` + CRON_COUNT=`expr 60 / ${CRON_INTERVAL}` +else + CRON_OWNER="root" + SU_C_OWNER="" + QUOTE="" + REM_CHOWN="# REM_CHOWN" + CRON_INTERVAL=10 + CRON_INTERVAL_SEC=600 + CRON_COUNT=6 +fi +AC_SUBST(CRON_OWNER) +AC_SUBST(SU_C_OWNER) +AC_SUBST(CRON_INTERVAL) +AC_SUBST(CRON_INTERVAL_SEC) +AC_SUBST(CRON_COUNT) +AC_SUBST(QUOTE) +AC_SUBST(REM_CHOWN) + +# Check whether documentation should be installed +AC_MSG_CHECKING(whether documentation should be installed) +AC_ARG_ENABLE(documentation, + AC_HELP_STRING([--disable-documentation], + [do not install documentation]), + AUX_DOC=$enableval,AUX_DOC=yes) +if test $AUX_DOC != "no"; then + AUX_DOC="yes" + INSTALL_DOC="y" +else + AUX_DOC="no" + INSTALL_DOC="n" +fi +AC_MSG_RESULT($AUX_DOC) +AC_SUBST(INSTALL_DOC) + +# Set directory for installing manual pages (see comment in Makefile) +if test $mandir != "\${datarootdir}/man"; then + AuxMandir=$mandir +else + AuxMandir=$AuxPrefix/man +fi +AC_SUBST(AuxMandir) + +# Check whether --debuginfo options should be allowed +AC_ARG_ENABLE(debuginfo, + AC_HELP_STRING([--enable-debuginfo], + [enable debug output (--debuginfo option)]), + WITH_DEBUG=yes ; DFLAGS="$DFLAGS -DDEBUG" , WITH_DEBUG=no) +AC_SUBST(WITH_DEBUG) +AC_SUBST(DFLAGS) + +# Create files +echo . +echo Now create files: +echo . +AC_CONFIG_FILES([sa1], [chmod +x sa1]) # Permissions must be changed +AC_CONFIG_FILES([sa2], [chmod +x sa2]) # Permissions must be changed +AC_CONFIG_FILES([crontab:crontab.sample]) # File must be renamed +AC_CONFIG_FILES([sysstat.sysconfig]) +AC_CONFIG_FILES([version.h:version.in]) # File must be renamed +AC_CONFIG_FILES([sysconfig.h:sysconfig.in]) # File must be renamed +AC_CONFIG_FILES([sysstat.cron.daily]) +AC_CONFIG_FILES([sysstat.cron.hourly]) +AC_CONFIG_FILES([sysstat.crond]) +AC_CONFIG_FILES([sysstat.crond.sample.in:sysstat.crond.in], [sed s/^/#/ sysstat.crond.sample.in > sysstat.crond.sample]) +AC_CONFIG_FILES([sysstat], [chmod +x sysstat]) # Permissions must be changed +AC_CONFIG_FILES([man/sa1.8:man/sa1.in]) # File must be renamed +AC_CONFIG_FILES([man/sa2.8:man/sa2.in]) # File must be renamed +AC_CONFIG_FILES([man/sadc.8:man/sadc.in]) # File must be renamed +AC_CONFIG_FILES([man/sadf.1:man/sadf.in]) # File must be renamed +AC_CONFIG_FILES([man/sar.1:man/sar.in]) # File must be renamed +AC_CONFIG_FILES([man/iostat.1:man/iostat.in]) # File must be renamed +AC_CONFIG_FILES([contrib/isag/isag], [chmod +x contrib/isag/isag]) # Permissions must be changed + +AC_OUTPUT(Makefile) + +echo " + Sysstat version: $PACKAGE_VERSION + Installation prefix: $prefix + rc directory: ${RC_DIR} + Init directory: ${INIT_DIR} + Configuration directory: ${SYSCONFIG_DIR} + Man pages directory: $AuxMandir + Compiler: $CC + Compiler flags: $CFLAGS +" + diff --git a/contrib/README-contrib b/contrib/README-contrib new file mode 100644 index 00000000..d8ef9aaa --- /dev/null +++ b/contrib/README-contrib @@ -0,0 +1,8 @@ +This is the directory where you can find various programs related to sysstat. +Please don't ask me any questions about them. Send your comments and/or +bug reports to their respective authors. + +Thx. +-- +Sébastien Godard (sysstat orange.fr) + diff --git a/contrib/isag/README-isag b/contrib/isag/README-isag new file mode 100644 index 00000000..ab443dae --- /dev/null +++ b/contrib/isag/README-isag @@ -0,0 +1,18 @@ +README file for the isag - Interactive System Activity Graph - command. + +isag is a command that enables you to plot data stored in a daily data file +by a previous sar run. +isag needs a recent version of Tcl/Tk installed, together with the +gnuplot plotting program. + +isag is (C) 2000,2001 by David Doubrava . +Send bug reports to . + +Note that the path to daily data files is hard coded in isag and +its value is "/var/log/sa". +Also isag assumes that sar is installed in /usr/bin directory. +Update isag script if sar is located elsewhere. + +-- +Sébastien Godard (sysstat wanadoo.fr) + diff --git a/contrib/isag/isag.1 b/contrib/isag/isag.1 new file mode 100644 index 00000000..8281a7a0 --- /dev/null +++ b/contrib/isag/isag.1 @@ -0,0 +1,201 @@ +.\" Automatically generated by Pod::Man version 1.02 +.\" Mon Mar 22 20:19:18 2004 +.\" +.\" Standard preamble: +.\" ====================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Ip \" List item +.br +.ie \\n(.$>=3 .ne \\$3 +.el .ne 3 +.IP "\\$1" \\$2 +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R + +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used +.\" to do unbreakable dashes and therefore won't be available. \*(C` and +.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> +.tr \(*W-|\(bv\*(Tr +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` ` +. ds C' ' +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" If the F register is turned on, we'll generate index entries on stderr +.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and +.\" index entries marked with X<> in POD. Of course, you'll have to process +.\" the output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +. . +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it +.\" makes way too many mistakes in technical documents. +.hy 0 +.if n .na +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +.bd B 3 +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ====================================================================== +.\" +.IX Title "ISAG 1" +.TH ISAG 1 "0.81.0" "March 2004" "System Activity Grapher" +.UC +.SH "NAME" +isag \- Interactive System Activity Grapher +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +isag [\-p datafiles_path] [\-c config_file] [\-ght gr_height] [\-gwd gr_width] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The \fIisag\fR command graphically displays the system activity data stored +in a binary data file by a previous \fIsar\fR run. The \fIisag\fR command invokes +\&\fIsar\fR to extract the data to be plotted. +.PP +The data are processed using \fIsar\fR command and slightly transformed +to tabular format, and then this format is visualized using \fIgnuplot\fR +program. +.SH "OPTIONS" +.IX Header "OPTIONS" +.Ip "\-p datafiles_path" 4 +.IX Item "-p datafiles_path" +Specify the pathname where are located the daily data files. +Default path is: \fI/var/log/sa\fR +.Ip "\-c config_file" 4 +.IX Item "-c config_file" +Specify the configuration file used by the \fIisag\fR command. +The contents of this file may depend on \fIisag\fR version number. +Default config file is: \fI$HOME/.isag.cfg\fR. +.Ip "\-ght gr_height" 4 +.IX Item "-ght gr_height" +Specify the height of the chart area. +Default value is: \fI400\fR. +.Ip "\-gwd gr_width" 4 +.IX Item "-gwd gr_width" +Specify the width of the chart area. +Default value is: \fI720\fR. +.SH "CONFIG FILE" +.IX Header "CONFIG FILE" +As mentioned above there is a config file. There are stored following values: +.Ip "last showed graph" 2 +.IX Item "last showed graph" +.Ip "y limits for each kind of graph" 2 +.IX Item "y limits for each kind of graph" +.PP +It seems usefull, because new run doesn't need new settings to obtain same scale. +.SH "PREREQUSITIES" +.IX Header "PREREQUSITIES" +Here is list of prerequsities including versioning and built-in features. +.Ip "Tcl/Tk" +.IX Item "Tcl/Tk" +Version 8.0 or newer. +.Ip "gnuplot" +.IX Item "gnuplot" +Gnuplot must have a \fBtkcanvas\fR display. +.SH "AUTHOR" +.IX Header "AUTHOR" +D. Doubrava 2000, 2002 e-mail:\ linux_monitor(at)volny(dot)cz +.PP +\&\s-1HTTP\s0 Site: http://www.volny.cz/linux_monitor/isag/index.html +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fBsar\fR (1), \fBsadc\fR (8). diff --git a/contrib/isag/isag.in b/contrib/isag/isag.in new file mode 100644 index 00000000..5627fee2 --- /dev/null +++ b/contrib/isag/isag.in @@ -0,0 +1,1550 @@ +#!/bin/sh +# the next line restarts using wish and correctly pass the arguments to this\ +exec wish "$0" -- "$@" + + +############################################################################### +# +# Copyright (c) 2000, 2001 David Doubrava (linux_monitor(at)volny(dot)cz) +# +# Primary-site: http://www.volny.cz:/linux_monitor/isag +# +# This program/module is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public License +# as published by Free Software Foundation; either version 2 of the +# License, or (at your option) any later version +# +# This program is distributed in the hope that it will be usefull, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY of FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +############################################################################### +# +# 2006/04/14 : Sebastien GODARD +# isag v1.3 +# Updated to current sysstat version (6.1.2). +# +# $Id: isag.m4,v 1.26 2004/03/22 19:39:14 david Exp $ +# $State: Exp $ +# +# $Log: isag.m4,v $ +# Revision 1.26 2004/03/22 19:39:14 david +# fully avoided shell script, i hope the temp file issue is fixed +# +# Revision 1.25 2004/03/22 19:13:18 david +# eliminated shell script, security issue +# +# Revision 1.24 2004/03/02 20:28:00 david +# replaced <> by () in mangled e-mails +# +# Revision 1.23 2004/02/24 07:40:14 david +# replaced (at) and (dot) in most e-mail addresses +# +# Revision 1.22 2003/02/26 18:19:09 david +# realized new layout of files +# +# Revision 1.21 2003/02/23 21:07:35 david +# first prototype of sag +# +# Revision 1.20 2003/01/26 20:41:48 david +# partially renamed variables, 1st implementation of "Save Graph" +# +# Revision 1.19 2002/03/04 20:23:26 david +# fixed whole day functionality +# +# Revision 1.17 2001/07/30 18:05:41 sarrep +# fix: bug2001060501; set LC_ALL to sane value; see Debian bug #101545 +# +# Revision 1.16 2001/04/22 14:19:34 sarrep +# Added GPL related text +# remove notes about solving R switch problems +# +# Revision 1.15 2001/03/17 17:30:15 sarrep +# CVSizing, unified headers of each element file +# +# Revision 1.14 2001/03/17 16:55:26 sarrep +# LINUX RESTART zeroes all counters. +# +# Revision 1.13 2001/03/11 20:15:19 sarrep +# First step after CVSizing +# +# Revision 1.12 2001/02/20 19:06:10 sarrep +# added q switch and actialize B switch to version 3.3.6 +# +# Revision 1.11 2001/02/10 10:42:03 sarrep +# finally renamed from sarrep to isag +# added additional commnts in header +# added patching +# +# Revision 1.10 2001/02/03 11:02:17 sarrep +# removed many same (for family) parts to different files. +# improved generationg of cmd array. +# +# Revision 1.9 2001/01/27 19:28:43 root +# added secondary Y axes functionality +# added -c cfg_file cmdln option +# writting of selected config data to cfg_file +# renamed chart lines to names used in sar +# parametrized creating of cmd() array +# added generic var __M4_TIMELEN__ for proc_line_generic +# +# Revision 1.8 2001/01/20 19:02:53 root +# added version check due to bug.2312200001 +# added secondary Y label +# +# Revision 1.7 2000/12/30 18:35:06 root +# split into few parts. main idea next extensibility for other platforms +# +# Revision 1.6 2000/12/30 11:30:20 root +# command line argument(s) functionality was added +# preparation for config file was done +# and few small changes +# +# Revision 1.5 2000/12/23 21:22:10 root +# fixed situation if LINUX RESTART is in data file +# fixed if no more than one line in data file. +# try to fix wrong graph size after resizing appl. window +# +# Revision 1.4 2000/12/23 20:48:31 root +# function rescale_graph was renamed to redraw_graph +# and one menu item was added. +# +# Revision 1.3 2000/12/16 13:37:12 root +# resize window related functions +# +# Revision 1.2 2000/12/11 18:54:17 root +# behavior will be parametrized +# +# Revision 1.1 2000/12/11 15:01:07 root +# Initial revision +# +# +############################################################################### + +# specific for sebastien's sar + +# +############################################################################### +# $Id: version.m4,v 1.4 2002/03/04 20:20:27 david Rel $ +# $State: Rel $ +# $Log: version.m4,v $ +# Revision 1.4 2002/03/04 20:20:27 david +# make new end line +# +# Revision 1.3 2001/03/17 17:43:07 sarrep +# About dialog modify +# +# Revision 1.2 2001/03/17 17:30:26 sarrep +# CVSizing, unified headers of each element file +# +# +############################################################################### + +set ident "/usr/bin/ident" +set version "" +# This can be set only if small interactive change in result code was occured +set patchlevel "" +if {[catch {set fp [open "| $ident $argv0" "r"]}] == 0} { + set n 0 + while {[gets $fp line] != -1} { + if {$n != 0 && -1 != [string first "Id:" $line]} { + set version "$version\n[string trim $line]" + } else { + set n 1 + } + } +} else { + set version "Unknown! $ident is missing" +} +if {"" != $patchlevel} { + set version "$version\nPatch level: $patchlevel" +} +# $Source: /var/CVSROOT/cvs/i-sag/common/version.m4,v $ +############################################################################## +# Tcl/Tk: version check +# +# $Id: ver_check.m4,v 1.6 2003/03/03 20:11:16 david Exp $ +# $State: Exp $ +# $Log: ver_check.m4,v $ +# Revision 1.6 2003/03/03 20:11:16 david +# fixed tools name +# +# Revision 1.5 2002/03/24 15:18:26 david +# added +# +# Revision 1.4 2002/03/04 20:20:27 david +# make new end line +# +# Revision 1.3 2001/03/17 17:30:25 sarrep +# CVSizing, unified headers of each element file +# +# +# +############################################################################### +set needed_version 8.0 +if {$tcl_version < $needed_version} { + out_msg "Warning Version check" "sag needs $needed_version, but this is version $tcl_version of Tcl.\nSome features can fail" +# exit +} + +# $Source: /var/CVSROOT/cvs/i-sag/common/ver_check.m4,v $ +############################################################################### +# default paths, programs and other variables +# +# $Id: variables.m4,v 1.5 2003/01/26 20:41:49 david Rel $ +# $State: Rel $ +# $Log: variables.m4,v $ +# Revision 1.5 2003/01/26 20:41:49 david +# partially renamed variables, 1st implementation of "Save Graph" +# +# Revision 1.4 2002/03/04 20:20:27 david +# make new end line +# +# Revision 1.3 2001/03/17 17:30:24 sarrep +# CVSizing, unified headers of each element file +# +# +# +############################################################################### + +set gnuplot "/usr/bin/gnuplot" +set grep "/bin/grep" +set sh "/bin/sh" +set gunzip "/usr/bin/gunzip" +set sed "/bin/sed" + +# default placement of config file +set isag_cfg_file "$env(HOME)/.isag.cfg" +set sag_graph_wd 720 +set sag_graph_ht 400 + +# $Source: /var/CVSROOT/cvs/i-sag/common/variables.m4,v $ + +############################################################################### +# Message box functionality +# +# $Id: msg_box.m4,v 1.6 2002/03/24 15:18:26 david Exp $ +# $State: Exp $ +# $Log: msg_box.m4,v $ +# Revision 1.6 2002/03/24 15:18:26 david +# added +# +# Revision 1.5 2002/03/04 20:21:08 david +# make new end line +# +# Revision 1.4 2001/06/03 19:58:04 sarrep +# improved behaviour, added grab capability +# removed (softly) Cancel button +# +# Revision 1.3 2001/03/17 17:30:22 sarrep +# CVSizing, unified headers of each element file +# +# +# +############################################################################### + +proc msg_box_btn {w} { + destroy $w +} + +proc err_msg {title text} { + tk_messageBox -icon error -type ok -message $text -title $title +} + +proc out_msg {title text} { + toplevel .msg_box + + wm title .msg_box $title + label .msg_box.l -text $text -justify left + pack .msg_box.l -side top + frame .msg_box.b + pack .msg_box.b -side top + + button .msg_box.b.ok -text OK -command {msg_box_btn .msg_box} + pack .msg_box.b.ok -side left + +# button .msg_box.b.cancel -text cancel -command {msg_box_btn .msg_box} +# pack .msg_box.b.cancel -side left + + grab .msg_box + tkwait window .msg_box +} + +# $Source: /var/CVSROOT/cvs/i-sag/isag/msg_box.m4,v $ + +# specific paths and programs +set sar_data_path "@SA_DIR@" +set sar_data_mask "sa\[0-9\]\[0-9\]" +set prefix "@prefix@" +set exec_prefix "@exec_prefix@" +set sar "@bindir@/sar" + +# following check added: Thu Mar 18 21:44:52 GMT+1 2004 +if { 1 != [file executable $sar]} { + err_msg "Error" "File: $sar does not exist" + exit +} + +#fix: bug2001060501; set LC_ALL to sane value; see Debian bug #101545 +set env(LC_ALL) "C" + + +############################################################################### +# $Id: isag_common_options.m4,v 1.6 2003/01/26 20:41:48 david Rel $ +# $State: Rel $ +# $Log: isag_common_options.m4,v $ +# Revision 1.6 2003/01/26 20:41:48 david +# partially renamed variables, 1st implementation of "Save Graph" +# +# Revision 1.5 2002/03/24 15:18:26 david +# added +# +# Revision 1.4 2002/03/04 20:21:51 david +# make new end line +# +# Revision 1.3 2001/03/17 17:30:20 sarrep +# CVSizing, unified headers of each element file +# +# +# +############################################################################### +proc Usage {} { + global sar_data_path sar_data_mask isag_cfg_file sag_graph_wd sag_graph_ht + + out_msg "Usage" \ +"isag \[options\] + +Options: +\t-p data_path (default: $sar_data_path) +\t-m data_file_mask (default: $sar_data_mask) +\t-c cfg_file (default: $isag_cfg_file) +\t-gwd graph_width (default: $sag_graph_wd) +\t-ght graph_height (default: $sag_graph_ht) " + exit +} + +proc getopt {argv opt} { + set rv "" + if {-1 != [set t [lsearch -exact $argv "-$opt"]]} { + set rv [lindex $argv [expr $t + 1]] + } + return $rv +} + +if {-1 != [set t [lsearch -exact $argv "-h"]]} { + Usage +} +if {-1 != [set t [lsearch -exact $argv "-?"]]} { + Usage +} +if {[set t [getopt $argv c]] != ""} { + # check for path + if {1 == ([file exist $t] && [file isfile $t])} { + set isag_cfg_file $t + } else { + out_msg "Error" "<$t> is not regular file, using default <$isag_cfg_file>" + } +} +if {[set t [getopt $argv p]] != ""} { + # check for path + if {1 == ([file exist $t] && [file isdirectory $t])} { + set sar_data_path $t + } else { + out_msg "Error" "<$t> is not directory, using default <$sar_data_path>" + } +} +if {[set t [getopt $argv m]] != ""} { + set sar_data_mask $t +} +if {[set t [getopt $argv ght]] != ""} { + if {1 == [string is digit $t]} { + set sag_graph_ht $t + } else { + out_msg "Error" "<$t> is not decimal number, using default <$sag_graph_ht>" + } +} +if {[set t [getopt $argv gwd]] != ""} { + if {1 == [string is digit $t]} { + set sag_graph_wd $t + } else { + out_msg "Error" "<$t> is not decimal number, using default <$sag_graph_wd>" + } +} + +unset t +# $Source: /var/CVSROOT/cvs/i-sag/isag/isag_common_options.m4,v $ + +############################################################################### +# +# Variables connected to graphs and their default values +# +# selected archive file for sa data, typically saNN +# this variable is set thru: data Chooser (see: Concept Guide) +set sag_if_archive "" + +# full path to archive file for sa data: either $sar_data_path/sa?? or +# $fgnr_tmpdir/sa_data (if the former file was compressed) +set sag_if_archive_uncompressed "" + +# last_graph contains last drawing function as letter +set last_graph "" + + +# path to the newest sa data file. Set by fill_file_menu, used by the main +# procedure to autoload the file on program's startup +set sag_latest_file "" + +# SGo 2008-07-06: Update options (options -S added). +# SGo 2008-06-15: Update options (options -c and -w have been merged). +# sar switches as names for object-instances (final and curent) +set prog_swtch [list b B q r R S u v w W] + +# maximal and current values for each graph indexed by sar switch i.e. for cpu +# is index u not -u + +foreach l $prog_swtch { + set val_max($l) 0 + set val_cur($l) 0 + set has_negative($l) 0 +} +unset l +# exceptions +set val_max(u) 100 +set has_negative(R) 1 + +set val_max(W) 1 +set val_cur(W) 1 + +# graph/view names this is shoved in menu-view and as name of the graph +# and other functional parameters +# xlabel - label for x-axis +# ylabel - label for y-axis +# y2label - label for secondary y-axis +# plotstr - string plot for gnuplot, describes a graph +# +# SGo 2008-07-06: Add menu option, ylabel and y2label for option -S. +# SGo 2008-06-15: Update menu functions and ylabel names +# view_n(ame) array +set view_n(b) "I/O Transfer Rate" +set view_n(B) "Paging Statistics" +set view_n(q) "Run Queue" +set view_n(r) "Memory Utilization" +set view_n(R) "Memory Statistics" +set view_n(S) "Swap Utilization" +set view_n(u) "CPU Utilization" +set view_n(v) "Inode Status" +set view_n(w) "Process Creation and Context Switches" +set view_n(W) "System Swapping" + +# xlabel is not an array - all values are same +set xlabel "Time" + +# ylabel array +set ylabel(b) "ops/s" +set ylabel(B) "pages/s" +set ylabel(q) "" +set ylabel(r) "kB" +set ylabel(R) "ops/s" +set ylabel(S) "kB" +set ylabel(u) "Percent" +set ylabel(v) "" +set ylabel(w) "ops/s" +set ylabel(W) "swp/s" + +set y2label(b) "" +set y2label(B) "" +set y2label(q) "" +set y2label(r) "" +set y2label(R) "" +set y2label(S) "" +set y2label(u) "" +set y2label(v) "" +set y2label(w) "" +set y2label(W) "" + +# sag_if_out_tokens describes how is input file covered +# if no list specified the proc_line_$l() is called +# Note: first element has index 0 (zero)! +# SGo 2007-07-06: Add fields for option -S. +# SGo 2007-10-21: Update fields taken for option -B. +# SGo 2006-04-14: Update fields taken for options -B, -q, -r, -R, -v. +# SGo 2008-06-15: Options -c and -w have been merged. +set sag_if_out_tokens(b) [list 1 2 3 4] +set sag_if_out_tokens2(b) "" +set sag_if_out_tokens(B) [list 0 1 2 3 4 5 6 7] +set sag_if_out_tokens2(B) "" +set sag_if_out_tokens(q) [list 0 1 2 3 4] +set sag_if_out_tokens2(q) "" +set sag_if_out_tokens(r) [list 0 1 3 4 5] +set sag_if_out_tokens2(r) "" +set sag_if_out_tokens(R) [list 0 1 2] +set sag_if_out_tokens2(R) "" +set sag_if_out_tokens(S) [list 0 1 3] +set sag_if_out_tokens2(S) "" +# CPU needs special computation, following list must be empty +# if no list is entered then following functions must be defined +# __output_zero_metrics_$l & proc_line_$l (see: proc_line_u()) +set sag_if_out_tokens(u) "" +set sag_if_out_tokens2(u) "" +set sag_if_out_tokens(v) [list 0 1 2 3 5 7] +set sag_if_out_tokens2(v) "" +set sag_if_out_tokens(w) [list 0 1] +set sag_if_out_tokens2(w) "" +set sag_if_out_tokens(W) [list 0 1] +set sag_if_out_tokens2(W) "" + +# +# The sar_elim() array contains string which have to be eliminated from sar's output +# SGo 2008-07-06: Add string for option -S. +# +set sar_elim(b) "tps" +set sar_elim(B) "pgpgin" +set sar_elim(c) "proc" +set sar_elim(q) "runq-sz" +set sar_elim(r) "kbmemfree" +set sar_elim(R) "frmpg" +set sar_elim(S) "kbswpfree" +set sar_elim(u) "user" +set sar_elim(v) "dentunusd" +set sar_elim(w) "cswch" +set sar_elim(W) "pswpin" + +# Functions which are responsible for data source selection and processing +# funcs are referred from GUI +proc fill_file_menu {} { + global sar_data_path sar_data_mask sag_latest_file + + set max_timestamp 0 + set directories [lsort -decreasing [glob -nocomplain -directory $sar_data_path -type d \[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]]] + + menu .file.menu.m -tearoff false + + foreach directory [concat $directories $sar_data_path ] { + set files [glob -nocomplain -directory $directory -type f $sar_data_mask ] + # add compressed files too + set files [concat $files [glob -nocomplain -directory $directory -type f $sar_data_mask.gz ]] + set files [concat $files [glob -nocomplain -directory $directory -type f $sar_data_mask.bz2 ]] + + if { 0 == [llength $files] } { + continue + } + + if { $directory == $sar_data_path } { + set menudir ".file.menu.m" + + # Sort files according to theirs modification times descending + + # i) create temporary list of items in form `timestamp:file' + set tmpfiles [list] + foreach file $files { + # skip symbolic links + if { "link" == [ file type $file]} { continue } + set timestamp [file mtime $file] + set tmpfiles [linsert $tmpfiles end "$timestamp:$file"] + } + + # ii) sort the temporary list + set tmpfiles [lsort -decreasing $tmpfiles] + # iii) remove timestamps to get back the file list + set files [list] + foreach file $tmpfiles { + set l [string first ":" $file] + set files [linsert $files end [string range $file [expr $l+1] end]] + } + } else { + # sort file list by file name, descending + set files [ lsort -decreasing $files ] + set l [string last "/" $directory] + set dir [string range $directory [expr $l + 1] end] + + # create submenu for the $dir directory + set menudir ".file.menu.m.dir$dir" + menu $menudir -tearoff 0 + .file.menu.m add cascade -label $dir -menu $menudir + } + + + # Fill menu with files + foreach file $files { + set l [string length $sar_data_path] + set basefile [string range $file [expr $l + 1] end] + set l [string last "/" $basefile] + set label [string range $basefile [expr $l + 1] end] + set label [string map { .gz "" } $label] + set label [string map { .bz2 "" } $label] + + $menudir add command -label "$label" -command "set_file $basefile" + set timestamp [file mtime $file] + # ignore files small then 4kB to avoid "No data found" error + if { ($timestamp > $max_timestamp) && ([file size $file] > 4096) } { + set sag_latest_file $basefile + set max_timestamp $timestamp + } + } + } +} + + +proc set_file {name} { + global sar_data_path sag_if_archive sag_if_archive_uncompressed last_graph fngr_tmpdir + + set sag_if_archive $name + .file.lbl configure -text "Data Source: $name" + + set l [string last "." $sag_if_archive] + if { [string range $sag_if_archive $l end] == ".gz" } { + # uncompress file to sa_data located in the temporary dir + set sag_if_archive_uncompressed "$fngr_tmpdir/sa_data" + exec zcat "$sar_data_path/$sag_if_archive" > $sag_if_archive_uncompressed + } else { + if { [string range $sag_if_archive $l end] == ".bz2" } { + set sag_if_archive_uncompressed "$fngr_tmpdir/sa_data" + exec bzcat "$sar_data_path/$sag_if_archive" > $sag_if_archive_uncompressed + } else { + set sag_if_archive_uncompressed "$sar_data_path/$sag_if_archive" + } + } + + + if {"" != $last_graph} { + new_chart $last_graph + } +} + +############################################################################### +# GUI +# +# $Id: isag.GUI.m4,v 1.14 2004/03/02 20:28:00 david Exp $ +# $State: Exp $ +# $Log: isag.GUI.m4,v $ +# Revision 1.14 2004/03/02 20:28:00 david +# replaced <> by () in mangled e-mails +# +# Revision 1.13 2004/02/24 07:40:14 david +# replaced (at) and (dot) in most e-mail addresses +# +# Revision 1.12 2003/01/26 20:41:48 david +# partially renamed variables, 1st implementation of "Save Graph" +# +# Revision 1.11 2002/10/31 15:07:21 david +# fixed bad behaviour with OpenMotif WM +# +# Revision 1.10 2002/03/24 15:18:26 david +# added +# +# Revision 1.9 2002/03/04 20:23:26 david +# fixed whole day functionality +# +# Revision 1.8 2002/03/04 18:36:37 david +# grid feature implemented +# +# Revision 1.7 2001/03/17 17:43:06 sarrep +# About dialog modify +# +# Revision 1.6 2001/03/17 17:30:11 sarrep +# CVSizing, unified headers of each element file +# +# +# +############################################################################### +set isag_title "System Activity Grapher" +wm title . $isag_title + +frame .menu -relief raised -borderwidth 2 +pack .menu -side top -fill x +menubutton .menu.file -text "Program" -menu .menu.file.m -underline 0 +menu .menu.file.m -tearoff false +.menu.file.m add command -label "Redraw" -underline 0 \ + -command "set isag_gr_scale_old 0;redraw_graph" -accelerator "F5" +.menu.file.m add command -label "Save Picture" -underline 0 \ + -command "sag_save_graph" +.menu.file.m add separator +.menu.file.m add command -label "Exit Program" -underline 0 \ + -command "exit_program" -accelerator "Alt-X" + +menubutton .menu.chart -text "Chart" -menu .menu.chart.m -underline 0 +menu .menu.chart.m -tearoff true + +# creates for each sar-switch menu item with apropriate command +foreach l $prog_swtch { + .menu.chart.m add command -label $view_n($l) \ + -command "new_chart $l" -accelerator $l + bind all $l "new_chart $l" +} + +menubutton .menu.opt -text "Options" -menu .menu.opt.m -underline 0 +menu .menu.opt.m -tearoff false +.menu.opt.m add checkbutton -label "Whole Day (00:00-23:59)" -underline 0 \ + -variable sag_opt_whole_day \ + -command "set isag_gr_scale_old 0;redraw_graph" +.menu.opt.m add checkbutton -label "Show Grid" -underline 0 \ + -variable sag_opt_grid -command "set isag_gr_scale_old 0;redraw_graph" + +menubutton .menu.help -text "Help" -menu .menu.help.m -underline 0 +menu .menu.help.m -tearoff false +.menu.help.m add command -label "About" -underline 0 \ + -command {About} + +pack .menu.file .menu.chart .menu.opt -side left +pack .menu.help -side right + +frame .file -relief raised +pack .file -side top -fill x +label .file.lbl -text "(No File)" -borderwidth 2 +menubutton .file.menu -relief raised -borderwidth 2 -text "-" -menu .file.menu.m +fill_file_menu +pack .file.lbl .file.menu -side left + +frame .graph +pack .graph -side top -expand true -fill both + +# this var contains a current value +set sag_gr_scale 0 +scale .graph.scale -orient vertical -length $sag_graph_ht -to 0 -from 1 -variable sag_gr_scale + +bind .graph.scale "redraw_graph" + +canvas .graph.canv -width $sag_graph_wd -height $sag_graph_ht +pack .graph.scale -side left -fill y +pack .graph.canv -side right -expand true -fill both + + +#bind all "%W configure -highlightbackground blue" +#bind all "%W configure -highlightbackground white" + +bind all "exit_program" +bind all "set isag_gr_scale_old 0;redraw_graph" + + +# acction to do when user closes isag with the window managers's close button +wm protocol . WM_DELETE_WINDOW exit_program + + +############################################################################### +# +# this function normalizes max val and sets scale and so on. +# this part is most common for draw_? functions +proc set_cur_max {l} { + global val_max sag_gr_scale val_cur + + set norm [num_norm $val_max($l)] + set val_max($l) [lindex $norm 0] + .graph.scale configure -from $val_max($l) -resolution [lindex $norm 1] + unset norm + + set val_cur($l) $sag_gr_scale + if {$val_cur($l) == 0} { + set val_cur($l) $val_max($l) + set sag_gr_scale $val_cur($l) + } +} + +############################################################################### +# +# this function is called when mouse leaves a graph-scale widget +# and here is local variable isag_gr_scale_old +# +# this can be also as flag, is set to 0 after resizing +set isag_gr_scale_old 0 +proc redraw_graph {} { + global last_graph sag_gr_scale isag_gr_scale_old sag_if_archive + + if {($last_graph == "") || ($sag_if_archive == "")} { + return + } + + if {$isag_gr_scale_old != $sag_gr_scale} { + set isag_gr_scale_old $sag_gr_scale + sag_draw $last_graph + } +} +############################################################################### +# +# this function is called from menu-view and decides which graph will be drawn +# +proc new_chart {l} { + global last_graph val_cur sag_gr_scale + + if {$last_graph != "$l"} { + set m [.graph.scale configure -from] + if {$m < $val_cur($l)} { + .graph.scale configure -from $val_cur($l) + } + set sag_gr_scale $val_cur($l) + set last_graph "$l" + unset m + } + sag_draw $l +} +############################################################################### +# +# About message box +# +proc About {} { + global version + + out_msg About "Sar Grapher\n\nBuild info:$version\n\nhttp://www.volny.cz/linux_monitor/isag/index.html\ne-mail: linux_monitor(at)volny(dot)cz" +} + +# $Source: /var/CVSROOT/cvs/i-sag/isag/isag.GUI.m4,v $ +############################################################################### +# Resizing graph window +# +# $Id: isag.ResizeAll.m4,v 1.7 2003/01/26 20:41:48 david Exp $ +# $State: Exp $ +# $Log:# +# +# +############################################################################### + +bind . {ResizeAll} +set isag_enResizing 0 +# first time this function is empty +proc gnuplot {w} {} + +proc ResizeAll {} { + global isag_enResizing isag_gr_scale_old + + set width [winfo width .] + set height [winfo height .] + + set w [expr [winfo width .graph.scale] + [winfo width .graph.canv]] + set h [expr [winfo height .menu] + [winfo height .file] + [winfo height .graph.scale]] + + if {($w >= $width) && ($h == $height)} { + incr isag_enResizing + return + } + + if {0 == $isag_enResizing} { + return + } + + set isag_enResizing 0 + if {$w <= $width} { +# number two look as magic number + .graph.canv configure -width [expr $width - [winfo width .graph.scale] - 2] + } + + if {$h != $height} { + set h1 [expr [winfo height .menu] + [.file cget -height]] + .graph.canv configure -height [expr $height - $h1] + .graph.scale configure -length [expr $height - $h1] + } +# set isag_gr_scale_old 0 +# redraw_graph +## not reliable WHY? + gnuplot .graph.canv + #set isag_enResizing 1 +} + +# $Source: /var/CVSROOT/cvs/i-sag/isag/isag.ResizeAll.m4,v $ +############################################################################### +# Other functions +# +# $Id: isag.Other.Funcs.m4,v 1.20 2004/03/22 19:39:14 david Exp $ +# $State: Exp $ +# $Log: isag.Other.Funcs.m4,v $ +# Revision 1.20 2004/03/22 19:39:14 david +# fully avoided shell script, i hope the temp file issue is fixed +# +# +############################################################################### + +############################################################################## +# +# + +proc strrep {str old new} { + set l [string length $old] + + for {set n [string first $old $str]} {$n != -1} {set n [string first $old $str]} { + set str "[string range $str 0 [expr $n - 1]]$new[string range $str [expr $n + $l] end]" + } + return $str +} + +# eof: strrep.m4 + + +# normalizes time if HH:MM:SS PM to 00-24 `format' for gnuplot +proc time_normalize {time} { + set n [string first "AM" $time] + if {$n > 0} { + set time [string trim [string range $time 0 [expr $n - 1]]] + set hours [string range $time 0 1] +# if hour is 12 then time is after midnight + if {$hours == 12} { + set time "[format %02d [expr $hours - 12]][string range $time 2 end]" + } else { + return [string trim [string range $time 0 [expr $n - 1]]] + } + unset hours + } + set n [string first "PM" $time] + if {$n > 0} { + set time [string trim [string range $time 0 [expr $n - 1]]] + set hours [string range $time 0 1] + # if hours string looks like 07, then is evaluated as octal number + # in case of 08 and 09 generates an error + if {"0" == [string range $hours 0 0]} { + set hours [string range $hours 1 1] + } + if {$hours < 12} { + set time "[format %02d [expr $hours + 12]][string range $time 2 end]" + } + unset hours + } + unset n + return $time +} + +# tokens are divided by one or more space(s) +proc parse_line {ln} { + global needed_version tcl_version + + set res "" + if {$tcl_version > $needed_version} { + # this is a more effective + set rest [string map { \t " " } [string trim $ln]] + } else { + set rest [strrep [string trim $ln] \t " "] + } + + for {} {[string length $rest] > 0} {} { + set a [string first " " $rest] + if {$a == -1} { + lappend res "$rest" + set rest "" + } else { + set token [string trim [string range $rest 0 [expr $a - 1]]] + set rest [string trim [string range $rest [expr $a + 1] end]] + lappend res "$token" + } + } + unset rest + return $res +} + + +# normalizes number to 2valid digits representation +# and returns lis of norm number and step for list +proc num_norm {num} { + if {$num < 10.0} { + return [list 10 1] + } + set l [expr int ([expr log10 ($num)])] + set n [expr int ([expr pow (10, [expr $l - 1])])] + set m [expr int ([expr ($num - 1) / $n]) + 1] + + set max [expr $m * $n] + set step [expr int ([expr pow (10, [expr $l - 2])])] + if {$step < 1} { + set step 1 + } + unset l n m + return [list $max $step] +} + +## +## Parameters +## gp_term - gnuplot terminal (currently used: tkcanvas & jpeg) +## ext - out filename extension (related to gp_term) +## fn - file name base for resulting file +## title - graph title/name +## xlabel - xlabel text +## ylabel - primary ylabel text +## y2label - secondary ylabel text (scale 0-100%) +## yrange - yrange (y-maximum) +## plot_str - gplot command which produces desired output graph +## f_grid - flag if grid should be drawn +## +proc create_gnuplot_file {gp_term ext fn title xlabel ylabel y2label yrange plot_str f_grid} { + global sag_graph_wd sag_graph_ht + + +# Y2 percentage + set fp [open $fn.gp "w"] + +# not consistent workaround + if { $gp_term == "jpeg" } { + puts $fp "set term $gp_term transparent interlace size $sag_graph_wd,$sag_graph_ht" + } else { + puts $fp "set term $gp_term" + } +# puts $fp "set title \"$title\"" +# puts $fp "set xlabel \"$xlabel\"" + puts $fp "set ylabel \"$ylabel\"" + if {$y2label != ""} { + puts $fp "set y2label \"$y2label\"" + puts $fp "set y2range \[0:100\]" + } + puts $fp "set timefmt \"%H:%M:%S\"" + puts $fp "set xdata time" + puts $fp "set format x \"%H:%M\"" + if {$yrange != ""} { + puts $fp "set yrange $yrange" + } + puts $fp "set output \"$fn.$ext\"" + if { 0 != $f_grid } { + puts $fp "set grid" + } + puts $fp "plot $plot_str" + close $fp +} + +set fngr_tmpdir [exec mktemp -d "/tmp/isag.XXXXXX"] + +# $Source: /var/CVSROOT/cvs/i-sag/isag/isag.Other.Funcs.m4,v $ + +############################################################################### +# +# Remaining graph paramaters +# + +# plotstr array +# in future - this string will not be fixed but functions will coming +# SGo 2008-07-06: Added fields for option -S. +# SGo 2008-06-15: Update fields for option -w (options -c and -w have been merged). +# SGo 2007-10-21: Update fields for option -B. +# SGo 2006-04-14: Update fields for options -B, -q, -r, -R, -u, -v. +# SGo 2007-07-31: Update fields for option -v. +set plotstr(b) "\"__FNGR__\" using 1:2 t \"rtps\" with line, \"__FNGR__\" using 1:3 t \"wtps\" with line, \"__FNGR__\" using 1:4 t \"bread/s\" with line, \"__FNGR__\" using 1:5 t \"bwrtn/s\" with line" +set plotstr(B) "\"__FNGR__\" using 1:2 t \"pgpgin/s\" with line, \"__FNGR__\" using 1:3 t \"pgpgout/s\" with line, \"__FNGR__\" using 1:4 t \"fault/s\" with line, \"__FNGR__\" using 1:5 t \"majflt/s\" with line, \"__FNGR__\" using 1:6 t \"pgfree/s\" with line, \"__FNGR__\" using 1:7 t \"pgscank/s\" with line, \"__FNGR__\" using 1:8 t \"pgscand/s\" with line, \"__FNGR__\" using 1:9 t \"pgsteal/s\" with line" +set plotstr(n) "" +set plotstr(q) "\"__FNGR__\" using 1:2 t \"runq-sz\" with line, \"__FNGR__\" using 1:3 t \"plist-sz\" with line, \"__FNGR__\" using 1:4 t \"ldavg-1\" with line, \"__FNGR__\" using 1:5 t \"ldavg-5\" with line, \"__FNGR__\" using 1:6 t \"ldavg-15\" with line" +set plotstr(r) "\"__FNGR__\" using 1:2 t \"kbmemfree\" with line, \"__FNGR__\" using 1:3 t \"kbmemused\" with line, \"__FNGR__\" using 1:4 t \"kbbuffers\" with line, \"__FNGR__\" using 1:5 t \"kbcached\" with line, \"__FNGR__\" using 1:6 t \"kbcommit\" with line" +set plotstr(R) "\"__FNGR__\" using 1:2 t \"frmpg/s\" with line, \"__FNGR__\" using 1:3 t \"bufpg/s\" with line, \"__FNGR__\" using 1:4 t \"campg/s\" with line" +set plotstr(S) "\"__FNGR__\" using 1:2 t \"kbswpfree\" with line, \"__FNGR__\" using 1:3 t \"kbswpused\" with line, \"__FNGR__\" using 1:4 t \"kbswpcad\" with line" +set plotstr(u) "\"__FNGR__\" using 1:2 t \"%user\" with line, \"__FNGR__\" using 1:3 t \"%nice\" with line, \"__FNGR__\" using 1:4 t \"%system\" with line, \"__FNGR__\" using 1:5 t \"%iowait\" with line, \"__FNGR__\" using 1:6 t \"%steal\" with line" +set plotstr(v) "\"__FNGR__\" using 1:2 t \"dentunusd\" with line, \"__FNGR__\" using 1:3 t \"file-nr\" with line, \"__FNGR__\" using 1:4 t \"inode-nr\" with line, \"__FNGR__\" using 1:5 t \"pty-nr\" with line" +set plotstr(w) "\"__FNGR__\" using 1:2 t \"proc/s\" with line, \"__FNGR__\" using 1:3 t \"cswch/s\" with line" +set plotstr(W) "\"__FNGR__\" using 1:2 t \"pswpin/s\" with line, \"__FNGR__\" using 1:3 t \"pswpout/s\" with line" + +############################################################################### +# Performance data processing +# +# $Id: isag.perf_data_procs.m4,v 1.11 2003/01/26 20:41:48 david Exp $ +# $State: Exp $ +# $Log: isag.perf_data_procs.m4,v $ +# Revision 1.11 2003/01/26 20:41:48 david +# partially renamed variables, 1st implementation of "Save Graph" +# +# Revision 1.10 2002/03/24 15:18:26 david +# added +# +# Revision 1.9 2002/03/04 20:23:26 david +# fixed whole day functionality +# +# Revision 1.8 2001/03/30 16:42:26 sarrep +# Fixed bug about _last_time, (mangled graph) +# +# Revision 1.7 2001/03/17 17:30:16 sarrep +# CVSizing, unified headers of each element file +# +# Revision 1.6 2001/03/17 16:55:27 sarrep +# LINUX RESTART zeroes all counters. +# +############################################################################### + +# CPU measurement specific line processing +# SGo 2006-04-14: take into account time spent in iowait and steal modes +proc sag_if_proc_line_u {fp line} { + global val_cur val_max sag_if_last_time sag_if_reboot_flag + + set rval 0 + set a [string first "all" $line] + if {$a != -1} { + set time [string trim [string range $line 0 [expr $a - 1]]] + set time [time_normalize "$time"] + set rest [string trim [string range $line [expr $a + 3] end]] + if {1 == $sag_if_reboot_flag} { +# after reboot, set to zero also, all charts are with lines + set sag_if_reboot_flag 0 +# NOTE: The func __output_zero_metrics() cannot be used, because 'u' don't have sag_if_out_tokens + puts $fp "$time 0 0 0 0 0" + } + + set nums [parse_line $rest] + # user nice system iowait steal (idle) + set user [lindex $nums 0] + set nice [lindex $nums 1] + set syst [lindex $nums 2] + set iow [lindex $nums 3] + set steal [lindex $nums 4] + + set total [expr $user + $nice + $syst + $iow + $steal] + if {$total > $val_max(u)} {set val_max(u) $total} + puts $fp "$time $total [expr $nice + $syst + $iow + $steal] [expr $syst + $iow + $steal] [expr $iow + $steal] $steal" + set rval 1 + set sag_if_last_time $time + } else {if {-1 != [string first "RESTART" $line]} { + set sag_if_reboot_flag 1 +# see previous NOTE + if {$sag_if_last_time != ""} { + puts $fp "$sag_if_last_time 0 0 0 0 0" + set rval 1 + } + }} + return $rval +} + +proc sag_if__output_zero_metrics_u {time} { + return "$time 0 0 0 0 0" +} + +# $Source: /var/CVSROOT/cvs/i-sag/isag/isag.perf_data_procs.m4,v $ +############################################################################### +# Performance Data Processing and Drawing functions +# proces line functions +# +# $Id: proc_line_generic.m4,v 1.11 2004/03/22 19:39:14 david Exp $ +# $State: Exp $ +# $Log: proc_line_generic.m4,v $ +# Revision 1.11 2004/03/22 19:39:14 david +# fully avoided shell script, i hope the temp file issue is fixed +# +# Revision 1.10 2003/01/26 20:41:49 david +# partially renamed variables, 1st implementation of "Save Graph" +# +# Revision 1.9 2002/03/24 15:18:26 david +# added +# +# Revision 1.8 2002/03/04 20:23:26 david +# fixed whole day functionality +# +# Revision 1.7 2001/07/30 18:06:25 sarrep +# Fixed one debug print. It was on wrong place. +# +# Revision 1.6 2001/03/30 16:42:26 sarrep +# Fixed bug about _last_time, (mangled graph) +# +# Revision 1.5 2001/03/17 17:30:23 sarrep +# CVSizing, unified headers of each element file +# +# Revision 1.4 2001/03/17 16:55:28 sarrep +# LINUX RESTART zeroes all counters. +# +# +############################################################################### + +# +# NOTE: following function is used when +# graph of whole day is required (see: draw() function) +# +proc sag_if__output_zero_metrics {time l} { + global sag_if_out_tokens sag_if_out_tokens2 + + set out "$time " + foreach N $sag_if_out_tokens($l) { + set out "$out 0" + } + foreach N $sag_if_out_tokens2($l) { + set out "$out 0" + } + return "$out" +} + +# +# NOTE: `_last_time' related functionality is used when +# graph of whole day is required (see: draw() function) +# +set sag_if_last_time "" +set sag_if_reboot_flag 0 + +# generic line processing +proc sag_if_proc_line_generic {l fp line} { + global val_cur val_max sag_if_out_tokens sag_if_out_tokens2 sag_if_last_time sag_if_reboot_flag + + set time [string trim [string range $line 0 12]] + # Here was a problem, time string was badly cutten + set time [time_normalize "$time"] + set rest [string trim [string range $line 12 end]] + +# +# Sebastien's isag specific +# check for line: "time LINUX RESTART" and reset counter to next +# valid time stamp. +# NOTE: Values must be zeroed also for first valid time after reboot. For +# explanation you can imagin the chart +# + if {-1 == [string first "RESTART" $rest]} { + if {1 == $sag_if_reboot_flag} { +# after reboot, set to zero also, all charts are with lines + set sag_if_reboot_flag 0 + puts $fp [sag_if__output_zero_metrics $time $l] + } + set nums [parse_line $rest] + set out "$time " + foreach N $sag_if_out_tokens($l) { + set n [lindex $nums $N] + set out "$out $n" + if {$n > $val_max($l)} {set val_max($l) $n} + } + + foreach N $sag_if_out_tokens2($l) { + set n [lindex $nums $N] + set out "$out $n" + } + set sag_if_last_time $time + unset nums n N + } else { +# reboot detected, drop all metrics to zero + set sag_if_reboot_flag 1 + if {$sag_if_last_time != ""} { + set out [sag_if__output_zero_metrics $sag_if_last_time $l] + } + } + + catch { + puts $fp "$out" + unset out + } + unset rest time + return 1 +} + +# $Source: /var/CVSROOT/cvs/i-sag/common/proc_line_generic.m4,v $ +############################################################################### +# Performance Data Processing and Drawing functions +# generic draw function +# parametrical draw func for each kind of graph +# +# $Id: draw.m4,v 1.16 2004/03/22 19:39:14 david Exp $ +# $State: Exp $ +# $Log: draw.m4,v $ +# Revision 1.16 2004/03/22 19:39:14 david +# fully avoided shell script, i hope the temp file issue is fixed +# +# Revision 1.15 2004/03/22 19:13:18 david +# eliminated shell script, security issue +# +# Revision 1.14 2004/02/27 19:26:06 david +# fixed bug: CAN-2004-0108 +# +# Revision 1.13 2003/02/23 19:48:16 david +# unified redundant code which generates data file +# +# Revision 1.12 2003/01/26 20:41:48 david +# partially renamed variables, 1st implementation of "Save Graph" +# +# Revision 1.11 2002/03/24 15:18:26 david +# added +# +# Revision 1.10 2002/03/04 20:23:43 david +# fixed whole day functionality +# +# Revision 1.9 2002/03/04 18:36:37 david +# grid feature implemented +# +# Revision 1.8 2002/03/03 19:45:19 david +# added parameters to create_gnuplot_file() +# +# Revision 1.7 2001/03/30 16:42:26 sarrep +# Fixed bug about _last_time, (mangled graph) +# +# Revision 1.6 2001/03/17 17:30:10 sarrep +# CVSizing, unified headers of each element file +# +# +# +############################################################################### + +proc sag_prepare_datafile {l} { + global sar sar_data_path sag_if_archive_uncompressed sag_if_out_tokens \ + sag_opt_whole_day sag_if_last_time sar_elim fngr_tmpdir + + + set sag_if_last_time "" + set fp [open "|$sar -$l -f $sag_if_archive_uncompressed" "r"] + + set fgrname "$fngr_tmpdir/data.$l" + + set fpgr [open $fgrname w] + + set nlines 0 + +# if needed set starting time + if { 0 != $sag_opt_whole_day } { + set sag_if_last_time "00:00" + if {"" != $sag_if_out_tokens($l)} { + puts $fpgr [sag_if__output_zero_metrics $sag_if_last_time $l] + } else { + puts $fpgr [sag_if__output_zero_metrics_$l $sag_if_last_time] + } + } + + while {[gets $fp line] != -1} { + if {(1 == [string match \[0-9\]* $line]) && (0 == [string match *$sar_elim($l)* $line])} { + + if {"" != $sag_if_out_tokens($l)} { + set n [sag_if_proc_line_generic $l $fpgr "$line"] + } else { + set n [sag_if_proc_line_$l $fpgr "$line"] + } + incr nlines $n + } + + } + +## make closing remark if necessary +# finishing whole day + if { 0 != $sag_opt_whole_day } { + if {"" != $sag_if_out_tokens($l)} { + puts $fpgr [sag_if__output_zero_metrics $sag_if_last_time $l] + } else { + puts $fpgr [sag_if__output_zero_metrics_$l $sag_if_last_time] + } + if {"" != $sag_if_out_tokens($l)} { + puts $fpgr [sag_if__output_zero_metrics "23:59" $l] + } else { + puts $fpgr [sag_if__output_zero_metrics_$l "23:59"] + } + } + + catch {close $fp} + catch {close $fpgr} + + unset fp fpgr line + + return [list $nlines $fgrname] +} + +# +# generic draw function +# Parameter: +# l - graph letter other values are parameters +# +proc sag_draw {l} { + global sag_if_archive isag_title sh sar grep sar_data_path gnuplot \ + sag_gr_scale val_cur val_max view_n sag_if_cmd xlabel sag_if_out_tokens \ + ylabel y2label plotstr has_negative \ + sag_if_last_time sag_opt_grid sag_opt_whole_day fngr_tmpdir last_graph + + if {$sag_if_archive == ""} { + err_msg "Error" "No data source selected for: $view_n($l)" + return + } + + wm title . "$isag_title: $view_n($l)" + + set prepared [sag_prepare_datafile $l] + set nlines [lindex $prepared 0] + set fgrname [lindex $prepared 1] + +# at least two lines of data + if {$nlines > 1} { + set_cur_max $l + + if {1 == $has_negative($l)} { + set yrange "\[-$val_cur($l):$val_cur($l)\]" + } else { + set yrange "\[0:$val_cur($l)\]" + } + set fngr "$fngr_tmpdir/draw.$l" + create_gnuplot_file tkcanvas tk $fngr "$view_n($l)" \ + "$xlabel" \ + "$ylabel($l)" $y2label($l) \ + $yrange \ + [strrep "$plotstr($l)" __FNGR__ $fgrname] $sag_opt_grid + + exec $gnuplot $fngr.gp + + source $fngr.tk + gnuplot .graph.canv + + file delete $fngr.gp + file delete $fngr.tk + file delete $fngr + } else { + .graph.canv delete all + err_msg "Datafile: $sag_if_archive" "No data to show" + .graph.canv delete all + } + file delete $fgrname + + unset nlines +} + +# $Source: /var/CVSROOT/cvs/i-sag/isag/draw.m4,v $ +############################################################################### +# Performance Data Processing and Drawing functions +# proces line functions +# +# $Id: sag.save_graph.m4,v 1.3 2003/02/23 21:07:41 david Exp $ +# $State: Exp $ +# $Log: sag.save_graph.m4,v $ +# Revision 1.3 2003/02/23 21:07:41 david +# first prototype of sag +# +# Revision 1.2 2003/02/23 19:48:16 david +# unified redundant code which generates data file +# +# Revision 1.1 2003/01/26 20:41:49 david +# partially renamed variables, 1st implementation of "Save Graph" +# +# Revision 1.9 2002/03/24 15:18:26 david +# added +# +# Revision 1.8 2002/03/04 20:23:26 david +# fixed whole day functionality +# +# Revision 1.7 2001/07/30 18:06:25 sarrep +# Fixed one debug print. It was on wrong place. +# +# Revision 1.6 2001/03/30 16:42:26 sarrep +# Fixed bug about _last_time, (mangled graph) +# +# Revision 1.5 2001/03/17 17:30:23 sarrep +# CVSizing, unified headers of each element file +# +# Revision 1.4 2001/03/17 16:55:28 sarrep +# LINUX RESTART zeroes all counters. +# +# +############################################################################### + +proc sag_save_graph {} { + global sag_if_archive isag_title sh sar grep sar_data_path gnuplot \ + sag_gr_scale val_cur val_max view_n sag_if_cmd xlabel sag_if_out_tokens \ + ylabel y2label plotstr has_negative \ + sag_if_last_time sag_opt_grid sag_opt_whole_day last_graph fngr_tmpdir + + + set l $last_graph + + if {$sag_if_archive == ""} { +# out_msg "Error" "No data source selected for: $view_n($l)" + return + } + + set prepared [sag_prepare_datafile $l] + set nlines [lindex $prepared 0] + set fgrname [lindex $prepared 1] + +# at least two lines of data + if {$nlines > 1} { +# set_cur_max $l + + if {$val_cur($l) != 0} { + if {1 == $has_negative($l)} { + set yrange "\[-$val_cur($l):$val_cur($l)\]" + } else { + set yrange "\[0:$val_cur($l)\]" + } + } else { + set yrange "" + } + + set fngr "$fngr_tmpdir/jpeg.$l" + create_gnuplot_file jpeg jpg $fngr "$view_n($l)" \ + "$xlabel" \ + "$ylabel($l)" $y2label($l) \ + $yrange \ + [strrep "$plotstr($l)" __FNGR__ $fgrname] $sag_opt_grid + + exec $gnuplot $fngr.gp + + file delete $fngr.gp + file delete $fngr + set filename [tk_getSaveFile -title "Save Picture" \ + -initialfile [string map { / _ } $sag_if_archive].$l.jpg \ + -filetypes {{{JPEG Images} {.jpg}} {{All files} *}} ] + if { "" != $filename } { + file rename -force $fngr.jpg $filename + } else { + file delete $fngr.jpg + } + + } else { + .graph.canv delete all + err_msg "Datafile: $sag_if_archive" "No data to show" + } + file delete "$fgrname" + + unset nlines +} + +# $Source: /var/CVSROOT/cvs/i-sag/common/sag.save_graph.m4,v $ +############################################################################### +# $Id: isag_cfg_file.m4,v 1.10 2004/03/22 19:39:14 david Exp $ +# $State: Exp $ +# +# $Log: isag_cfg_file.m4,v $ +# Revision 1.10 2004/03/22 19:39:14 david +# fully avoided shell script, i hope the temp file issue is fixed +# +# Revision 1.9 2004/03/22 19:13:18 david +# eliminated shell script, security issue +# +# Revision 1.8 2004/02/27 19:53:28 david +# hide temporary files +# +# Revision 1.7 2004/02/27 19:26:06 david +# fixed bug: CAN-2004-0108 +# +# Revision 1.6 2003/01/26 20:41:48 david +# partially renamed variables, 1st implementation of "Save Graph" +# +# Revision 1.5 2002/03/04 20:21:51 david +# make new end line +# +# Revision 1.4 2002/03/04 18:36:37 david +# grid feature implemented +# +# Revision 1.3 2001/03/17 17:30:19 sarrep +# CVSizing, unified headers of each element file +# +# +# +############################################################################### +if {[file isfile $isag_cfg_file] == 1} { + source $isag_cfg_file + + if {"" != $last_graph} { + if {$val_max($last_graph) > 0} { + .graph.scale configure -to 0 \ + -from $val_max($last_graph) + set sag_gr_scale $val_cur($last_graph) + } + } +} + +if { "" != $sag_latest_file } { + catch { set_file $sag_latest_file } +} + +# +# Finishing a program and writting of config file +# +proc exit_program {} { + global isag_cfg_file prog_swtch val_max val_cur last_graph \ + sag_opt_whole_day sag_opt_grid \ + fngr_tmpdir + + + set fp [open $isag_cfg_file w] + foreach l $prog_swtch { + puts $fp "set val_max($l) $val_max($l)" + puts $fp "set val_cur($l) $val_cur($l)" + } + if {$last_graph == ""} { + puts $fp "set last_graph \"\"" + } else { + puts $fp "set last_graph $last_graph" + } + + puts $fp "set sag_opt_whole_day $sag_opt_whole_day" + puts $fp "set sag_opt_grid $sag_opt_grid" + + close $fp + + file delete -force -- "$fngr_tmpdir" + destroy . + exit +} + +# $Source: /var/CVSROOT/cvs/i-sag/isag/isag_cfg_file.m4,v $ + +# $Source: /var/CVSROOT/cvs/i-sag/isag/isag.m4,v $ diff --git a/contrib/sargraph/sargraph b/contrib/sargraph/sargraph new file mode 100755 index 00000000..2f3e717a --- /dev/null +++ b/contrib/sargraph/sargraph @@ -0,0 +1,486 @@ +#!/bin/bash +# sargraph - a simple sketch on how to generate graphs from sadf XML output +# by Lans.Carstensen@dreamworks.com + +# Our dependencies +ZENITY="/usr/bin/zenity" +XSLTPROC="/usr/bin/xsltproc" +SADF="/usr/local/bin/sadf" +GNUPLOT="/usr/bin/gnuplot" +MKTEMP="/bin/mktemp" +FIND="/usr/bin/find" +SORT="/bin/sort" +CUT="/bin/cut" + +# sar / sysstat DTD is published here: +# http://pagesperso-orange.fr/sebastien.godard/sysstat.dtd +# compare against output of "sadf -x" +# and pull apart data into gnuplot tabular data files + +# Subroutines + +# Graph for "sar -u" + +cpu_xslt() { + # Create the XSLT transform to make a GNUplot data file out of "sar -u" type data + # test with "sadf -x | xsltproc - + cat > $1 < + + + + + + + + + + + + + + + + + + + +EOF +} + +cpu_gnuplot() { + # Create the GNUplot rendering file, largely based on "isag" Tk script from sysstat package +#set yrange [0:100] + cat > $1 < - + cat > $1 < + + + + + + + + + + + + + + + + + + + +EOF +} + +rq_gnuplot() { + cat > $1 < - + cat > $1 < + + + + + + + + + + + + + + + + + +EOF +} + +rqnoplistsz_gnuplot() { + cat > $1 < - + cat > $1 < + + + + + + + + + + + + + + + + + + + +EOF +} + +io_gnuplot() { + cat > $1 < - + cat > $1 < + + + + + + + + + + + + + + + + + + + + + +EOF +} + +nfsclient_gnuplot() { + cat > $1 < - + cat > $1 < + + + + + + + + + + + + + + + + + +EOF +} + +paging_gnuplot() { + cat > $1 < - + cat > $1 < + + + + + + + + + + + + + + + + + + + + + + + +EOF +} + +memuse_gnuplot() { + cat > $1 < - + cat > $1 < + + + + + + + + + + + + + + + +EOF +} + +swapuse_gnuplot() { + cat > $1 < $DATAFILE + GNUPLOTFILE=`mktemp` + cpu_gnuplot $GNUPLOTFILE $DATAFILE + $GNUPLOT $GNUPLOTFILE + rm $GNUPLOTFILE + rm $DATAFILE + rm $XSLTFILE + ;; + "Run Queue") + XSLTFILE=`mktemp` + rq_xslt $XSLTFILE + DATAFILE=`mktemp` + $SADF -t -x $SARFILE -- -q | $XSLTPROC --novalid $XSLTFILE - > $DATAFILE + GNUPLOTFILE=`mktemp` + rq_gnuplot $GNUPLOTFILE $DATAFILE + $GNUPLOT $GNUPLOTFILE + rm $GNUPLOTFILE + rm $DATAFILE + rm $XSLTFILE + ;; + "Run Queue w/o Process List Size") + XSLTFILE=`mktemp` + rqnoplistsz_xslt $XSLTFILE + DATAFILE=`mktemp` + $SADF -t -x $SARFILE -- -q | $XSLTPROC --novalid $XSLTFILE - > $DATAFILE + GNUPLOTFILE=`mktemp` + rqnoplistsz_gnuplot $GNUPLOTFILE $DATAFILE + $GNUPLOT $GNUPLOTFILE + rm $GNUPLOTFILE + rm $DATAFILE + rm $XSLTFILE + ;; + "IO Transfer Rate") + XSLTFILE=`mktemp` + io_xslt $XSLTFILE + DATAFILE=`mktemp` + $SADF -t -x $SARFILE -- -b | $XSLTPROC --novalid $XSLTFILE - > $DATAFILE + GNUPLOTFILE=`mktemp` + io_gnuplot $GNUPLOTFILE $DATAFILE + $GNUPLOT $GNUPLOTFILE + rm $GNUPLOTFILE + rm $DATAFILE + rm $XSLTFILE + ;; + "NFS Client") + XSLTFILE=`mktemp` + nfsclient_xslt $XSLTFILE + DATAFILE=`mktemp` + $SADF -t -x $SARFILE -- -n NFS | $XSLTPROC --novalid $XSLTFILE - > $DATAFILE + GNUPLOTFILE=`mktemp` + nfsclient_gnuplot $GNUPLOTFILE $DATAFILE + $GNUPLOT $GNUPLOTFILE + rm $GNUPLOTFILE + rm $DATAFILE + rm $XSLTFILE + ;; + "Paging Stats") + XSLTFILE=`mktemp` + paging_xslt $XSLTFILE + DATAFILE=`mktemp` + $SADF -t -x $SARFILE -- -B | $XSLTPROC --novalid $XSLTFILE - > $DATAFILE + GNUPLOTFILE=`mktemp` + paging_gnuplot $GNUPLOTFILE $DATAFILE + $GNUPLOT $GNUPLOTFILE + rm $GNUPLOTFILE + rm $DATAFILE + rm $XSLTFILE + ;; + "Memory Utilization") + XSLTFILE=`mktemp` + memuse_xslt $XSLTFILE + DATAFILE=`mktemp` + $SADF -t -x $SARFILE -- -r | $XSLTPROC --novalid $XSLTFILE - > $DATAFILE + GNUPLOTFILE=`mktemp` + memuse_gnuplot $GNUPLOTFILE $DATAFILE + $GNUPLOT $GNUPLOTFILE + rm $GNUPLOTFILE + rm $DATAFILE + rm $XSLTFILE + ;; + "Memory Utilization (Swap)") + XSLTFILE=`mktemp` + swapuse_xslt $XSLTFILE + DATAFILE=`mktemp` + $SADF -t -x $SARFILE -- -S | $XSLTPROC --novalid $XSLTFILE - > $DATAFILE + GNUPLOTFILE=`mktemp` + swapuse_gnuplot $GNUPLOTFILE $DATAFILE + $GNUPLOT $GNUPLOTFILE + rm $GNUPLOTFILE + rm $DATAFILE + rm $XSLTFILE + ;; + *) + # If you click "Cancel", you end up here and exit + exit + ;; +esac + +done + +exit + diff --git a/crontab.sample b/crontab.sample new file mode 100644 index 00000000..ddb26fc2 --- /dev/null +++ b/crontab.sample @@ -0,0 +1,19 @@ +# Crontab sample for root or adm +# Please update this crontab with the proper location +# for sa1 and sa2 shell scripts (replace @SA_LIB_DIR@ with +# /usr/lib/sa for example). +# +# 8am-7pm activity reports every 20 minutes during weekdays. +# 0 8-18 * * 1-5 @SA_LIB_DIR@/sa1 1200 3 & +# activity reports every @CRON_INTERVAL@ minutes everyday. +0 * * * * @SA_LIB_DIR@/sa1 @CRON_INTERVAL_SEC@ @CRON_COUNT@ & +# +# Activity reports every an hour on Saturday and Sunday. +# 0 * * * 0,6 @SA_LIB_DIR@/sa1 & +# +# 7pm-8am activity reports every an hour during weekdays. +# 0 19-7 * * 1-5 @SA_LIB_DIR@/sa1 & +# +# Daily summary prepared at 19:05. +# 5 19 * * 1-5 @SA_LIB_DIR@/sa2 -A & +5 19 * * * @SA_LIB_DIR@/sa2 -A & diff --git a/iconfig b/iconfig new file mode 100755 index 00000000..987ca4f4 --- /dev/null +++ b/iconfig @@ -0,0 +1,185 @@ +#!/bin/sh +#@(#) Configuration script for sysstat +# (C) 2000-2010 Sebastien GODARD (sysstat orange.fr) + +ASK="sh build/Ask.sh" + +echo ; echo +echo Welcome to sysstat\'s Interactive Configuration script! +echo +echo This script enables you to set the parameters value used by ./configure. +echo Please enter the value for the parameters listed below. +echo Press Return to tell ./configure to use the default value or to try to guess the proper one. +echo "Defaut value for yes/no questions is no (parameter is NOT set)." +echo You can enter a ? to display a help message at any time... +echo + +# Syntax: Ask + +# Installation directory +PREFIX=`${ASK} 'Installation directory:' "--prefix" "prefix"` +if [ "${PREFIX}" != "" ]; then + PREFIX="--prefix=${PREFIX} " +fi + +# sadc directory +SA_LIB_DIR=`${ASK} 'sadc directory:' "sa_lib_dir" "sa_lib_dir"` +if [ "${SA_LIB_DIR}" != "" ]; then + SA_LIB_DIR="sa_lib_dir=${SA_LIB_DIR} " +fi + +# System Activity directory +SA_DIR=`${ASK} 'System activity directory:' "sa_dir" "sa_dir"` +if [ "${SA_DIR}" != "" ]; then + SA_DIR="sa_dir=${SA_DIR} " +fi + +# sysstat configuration directory +SYSCONFIG_DIR=`${ASK} 'sysstat configuration directory:' "conf_dir" "conf_dir"` +if [ "${SYSCONFIG_DIR}" != "" ]; then + SYSCONFIG_DIR="conf_dir=${SYSCONFIG_DIR} " +fi + +# Clean sa directory +CLEAN_SA_DIR=`${ASK} 'Clean system activity directory? (y/n)' "--enable-clean-sa-dir" "clean-sa-dir"` +if [ "${CLEAN_SA_DIR}" = "y" ]; then + CLEAN_SA_DIR="--enable-clean-sa-dir " +else + CLEAN_SA_DIR="" + echo "Parameter --enable-clean-sa-dir is NOT set" +fi + +# National Language Support +NLS=`${ASK} 'Disable National Language Support (NLS)? (y/n)' "--disable-nls" "nls"` +if [ "${NLS}" = "y" ]; then + NLS="--disable-nls " +else + NLS="" + echo "Parameter --disable-nls is NOT set" +fi + +# Sensors support +SENSORS=`${ASK} 'Disable sensors support? (y/n)' "--disable-sensors" "sensors"` +if [ "${SENSORS}" = "y" ]; then + SENSORS="--disable-sensors " +else + SENSORS="" + echo "Parameter --disable-sensors is NOT set" +fi + +# sa2 processes data file of the day before +YESTERDAY=`${ASK} 'sa2 uses daily data file of the day before? (y/n)' "--enable-yesterday" "yesterday"` +if [ "${YESTERDAY}" = "y" ]; then + YESTERDAY="--enable-yesterday " +else + YESTERDAY="" + echo "Parameter --enable-yesterday is NOT set" +fi + +# Data history to keep by sa2 +HISTORY=`${ASK} 'Number of daily data files to keep:' "history" "history"` +if [ "${HISTORY}" != "" ]; then + HISTORY="history=${HISTORY} " +fi + +# Delay after which datafiles are to be compressed +COMPRESSAFTER=`${ASK} 'Number of days after which sar datafiles must be compressed:' "compressafter" "compressafter"` +if [ "${COMPRESSAFTER}" != "" ]; then + COMPRESSAFTER="compressafter=${COMPRESSAFTER} " +fi + +# Manual page group +MAN=`${ASK} 'Group for manual pages:' "man_group" "man_group"` +if [ "${MAN}" != "" ]; then + MAN="man_group=${MAN} " +fi + +# Ignore man_group variable +IGNORE_MAN=`${ASK} 'Ignore contents of man_group variable? (y/n)' "--disable-man-group" "ignore-man-group"` +if [ "${IGNORE_MAN}" = "y" ]; then + IGNORE_MAN="--disable-man-group " +else + IGNORE_MAN="" + echo "Parameter --disable-man-group is NOT set" +fi + +# Crontab +CRON=`${ASK} 'Set crontab to start sar automatically? (y/n)' "--enable-install-cron" "install-cron"` +if [ "${CRON}" = "y" ]; then + CRON="--enable-install-cron " +else + CRON="" + echo "Parameter --enable-install-cron is NOT set" +fi + +if [ "${CRON}" != "" ]; +then + CRON_OWNER=`${ASK} 'Crontab owner:' "cron_owner" "cron_owner"` + if [ "${CRON_OWNER}" != "" ]; then + CRON="${CRON}cron_owner=${CRON_OWNER} " + fi +fi + +if [ "${CRON}" != "" ]; +then + CRON_INTERVAL=`${ASK} 'Crontab sampling interval (in minutes):' "cron_interval" "cron_interval"` + if [ "${CRON_INTERVAL}" != "" ]; then + CRON="${CRON}cron_interval=${CRON_INTERVAL} " + fi +fi + +if [ "${CRON}" != "" ]; +then + # rc directory + RCDIR=`${ASK} 'rc directory:' "rcdir" "rcdir"` + if [ "${RCDIR}" != "" ]; then + RCDIR="rcdir=${RCDIR} " + fi +fi + +# Compress manual pages +COMPRESSMANPG=`${ASK} 'Compress manual pages? (y/n)' "--enable-compress-manpg" "compress-manpg"` +if [ "${COMPRESSMANPG}" = "y" ]; then + COMPRESSMANPG="--enable-compress-manpg " +else + COMPRESSMANPG="" + echo "Parameter --enable-compress-manpg is NOT set" +fi + +# Install documentation +INSTALL_DOC=`${ASK} 'Skip documentation installation? (y/n)' "--disable-documentation" "install-doc"` +if [ "${INSTALL_DOC}" = "y" ]; then + INSTALL_DOC="--disable-documentation " +else + INSTALL_DOC="" + echo "Parameter --disable-documentation is NOT set" +fi + +# Debug mode +DEBUGINFO=`${ASK} 'Debug mode support? (y/n)' "--enable-debuginfo" "debuginfo"` +if [ "${DEBUGINFO}" = "y" ]; then + DEBUGINFO="--enable-debuginfo " +else + DEBUGINFO="" + echo "Parameter --enable-debuginfo is NOT set" +fi + +# Install isag script +INSTALL_ISAG=`${ASK} 'Install isag script? (y/n)' "--enable-install-isag" "install-isag"` +if [ "${INSTALL_ISAG}" = "y" ]; then + INSTALL_ISAG="--enable-install-isag " +else + INSTALL_ISAG="" + echo "Parameter --enable-install-isag is NOT set" +fi + +echo +echo "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \ +${YESTERDAY}${HISTORY}${COMPRESSAFTER}${MAN}${IGNORE_MAN}${CRON}${RCDIR} \ +${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS}" +echo + +./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \ +${YESTERDAY}${HISTORY}${COMPRESSAFTER}${MAN}${IGNORE_MAN}${CRON}${RCDIR} \ +${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS} + diff --git a/ioconf.c b/ioconf.c new file mode 100644 index 00000000..b6b99942 --- /dev/null +++ b/ioconf.c @@ -0,0 +1,515 @@ +/* + * ioconf: ioconf configuration file handling code + * Original code (C) 2004 by Red Hat (Charlie Bennett ) + * + * Modified and maintained by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include + +#include "ioconf.h" +#include "common.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +static unsigned int ioc_parsed = 0; +static struct ioc_entry *ioconf[MAX_BLKDEV + 1]; +static unsigned int ioc_refnr[MAX_BLKDEV + 1]; + +/* + *************************************************************************** + * Free ioc_entry structures + *************************************************************************** + */ +static void ioc_free(void) +{ + unsigned int i; + struct ioc_entry **p; + + /* Take out all of the references first */ + for (i = 0, p = ioconf; i < MAX_BLKDEV; ++i, ++p) { + if ((*p == NULL) || ((*p)->live)) + continue; + + if ((*p)->desc != (*p)->blkp->desc) { + /* Not a shared description */ + free((*p)->desc); + } + free(*p); + *p = NULL; + } + + /* Now the live ones */ + for (i = 0, p = ioconf; i < MAX_BLKDEV; ++i, ++p) { + if (*p == NULL) + continue; + free((*p)->blkp); + free(*p); + *p = NULL; + } +} + +/* + *************************************************************************** + * ioc_conv - Turn a number into a string in radix using symbol + * set (and ordering) syms. Use nozero to generate strings + * in which the number system uses a single sym for the + * radix value (not 2, like decimal) and adds a column only + * at radix+1. If decimal were like this: + * + * (no zero) 1 2 3 4 5 6 7 8 9 0 11 12 13 14 15 16 17 18 19 10 ... + *************************************************************************** + */ +static char *ioc_conv(int radix, int nozero, const char *syms, + unsigned int val) +{ + static char out[17]; + char *p; + int j; + + *(p = out + 16) = '\0'; + + val += nozero; + + if (val == 0) { + if (!nozero) { + *--p = '0'; + } + return (p); /* Empty string if nozero radix gets val == 0 */ + } + + while (val > 0) { + *--p = syms[j = val % radix]; + val /= radix; + if (nozero && (j == 0)) { + /* Comp for 10 in nozero bases */ + --val; + } + } + return (p); +} + +char *ioc_ito10(unsigned int n) +{ + return (ioc_conv(10, 0, "0123456789", n)); +} + +char *ioc_ito26(unsigned int n) +{ + return (ioc_conv(26, 1, "zabcdefghijklmnopqrstuvwxy", n)); +} + +/* + *************************************************************************** + * ioc_init() - internalize the ioconf file + * + * given: void + * does: parses IOCONF into ioconf, an array of ioc_entry * + * Only entries having lines in IOCONF will have valid pointers + * return: 1 on success + * 0 on failure + *************************************************************************** + */ +int ioc_init(void) +{ + FILE *fp; + unsigned int i, major, indirect, count = 0; + char buf[IOC_LINESIZ + 1]; + char cfmt[IOC_FMTLEN + 1]; + char dfmt[IOC_FMTLEN + 1]; + char pfmt[IOC_FMTLEN + 1]; + char desc[IOC_DESCLEN + 1]; + struct ioc_entry *iocp = NULL; + struct blk_config *blkp = NULL; + char ioconf_name[64]; + + if ((fp = fopen(IOCONF, "r")) == NULL) { + if ((fp = fopen(LOCAL_IOCONF, "r")) == NULL) + return 0; + strncpy(ioconf_name, LOCAL_IOCONF, 64); + } + else { + strncpy(ioconf_name, IOCONF, 64); + } + ioconf_name[63] = '\0'; + + /* Init ioc_refnr array */ + memset(ioc_refnr, 0, sizeof(ioc_refnr)); + + while (fgets(buf, IOC_LINESIZ, fp)) { + + if ((*buf == '#') || (*buf == '\n')) + continue; + + /* + * Preallocate some (probably) needed data structures + */ + IOC_ALLOC(blkp, struct blk_config, BLK_CONFIG_SIZE); + IOC_ALLOC(iocp, struct ioc_entry, IOC_ENTRY_SIZE); + memset(blkp, 0, BLK_CONFIG_SIZE); + memset(iocp, 0, IOC_ENTRY_SIZE); + + i = sscanf(buf, "%u:%u:%u:%s", + &major, &indirect, &iocp->ctrlno, desc); + + if (i != 4) { + i = sscanf(buf, "%u:%u:%u", + &major, &indirect, &iocp->ctrlno); + } + + if ((i == 3) || (i == 4)) { + /* indirect record */ + if (indirect == 0) { + /* conventional usage for unsupported device */ + continue; + } + if (indirect >= MAX_BLKDEV) { + fprintf(stderr, "%s: Indirect major #%u out of range\n", + ioconf_name, indirect); + continue; + } + if (ioconf[indirect] == NULL) { + fprintf(stderr, + "%s: Indirect record '%u:%u:%u:...'" + " references not yet seen major %u\n", + ioconf_name, major, indirect, iocp->ctrlno, major); + continue; + } + /* + * Cool. Point this device at its referent. + * Skip last: (last field my be empty...) + * if it was empty and : was in the sscanf spec + * we'd only see 3 fields... + */ + if (i == 3) { + /* reference the mothership */ + iocp->desc = ioconf[indirect]->blkp->desc; + } + else { + IOC_ALLOC(iocp->desc, char, IOC_DESCLEN + 1); + strncpy(iocp->desc, desc, IOC_DESCLEN); + } + ioc_refnr[indirect]++; + ioconf[major] = iocp; + iocp->basemajor = indirect; + iocp->blkp = ioconf[indirect]->blkp; + iocp->live = 0; + iocp = NULL; + continue; + /* all done with indirect record */ + } + + /* maybe it's a full record? */ + + i = sscanf(buf, "%u:%[^:]:%[^:]:%d:%[^:]:%u:%[^:]:%u:%s", + &major, blkp->name, + cfmt, &iocp->ctrlno, + dfmt, &blkp->dcount, + pfmt, &blkp->pcount, + desc); + + if (i != 9) { + fprintf(stderr, "%s: Malformed %d field record: %s\n", + ioconf_name, i, buf); + continue; + } + + /* this is a full-fledged direct record */ + + if ((major == 0) || (major >= MAX_BLKDEV)) { + fprintf(stderr, "%s: major #%u out of range\n", + __FUNCTION__, major); + continue; + } + + /* is this an exception record? */ + if (*cfmt == 'x') { + struct blk_config *xblkp; + + /* + * device has an aliased minor + * for now we only support on exception per major + * (catering to initrd: (1,250)) + */ + if (ioconf[major] == NULL) { + fprintf(stderr, "%s: type 'x' record for" + " major #%u must follow the base record - ignored\n", + ioconf_name, major); + continue; + } + xblkp = ioconf[major]->blkp; + + if (xblkp->ext) { + /* + * Enforce one minor exception per major policy + * note: this applies to each major number and + * all of it's indirect (short form) majors + */ + fprintf(stderr, "%s: duplicate 'x' record for" + " major #%u - ignored\ninput line: %s\n", + ioconf_name, major, buf); + continue; + } + /* + * Decorate the base major struct with the + * exception info + */ + xblkp->ext_minor = iocp->ctrlno; + strcpy(xblkp->ext_name, blkp->name); + xblkp->ext = 1; + continue; + } + + /* + * Preformat the sprintf format strings for generating + * c-d-p info in ioc_name() + */ + + /* basename of device + provided string + controller # */ + if (*cfmt == '*') { + strcpy(blkp->cfmt, blkp->name); + } + else { + sprintf(blkp->cfmt, "%s%s%%d", blkp->name, cfmt); + ++(blkp->ctrl_explicit); + } + + /* Disk */ + *blkp->dfmt = '\0'; + switch (*dfmt) { + case 'a': + blkp->cconv = ioc_ito26; + strcpy(blkp->dfmt, "%s"); + break; + + case '%': + strcpy(blkp->dfmt, dfmt + 1); + case 'd': + blkp->cconv = ioc_ito10; + strcat(blkp->dfmt, "%s"); + break; + } + + /* Partition */ + sprintf(blkp->pfmt, "%s%%d", (*pfmt == '*') ? "" : pfmt); + + /* + * We're good to go. + * Stuff the ioc_entry and ref it. + */ + iocp->live = 1; + iocp->blkp = blkp; + iocp->desc = NULL; + iocp->basemajor = major; + ioconf[major] = iocp; + strncpy(blkp->desc, desc, IOC_DESCLEN); + blkp = NULL; iocp = NULL; + ++count; + } + fclose(fp); + + /* + * These will become leaks if we ever 'continue' + * after IOC_ALLOC( blkp->desc ... ). + * Right Now, we don't. + */ + if (blkp != NULL) + free(blkp); + if (iocp != NULL) + free(iocp); + + /* Indicate that ioconf file has been parsed */ + ioc_parsed = 1; + + return (count); +} + +/* + *************************************************************************** + * ioc_name() - Generate a name from a maj,min pair + * + * IN: + * @major Device major number. + * @minor Device minor number. + * + * RETURNS: + * Returns NULL if major or minor are out of range + * otherwise returns a pointer to a static string containing + * the generated name. + *************************************************************************** + */ + +char *ioc_name(unsigned int major, unsigned int minor) +{ + static char name[IOC_DEVLEN + 1]; + struct ioc_entry *p; + int base, offset; + + if ((MAX_BLKDEV <= major) || (IOC_MAXMINOR <= minor)) { + return (NULL); + } + + if (!ioc_parsed && !ioc_init()) + return (NULL); + + p = ioconf[major]; + + /* Invalid major or minor numbers? */ + if ((p == NULL) || ((minor & 0xff) >= (p->blkp->dcount * p->blkp->pcount))) { + /* + * That minor test is only there for IDE-style devices + * that have no minors over 128. + */ + strcpy(name, K_NODEV); + return (name); + } + + /* Is this an extension record? */ + if (p->blkp->ext && (p->blkp->ext_minor == minor)) { + strcpy(name, p->blkp->ext_name); + return (name); + } + + /* OK. we're doing an actual device name... */ + + /* + * Assemble base + optional controller info + * this is of course too clever by half + * the parser has already cooked cfmt, dfmt to make this easy + * (we parse once but may generate lots of names) + */ + base = p->ctrlno * p->blkp->dcount; + if (minor >= 256) { + base += p->blkp->dcount * (ioc_refnr[p->basemajor] + 1) * (minor >> 8); + } + + offset = (minor & 0xff) / p->blkp->pcount; + if (!p->blkp->ctrl_explicit) { + offset += base; + } + + /* + * These sprintfs can't be coalesced because the first might + * ignore its first arg + */ + sprintf(name, p->blkp->cfmt, p->ctrlno); + sprintf(name + strlen(name), p->blkp->dfmt, p->blkp->cconv(offset)); + + if (!IS_WHOLE(major, minor)) { + /* + * Tack on partition info, format string cooked (curried?) by + * the parser + */ + sprintf(name + strlen(name), p->blkp->pfmt, minor % p->blkp->pcount); + } + return (name); +} + +/* + *************************************************************************** + * Check whether a device is a whole disk device or not. + * + * IN: + * @major Device major number. + * @minor Device minor number. + * + * RETURNS: + * Predicate: Returns 1 if dev (major,minor) is a whole disk device. + * Returns 0 otherwise. + *************************************************************************** + */ +int ioc_iswhole(unsigned int major, unsigned int minor) +{ + if (!ioc_parsed && !ioc_init()) + return 0; + + if (major >= MAX_BLKDEV) + /* + * Later: Handle Linux long major numbers here. + * Now: This is an error. + */ + return 0; + + if (ioconf[major] == NULL) + /* Device not registered */ + return 0 ; + + return (IS_WHOLE(major, minor)); +} + +/* + *************************************************************************** + * Transform device mapper name: Get the user assigned name of the logical + * device instead of the internal device mapper numbering. + * + * IN: + * @major Device major number. + * @minor Device minor number. + * + * RETURNS: + * Assigned name of the logical device. + *************************************************************************** + */ +char *transform_devmapname(unsigned int major, unsigned int minor) +{ + DIR *dm_dir; + struct dirent *dp; + char filen[MAX_FILE_LEN]; + char *dm_name = NULL; + struct stat aux; + unsigned int dm_major, dm_minor; + + if ((dm_dir = opendir(DEVMAP_DIR)) == NULL) { + fprintf(stderr, _("Cannot open %s: %s\n"), DEVMAP_DIR, strerror(errno)); + exit(4); + } + + while ((dp = readdir(dm_dir)) != NULL) { + /* For each file in DEVMAP_DIR */ + + snprintf(filen, MAX_FILE_LEN, "%s/%s", DEVMAP_DIR, dp->d_name); + filen[MAX_FILE_LEN - 1] = '\0'; + + if (stat(filen, &aux) == 0) { + /* Get its minor and major numbers */ + + dm_major = ((aux.st_rdev >> 8) & 0xff); + dm_minor = (aux.st_rdev & 0xff); + + if ((dm_minor == minor) && (dm_major == major)) { + dm_name = dp->d_name; + break; + } + } + } + closedir(dm_dir); + + return dm_name; +} diff --git a/ioconf.h b/ioconf.h new file mode 100644 index 00000000..c704cf82 --- /dev/null +++ b/ioconf.h @@ -0,0 +1,84 @@ +/* + * ioconf: ioconf configuration file handling code + * Original code (C) 2004 by Red Hat (Charlie Bennett ) + * + * Modified and maintained by Sebastien GODARD (sysstat orange.fr) + */ + +#ifndef _IOCONF_H +#define _IOCONF_H + +#include "sysconfig.h" + +#define IOC_NAMELEN 31 +#define IOC_DESCLEN 63 +#define IOC_DEVLEN 47 +#define IOC_MAXMINOR 2047 +#define IOC_LINESIZ 255 +#define IOC_PARTLEN 7 +#define IOC_FMTLEN 15 + +#ifndef MAX_BLKDEV +#define MAX_BLKDEV 255 +#endif + +#define K_NODEV "nodev" + +#define IS_WHOLE(maj,min) ((min % ioconf[maj]->blkp->pcount) == 0) + +/* + * When is C going to get templates? + */ +#define IOC_ALLOC(P,TYPE,SIZE) \ + do { \ + if (P == NULL) { \ + P = (TYPE *) malloc(SIZE); \ + if (P == NULL) { \ + perror("malloc"); \ + ioc_free(); \ + return 0; \ + } \ + } \ + } \ + while (0) +/* That dummy while allows ';' on the line that invokes the macro... */ + + +struct blk_config { + char name[IOC_NAMELEN + 1]; /* device basename */ + char cfmt[IOC_FMTLEN + 1]; /* controller format string */ + char dfmt[IOC_FMTLEN + 1]; /* disk format string */ + char pfmt[IOC_FMTLEN + 1]; /* partition format string */ + /* ctrlno is in the ioc_entry */ + unsigned int ctrl_explicit; /* use "cN" in name */ + unsigned int dcount; /* number of devices handled by this major */ + unsigned int pcount; /* partitions per device */ + char desc[IOC_DESCLEN + 1]; + /* disk info unit # conversion function */ + char *(*cconv)(unsigned int); + + /* extension properties (all this for initrd?) */ + char ext_name[IOC_NAMELEN + 1]; + unsigned int ext; /* flag - this is an extension record */ + unsigned int ext_minor; /* which minor does this apply to */ +}; + +#define BLK_CONFIG_SIZE (sizeof(struct blk_config)) + + +struct ioc_entry { + int live; /* is this a Direct entry? */ + unsigned int ctrlno; /* controller number */ + unsigned int basemajor; /* Major number of the template */ + char *desc; /* (dynamic) per-controller description */ + struct blk_config *blkp; /* the real info, may be a shared ref */ +}; + +#define IOC_ENTRY_SIZE (sizeof(struct ioc_entry)) + + +extern int ioc_iswhole(unsigned int, unsigned int); +extern char *ioc_name(unsigned int, unsigned int); +extern char *transform_devmapname(unsigned int, unsigned int); + +#endif diff --git a/iostat.c b/iostat.c new file mode 100644 index 00000000..0b98b169 --- /dev/null +++ b/iostat.c @@ -0,0 +1,1325 @@ +/* + * iostat: report CPU and I/O statistics + * (C) 1998-2009 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "version.h" +#include "iostat.h" +#include "common.h" +#include "ioconf.h" +#include "rd_stats.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__ +char *sccsid(void) { return (SCCSID); } + +struct stats_cpu *st_cpu[2]; +unsigned long long uptime[2] = {0, 0}; +unsigned long long uptime0[2] = {0, 0}; +struct io_stats *st_iodev[2]; +struct io_hdr_stats *st_hdr_iodev; +struct io_dlist *st_dev_list; + +int iodev_nr = 0; /* Nb of devices and partitions found */ +int cpu_nr = 0; /* Nb of processors on the machine */ +int dlist_idx = 0; /* Nb of devices entered on the command line */ +int flags = 0; /* Flag for common options and system state */ + +long interval = 0; +char timestamp[64]; + + +/* + *************************************************************************** + * Print usage and exit. + * + * IN: + * @progname Name of sysstat command. + *************************************************************************** + */ +void usage(char *progname) +{ + fprintf(stderr, _("Usage: %s [ options ] [ [ ] ]\n"), + progname); +#ifdef DEBUG + fprintf(stderr, _("Options are:\n" + "[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" + "[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n")); +#else + fprintf(stderr, _("Options are:\n" + "[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" + "[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n")); +#endif + exit(1); +} + +/* + *************************************************************************** + * Set disk output unit. Unit will be kB/s unless POSIXLY_CORRECT + * environment variable has been set, in which case the output will be + * expressed in blocks/s. + *************************************************************************** + */ +void set_disk_output_unit(void) +{ + char *e; + + if (DISPLAY_KILOBYTES(flags) || DISPLAY_MEGABYTES(flags)) + return; + + /* Check POSIXLY_CORRECT environment variable */ + if ((e = getenv(ENV_POSIXLY_CORRECT)) == NULL) { + /* Variable not set: Unit is kB/s and not blocks/s */ + flags |= I_D_KILOBYTES; + } +} + +/* + *************************************************************************** + * SIGALRM signal handler. + * + * IN: + * @sig Signal number. Set to 0 for the first time, then to SIGALRM. + *************************************************************************** + */ +void alarm_handler(int sig) +{ + signal(SIGALRM, alarm_handler); + alarm(interval); +} + +/* + *************************************************************************** + * Initialize stats common structures. + *************************************************************************** + */ +void init_stats(void) +{ + int i; + + /* Allocate structures for CPUs "all" and 0 */ + for (i = 0; i < 2; i++) { + if ((st_cpu[i] = (struct stats_cpu *) malloc(STATS_CPU_SIZE * 2)) == NULL) { + perror("malloc"); + exit(4); + } + memset(st_cpu[i], 0, STATS_CPU_SIZE * 2); + } +} + +/* + *************************************************************************** + * Set every disk_io entry to inactive state (unregistered). + * + * IN: + * @ioln_nr Number of devices and partitions. + * @st_hdr_ioln Pointer on first structure describing a device/partition. + *************************************************************************** + */ +void set_entries_inactive(int ioln_nr, struct io_hdr_stats *st_hdr_ioln) +{ + int i; + struct io_hdr_stats *shi = st_hdr_ioln; + + for (i = 0; i < ioln_nr; i++, shi++) { + shi->active = FALSE; + } +} + +/* + *************************************************************************** + * Free inactive entries (mark them as unused). + * + * IN: + * @ioln_nr Number of devices and partitions. + * @st_hdr_ioln Pointer on first structure describing a device/partition. + *************************************************************************** + */ +void free_inactive_entries(int ioln_nr, struct io_hdr_stats *st_hdr_ioln) +{ + int i; + struct io_hdr_stats *shi = st_hdr_ioln; + + for (i = 0; i < ioln_nr; i++, shi++) { + if (!shi->active) { + shi->used = FALSE; + } + } +} + +/* + *************************************************************************** + * Allocate and init I/O device structures. + * + * IN: + * @iodev_nr Number of devices and partitions. + *************************************************************************** + */ +void salloc_device(int iodev_nr) +{ + int i; + + for (i = 0; i < 2; i++) { + if ((st_iodev[i] = + (struct io_stats *) malloc(IO_STATS_SIZE * iodev_nr)) == NULL) { + perror("malloc"); + exit(4); + } + memset(st_iodev[i], 0, IO_STATS_SIZE * iodev_nr); + } + + if ((st_hdr_iodev = + (struct io_hdr_stats *) malloc(IO_HDR_STATS_SIZE * iodev_nr)) == NULL) { + perror("malloc"); + exit(4); + } + memset(st_hdr_iodev, 0, IO_HDR_STATS_SIZE * iodev_nr); +} + +/* + *************************************************************************** + * Allocate structures for devices entered on the command line. + * + * IN: + * @list_len Number of arguments on the command line. + *************************************************************************** + */ +void salloc_dev_list(int list_len) +{ + if ((st_dev_list = (struct io_dlist *) malloc(IO_DLIST_SIZE * list_len)) == NULL) { + perror("malloc"); + exit(4); + } + memset(st_dev_list, 0, IO_DLIST_SIZE * list_len); +} + +/* + *************************************************************************** + * Free structures used for devices entered on the command line. + *************************************************************************** + */ +void sfree_dev_list(void) +{ + if (st_dev_list) { + free(st_dev_list); + } +} + +/* + *************************************************************************** + * Look for the device in the device list and store it if necessary. + * + * IN: + * @dlist_idx Length of the device list. + * @device_name Name of the device. + * + * OUT: + * @dlist_idx Length of the device list. + * + * RETURNS: + * Position of the device in the list. + *************************************************************************** + */ +int update_dev_list(int *dlist_idx, char *device_name) +{ + int i; + struct io_dlist *sdli = st_dev_list; + + for (i = 0; i < *dlist_idx; i++, sdli++) { + if (!strcmp(sdli->dev_name, device_name)) + break; + } + + if (i == *dlist_idx) { + /* Device not found: Store it */ + (*dlist_idx)++; + strncpy(sdli->dev_name, device_name, MAX_NAME_LEN - 1); + } + + return i; +} + +/* + *************************************************************************** + * Allocate and init structures, according to system state. + *************************************************************************** + */ +void io_sys_init(void) +{ + /* Allocate and init stat common counters */ + init_stats(); + + /* How many processors on this machine? */ + cpu_nr = get_cpu_nr(~0); + + /* Get number of block devices and partitions in /proc/diskstats */ + if ((iodev_nr = get_diskstats_dev_nr(CNT_PART, CNT_ALL_DEV)) > 0) { + flags |= I_F_HAS_DISKSTATS; + iodev_nr += NR_DEV_PREALLOC; + } + + if (!HAS_DISKSTATS(flags) || + (DISPLAY_PARTITIONS(flags) && !DISPLAY_PART_ALL(flags))) { + /* + * If /proc/diskstats exists but we also want stats for the partitions + * of a particular device, stats will have to be found in /sys. So we + * need to know if /sys is mounted or not, and set flags accordingly. + */ + + /* Get number of block devices (and partitions) in sysfs */ + if ((iodev_nr = get_sysfs_dev_nr(DISPLAY_PARTITIONS(flags))) > 0) { + flags |= I_F_HAS_SYSFS; + iodev_nr += NR_DEV_PREALLOC; + } + else { + fprintf(stderr, _("Cannot find disk data\n")); + exit(2); + } + } + /* + * Allocate structures for number of disks found. + * iodev_nr must be <> 0. + */ + salloc_device(iodev_nr); +} + +/* + *************************************************************************** + * Free various structures. + *************************************************************************** +*/ +void io_sys_free(void) +{ + int i; + + for (i = 0; i < 2; i++) { + + /* Free CPU structures */ + if (st_cpu[i]) { + free(st_cpu[i]); + } + + /* Free I/O device structures */ + if (st_iodev[i]) { + free(st_iodev[i]); + } + } + + if (st_hdr_iodev) { + free(st_hdr_iodev); + } +} + +/* + *************************************************************************** + * Save stats for current device or partition. + * + * IN: + * @name Name of the device/partition. + * @curr Index in array for current sample statistics. + * @st_io Structure with device or partition to save. + * @ioln_nr Number of devices and partitions. + * @st_hdr_ioln Pointer on structures describing a device/partition. + * + * OUT: + * @st_hdr_ioln Pointer on structures describing a device/partition. + *************************************************************************** + */ +void save_stats(char *name, int curr, void *st_io, int ioln_nr, + struct io_hdr_stats *st_hdr_ioln) +{ + int i; + struct io_hdr_stats *st_hdr_ioln_i; + struct io_stats *st_iodev_i; + + /* Look for device in data table */ + for (i = 0; i < ioln_nr; i++) { + st_hdr_ioln_i = st_hdr_ioln + i; + if (!strcmp(st_hdr_ioln_i->name, name)) { + break; + } + } + + if (i == ioln_nr) { + /* + * This is a new device: look for an unused entry to store it. + * Thus we are able to handle dynamically registered devices. + */ + for (i = 0; i < ioln_nr; i++) { + st_hdr_ioln_i = st_hdr_ioln + i; + if (!st_hdr_ioln_i->used) { + /* Unused entry found... */ + st_hdr_ioln_i->used = TRUE; /* Indicate it is now used */ + strcpy(st_hdr_ioln_i->name, name); + st_iodev_i = st_iodev[!curr] + i; + memset(st_iodev_i, 0, IO_STATS_SIZE); + break; + } + } + } + if (i < ioln_nr) { + st_hdr_ioln_i = st_hdr_ioln + i; + st_hdr_ioln_i->active = TRUE; + st_iodev_i = st_iodev[curr] + i; + *st_iodev_i = *((struct io_stats *) st_io); + } + /* + * else it was a new device + * but there was no free structure to store it. + */ +} + +/* + *************************************************************************** + * Read sysfs stat for current block device or partition. + * + * IN: + * @curr Index in array for current sample statistics. + * @filename File name where stats will be read. + * @dev_name Device or partition name. + * + * RETURNS: + * 0 if file couldn't be opened, 1 otherwise. + *************************************************************************** + */ +int read_sysfs_file_stat(int curr, char *filename, char *dev_name) +{ + FILE *fp; + struct io_stats sdev; + int i; + unsigned long rd_ios, rd_merges_or_rd_sec, rd_ticks_or_wr_sec, wr_ios; + unsigned long ios_pgr, tot_ticks, rq_ticks, wr_merges, wr_ticks; + unsigned long long rd_sec_or_wr_ios, wr_sec; + + /* Try to read given stat file */ + if ((fp = fopen(filename, "r")) == NULL) + return 0; + + i = fscanf(fp, "%lu %lu %llu %lu %lu %lu %llu %lu %lu %lu %lu", + &rd_ios, &rd_merges_or_rd_sec, &rd_sec_or_wr_ios, &rd_ticks_or_wr_sec, + &wr_ios, &wr_merges, &wr_sec, &wr_ticks, &ios_pgr, &tot_ticks, &rq_ticks); + + if (i == 11) { + /* Device or partition */ + sdev.rd_ios = rd_ios; + sdev.rd_merges = rd_merges_or_rd_sec; + sdev.rd_sectors = rd_sec_or_wr_ios; + sdev.rd_ticks = rd_ticks_or_wr_sec; + sdev.wr_ios = wr_ios; + sdev.wr_merges = wr_merges; + sdev.wr_sectors = wr_sec; + sdev.wr_ticks = wr_ticks; + sdev.ios_pgr = ios_pgr; + sdev.tot_ticks = tot_ticks; + sdev.rq_ticks = rq_ticks; + } + else if (i == 4) { + /* Partition without extended statistics */ + sdev.rd_ios = rd_ios; + sdev.rd_sectors = rd_merges_or_rd_sec; + sdev.wr_ios = rd_sec_or_wr_ios; + sdev.wr_sectors = rd_ticks_or_wr_sec; + } + + if ((i == 11) || !DISPLAY_EXTENDED(flags)) { + /* + * In fact, we _don't_ save stats if it's a partition without + * extended stats and yet we want to display ext stats. + */ + save_stats(dev_name, curr, &sdev, iodev_nr, st_hdr_iodev); + } + + fclose(fp); + + return 1; +} + +/* + *************************************************************************** + * Read sysfs stats for all the partitions of a device. + * + * IN: + * @curr Index in array for current sample statistics. + * @dev_name Device name. + *************************************************************************** + */ +void read_sysfs_dlist_part_stat(int curr, char *dev_name) +{ + DIR *dir; + struct dirent *drd; + char dfile[MAX_PF_NAME], filename[MAX_PF_NAME]; + + snprintf(dfile, MAX_PF_NAME, "%s/%s", SYSFS_BLOCK, dev_name); + dfile[MAX_PF_NAME - 1] = '\0'; + + /* Open current device directory in /sys/block */ + if ((dir = opendir(dfile)) == NULL) + return; + + /* Get current entry */ + while ((drd = readdir(dir)) != NULL) { + if (!strcmp(drd->d_name, ".") || !strcmp(drd->d_name, "..")) + continue; + snprintf(filename, MAX_PF_NAME, "%s/%s/%s", dfile, drd->d_name, S_STAT); + filename[MAX_PF_NAME - 1] = '\0'; + + /* Read current partition stats */ + read_sysfs_file_stat(curr, filename, drd->d_name); + } + + /* Close device directory */ + closedir(dir); +} + +/* + *************************************************************************** + * Read stats from the sysfs filesystem for the devices entered on the + * command line. + * + * IN: + * @curr Index in array for current sample statistics. + *************************************************************************** + */ +void read_sysfs_dlist_stat(int curr) +{ + int dev, ok; + char filename[MAX_PF_NAME]; + char *slash; + struct io_dlist *st_dev_list_i; + + /* Every I/O device (or partition) is potentially unregistered */ + set_entries_inactive(iodev_nr, st_hdr_iodev); + + for (dev = 0; dev < dlist_idx; dev++) { + st_dev_list_i = st_dev_list + dev; + + /* Some devices may have a slash in their name (eg. cciss/c0d0...) */ + while ((slash = strchr(st_dev_list_i->dev_name, '/'))) { + *slash = '!'; + } + + snprintf(filename, MAX_PF_NAME, "%s/%s/%s", + SYSFS_BLOCK, st_dev_list_i->dev_name, S_STAT); + filename[MAX_PF_NAME - 1] = '\0'; + + /* Read device stats */ + ok = read_sysfs_file_stat(curr, filename, st_dev_list_i->dev_name); + + if (ok && st_dev_list_i->disp_part) { + /* Also read stats for its partitions */ + read_sysfs_dlist_part_stat(curr, st_dev_list_i->dev_name); + } + } + + /* Free structures corresponding to unregistered devices */ + free_inactive_entries(iodev_nr, st_hdr_iodev); +} + +/* + *************************************************************************** + * Read stats from the sysfs filesystem for every block devices found. + * + * IN: + * @curr Index in array for current sample statistics. + *************************************************************************** + */ +void read_sysfs_stat(int curr) +{ + DIR *dir; + struct dirent *drd; + char filename[MAX_PF_NAME]; + int ok; + + /* Every I/O device entry is potentially unregistered */ + set_entries_inactive(iodev_nr, st_hdr_iodev); + + /* Open /sys/block directory */ + if ((dir = opendir(SYSFS_BLOCK)) != NULL) { + + /* Get current entry */ + while ((drd = readdir(dir)) != NULL) { + if (!strcmp(drd->d_name, ".") || !strcmp(drd->d_name, "..")) + continue; + snprintf(filename, MAX_PF_NAME, "%s/%s/%s", + SYSFS_BLOCK, drd->d_name, S_STAT); + filename[MAX_PF_NAME - 1] = '\0'; + + /* If current entry is a directory, try to read its stat file */ + ok = read_sysfs_file_stat(curr, filename, drd->d_name); + + /* + * If '-p ALL' was entered on the command line, + * also try to read stats for its partitions + */ + if (ok && DISPLAY_PART_ALL(flags)) { + read_sysfs_dlist_part_stat(curr, drd->d_name); + } + } + + /* Close /sys/block directory */ + closedir(dir); + } + + /* Free structures corresponding to unregistered devices */ + free_inactive_entries(iodev_nr, st_hdr_iodev); +} + +/* + *************************************************************************** + * Read stats from /proc/diskstats. + * + * IN: + * @curr Index in array for current sample statistics. + *************************************************************************** + */ +void read_diskstats_stat(int curr) +{ + FILE *fp; + char line[256], dev_name[MAX_NAME_LEN]; + char *dm_name; + struct io_stats sdev; + int i; + unsigned long rd_ios, rd_merges_or_rd_sec, rd_ticks_or_wr_sec, wr_ios; + unsigned long ios_pgr, tot_ticks, rq_ticks, wr_merges, wr_ticks; + unsigned long long rd_sec_or_wr_ios, wr_sec; + char *ioc_dname; + unsigned int major, minor; + + /* Every I/O device entry is potentially unregistered */ + set_entries_inactive(iodev_nr, st_hdr_iodev); + + if ((fp = fopen(DISKSTATS, "r")) == NULL) + return; + + while (fgets(line, 256, fp) != NULL) { + + /* major minor name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq */ + i = sscanf(line, "%u %u %s %lu %lu %llu %lu %lu %lu %llu %lu %lu %lu %lu", + &major, &minor, dev_name, + &rd_ios, &rd_merges_or_rd_sec, &rd_sec_or_wr_ios, &rd_ticks_or_wr_sec, + &wr_ios, &wr_merges, &wr_sec, &wr_ticks, &ios_pgr, &tot_ticks, &rq_ticks); + + if (i == 14) { + /* Device or partition */ + if (!dlist_idx && !DISPLAY_PARTITIONS(flags) && !is_device(dev_name)) + continue; + sdev.rd_ios = rd_ios; + sdev.rd_merges = rd_merges_or_rd_sec; + sdev.rd_sectors = rd_sec_or_wr_ios; + sdev.rd_ticks = rd_ticks_or_wr_sec; + sdev.wr_ios = wr_ios; + sdev.wr_merges = wr_merges; + sdev.wr_sectors = wr_sec; + sdev.wr_ticks = wr_ticks; + sdev.ios_pgr = ios_pgr; + sdev.tot_ticks = tot_ticks; + sdev.rq_ticks = rq_ticks; + } + else if (i == 7) { + /* Partition without extended statistics */ + if (DISPLAY_EXTENDED(flags) || + (!dlist_idx && !DISPLAY_PARTITIONS(flags))) + continue; + + sdev.rd_ios = rd_ios; + sdev.rd_sectors = rd_merges_or_rd_sec; + sdev.wr_ios = rd_sec_or_wr_ios; + sdev.wr_sectors = rd_ticks_or_wr_sec; + } + else + /* Unknown entry: Ignore it */ + continue; + + if ((ioc_dname = ioc_name(major, minor)) != NULL) { + if (strcmp(dev_name, ioc_dname) && strcmp(ioc_dname, K_NODEV)) { + /* + * No match: Use name generated from sysstat.ioconf data + * (if different from "nodev") works around known issues + * with EMC PowerPath. + */ + strncpy(dev_name, ioc_dname, MAX_NAME_LEN); + } + } + + if ((DISPLAY_DEVMAP_NAME(flags)) && (major == DEVMAP_MAJOR)) { + /* + * If the device is a device mapper device, try to get its + * assigned name of its logical device. + */ + dm_name = transform_devmapname(major, minor); + if (dm_name) { + strcpy(dev_name, dm_name); + } + } + + save_stats(dev_name, curr, &sdev, iodev_nr, st_hdr_iodev); + } + fclose(fp); + + /* Free structures corresponding to unregistered devices */ + free_inactive_entries(iodev_nr, st_hdr_iodev); +} + +/* + *************************************************************************** + * Display CPU utilization. + * + * IN: + * @curr Index in array for current sample statistics. + * @itv Interval of time. + *************************************************************************** + */ +void write_cpu_stat(int curr, unsigned long long itv) +{ + printf("avg-cpu: %%user %%nice %%system %%iowait %%steal %%idle\n"); + + printf(" %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f\n\n", + ll_sp_value(st_cpu[!curr]->cpu_user, st_cpu[curr]->cpu_user, itv), + ll_sp_value(st_cpu[!curr]->cpu_nice, st_cpu[curr]->cpu_nice, itv), + /* + * Time spent in system mode also includes time spent servicing + * hard and soft interrupts. + */ + ll_sp_value(st_cpu[!curr]->cpu_sys + st_cpu[!curr]->cpu_softirq + + st_cpu[!curr]->cpu_hardirq, + st_cpu[curr]->cpu_sys + st_cpu[curr]->cpu_softirq + + st_cpu[curr]->cpu_hardirq, itv), + ll_sp_value(st_cpu[!curr]->cpu_iowait, st_cpu[curr]->cpu_iowait, itv), + ll_sp_value(st_cpu[!curr]->cpu_steal, st_cpu[curr]->cpu_steal, itv), + (st_cpu[curr]->cpu_idle < st_cpu[!curr]->cpu_idle) ? + 0.0 : + ll_sp_value(st_cpu[!curr]->cpu_idle, st_cpu[curr]->cpu_idle, itv)); +} + +/* + *************************************************************************** + * Display disk stats header. + * + * OUT: + * @fctr Conversion factor. + *************************************************************************** + */ +void write_disk_stat_header(int *fctr) +{ + if (DISPLAY_EXTENDED(flags)) { + /* Extended stats */ + printf("Device: rrqm/s wrqm/s r/s w/s"); + if (DISPLAY_MEGABYTES(flags)) { + printf(" rMB/s wMB/s"); + *fctr = 2048; + } + else if (DISPLAY_KILOBYTES(flags)) { + printf(" rkB/s wkB/s"); + *fctr = 2; + } + else { + printf(" rsec/s wsec/s"); + } + printf(" avgrq-sz avgqu-sz await r_await w_await svctm %%util\n"); + } + else { + /* Basic stats */ + printf("Device: tps"); + if (DISPLAY_KILOBYTES(flags)) { + printf(" kB_read/s kB_wrtn/s kB_read kB_wrtn\n"); + *fctr = 2; + } + else if (DISPLAY_MEGABYTES(flags)) { + printf(" MB_read/s MB_wrtn/s MB_read MB_wrtn\n"); + *fctr = 2048; + } + else { + printf(" Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn\n"); + } + } +} + +/* + *************************************************************************** + * Display extended stats, read from /proc/{diskstats,partitions} or /sys. + * + * IN: + * @curr Index in array for current sample statistics. + * @itv Interval of time. + * @fctr Conversion factor. + * @shi Structures describing the devices and partitions. + * @ioi Current sample statistics. + * @ioj Previous sample statistics. + *************************************************************************** + */ +void write_ext_stat(int curr, unsigned long long itv, int fctr, + struct io_hdr_stats *shi, struct io_stats *ioi, + struct io_stats *ioj) +{ + struct stats_disk sdc, sdp; + struct ext_disk_stats xds; + double r_await, w_await; + + /* + * Counters overflows are possible, but don't need to be handled in + * a special way: the difference is still properly calculated if the + * result is of the same type as the two values. + * Exception is field rq_ticks which is incremented by the number of + * I/O in progress times the number of milliseconds spent doing I/O. + * But the number of I/O in progress (field ios_pgr) happens to be + * sometimes negative... + */ + sdc.nr_ios = ioi->rd_ios + ioi->wr_ios; + sdp.nr_ios = ioj->rd_ios + ioj->wr_ios; + + sdc.tot_ticks = ioi->tot_ticks; + sdp.tot_ticks = ioj->tot_ticks; + + sdc.rd_ticks = ioi->rd_ticks; + sdp.rd_ticks = ioj->rd_ticks; + sdc.wr_ticks = ioi->wr_ticks; + sdp.wr_ticks = ioj->wr_ticks; + + sdc.rd_sect = ioi->rd_sectors; + sdp.rd_sect = ioj->rd_sectors; + sdc.wr_sect = ioi->wr_sectors; + sdp.wr_sect = ioj->wr_sectors; + + compute_ext_disk_stats(&sdc, &sdp, itv, &xds); + + r_await = (ioi->rd_ios - ioj->rd_ios) ? + (ioi->rd_ticks - ioj->rd_ticks) / + ((double) (ioi->rd_ios - ioj->rd_ios)) : 0.0; + w_await = (ioi->wr_ios - ioj->wr_ios) ? + (ioi->wr_ticks - ioj->wr_ticks) / + ((double) (ioi->wr_ios - ioj->wr_ios)) : 0.0; + + /* DEV rrq/s wrq/s r/s w/s rsec wsec rqsz qusz await r_await w_await svctm %util */ + printf("%-13s %8.2f %8.2f %7.2f %7.2f %8.2f %8.2f %8.2f %8.2f %7.2f %7.2f %7.2f %6.2f %6.2f\n", + shi->name, + S_VALUE(ioj->rd_merges, ioi->rd_merges, itv), + S_VALUE(ioj->wr_merges, ioi->wr_merges, itv), + S_VALUE(ioj->rd_ios, ioi->rd_ios, itv), + S_VALUE(ioj->wr_ios, ioi->wr_ios, itv), + ll_s_value(ioj->rd_sectors, ioi->rd_sectors, itv) / fctr, + ll_s_value(ioj->wr_sectors, ioi->wr_sectors, itv) / fctr, + xds.arqsz, + S_VALUE(ioj->rq_ticks, ioi->rq_ticks, itv) / 1000.0, + xds.await, + r_await, + w_await, + /* The ticks output is biased to output 1000 ticks per second */ + xds.svctm, + /* Again: Ticks in milliseconds */ + xds.util / 10.0); +} + +/* + *************************************************************************** + * Write basic stats, read from /proc/diskstats or from sysfs. + * + * IN: + * @curr Index in array for current sample statistics. + * @itv Interval of time. + * @fctr Conversion factor. + * @shi Structures describing the devices and partitions. + * @ioi Current sample statistics. + * @ioj Previous sample statistics. + *************************************************************************** + */ +void write_basic_stat(int curr, unsigned long long itv, int fctr, + struct io_hdr_stats *shi, struct io_stats *ioi, + struct io_stats *ioj) +{ + unsigned long long rd_sec, wr_sec; + + printf("%-13s", shi->name); + + /* Print stats coming from /sys or /proc/diskstats */ + rd_sec = ioi->rd_sectors - ioj->rd_sectors; + if ((ioi->rd_sectors < ioj->rd_sectors) && (ioj->rd_sectors <= 0xffffffff)) { + rd_sec &= 0xffffffff; + } + wr_sec = ioi->wr_sectors - ioj->wr_sectors; + if ((ioi->wr_sectors < ioj->wr_sectors) && (ioj->wr_sectors <= 0xffffffff)) { + wr_sec &= 0xffffffff; + } + + printf(" %8.2f %12.2f %12.2f %10llu %10llu\n", + S_VALUE(ioj->rd_ios + ioj->wr_ios, ioi->rd_ios + ioi->wr_ios, itv), + ll_s_value(ioj->rd_sectors, ioi->rd_sectors, itv) / fctr, + ll_s_value(ioj->wr_sectors, ioi->wr_sectors, itv) / fctr, + (unsigned long long) rd_sec / fctr, + (unsigned long long) wr_sec / fctr); +} + +/* + *************************************************************************** + * Print everything now (stats and uptime). + * + * IN: + * @curr Index in array for current sample statistics. + * @rectime Current date and time. + *************************************************************************** + */ +void write_stats(int curr, struct tm *rectime) +{ + int dev, i, fctr = 1; + unsigned long long itv; + struct io_hdr_stats *shi; + struct io_dlist *st_dev_list_i; + + /* Test stdout */ + TEST_STDOUT(STDOUT_FILENO); + + /* Print time stamp */ + if (DISPLAY_TIMESTAMP(flags)) { + if (DISPLAY_ISO(flags)) { + strftime(timestamp, sizeof(timestamp), "%FT%T%z", rectime); + } + else { + strftime(timestamp, sizeof(timestamp), "%x %X", rectime); + } + printf("%s\n", timestamp); +#ifdef DEBUG + if (DISPLAY_DEBUG(flags)) { + fprintf(stderr, "%s\n", timestamp); + } +#endif + } + + /* Interval is multiplied by the number of processors */ + itv = get_interval(uptime[!curr], uptime[curr]); + + if (DISPLAY_CPU(flags)) { +#ifdef DEBUG + if (DISPLAY_DEBUG(flags)) { + /* Debug output */ + fprintf(stderr, "itv=%llu st_cpu[curr]{ cpu_user=%llu cpu_nice=%llu " + "cpu_sys=%llu cpu_idle=%llu cpu_iowait=%llu cpu_steal=%llu " + "cpu_hardirq=%llu cpu_softirq=%llu cpu_guest=%llu }\n", + itv, + st_cpu[curr]->cpu_user, + st_cpu[curr]->cpu_nice, + st_cpu[curr]->cpu_sys, + st_cpu[curr]->cpu_idle, + st_cpu[curr]->cpu_iowait, + st_cpu[curr]->cpu_steal, + st_cpu[curr]->cpu_hardirq, + st_cpu[curr]->cpu_softirq, + st_cpu[curr]->cpu_guest + ); + } +#endif + + /* Display CPU utilization */ + write_cpu_stat(curr, itv); + } + + if (cpu_nr > 1) { + /* On SMP machines, reduce itv to one processor (see note above) */ + itv = get_interval(uptime0[!curr], uptime0[curr]); + } + + if (DISPLAY_DISK(flags)) { + struct io_stats *ioi, *ioj; + + shi = st_hdr_iodev; + + /* Display disk stats header */ + write_disk_stat_header(&fctr); + + for (i = 0; i < iodev_nr; i++, shi++) { + if (shi->used) { + + if (dlist_idx && !HAS_SYSFS(flags)) { + /* + * With sysfs, only stats for the requested + * devices are read. + * With /proc/diskstats, stats for + * every device are read. Thus we need to check + * if stats for current device are to be displayed. + */ + for (dev = 0; dev < dlist_idx; dev++) { + st_dev_list_i = st_dev_list + dev; + if (!strcmp(shi->name, st_dev_list_i->dev_name)) + break; + } + if (dev == dlist_idx) + /* Device not found in list: Don't display it */ + continue; + } + + ioi = st_iodev[curr] + i; + ioj = st_iodev[!curr] + i; + + if (!DISPLAY_UNFILTERED(flags)) { + if (!ioi->rd_ios && !ioi->wr_ios) + continue; + } + + if (DISPLAY_ZERO_OMIT(flags)) { + if ((ioi->rd_ios == ioj->rd_ios) && + (ioi->wr_ios == ioj->wr_ios)) + /* No activity: Ignore it */ + continue; + } +#ifdef DEBUG + if (DISPLAY_DEBUG(flags)) { + /* Debug output */ + fprintf(stderr, "name=%s itv=%llu fctr=%d ioi{ rd_sectors=%llu " + "wr_sectors=%llu rd_ios=%lu rd_merges=%lu rd_ticks=%lu " + "wr_ios=%lu wr_merges=%lu wr_ticks=%lu ios_pgr=%lu tot_ticks=%lu " + "rq_ticks=%lu dk_drive=%lu dk_drive_rblk=%lu dk_drive_wblk=%lu }\n", + shi->name, + itv, + fctr, + ioi->rd_sectors, + ioi->wr_sectors, + ioi->rd_ios, + ioi->rd_merges, + ioi->rd_ticks, + ioi->wr_ios, + ioi->wr_merges, + ioi->wr_ticks, + ioi->ios_pgr, + ioi->tot_ticks, + ioi->rq_ticks, + ioi->dk_drive, + ioi->dk_drive_rblk, + ioi->dk_drive_wblk + ); + } +#endif + + if (DISPLAY_EXTENDED(flags)) { + write_ext_stat(curr, itv, fctr, shi, ioi, ioj); + } + else { + write_basic_stat(curr, itv, fctr, shi, ioi, ioj); + } + } + } + printf("\n"); + } +} + +/* + *************************************************************************** + * Main loop: Read I/O stats from the relevant sources and display them. + * + * IN: + * @count Number of lines of stats to print. + * @rectime Current date and time. + *************************************************************************** + */ +void rw_io_stat_loop(long int count, struct tm *rectime) +{ + int curr = 1; + + /* Don't buffer data if redirected to a pipe */ + setbuf(stdout, NULL); + + do { + if (cpu_nr > 1) { + /* + * Read system uptime (only for SMP machines). + * Init uptime0. So if /proc/uptime cannot fill it, + * this will be done by /proc/stat. + */ + uptime0[curr] = 0; + read_uptime(&(uptime0[curr])); + } + + /* + * Read stats for CPU "all" and 0. + * Note that stats for CPU 0 are not used per se. It only makes + * read_stat_cpu() fill uptime0. + */ + read_stat_cpu(st_cpu[curr], 2, &(uptime[curr]), &(uptime0[curr])); + + if (dlist_idx) { + /* + * A device or partition name was entered on the command line, + * with or without -p option (but not -p ALL). + */ + if (HAS_DISKSTATS(flags) && !DISPLAY_PARTITIONS(flags)) { + read_diskstats_stat(curr); + } + else if (HAS_SYSFS(flags)) { + read_sysfs_dlist_stat(curr); + } + } + else { + /* + * No devices nor partitions entered on the command line + * (for example if -p ALL was used). + */ + if (HAS_DISKSTATS(flags)) { + read_diskstats_stat(curr); + } + else if (HAS_SYSFS(flags)) { + read_sysfs_stat(curr); + } + } + + /* Get time */ + get_localtime(rectime); + + /* Print results */ + write_stats(curr, rectime); + + if (count > 0) { + count--; + } + if (count) { + curr ^= 1; + pause(); + } + } + while (count); +} + +/* + *************************************************************************** + * Main entry to the iostat program. + *************************************************************************** + */ +int main(int argc, char **argv) +{ + int it = 0; + int opt = 1; + int i, report_set = FALSE; + long count = 1; + struct utsname header; + struct io_dlist *st_dev_list_i; + struct tm rectime; + char *t; + +#ifdef USE_NLS + /* Init National Language Support */ + init_nls(); +#endif + + /* Get HZ */ + get_HZ(); + + /* Allocate structures for device list */ + if (argc > 1) { + salloc_dev_list(argc - 1 + count_csvalues(argc, argv)); + } + + /* Process args... */ + while (opt < argc) { + + if (!strcmp(argv[opt], "-p")) { + flags |= I_D_PARTITIONS; + if (argv[++opt] && + (strspn(argv[opt], DIGITS) != strlen(argv[opt])) && + (strncmp(argv[opt], "-", 1))) { + flags |= I_D_UNFILTERED; + + for (t = strtok(argv[opt], ","); t; t = strtok(NULL, ",")) { + if (!strcmp(t, K_ALL)) { + flags |= I_D_PART_ALL; + } + else { + /* Store device name */ + i = update_dev_list(&dlist_idx, device_name(t)); + st_dev_list_i = st_dev_list + i; + st_dev_list_i->disp_part = TRUE; + } + } + opt++; + } + else { + flags |= I_D_PART_ALL; + } + } + +#ifdef DEBUG + else if (!strcmp(argv[opt], "--debuginfo")) { + flags |= I_D_DEBUG; + opt++; + } +#endif + + else if (!strncmp(argv[opt], "-", 1)) { + for (i = 1; *(argv[opt] + i); i++) { + + switch (*(argv[opt] + i)) { + + case 'c': + /* Display cpu usage */ + flags |= I_D_CPU; + report_set = TRUE; + break; + + case 'd': + /* Display disk utilization */ + flags |= I_D_DISK; + report_set = TRUE; + break; + + case 'k': + if (DISPLAY_MEGABYTES(flags)) { + usage(argv[0]); + } + /* Display stats in kB/s */ + flags |= I_D_KILOBYTES; + break; + + case 'm': + if (DISPLAY_KILOBYTES(flags)) { + usage(argv[0]); + } + /* Display stats in MB/s */ + flags |= I_D_MEGABYTES; + break; + + case 'N': + /* Display device mapper logical name */ + flags |= I_D_DEVMAP_NAME; + break; + + case 't': + /* Display timestamp */ + flags |= I_D_TIMESTAMP; + break; + + case 'x': + /* Display extended stats */ + flags |= I_D_EXTENDED; + break; + + case 'z': + /* Omit output for devices with no activity */ + flags |= I_D_ZERO_OMIT; + break; + + case 'V': + /* Print version number and exit */ + print_version(); + break; + + default: + usage(argv[0]); + } + } + opt++; + } + + else if (!isdigit(argv[opt][0])) { + flags |= I_D_UNFILTERED; + if (strcmp(argv[opt], K_ALL)) { + /* Store device name */ + update_dev_list(&dlist_idx, device_name(argv[opt++])); + } + else { + opt++; + } + } + + else if (!it) { + interval = atol(argv[opt++]); + if (interval < 0) { + usage(argv[0]); + } + count = -1; + it = 1; + } + + else if (it > 0) { + count = atol(argv[opt++]); + if ((count < 1) || !interval) { + usage(argv[0]); + } + it = -1; + } + else { + usage(argv[0]); + } + } + + if (!interval) { + count = 1; + } + + /* Default: Display CPU and DISK reports */ + if (!report_set) { + flags |= I_D_CPU + I_D_DISK; + } + /* + * Also display DISK reports if options -p, -x or a device has been entered + * on the command line. + */ + if (DISPLAY_PARTITIONS(flags) || DISPLAY_EXTENDED(flags) || + DISPLAY_UNFILTERED(flags)) { + flags |= I_D_DISK; + } + + /* Select disk output unit (kB/s or blocks/s) */ + set_disk_output_unit(); + + /* Ignore device list if '-p ALL' entered on the command line */ + if (DISPLAY_PART_ALL(flags)) { + dlist_idx = 0; + } + + /* Init structures according to machine architecture */ + io_sys_init(); + + get_localtime(&rectime); + + /* Get system name, release number and hostname */ + uname(&header); + if (print_gal_header(&rectime, header.sysname, header.release, + header.nodename, header.machine, cpu_nr)) { + flags |= I_D_ISO; + } + printf("\n"); + + /* Set a handler for SIGALRM */ + alarm_handler(0); + + /* Main loop */ + rw_io_stat_loop(count, &rectime); + + /* Free structures */ + io_sys_free(); + sfree_dev_list(); + + return 0; +} diff --git a/iostat.h b/iostat.h new file mode 100644 index 00000000..d596cb96 --- /dev/null +++ b/iostat.h @@ -0,0 +1,121 @@ +/* + * iostat: report CPU and I/O statistics + * (C) 1999-2009 by Sebastien Godard (sysstat orange.fr) + */ + +#ifndef _IOSTAT_H +#define _IOSTAT_H + +#include "common.h" + +/* I_: iostat - D_: Display - F_: Flag */ +#define I_D_CPU 0x00001 +#define I_D_DISK 0x00002 +#define I_D_TIMESTAMP 0x00004 +#define I_D_EXTENDED 0x00008 +#define I_D_PART_ALL 0x00010 +#define I_D_KILOBYTES 0x00020 +#define I_F_HAS_SYSFS 0x00040 +#define I_D_DEBUG 0x00080 +#define I_D_UNFILTERED 0x00100 +#define I_D_MEGABYTES 0x00200 +#define I_D_PARTITIONS 0x00400 +#define I_F_HAS_DISKSTATS 0x00800 +/* Unused 0x01000 */ +/* Unused 0x02000 */ +/* Unused 0x04000 */ +/* Unused 0x08000 */ +#define I_D_DEVMAP_NAME 0x10000 +#define I_D_ISO 0x20000 +/* Unused 0x40000 */ +#define I_D_ZERO_OMIT 0x80000 + +#define DISPLAY_CPU(m) (((m) & I_D_CPU) == I_D_CPU) +#define DISPLAY_DISK(m) (((m) & I_D_DISK) == I_D_DISK) +#define DISPLAY_TIMESTAMP(m) (((m) & I_D_TIMESTAMP) == I_D_TIMESTAMP) +#define DISPLAY_EXTENDED(m) (((m) & I_D_EXTENDED) == I_D_EXTENDED) +#define DISPLAY_PART_ALL(m) (((m) & I_D_PART_ALL) == I_D_PART_ALL) +#define DISPLAY_KILOBYTES(m) (((m) & I_D_KILOBYTES) == I_D_KILOBYTES) +#define DISPLAY_MEGABYTES(m) (((m) & I_D_MEGABYTES) == I_D_MEGABYTES) +#define HAS_SYSFS(m) (((m) & I_F_HAS_SYSFS) == I_F_HAS_SYSFS) +#define DISPLAY_DEBUG(m) (((m) & I_D_DEBUG) == I_D_DEBUG) +#define DISPLAY_UNFILTERED(m) (((m) & I_D_UNFILTERED) == I_D_UNFILTERED) +#define DISPLAY_PARTITIONS(m) (((m) & I_D_PARTITIONS) == I_D_PARTITIONS) +#define HAS_DISKSTATS(m) (((m) & I_F_HAS_DISKSTATS) == I_F_HAS_DISKSTATS) +#define DISPLAY_DEVMAP_NAME(m) (((m) & I_D_DEVMAP_NAME) == I_D_DEVMAP_NAME) +#define DISPLAY_ISO(m) (((m) & I_D_ISO) == I_D_ISO) +#define DISPLAY_ZERO_OMIT(m) (((m) & I_D_ZERO_OMIT) == I_D_ZERO_OMIT) + +/* Preallocation constats */ +#define NR_DEV_PREALLOC 4 +#define NR_DISK_PREALLOC 3 + +/* Environment variable */ +#define ENV_POSIXLY_CORRECT "POSIXLY_CORRECT" + +/* + * Structures for I/O stats. + * The number of structures allocated corresponds to the number of devices + * present in the system, plus a preallocation number to handle those + * that can be registered dynamically. + * The number of devices is found by using /sys filesystem (if mounted), + * or the number of "disk_io:" entries in /proc/stat (2.4 kernels), + * else the default value is 4 (for old kernels, which maintained stats + * for the first four devices in /proc/stat). + * For each io_stats structure allocated corresponds a io_hdr_stats structure. + * A io_stats structure is considered as unused or "free" (containing no stats + * for a particular device) if the 'major' field of the io_hdr_stats + * structure is set to 0. + */ +struct io_stats { + /* # of sectors read */ + unsigned long long rd_sectors __attribute__ ((aligned (8))); + /* # of sectors written */ + unsigned long long wr_sectors __attribute__ ((packed)); + /* # of read operations issued to the device */ + unsigned long rd_ios __attribute__ ((packed)); + /* # of read requests merged */ + unsigned long rd_merges __attribute__ ((packed)); + /* Time of read requests in queue */ + unsigned long rd_ticks __attribute__ ((packed)); + /* # of write operations issued to the device */ + unsigned long wr_ios __attribute__ ((packed)); + /* # of write requests merged */ + unsigned long wr_merges __attribute__ ((packed)); + /* Time of write requests in queue */ + unsigned long wr_ticks __attribute__ ((packed)); + /* # of I/Os in progress */ + unsigned long ios_pgr __attribute__ ((packed)); + /* # of ticks total (for this device) for I/O */ + unsigned long tot_ticks __attribute__ ((packed)); + /* # of ticks requests spent in queue */ + unsigned long rq_ticks __attribute__ ((packed)); + /* # of I/O done since last reboot */ + unsigned long dk_drive __attribute__ ((packed)); + /* # of blocks read */ + unsigned long dk_drive_rblk __attribute__ ((packed)); + /* # of blocks written */ + unsigned long dk_drive_wblk __attribute__ ((packed)); +}; + +#define IO_STATS_SIZE (sizeof(struct io_stats)) + +struct io_hdr_stats { + unsigned int active __attribute__ ((aligned (4))); + unsigned int used __attribute__ ((packed)); + char name[MAX_NAME_LEN]; +}; + +#define IO_HDR_STATS_SIZE (sizeof(struct io_hdr_stats)) + +/* List of devices entered on the command line */ +struct io_dlist { + /* Indicate whether its partitions are to be displayed or not */ + int disp_part __attribute__ ((aligned (4))); + /* Device name */ + char dev_name[MAX_NAME_LEN]; +}; + +#define IO_DLIST_SIZE (sizeof(struct io_dlist)) + +#endif /* _IOSTAT_H */ diff --git a/man/cifsiostat.1 b/man/cifsiostat.1 new file mode 100644 index 00000000..d5886510 --- /dev/null +++ b/man/cifsiostat.1 @@ -0,0 +1,137 @@ +.TH CIFSIOSTAT 1 "JULY 2010" Linux "Linux User's Manual" -*- nroff -*- +.SH NAME +cifsiostat \- Report CIFS statistics. +.SH SYNOPSIS +.B cifsiostat [ -h ] [ -k | -m ] [ -t ] [ -V ] [ +.I interval +.B [ +.I count +.B ] ] +.SH DESCRIPTION +The +.B cifsiostat +command displays statistics about read and write operations +on CIFS filesystems. + +The +.I interval +parameter specifies the amount of time in seconds between +each report. The first report contains statistics for the time since +system startup (boot). Each subsequent report contains statistics +collected during the interval since the previous report. +A report consists of a CIFS header row followed by +a line of statistics for each CIFS filesystem that is mounted. +The +.I count +parameter can be specified in conjunction with the +.I interval +parameter. If the +.I count +parameter is specified, the value of +.I count +determines the number of reports generated at +.I interval +seconds apart. If the +.I interval +parameter is specified without the +.I count +parameter, the +.B cifsiostat +command generates reports continuously. + +.SH REPORT +The CIFS report provides statistics for each mounted CIFS filesystem. +The report shows the following fields: + +.B Filesystem: +.RS +This columns shows the mount point of the CIFS filesystem. + +.RE +.B rB/s (rkB/s, rMB/s) +.RS +Indicate the average number of bytes (kilobytes, megabytes) read per second. + +.RE +.B wB/s (wkB/s, wMB/s) +.RS +Indicate the average number of bytes (kilobytes, megabytes) written per second. + +.RE +.B rop/s +.RS +Indicate the number of 'read' operations that were issued to the filesystem +per second. + +.RE +.B wop/s +.RS +Indicate the number of 'write' operations that were issued to the filesystem +per second. + +.RE +.B fo/s +.RS +Indicate the number of open files per second. + +.RE +.B fc/s +.RS +Indicate the number of closed files per second. + +.RE +.B fd/s +.RS +Indicate the number of deleted files per second. +.RE +.RE +.SH OPTIONS +.IP -h +Make the CIFS report easier to read by a human. +.IP -k +Display statistics in kilobytes per second. +.IP -m +Display statistics in megabytes per second. +.IP -t +Print the time for each report displayed. The timestamp format may depend +on the value of the S_TIME_FORMAT environment variable (see below). +.IP -V +Print version number then exit. + +.SH ENVIRONMENT +The +.B cifsiostat +command takes into account the following environment variables: + +.IP S_TIME_FORMAT +If this variable exists and its value is +.BR ISO +then the current locale will be ignored when printing the date in the report +header. The +.B nfsiostat +command will use the ISO 8601 format (YYYY-MM-DD) instead. +The timestamp displayed with option -t will also be compliant with ISO 8601 +format. + +.SH BUG +.I /proc +filesystem must be mounted for +.B cifsiostat +to work. + +.SH FILE +.I /proc/fs/cifs/Stats +contains CIFS statistics. +.SH AUTHORS +Written by Ivana Varekova (varekova redhat.com) + +Maintained by Sebastien Godard (sysstat orange.fr) +.SH SEE ALSO +.BR sar (1), +.BR pidstat (1), +.BR mpstat (1), +.BR vmstat (8), +.BR iostat (1), +.BR nfsiostat (1) + +.I http://pagesperso-orange.fr/sebastien.godard/ diff --git a/man/iostat.in b/man/iostat.in new file mode 100644 index 00000000..3f3bd8aa --- /dev/null +++ b/man/iostat.in @@ -0,0 +1,377 @@ +.TH IOSTAT 1 "JUNE 2010" Linux "Linux User's Manual" -*- nroff -*- +.SH NAME +iostat \- Report Central Processing Unit (CPU) statistics and input/output +statistics for devices and partitions. +.SH SYNOPSIS +.ie 'yes'@WITH_DEBUG@' \{ +.B iostat [ -c ] [ -d ] [ --debuginfo ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ] [ +.I device +.B [...] | ALL ] [ -p [ +.I device +.B [,...] | ALL ] ] [ +.I interval +.B [ +.I count +.B ] ] +.\} +.el \{ +.B iostat [ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ] [ +.I device +.B [...] | ALL ] [ -p [ +.I device +.B [,...] | ALL ] ] [ +.I interval +.B [ +.I count +.B ] ] +.\} +.SH DESCRIPTION +The +.B iostat +command is used for monitoring system input/output device +loading by observing the time the devices are active in relation +to their average transfer rates. The +.B iostat +command generates reports +that can be used to change system configuration to better balance +the input/output load between physical disks. + +The first report generated by the +.B iostat +command provides statistics +concerning the time since the system was booted. Each subsequent report +covers the time since the previous report. All statistics are reported +each time the iostat command is run. The report consists of a +CPU header row followed by a row of +CPU statistics. On +multiprocessor systems, CPU statistics are calculated system-wide +as averages among all processors. A device header row is displayed +followed by a line of statistics for each device that is configured. + +The +.I interval +parameter specifies the amount of time in seconds between +each report. The first report contains statistics for the time since +system startup (boot). Each subsequent report contains statistics +collected during the interval since the previous report. The +.I count +parameter can be specified in conjunction with the +.I interval +parameter. If the +.I count +parameter is specified, the value of +.I count +determines the number of reports generated at +.I interval +seconds apart. If the +.I interval +parameter is specified without the +.I count +parameter, the +.B iostat +command generates reports continuously. + +.SH REPORTS +The +.B iostat +command generates three types of reports, the CPU +Utilization report, the Device Utilization report and +the Network Filesystem report. +.IP "CPU Utilization Report" +The first report generated by the +.B iostat +command is the CPU +Utilization Report. For multiprocessor systems, the CPU values are +global averages among all processors. +The report has the following format: + +.B %user +.RS +.RS +Show the percentage of CPU utilization that occurred while +executing at the user level (application). +.RE + +.B %nice +.RS +Show the percentage of CPU utilization that occurred while +executing at the user level with nice priority. +.RE + +.B %system +.RS +Show the percentage of CPU utilization that occurred while +executing at the system level (kernel). +.RE + +.B %iowait +.RS +Show the percentage of time that the CPU or CPUs were idle during which +the system had an outstanding disk I/O request. +.RE + +.B %steal +.RS +Show the percentage of time spent in involuntary wait by the virtual CPU +or CPUs while the hypervisor was servicing another virtual processor. +.RE + +.B %idle +.RS +Show the percentage of time that the CPU or CPUs were idle and the system +did not have an outstanding disk I/O request. +.RE +.RE +.IP "Device Utilization Report" +The second report generated by the +.B iostat +command is the Device Utilization +Report. The device report provides statistics on a per physical device +or partition basis. Block devices and partitions for which statistics are +to be displayed may be entered on the command line. +If no device nor partition +is entered, then statistics are displayed +for every device used by the system, and +providing that the kernel maintains statistics for it. +If the +.B ALL +keyword is given on the command line, then statistics are +displayed for every device defined by the system, including those +that have never been used. +Transfer rates are shown in 1K blocks by default, unless the environment +variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used. +The report may show the following fields, +depending on the flags used: + +.B Device: +.RS +.RS +This column gives the device (or partition) name as listed in the /dev +directory. + +.RE +.B tps +.RS +Indicate the number of transfers per second that were issued +to the device. A transfer is an I/O request to the +device. Multiple logical requests can be combined into a single I/O +request to the device. A transfer is of indeterminate size. + +.RE +.B Blk_read/s (kB_read/s, MB_read/s) +.RS +Indicate the amount of data read from the device expressed in a number of +blocks (kilobytes, megabytes) per second. Blocks are equivalent to sectors +and therefore have a size of 512 bytes. + +.RE +.B Blk_wrtn/s (kB_wrtn/s, MB_wrtn/s) +.RS +Indicate the amount of data written to the device expressed in a number of +blocks (kilobytes, megabytes) per second. + +.RE +.B Blk_read (kB_read, MB_read) +.RS +The total number of blocks (kilobytes, megabytes) read. + +.RE +.B Blk_wrtn (kB_wrtn, MB_wrtn) +.RS +The total number of blocks (kilobytes, megabytes) written. + +.RE +.B rrqm/s +.RS +The number of read requests merged per second that were queued to the device. + +.RE +.B wrqm/s +.RS +The number of write requests merged per second that were queued to the device. + +.RE +.B r/s +.RS +The number (after merges) of read requests completed per second for the device. + +.RE +.B w/s +.RS +The number (after merges) of write requests completed per second for the device. + +.RE +.B rsec/s (rkB/s, rMB/s) +.RS +The number of sectors (kilobytes, megabytes) read from the device per second. + +.RE +.B wsec/s (wkB/s, wMB/s) +.RS +The number of sectors (kilobytes, megabytes) written to the device per second. + +.RE +.B avgrq-sz +.RS +The average size (in sectors) of the requests that were issued to the device. + +.RE +.B avgqu-sz +.RS +The average queue length of the requests that were issued to the device. + +.RE +.B await +.RS +The average time (in milliseconds) for I/O requests issued to the device +to be served. This includes the time spent by the requests in queue and +the time spent servicing them. + +.RE +.B r_await +.RS +The average time (in milliseconds) for read requests issued to the device +to be served. This includes the time spent by the requests in queue and +the time spent servicing them. + +.RE +.B w_await +.RS +The average time (in milliseconds) for write requests issued to the device +to be served. This includes the time spent by the requests in queue and +the time spent servicing them. + +.RE +.B svctm +.RS +The average service time (in milliseconds) for I/O requests that were issued +to the device. Warning! Do not trust this field any more. +This field will be removed in a future sysstat version. + +.RE +.B %util +.RS +Percentage of CPU time during which I/O requests were issued to the device +(bandwidth utilization for the device). Device saturation occurs when this +value is close to 100%. +.RE +.RE +.SH OPTIONS +.IP -c +Display the CPU utilization report. +.IP -d +Display the device utilization report. +.if 'yes'@WITH_DEBUG@' \{ +.IP --debuginfo +Print debug output to stderr. +.\} +.IP -k +Display statistics in kilobytes per second. +.IP -m +Display statistics in megabytes per second. +.IP -N +Display the registered device mapper names for any device mapper devices. +Useful for viewing LVM2 statistics. +.IP "-p [ { device [,...] | ALL } ]" +The -p option displays statistics for +block devices and all their partitions that are used by the system. +If a device name is entered on the command line, then statistics for it +and all its partitions are displayed. Last, the +.B ALL +keyword indicates that statistics have to be displayed for all the block +devices and partitions defined by the system, including those that have +never been used. +.IP -t +Print the time for each report displayed. The timestamp format may depend +on the value of the S_TIME_FORMAT environment variable (see below). +.IP -V +Print version number then exit. +.IP -x +Display extended statistics. +.IP -z +Tell iostat to omit output for any devices for which there was no activity +during the sample period. + +.SH ENVIRONMENT +The +.B iostat +command takes into account the following environment variables: + +.IP S_TIME_FORMAT +If this variable exists and its value is +.BR ISO +then the current locale will be ignored when printing the date in the report +header. The +.B iostat +command will use the ISO 8601 format (YYYY-MM-DD) instead. +The timestamp displayed with option -t will also be compliant with ISO 8601 +format. + +.IP POSIXLY_CORRECT +When this variable is set, transfer rates are shown in 512-byte blocks instead +of the default 1K blocks. + +.SH EXAMPLES +.B iostat +.RS +Display a single history since boot report for all CPU and Devices. + +.RE +.B iostat -d 2 +.RS +Display a continuous device report at two second intervals. + +.RE +.B iostat -d 2 6 +.RS +Display six reports at two second intervals for all devices. + +.RE +.B iostat -x sda sdb 2 6 +.RS +Display six reports of extended statistics at two second intervals for devices +sda and sdb. + +.RE +.B iostat -p sda 2 6 +.RS +Display six reports at two second intervals for device sda and all its +partitions (sda1, etc.) +.SH BUGS +.I /proc +filesystem must be mounted for +.B iostat +to work. + +Kernels older than 2.6.x are no longer supported. + +The average service time (svctm field) value is meaningless, +as I/O statistics are calculated at block level, and we don't know +when the disk driver starts to process a request. For this reason, +this field will be removed in a future sysstat version. +.SH FILES +.I /proc/stat +contains system statistics. + +.I /proc/uptime +contains system uptime. + +.I /proc/diskstats +contains disks statistics. + +.I /sys +contains statistics for block devices. + +.I /proc/self/mountstats +contains statistics for network filesystems. +.SH AUTHOR +Sebastien Godard (sysstat orange.fr) +.SH SEE ALSO +.BR sar (1), +.BR pidstat (1), +.BR mpstat (1), +.BR vmstat (8), +.BR nfsiostat (1), +.BR cifsiostat (1) + +.I http://pagesperso-orange.fr/sebastien.godard/ diff --git a/man/mpstat.1 b/man/mpstat.1 new file mode 100644 index 00000000..1d0527d8 --- /dev/null +++ b/man/mpstat.1 @@ -0,0 +1,214 @@ +.TH MPSTAT 1 "JANUARY 2010" Linux "Linux User's Manual" -*- nroff -*- +.SH NAME +mpstat \- Report processors related statistics. +.SH SYNOPSIS +.B mpstat [ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { +.I cpu +.B [,...] | ALL } ] [ -V ] [ +.I interval +.B [ +.I count +.B ] ] +.SH DESCRIPTION +The +.B mpstat +command writes to standard output activities for each available processor, +processor 0 being the first one. +Global average activities among all processors are also reported. +The +.B mpstat +command can be used both on SMP and UP machines, but in the latter, only global +average activities will be printed. If no activity has been selected, then the +default report is the CPU utilization report. + +The +.I interval +parameter specifies the amount of time in seconds between each report. +A value of 0 (or no parameters at all) indicates that processors statistics are +to be reported for the time since system startup (boot). +The +.I count +parameter can be specified in conjunction with the +.I interval +parameter if this one is not set to zero. The value of +.I count +determines the number of reports generated at +.I interval +seconds apart. If the +.I interval +parameter is specified without the +.I count +parameter, the +.B mpstat +command generates reports continuously. + +.SH OPTIONS +.IP -A +This option is equivalent to specifying +.BR "-I ALL -u -P ALL" +.IP "-I { SUM | CPU | SCPU | ALL }" +Report interrupts statistics. + +With the +.B SUM +keyword, the +.B mpstat +command reports the total number of interrupts per processor. +The following values are displayed: + +.B CPU +.RS +.RS +Processor number. The keyword +.I all +indicates that statistics are calculated as averages among all +processors. +.RE + +.B intr/s +.RS +Show the total number of interrupts received per second by +the CPU or CPUs. +.RE + +With the +.B CPU +keyword, the number of each individual interrupt received per +second by the CPU or CPUs is displayed. + +With the +.B SCPU +keyword, the number of each individual software interrupt received per +second by the CPU or CPUs is displayed. This option works only +with kernels 2.6.31 and later. + +The +.B ALL +keyword is equivalent to specifying all the keywords above and +therefore all the interrupts statistics are displayed. +.RE +.RE +.IP "-P { cpu [,...] | ALL }" +Indicate the processor number for which statistics are to be reported. +.I cpu +is the processor number. Note that processor 0 is the first processor. +The +.B ALL +keyword indicates that statistics are to be reported for all processors. +.IP -u +Report CPU utilization. The following values are displayed: + +.B CPU +.RS +.RS +Processor number. The keyword +.I all +indicates that statistics are calculated as averages among all +processors. +.RE + +.B %usr +.RS +Show the percentage of CPU utilization that occurred while +executing at the user level (application). +.RE + +.B %nice +.RS +Show the percentage of CPU utilization that occurred while +executing at the user level with nice priority. +.RE + +.B %sys +.RS +Show the percentage of CPU utilization that occurred while +executing at the system level (kernel). Note that this does not +include time spent servicing hardware and software interrupts. +.RE + +.B %iowait +.RS +Show the percentage of time that the CPU or CPUs were idle during which +the system had an outstanding disk I/O request. +.RE + +.B %irq +.RS +Show the percentage of time spent by the CPU or CPUs to service hardware +interrupts. +.RE + +.B %soft +.RS +Show the percentage of time spent by the CPU or CPUs to service software +interrupts. +.RE + +.B %steal +.RS +Show the percentage of time spent in involuntary wait by the virtual CPU +or CPUs while the hypervisor was servicing another virtual processor. +.RE + +.B %guest +.RS +Show the percentage of time spent by the CPU or CPUs to run a virtual +processor. +.RE + +.B %idle +.RS +Show the percentage of time that the CPU or CPUs were idle and the system +did not have an outstanding disk I/O request. +.RE + +Note: On SMP machines a processor that does not have any activity at all +is a disabled (offline) processor. +.RE +.IP -V +Print version number then exit. + +.SH ENVIRONMENT +The +.B mpstat +command takes into account the following environment variable: + +.IP S_TIME_FORMAT +If this variable exists and its value is +.BR ISO +then the current locale will be ignored when printing the date in the report header. +The +.B mpstat +command will use the ISO 8601 format (YYYY-MM-DD) instead. + +.SH EXAMPLES +.B mpstat 2 5 +.RS +Display five reports of global statistics among all processors at two second intervals. +.RE + +.B mpstat -P ALL 2 5 +.RS +Display five reports of statistics for all processors at two second intervals. + +.SH BUGS +.I /proc +filesystem must be mounted for the +.B mpstat +command to work. + +Only a few activities are given by the Linux kernel for each processor. + +.SH FILES +.IR /proc +contains various files with system statistics. + +.SH AUTHOR +Sebastien Godard (sysstat orange.fr) +.SH SEE ALSO +.BR sar (1), +.BR pidstat (1), +.BR iostat (1), +.BR vmstat (8) + +.I http://pagesperso-orange.fr/sebastien.godard/ diff --git a/man/nfsiostat.1 b/man/nfsiostat.1 new file mode 100644 index 00000000..ec667ba5 --- /dev/null +++ b/man/nfsiostat.1 @@ -0,0 +1,156 @@ +.TH NFSIOSTAT 1 "JULY 2010" Linux "Linux User's Manual" -*- nroff -*- +.SH NAME +nfsiostat \- Report input/output statistics for network filesystems (NFS). +.SH SYNOPSIS +.B nfsiostat [ -h ] [ -k | -m ] [ -t ] [ -V ] [ +.I interval +.B [ +.I count +.B ] ] +.SH DESCRIPTION +The +.B nfsiostat +command displays statistics about read and write operations +on NFS filesystems. + +The +.I interval +parameter specifies the amount of time in seconds between +each report. The first report contains statistics for the time since +system startup (boot). Each subsequent report contains statistics +collected during the interval since the previous report. +A report consists of an NFS header row followed by +a line of statistics for each network filesystem that is mounted. +The +.I count +parameter can be specified in conjunction with the +.I interval +parameter. If the +.I count +parameter is specified, the value of +.I count +determines the number of reports generated at +.I interval +seconds apart. If the +.I interval +parameter is specified without the +.I count +parameter, the +.B nfsiostat +command generates reports continuously. + +.SH REPORT +The Network Filesystem (NFS) report provides statistics for each mounted network filesystem. +The report shows the following fields: + +.B Filesystem: +.RS +This columns shows the hostname of the NFS server followed by a colon and +by the directory name where the network filesystem is mounted. + +.RE +.B rBlk_nor/s (rkB_nor/s, rMB_nor) +.RS +Indicate the number of blocks (kilobytes, megabytes) read by applications +via the read(2) system +call interface. A block has a size of 512 bytes. + +.RE +.B wBlk_nor/s (wkB_nor/s, wMB_nor/s) +.RS +Indicate the number of blocks (kilobytes, megabytes) written by applications +via the write(2) system +call interface. + +.RE +.B rBlk_dir/s (rkB_dir/s, rMB_dir/s) +.RS +Indicate the number of blocks (kilobytes, megabytes) read from files +opened with the O_DIRECT flag. + +.RE +.B wBlk_dir/s (wkB_dir/s, wMB_dir/s) +.RS +Indicate the number of blocks (kilobytes, megabytes) written to files +opened with the O_DIRECT flag. + +.RE +.B rBlk_svr/s (rkB_svr/s, rMB_svr/s) +.RS +Indicate the number of blocks (kilobytes, megabytes) read from the server +by the NFS client via an NFS READ request. + +.RE +.B wBlk_svr/s (wkB_svr/s, wMB_svr/s) +.RS +Indicate the number of blocks (kilobytes, megabytes) written to the server +by the NFS client via an NFS WRITE request. + +.RE +.B ops/s +.RS +Indicate the number of operations that were issued to the filesystem per second. + +.RE +.B rops/s +.RS +Indicate the number of 'read' operations that were issued to the filesystem +per second. + +.RE +.B wops/s +.RS +Indicate the number of 'write' operations that were issued to the filesystem +per second. +.RE +.RE +.SH OPTIONS +.IP -h +Make the NFS report easier to read by a human. +.IP -k +Display statistics in kilobytes per second. +.IP -m +Display statistics in megabytes per second. +.IP -t +Print the time for each report displayed. The timestamp format may depend +on the value of the S_TIME_FORMAT environment variable (see below). +.IP -V +Print version number then exit. + +.SH ENVIRONMENT +The +.B nfsiostat +command takes into account the following environment variables: + +.IP S_TIME_FORMAT +If this variable exists and its value is +.BR ISO +then the current locale will be ignored when printing the date in the report +header. The +.B nfsiostat +command will use the ISO 8601 format (YYYY-MM-DD) instead. +The timestamp displayed with option -t will also be compliant with ISO 8601 +format. + +.SH BUG +.I /proc +filesystem must be mounted for +.B nfsiostat +to work. + +.SH FILE +.I /proc/self/mountstats +contains statistics for network filesystems. +.SH AUTHORS +Written by Ivana Varekova (varekova redhat.com) + +Maintained by Sebastien Godard (sysstat orange.fr) +.SH SEE ALSO +.BR sar (1), +.BR pidstat (1), +.BR mpstat (1), +.BR vmstat (8), +.BR iostat (1), +.BR cifsiostat (1) + +.I http://pagesperso-orange.fr/sebastien.godard/ diff --git a/man/pidstat.1 b/man/pidstat.1 new file mode 100644 index 00000000..50e31049 --- /dev/null +++ b/man/pidstat.1 @@ -0,0 +1,427 @@ +.TH PIDSTAT 1 "JUNE 2010" Linux "Linux User's Manual" -*- nroff -*- +.SH NAME +pidstat \- Report statistics for Linux tasks. +.SH SYNOPSIS +.B pidstat [ -C +.I comm +.B ] [ -d ] [ -h ] [ -I ] [ -l ] [ -p { +.I pid +.B [,...] | SELF | ALL } ] [ -r ] [ -s ] [ -t ] [ -T { TASK | CHILD | ALL } ] [ -u ] [ -V ] [ -w ] [ +.I interval +.B [ +.I count +.B ] ] +.SH DESCRIPTION +The +.B pidstat +command is used for monitoring individual tasks currently being managed +by the Linux kernel. +It writes to standard output activities for every task selected with option +.B -p +or for every task managed by the Linux kernel if option +.B -p ALL +has been used. Not selecting any tasks is equivalent to specifying +.B -p ALL +but only active tasks (tasks with non-zero statistics values) +will appear in the report. + +The +.B pidstat +command can also be used for monitoring the child processes of selected tasks. +Read about option +.B -T +below. + +The +.I interval +parameter specifies the amount of time in seconds between each report. +A value of 0 (or no parameters at all) indicates that tasks statistics are +to be reported for the time since system startup (boot). +The +.I count +parameter can be specified in conjunction with the +.I interval +parameter if this one is not set to zero. The value of +.I count +determines the number of reports generated at +.I interval +seconds apart. If the +.I interval +parameter is specified without the +.I count +parameter, the +.B pidstat +command generates reports continuously. + +You can select information about specific task activities using flags. +Not specifying any flags selects only CPU activity. + +.SH OPTIONS +.IP "-C comm" +Display only tasks whose command name includes the string +.IR comm . +This string can be a regular expression. +.IP -d +Report I/O statistics (kernels 2.6.20 and later only). +The following values are displayed: + +.B PID +.RS +.RS +The identification number of the task being monitored. +.RE + +.B kB_rd/s +.RS +Number of kilobytes the task has caused to be read from disk +per second. +.RE + +.B kB_wr/s +.RS +Number of kilobytes the task has caused, or shall cause to be +written to disk per second. +.RE + +.B kB_ccwr/s +.RS +Number of kilobytes whose writing to disk has been cancelled by +the task. This may occur when the task truncates some +dirty pagecache. In this case, some IO which another task has +been accounted for will not be happening. +.RE + +.B Command +.RS +The command name of the task. +.RE +.RE +.IP -h +Display all activities horizontally on a single line. This is +intended to make it easier to be parsed by other programs. +.IP -I +In an SMP environment, indicate that tasks CPU usage +(as displayed by option +.B -u +) should be divided by the total number of processors. +.IP -l +Display the process command name and all its arguments. +.IP "-p { pid [,...] | SELF | ALL }" +Select tasks (processes) for which statistics are to be reported. +.B pid +is the process identification number. The +.B SELF +keyword indicates that statistics are to be reported for the +.B pidstat +process itself, whereas the +.B ALL +keyword indicates that statistics are to be reported for all the +tasks managed by the system. +.IP -r +Report page faults and memory utilization. + +When reporting statistics for individual tasks, +the following values are displayed: + +.B PID +.RS +.RS +The identification number of the task being monitored. +.RE + +.B minflt/s +.RS +Total number of minor faults the task has made per second, those +which have not required loading a memory page from disk. +.RE + +.B majflt/s +.RS +Total number of major faults the task has made per second, those +which have required loading a memory page from disk. +.RE + +.B VSZ +.RS +Virtual Size: The virtual memory usage of entire task in kilobytes. +.RE + +.B RSS +.RS +Resident Set Size: The non-swapped physical memory +used by the task in kilobytes. +.RE + +.B Command +.RS +The command name of the task. +.RE + +When reporting global statistics for tasks and all their children, +the following values are displayed: + +.B PID +.RS +The identification number of the task which is being monitored +together with its children. +.RE + +.B minflt-nr +.RS +Total number of minor faults made by the task and all its children, +and collected during the interval of time. +.RE + +.B majflt-nr +.RS +Total number of major faults made by the task and all its children, +and collected during the interval of time. +.RE + +.B Command +.RS +The command name of the task which is being monitored +together with its children. +.RE +.RE +.IP -s +Report stack utilization. +The following values are displayed: + +.B PID +.RS +.RS +The identification number of the task being monitored. +.RE + +.B StkSize +.RS +The amount of memory in kilobytes reserved for the task as stack, +but not necessarily used. +.RE + +.B StkRef +.RS +The amount of memory in kilobytes used as stack, referenced by the task. +.RE + +.B Command +.RS +The command name of the task. +.RE +.RE +.IP -t +Also display statistics for threads associated with selected tasks. + +This option adds the following values to the reports: + +.B TGID +.RS +.RS +The identification number of the thread group leader. +.RE + +.B TID +.RS +The identification number of the thread being monitored. +.RE +.RE +.IP "-T { TASK | CHILD | ALL }" +This option specifies what has to be monitored by the +.B pidstat +command. The +.B TASK +keyword indicates that statistics are to be reported for individual tasks +(this is the default option) whereas the +.B CHILD +keyword indicates that statistics are to be globally reported for the +selected tasks and all their children. The +.B ALL +keyword indicates that statistics are to be reported for +individual tasks and globally for the selected +tasks and their children. + +Note: Global statistics for tasks and all their children are not available +for all options of +.B pidstat. +Also these statistics are not necessarily relevant to current time interval: +The statistics of a child process are collected only when it finishes or +it is killed. +.IP -u +Report CPU utilization. + +When reporting statistics for individual tasks, +the following values are displayed: + +.B PID +.RS +.RS +The identification number of the task being monitored. +.RE + +.B %usr +.RS +Percentage of CPU used by the task while executing at the user level +(application), with or without nice priority. Note that this field +does NOT include time spent running a virtual processor. +.RE + +.B %system +.RS +Percentage of CPU used by the task while executing at the system level +(kernel). +.RE + +.B %guest +.RS +Percentage of CPU spent by the task in virtual machine (running a virtual +processor). +.RE + +.B %CPU +.RS +Total percentage of CPU time used by the task. In an SMP environment, +the task's CPU usage will be divided by the total number of CPU's if +option +.B -I +has been entered on the command line. +.RE + +.B CPU +.RS +Processor number to which the task is attached. +.RE + +.B Command +.RS +The command name of the task. +.RE + +When reporting global statistics for tasks and all their children, +the following values are displayed: + +.B PID +.RS +The identification number of the task which is being monitored +together with its children. +.RE + +.B usr-ms +.RS +Total number of milliseconds spent +by the task and all its children while executing at the +user level (application), with or without nice priority, and +collected during the interval of time. Note that this field does +NOT include time spent running a virtual processor. +.RE + +.B system-ms +.RS +Total number of milliseconds spent +by the task and all its children while executing at the +system level (kernel), and collected during the interval of time. +.RE + +.B guest-ms +.RS +Total number of milliseconds spent +by the task and all its children in virtual machine (running a virtual +processor). +.RE + +.B Command +.RS +The command name of the task which is being monitored +together with its children. +.RE +.RE +.IP -V +Print version number then exit. +.IP -w +Report task switching activity (kernels 2.6.23 and later only). +The following values are displayed: + +.B PID +.RS +.RS +The identification number of the task being monitored. +.RE + +.B cswch/s +.RS +Total number of voluntary context switches the task made per second. +A voluntary context switch occurs when a task blocks because it +requires a resource that is unavailable. +.RE + +.B nvcswch/s +.RS +Total number of non voluntary context switches the task made per second. +A involuntary context switch takes place when a task executes +for the duration of its time slice and then is forced to relinquish the +processor. +.RE + +.B Command +.RS +The command name of the task. +.RE +.RE +.SH ENVIRONMENT +The +.B pidstat +command takes into account the following environment variable: + +.IP S_TIME_FORMAT +If this variable exists and its value is +.BR ISO +then the current locale will be ignored when printing the date in the report header. +The +.B pidstat +command will use the ISO 8601 format (YYYY-MM-DD) instead. + +.SH EXAMPLES +.B pidstat 2 5 +.RS +Display five reports of CPU statistics for every active task in the system +at two second intervals. +.RE + +.B pidstat -r -p 1643 2 5 +.RS +Display five reports of page faults and memory statistics for +PID 1643 at two second intervals. +.RE + +.B pidstat -C """fox|bird"" -r -p ALL +.RS +Display global page faults and memory statistics for all the +processes whose command name includes the string "fox" or "bird". +.RE + +.B pidstat -T CHILD -r 2 5 +.RS +Display five reports of page faults statistics at two second intervals +for the child processes of all tasks in the system. Only child processes +with non-zero statistics values are displayed. +.SH BUGS +.I /proc +filesystem must be mounted for the +.B pidstat +command to work. + +.SH FILES +.IR /proc +contains various files with system statistics. + +.SH AUTHOR +Sebastien Godard (sysstat orange.fr) +.SH SEE ALSO +.BR sar (1), +.BR top (1), +.BR ps (1), +.BR mpstat (1), +.BR iostat (1), +.BR vmstat (8) + +.I http://pagesperso-orange.fr/sebastien.godard/ diff --git a/man/sa1.in b/man/sa1.in new file mode 100644 index 00000000..5e84424e --- /dev/null +++ b/man/sa1.in @@ -0,0 +1,68 @@ +.TH SA1 8 "AUGUST 2010" Linux "Linux User's Manual" -*- nroff -*- +.SH NAME +sa1 \- Collect and store binary data in the system activity daily data file. +.SH SYNOPSIS +.B @SA_LIB_DIR@/sa1 [ --boot | +.I interval +.I count +.B ] +.SH DESCRIPTION +The +.B sa1 +command is a shell procedure variant of the +.B sadc +command and handles all of the flags and parameters of that command. The +.B sa1 +command collects and stores binary data in the +.IR @SA_DIR@/sa dd +file, where the dd parameter indicates the current day. The +.I interval +and +.I count +parameters specify that the record should be written +.I count +times at +.I interval +seconds. If no arguments are given to +.B sa1 +then a single record is written. + +The +.B sa1 +command is designed to be started automatically by the cron command. + +.SH OPTIONS +.IP --boot +This option tells +.B sa1 +that the +.B sadc +command should be called without specifying the +.I interval +and +.I count +parameters in order to insert a dummy record, marking the time when the counters +restarts from 0. + +.SH EXAMPLES +To create a daily record of +.B sar +activities, place the following entry in your root or adm crontab file: + +.B 0 8-18 * * 1-5 @SA_LIB_DIR@/sa1 1200 3 & + +.SH FILES +.IR @SA_DIR@/sa dd +.RS +Indicate the daily data file, where the +.B dd +parameter is a number representing the day of the month. +.SH AUTHOR +Sebastien Godard (sysstat orange.fr) +.SH SEE ALSO +.BR sar (1), +.BR sadc (8), +.BR sa2 (8), +.BR sadf (1) + +.I http://pagesperso-orange.fr/sebastien.godard/ diff --git a/man/sa2.in b/man/sa2.in new file mode 100644 index 00000000..2f688e36 --- /dev/null +++ b/man/sa2.in @@ -0,0 +1,47 @@ +.TH SA2 8 "AUGUST 2010" Linux "Linux User's Manual" -*- nroff -*- +.SH NAME +sa2 \- Write a daily report in the @SA_DIR@ directory. +.SH SYNOPSIS +.B @SA_LIB_DIR@/sa2 +.SH DESCRIPTION +The +.B sa2 +command is a shell procedure variant of the +.B sar +command which writes a daily report in the +.IR @SA_DIR@/sar dd +file, where the dd parameter indicates the current day. The +.B sa2 +command handles all of the flags and parameters of the +.B sar +command. + +The +.B sa2 +command is designed to be started automatically by the cron command. + +.SH EXAMPLES +To run the +.B sa2 +command daily, place the following entry in your root or adm crontab file: + +.B 5 19 * * 1-5 @SA_LIB_DIR@/sa2 -A & + +This will generate a daily report called +.IR @SA_DIR@/sar dd +It will also remove reports more than one week old. +.SH FILES +.IR @SA_DIR@/sar dd +.RS +Indicate the daily report file, where the +.B dd +parameter is a number representing the day of the month. +.SH AUTHOR +Sebastien Godard (sysstat orange.fr) +.SH SEE ALSO +.BR sar (1), +.BR sadc (8), +.BR sa1 (8), +.BR sadf (1) + +.I http://pagesperso-orange.fr/sebastien.godard/ diff --git a/man/sadc.in b/man/sadc.in new file mode 100644 index 00000000..a2d2679f --- /dev/null +++ b/man/sadc.in @@ -0,0 +1,208 @@ +.TH SADC 8 "AUGUST 2010" Linux "Linux User's Manual" -*- nroff -*- +.SH NAME +sadc \- System activity data collector. +.SH SYNOPSIS +.B @SA_LIB_DIR@/sadc [ -C +.I comment +.B ] [ -S { INT | DISK | SNMP | IPV6 | POWER | XDISK | ALL | XALL } ] [ -F ] [ -L ] [ -V ] [ +.I interval +.B [ +.I count +.B ] ] [ +.I outfile +.B ] +.SH DESCRIPTION +The +.B sadc +command samples system data a specified number of times +(\fIcount\fR) at a specified interval measured in seconds +(\fIinterval\fR). It writes in binary format to the specified +.I outfile +or to standard output. If +.I outfile +is set to -, then +.B sadc +uses the standard system activity daily data file, the +.IR @SA_DIR@/sa dd +file, where the dd parameter indicates the current day. +By default +.B sadc +collects all the data available from the kernel. +Exceptions are interrupts and disk data, for which the +relevant options must be explicitly passed to +.B sadc +(see options below). + +When the +.I count +parameter is not specified, +.B sadc +writes its data endlessly. +When both +.I interval +and +.I count +are not specified, and option -C is not used, +a dummy record, which is used at system startup to mark +the time when the counter restarts from 0, will be written. +For example, one of the system startup script may write the restart mark to +the daily data file by the command entry: + +.B "@SA_LIB_DIR@/sadc -" + +The +.B sadc +command is intended to be used as a backend to the +.B sar +command. + +Note: The +.B sadc +command only reports on local activities. + +.SH OPTIONS +.IP "-C comment" +When neither the +.I interval +nor the +.I count +parameters are specified, this option tells +.B sadc +to write a dummy record containing the specified +.I comment +string. +This comment can then be displayed with option -C of +.BR sar . +.IP -F +The creation of +.I outfile +will be forced. If the file already exists and has a format unknown to +.B sadc +then it will be truncated. This may be useful for daily data files +created by an older version of +.B sadc +and whose format is no longer compatible with current one. +.IP -L +.B sadc +will try to get an exclusive lock on the +.I outfile +before writing to it or truncating it. Failure to get the lock is fatal, +except in the case of trying to write a normal (i.e. not a dummy and not +a header) record to an existing file, in which case +.B sadc +will try again at the next interval. Usually, the only reason a lock +would fail would be if another +.B sadc +process were also writing to the file. This can happen when cron is used +to launch +.BR sadc . +If the system is under heavy load, an old +.B sadc +might still be running when cron starts a new one. Without locking, +this situation can result in a corrupted system activity file. +.IP "-S { INT | DISK | SNMP | IPV6 | POWER | XDISK | ALL | XALL }" +Specify which optional activities should be collected by +.BR sadc . +Some activities are optional to prevent data files from growing too large. +The +.B INT +keyword indicates that +.B sadc +should collect data for system interrupts. +The +.B DISK +keyword indicates that +.B sadc +should collect data for block devices. +The +.B SNMP +and +.B IPV6 +keywords indicate respectively that SNMP and IPv6 statistics should be +collected by +.BR sadc . +The +.B POWER +keyword indicates that +.B sadc +should collect power management statistics. +The +.B ALL +keyword is equivalent to specifying all the keywords above and therefore +all previous activities are collected. + +The +.B XDISK +keyword is an extension to the +.B DISK +one and indicates that partition statistics should be collected by +.B sadc +in addition to disk statistics. This option works only with kernels 2.6.25 +and later. +The +.B XALL +keyword is equivalent to specifying all the keywords above (including +keyword extensions) and therefore all possible activities are collected. + +Important note: The activities (including optional ones) saved in an existing +data file prevail over those selected with option -S. +As a consequence, appending data to an existing data file will result in +option -S being ignored. +.IP -V +Print version number then exit. + +.SH ENVIRONMENT +The +.B sadc +command takes into account the following environment variable: + +.IP S_TIME_DEF_TIME +If this variable exists and its value is +.BR UTC +then +.B sadc +will save its data in UTC time. +.B sadc +will also use UTC time instead of local time to determine the current +daily data file located in the +.IR @SA_DIR@ +directory. +.SH EXAMPLES +.B @SA_LIB_DIR@/sadc 1 10 /tmp/datafile +.RS +Write 10 records of one second intervals to the /tmp/datafile binary file. +.RE + +.B @SA_LIB_DIR@/sadc -C Backup_Start /tmp/datafile +.RS +Insert the comment Backup_Start into the file /tmp/datafile. +.RE +.SH BUGS +The +.I /proc +filesystem must be mounted for the +.B sadc +command to work. + +All the statistics are not necessarily available, depending on the kernel version used. +.B sadc +assumes that you are using at least a 2.6 kernel. +.SH FILES +.IR @SA_DIR@/sa dd +.RS +Indicate the daily data file, where the +.B dd +parameter is a number representing the day of the month. + +.RE +.IR /proc +contains various files with system statistics. +.SH AUTHOR +Sebastien Godard (sysstat orange.fr) +.SH SEE ALSO +.BR sar (1), +.BR sa1 (8), +.BR sa2 (8), +.BR sadf (1) + +.I http://pagesperso-orange.fr/sebastien.godard/ diff --git a/man/sadf.in b/man/sadf.in new file mode 100644 index 00000000..7a4a771c --- /dev/null +++ b/man/sadf.in @@ -0,0 +1,184 @@ +.TH SADF 1 "AUGUST 2010" Linux "Linux User's Manual" -*- nroff -*- +.SH NAME +sadf \- Display data collected by sar in multiple formats. +.SH SYNOPSIS +.B sadf [ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ] [ -P { +.I cpu +.B [,...] | ALL } ] [ -s [ +.I hh:mm:ss +.B ] ] [ -e [ +.I hh:mm:ss +.B ] ] [ -- +.I sar_options +.B ] [ +.I interval +.B [ +.I count +.B ] ] [ +.I datafile +.B ] +.SH DESCRIPTION +The +.B sadf +command is used for displaying the contents of data files created by the +.B sar(1) +command. But unlike sar, +.B sadf +can write its data in many different formats (CSV, XML, etc.) +The default format is one that can +easily be handled by pattern processing commands like awk (see option -p). + +The +.B sadf +command extracts and writes to standard output records saved in the +.I datafile +file. This file must have been created by a version of +.B sar +which is compatible with that of +.B sadf. +If +.I datafile +is omitted, +.B sadf +uses the standard system activity file, the +.IR @SA_DIR@/sa dd +file, where the dd parameter indicates the current day. + +The +.I interval +and +.I count +parameters are used to tell +.B sadf +to select +.I count +records at +.I interval +seconds apart. If the +.I count +parameter is not set, then all the records saved in the data file will be +displayed. + +All the activity flags of +.B sar +may be entered on the command line to indicate which +activities are to be reported. Before specifying them, put a pair of +dashes (--) on the command line in order not to confuse the flags +with those of +.B sadf. +Not specifying any flags selects only CPU activity. + +.SH OPTIONS +.IP -C +Tell +.B sadf +to display comments present in file. +.IP -D +This option is equivalent to option -d below, except that the timestamp +is always expressed in seconds since the epoch (00:00:00 UTC 01/01/1970). +.IP -d +Print the contents of the data file in a format that can easily +be ingested by a relational database system. The output consists +of fields separated by a semicolon. Each record contains +the hostname of the host where the file was created, the interval value +(or -1 if not applicable), the timestamp in a form easily acceptable by +most databases, and additional semicolon separated data fields as specified +by +.I sar_options +command line options. +Note that the timestamp is displayed in UTC (Coordinated Universal Time) +unless option -t is used. In this latter case, the timestamp is displayed +in local time. +.IP "-e [ hh:mm:ss ]" +Set the ending time of the report, given in local time. The default ending +time is 18:00:00. Hours must be given in 24-hour format. +This option is ignored when option -x is used. +.IP -h +When used in conjunction with option -d or -D, all activities +will be displayed horizontally on a single line. +.IP -H +Display the header of the data file. +.IP "-P { cpu [,...] | ALL }" +Tell +.B sadf +that processor dependent statistics are to be reported only for the +specified processor or processors. Specifying the +.B ALL +keyword reports statistics for each individual processor, and globally for +all processors. Note that processor 0 is the first processor. +.IP -p +Print the contents of the data file in a format that can +easily be handled by pattern processing commands like awk. +The output consists of fields separated by a tab. Each record contains the +hostname of the host where the file was created, the interval value +(or -1 if not applicable), the timestamp (UTC value - Coordinated Universal +Time) in seconds from the epoch, the device name (or - if not applicable), +the field name and its value. +.IP "-s [ hh:mm:ss ]" +Set the starting time of the data (given in local time), causing the +.B sadf +command to extract records time-tagged at, or following, the time +specified. The default starting time is 08:00:00. +Hours must be given in 24-hour format. This option is ignored when +option -x is used. +.IP -t +When this option is used together with options -d or -x, the timestamp +is displayed in local time instead of UTC (Coordinated Universal Time). +This option is ignored when options -p or -D are used. +.IP -V +Print version number then exit. +.IP -x +Print the contents of the data file in XML format. +Timestamps are displayed in UTC (Coordinated Universal Time) +unless option -t is used, in which case they are displayed +in local time. The corresponding +DTD (Document Type Definition) and XML Schema are included in the sysstat +source package. They are also available at +.I http://pagesperso-orange.fr/sebastien.godard/download.html + +.SH ENVIRONMENT +The +.B sadf +command takes into account the following environment variable: + +.IP S_TIME_DEF_TIME +If this variable exists and its value is +.BR UTC +then +.B sadf +will use UTC time instead of local time to determine the current daily data +file located in the +.IR @SA_DIR@ +directory. +.SH EXAMPLES +.B sadf -d @SA_DIR@/sa21 -- -r -n DEV +.RS +Extract memory, swap space and network statistics from system activity +file 'sa21', and display them in a format that can be ingested by a +database. +.RE + +.B sadf -p -P 1 +.RS +Extract CPU statistics for processor 1 (the second processor) from current +daily data file, and display them in a format that can easily be handled +by a pattern processing command. +.RE + +.SH FILES +.IR @SA_DIR@/sa dd +.RS +Indicate the daily data file, where the +.B dd +parameter is a number representing the day of the month. + +.RE +.SH AUTHOR +Sebastien Godard (sysstat orange.fr) +.SH SEE ALSO +.BR sar (1), +.BR sadc (8), +.BR sa1 (8), +.BR sa2 (8) + +.I http://pagesperso-orange.fr/sebastien.godard/ diff --git a/man/sar.in b/man/sar.in new file mode 100644 index 00000000..16ee09f6 --- /dev/null +++ b/man/sar.in @@ -0,0 +1,1975 @@ +.TH SAR 1 "AUGUST 2010" Linux "Linux User's Manual" -*- nroff -*- +.SH NAME +sar \- Collect, report, or save system activity information. +.SH SYNOPSIS +.B sar [ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -i +.I interval +.B ] [ -p ] [ -q ] [ -r ] [ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] +[ -v ] [ -V ] [ -w ] [ -W ] [ -y ] +.B [ -m { +.I keyword +.B [,...] | ALL } ] +.B [ -n { +.I keyword +.B [,...] | ALL } ] +.B [ -I { +.I int +.B [,...] | SUM | ALL | XALL } ] [ -P { +.I cpu +.B [,...] | ALL } ] [ -o [ +.I filename +.B ] | -f [ +.I filename +.B ] ] [ -s [ +.I hh:mm:ss +.B ] ] [ -e [ +.I hh:mm:ss +.B ] ] [ +.I interval +.B [ +.I count +.B ] ] +.SH DESCRIPTION +The +.B sar +command writes to standard output the contents of selected +cumulative activity counters in the operating system. The accounting +system, based on the values in the +.I count +and +.I interval +parameters, writes information the specified number of times spaced +at the specified intervals in seconds. +If the +.I interval +parameter is set to zero, the +.B sar +command displays the average statistics for the time +since the system was started. If the +.I interval +parameter is specified without the +.I count +parameter, then reports are generated continuously. +The collected data can also +be saved in the file specified by the +.B -o +.I filename +flag, in addition to being displayed onto the screen. If +.I filename +is omitted, sar uses the standard system activity daily data file, +the +.IR @SA_DIR@/sa dd +file, where the dd parameter indicates the current day. +By default all the data available from the kernel are saved in the +data file. + +The +.B sar +command extracts and writes to standard output records previously +saved in a file. This file can be either the one specified by the +.B -f +flag or, by default, the standard system activity daily data file. + +Without the +.B -P +flag, the +.B sar +command reports system-wide (global among all processors) statistics, +which are calculated as averages for values expressed as percentages, +and as sums otherwise. If the +.B -P +flag is given, the +.B sar +command reports activity which relates to the specified processor or +processors. If +.B -P ALL +is given, the +.B sar +command reports statistics for each individual processor and global +statistics among all processors. + +You can select information about specific system activities using +flags. Not specifying any flags selects only CPU activity. +Specifying the +.B -A +flag is equivalent to specifying +.BR "-bBdqrRSvwWy -I SUM -I XALL -n ALL -u ALL -P ALL". + +The default version of the +.B sar +command (CPU utilization report) might be one of the first facilities +the user runs to begin system activity investigation, because it +monitors major system resources. If CPU utilization is near 100 percent +(user + nice + system), the workload sampled is CPU-bound. + +If multiple samples and multiple reports are desired, it is convenient +to specify an output file for the +.B sar +command. +Run the +.B sar +command as a background process. The syntax for this is: + +.B sar -o datafile interval count >/dev/null 2>&1 & + +All data are captured in binary form and saved to a file (datafile). +The data can then be selectively displayed with the +.B sar +command using the +.B -f +option. Set the +.I interval +and +.I count +parameters to select +.I count +records at +.I interval +second intervals. If the +.I count +parameter is not set, all the records saved in the +file will be selected. +Collection of data in this manner is useful to characterize +system usage over a period of time and determine peak usage hours. + +Note: The +.B sar +command only reports on local activities. + +.SH OPTIONS +.IP -A +This is equivalent to specifying +.BR "-bBdqrRSuvwWy -I SUM -I XALL -n ALL -u ALL -P ALL". +.IP -b +Report I/O and transfer rate statistics. +The following values are displayed: + +.B tps +.RS +.RS +Total number of transfers per second that were issued to physical devices. +A transfer is an I/O request to a physical device. Multiple logical +requests can be combined into a single I/O request to the device. +A transfer is of indeterminate size. +.RE + +.B rtps +.RS +Total number of read requests per second issued to physical devices. +.RE + +.B wtps +.RS +Total number of write requests per second issued to physical devices. +.RE + +.B bread/s +.RS +Total amount of data read from the devices in blocks per second. +Blocks are equivalent to sectors +and therefore have a size of 512 bytes. +.RE + +.B bwrtn/s +.RS +Total amount of data written to devices in blocks per second. +.RE +.RE +.IP -B +Report paging statistics. +The following values are displayed: + +.B pgpgin/s +.RS +.RS +Total number of kilobytes the system paged in from disk per second. +.RE + +.B pgpgout/s +.RS +Total number of kilobytes the system paged out to disk per second. +.RE + +.B fault/s +.RS +Number of page faults (major + minor) made by the system per second. +This is not a count of page faults that generate I/O, because some page +faults can be resolved without I/O. +.RE + +.B majflt/s +.RS +Number of major faults the system has made per second, those which +have required loading a memory page from disk. +.RE + +.B pgfree/s +.RS +Number of pages placed on the free list by the system per second. +.RE + +.B pgscank/s +.RS +Number of pages scanned by the kswapd daemon per second. +.RE + +.B pgscand/s +.RS +Number of pages scanned directly per second. +.RE + +.B pgsteal/s +.RS +Number of pages the system has reclaimed from cache (pagecache and +swapcache) per second to satisfy its memory demands. +.RE + +.B %vmeff +.RS +Calculated as pgsteal / pgscan, this is a metric of the efficiency of +page reclaim. If it is near 100% then almost every page coming off the +tail of the inactive list is being reaped. If it gets too low (e.g. less +than 30%) then the virtual memory is having some difficulty. +This field is displayed as zero if no pages have been scanned during the +interval of time. +.RE +.RE +.IP -C +When reading data from a file, tell +.B sar +to display comments that have been inserted by +.BR sadc . +.IP -d +Report activity for each block device. +When data are displayed, the device specification +.I dev m-n +is generally used ( +.B DEV +column). +.B m +is the major number of the device and +.B n +its minor number. +Device names may also be pretty-printed if option -p +is used (see below). +Note that disk activity depends on sadc options "-S DISK" and "-S XDISK" +to be collected. The following values are displayed: + +.B tps +.RS +.RS +Indicate the number of transfers per second that were issued to the device. +Multiple logical requests can be combined into a single I/O request to the +device. A transfer is of indeterminate size. +.RE + +.B rd_sec/s +.RS +Number of sectors read from the device. The size of a sector is 512 bytes. +.RE + +.B wr_sec/s +.RS +Number of sectors written to the device. The size of a sector is 512 bytes. +.RE + +.B avgrq-sz +.RS +The average size (in sectors) of the requests that were issued to the device. +.RE + +.B avgqu-sz +.RS +The average queue length of the requests that were issued to the device. +.RE + +.B await +.RS +The average time (in milliseconds) for I/O requests issued to the device +to be served. This includes the time spent by the requests in queue and +the time spent servicing them. +.RE + +.B svctm +.RS +The average service time (in milliseconds) for I/O requests that were issued +to the device. Warning! Do not trust this field any more. This field will be +removed in a future sysstat version. +.RE + +.B %util +.RS +Percentage of CPU time during which I/O requests were issued to the device +(bandwidth utilization for the device). Device saturation occurs when this +value is close to 100%. +.RE +.RE +.IP "-e [ hh:mm:ss ]" +Set the ending time of the report. The default ending time is +18:00:00. Hours must be given in 24-hour format. +This option can be used when data are read from +or written to a file (options +.B -f +or +.B -o +). +.IP "-f [ filename ]" +Extract records from +.I filename +(created by the +.B -o filename +flag). The default value of the +.B filename +parameter is the current daily data file, the +.IR @SA_DIR@/sa dd +file. The -f option is exclusive of the -o option. +.IP -h +Display a short help message then exit. +.IP "-i interval" +Select data records at seconds as close as possible to the number specified +by the +.I interval +parameter. +.IP "-I { int [,...] | SUM | ALL | XALL }" +Report statistics for a given interrupt. +.B int +is the interrupt number. Specifying multiple +.B -I int +parameters on the command line will look at multiple independent interrupts. +The +.B SUM +keyword indicates that the total number of interrupts received per second +is to be displayed. The +.B ALL +keyword indicates that statistics from +the first 16 interrupts are to be reported, whereas the +.B XALL +keyword indicates that statistics from all interrupts, including potential +APIC interrupt sources, are to be reported. +Note that interrupt statistics depend on sadc option "-S INT" to be collected. +.IP "-m { keyword [,...] | ALL }" +Report power management statistics. +Note that these statistics depend on sadc option "-S POWER" to be collected. + +Possible keywords are +.BR CPU , +.BR FAN , +.BR IN +and +.BR TEMP . + +With the +.B CPU +keyword, statistics about CPU clock frequency are reported. +The following value is displayed: + +.B MHz +.RS +.RS +CPU clock frequency in MHz. +.RE + +With the +.B FAN +keyword, statistics about fans speed are reported. +The following values are displayed: + +.B rpm +.RS +Fan speed expressed in revolutions per minute. +.RE + +.B drpm +.RS +This field is calculated as the difference between current fan speed (rpm) +and its low limit (fan_min). +.RE + +.B DEVICE +.RS +Sensor device name. +.RE + +With the +.B IN +keyword, statistics about voltage inputs are reported. +The following values are displayed: + +.B inV +.RS +Voltage input expressed in Volts. +.RE + +.B %in +.RS +Relative input value. A value of 100% means that +voltage input has reached its high limit (in_max) whereas +a value of 0% means that it has reached its low limit (in_min). +.RE + +.B DEVICE +.RS +Sensor device name. +.RE + +With the +.B TEMP +keyword, statistics about devices temperature are reported. +The following values are displayed: + +.B degC +.RS +Device temperature expressed in degrees Celsius. +.RE + +.B %temp +.RS +Relative device temperature. A value of 100% means that +temperature has reached its high limit (temp_max). +.RE + +.B DEVICE +.RS +Sensor device name. +.RE +.RE +.IP "-n { keyword [,...] | ALL }" +Report network statistics. + +Possible keywords are +.BR DEV , +.BR EDEV , +.BR NFS , +.BR NFSD , +.BR SOCK , +.BR IP , +.BR EIP , +.BR ICMP , +.BR EICMP , +.BR TCP , +.BR ETCP , +.BR UDP , +.BR SOCK6 , +.BR IP6 , +.BR EIP6 , +.BR ICMP6 , +.BR EICMP6 +and +.BR UDP6 . + +With the +.B DEV +keyword, statistics from the network devices are reported. +The following values are displayed: + +.B IFACE +.RS +.RS +Name of the network interface for which statistics are reported. +.RE + +.B rxpck/s +.RS +Total number of packets received per second. +.RE + +.B txpck/s +.RS +Total number of packets transmitted per second. +.RE + +.B rxkB/s +.RS +Total number of kilobytes received per second. +.RE + +.B txkB/s +.RS +Total number of kilobytes transmitted per second. +.RE + +.B rxcmp/s +.RS +Number of compressed packets received per second (for cslip etc.). +.RE + +.B txcmp/s +.RS +Number of compressed packets transmitted per second. +.RE + +.B rxmcst/s +.RS +Number of multicast packets received per second. +.RE + +With the +.B EDEV +keyword, statistics on failures (errors) from the network devices are reported. +The following values are displayed: + +.B IFACE +.RS +Name of the network interface for which statistics are reported. +.RE + +.B rxerr/s +.RS +Total number of bad packets received per second. +.RE + +.B txerr/s +.RS +Total number of errors that happened per second while transmitting packets. +.RE + +.B coll/s +.RS +Number of collisions that happened per second while transmitting packets. +.RE + +.B rxdrop/s +.RS +Number of received packets dropped per second because of a lack of space in linux buffers. +.RE + +.B txdrop/s +.RS +Number of transmitted packets dropped per second because of a lack of space in linux buffers. +.RE + +.B txcarr/s +.RS +Number of carrier-errors that happened per second while transmitting packets. +.RE + +.B rxfram/s +.RS +Number of frame alignment errors that happened per second on received packets. +.RE + +.B rxfifo/s +.RS +Number of FIFO overrun errors that happened per second on received packets. +.RE + +.B txfifo/s +.RS +Number of FIFO overrun errors that happened per second on transmitted packets. +.RE + +With the +.B NFS +keyword, statistics about NFS client activity are reported. +The following values are displayed: + +.B call/s +.RS +Number of RPC requests made per second. +.RE + +.B retrans/s +.RS +Number of RPC requests per second, those which needed to be retransmitted (for +example because of a server timeout). +.RE + +.B read/s +.RS +Number of 'read' RPC calls made per second. +.RE + +.B write/s +.RS +Number of 'write' RPC calls made per second. +.RE + +.B access/s +.RS +Number of 'access' RPC calls made per second. +.RE + +.B getatt/s +.RS +Number of 'getattr' RPC calls made per second. +.RE + +With the +.B NFSD +keyword, statistics about NFS server activity are reported. +The following values are displayed: + +.B scall/s +.RS +Number of RPC requests received per second. +.RE + +.B badcall/s +.RS +Number of bad RPC requests received per second, those whose +processing generated an error. +.RE + +.B packet/s +.RS +Number of network packets received per second. +.RE + +.B udp/s +.RS +Number of UDP packets received per second. +.RE + +.B tcp/s +.RS +Number of TCP packets received per second. +.RE + +.B hit/s +.RS +Number of reply cache hits per second. +.RE + +.B miss/s +.RS +Number of reply cache misses per second. +.RE + +.B sread/s +.RS +Number of 'read' RPC calls received per second. +.RE + +.B swrite/s +.RS +Number of 'write' RPC calls received per second. +.RE + +.B saccess/s +.RS +Number of 'access' RPC calls received per second. +.RE + +.B sgetatt/s +.RS +Number of 'getattr' RPC calls received per second. +.RE + +With the +.B SOCK +keyword, statistics on sockets in use are reported +(IPv4). +The following values are displayed: + +.B totsck +.RS +Total number of sockets used by the system. +.RE + +.B tcpsck +.RS +Number of TCP sockets currently in use. +.RE + +.B udpsck +.RS +Number of UDP sockets currently in use. +.RE + +.B rawsck +.RS +Number of RAW sockets currently in use. +.RE + +.B ip-frag +.RS +Number of IP fragments currently in use. +.RE + +.B tcp-tw +.RS +Number of TCP sockets in TIME_WAIT state. +.RE + +With the +.B IP +keyword, statistics about IPv4 network traffic are reported. +Note that IPv4 statistics depend on sadc option "-S SNMP" to be +collected. +The following values are displayed (formal SNMP names between +square brackets): + +.B irec/s +.RS +The total number of input datagrams received from interfaces +per second, including those received in error [ipInReceives]. +.RE + +.B fwddgm/s +.RS +The number of input datagrams per second, for which this entity was not +their final IP destination, as a result of which an attempt +was made to find a route to forward them to that final +destination [ipForwDatagrams]. +.RE + +.B idel/s +.RS +The total number of input datagrams successfully delivered per second +to IP user-protocols (including ICMP) [ipInDelivers]. +.RE + +.B orq/s +.RS +The total number of IP datagrams which local IP user-protocols (including ICMP) +supplied per second to IP in requests for transmission [ipOutRequests]. +Note that this counter does not include any datagrams counted in fwddgm/s. +.RE + +.B asmrq/s +.RS +The number of IP fragments received per second which needed to be +reassembled at this entity [ipReasmReqds]. +.RE + +.B asmok/s +.RS +The number of IP datagrams successfully re-assembled per second [ipReasmOKs]. +.RE + +.B fragok/s +.RS +The number of IP datagrams that have been successfully +fragmented at this entity per second [ipFragOKs]. +.RE + +.B fragcrt/s +.RS +The number of IP datagram fragments that have been +generated per second as a result of fragmentation at this entity [ipFragCreates]. +.RE + +With the +.B EIP +keyword, statistics about IPv4 network errors are reported. +Note that IPv4 statistics depend on sadc option "-S SNMP" to be +collected. +The following values are displayed (formal SNMP names between +square brackets): + +.B ihdrerr/s +.RS +The number of input datagrams discarded per second due to errors in +their IP headers, including bad checksums, version number +mismatch, other format errors, time-to-live exceeded, errors +discovered in processing their IP options, etc. [ipInHdrErrors] +.RE + +.B iadrerr/s +.RS +The number of input datagrams discarded per second because the IP +address in their IP header's destination field was not a +valid address to be received at this entity. This count +includes invalid addresses (e.g., 0.0.0.0) and addresses of +unsupported Classes (e.g., Class E). For entities which are +not IP routers and therefore do not forward datagrams, this +counter includes datagrams discarded because the destination +address was not a local address [ipInAddrErrors]. +.RE + +.B iukwnpr/s +.RS +The number of locally-addressed datagrams received +successfully but discarded per second because of an unknown or +unsupported protocol [ipInUnknownProtos]. +.RE + +.B idisc/s +.RS +The number of input IP datagrams per second for which no problems were +encountered to prevent their continued processing, but which +were discarded (e.g., for lack of buffer space) [ipInDiscards]. +Note that this counter does not include any datagrams discarded while +awaiting re-assembly. +.RE + +.B odisc/s +.RS +The number of output IP datagrams per second for which no problem was +encountered to prevent their transmission to their +destination, but which were discarded (e.g., for lack of +buffer space) [ipOutDiscards]. +Note that this counter would include +datagrams counted in fwddgm/s if any such packets met +this (discretionary) discard criterion. +.RE + +.B onort/s +.RS +The number of IP datagrams discarded per second because no route could +be found to transmit them to their destination [ipOutNoRoutes]. +Note that this counter includes any packets counted in fwddgm/s +which meet this 'no-route' criterion. +Note that this includes any datagrams which a host cannot route because all +of its default routers are down. +.RE + +.B asmf/s +.RS +The number of failures detected per second by the IP re-assembly +algorithm (for whatever reason: timed out, errors, etc) [ipReasmFails]. +Note that this is not necessarily a count of discarded IP +fragments since some algorithms can lose track of the number of +fragments by combining them as they are received. +.RE + +.B fragf/s +.RS +The number of IP datagrams that have been discarded per second because +they needed to be fragmented at this entity but could not +be, e.g., because their Don't Fragment flag was set [ipFragFails]. +.RE + +With the +.B ICMP +keyword, statistics about ICMPv4 network traffic are reported. +Note that ICMPv4 statistics depend on sadc option "-S SNMP" to be +collected. +The following values are displayed (formal SNMP names between +square brackets): + +.B imsg/s +.RS +The total number of ICMP messages which the entity +received per second [icmpInMsgs]. +Note that this counter includes all those counted by ierr/s. +.RE + +.B omsg/s +.RS +The total number of ICMP messages which this entity +attempted to send per second [icmpOutMsgs]. +Note that this counter includes all those counted by oerr/s. +.RE + +.B iech/s +.RS +The number of ICMP Echo (request) messages received per second [icmpInEchos]. +.RE + +.B iechr/s +.RS +The number of ICMP Echo Reply messages received per second [icmpInEchoReps]. +.RE + +.B oech/s +.RS +The number of ICMP Echo (request) messages sent per second [icmpOutEchos]. +.RE + +.B oechr/s +.RS +The number of ICMP Echo Reply messages sent per second [icmpOutEchoReps]. +.RE + +.B itm/s +.RS +The number of ICMP Timestamp (request) messages received per second [icmpInTimestamps]. +.RE + +.B itmr/s +.RS +The number of ICMP Timestamp Reply messages received per second [icmpInTimestampReps]. +.RE + +.B otm/s +.RS +The number of ICMP Timestamp (request) messages sent per second [icmpOutTimestamps]. +.RE + +.B otmr/s +.RS +The number of ICMP Timestamp Reply messages sent per second [icmpOutTimestampReps]. +.RE + +.B iadrmk/s +.RS +The number of ICMP Address Mask Request messages received per second [icmpInAddrMasks]. +.RE + +.B iadrmkr/s +.RS +The number of ICMP Address Mask Reply messages received per second [icmpInAddrMaskReps]. +.RE + +.B oadrmk/s +.RS +The number of ICMP Address Mask Request messages sent per second [icmpOutAddrMasks]. +.RE + +.B oadrmkr/s +.RS +The number of ICMP Address Mask Reply messages sent per second [icmpOutAddrMaskReps]. +.RE + +With the +.B EICMP +keyword, statistics about ICMPv4 error messages are reported. +Note that ICMPv4 statistics depend on sadc option "-S SNMP" to be +collected. +The following values are displayed (formal SNMP names between +square brackets): + +.B ierr/s +.RS +The number of ICMP messages per second which the entity received but +determined as having ICMP-specific errors (bad ICMP +checksums, bad length, etc.) [icmpInErrors]. +.RE + +.B oerr/s +.RS +The number of ICMP messages per second which this entity did not send +due to problems discovered within ICMP such as a lack of buffers [icmpOutErrors]. +.RE + +.B idstunr/s +.RS +The number of ICMP Destination Unreachable messages +received per second [icmpInDestUnreachs]. +.RE + +.B odstunr/s +.RS +The number of ICMP Destination Unreachable messages sent per second [icmpOutDestUnreachs]. +.RE + +.B itmex/s +.RS +The number of ICMP Time Exceeded messages received per second [icmpInTimeExcds]. +.RE + +.B otmex/s +.RS +The number of ICMP Time Exceeded messages sent per second [icmpOutTimeExcds]. +.RE + +.B iparmpb/s +.RS +The number of ICMP Parameter Problem messages received per second [icmpInParmProbs]. +.RE + +.B oparmpb/s +.RS +The number of ICMP Parameter Problem messages sent per second [icmpOutParmProbs]. +.RE + +.B isrcq/s +.RS +The number of ICMP Source Quench messages received per second [icmpInSrcQuenchs]. +.RE + +.B osrcq/s +.RS +The number of ICMP Source Quench messages sent per second [icmpOutSrcQuenchs]. +.RE + +.B iredir/s +.RS +The number of ICMP Redirect messages received per second [icmpInRedirects]. +.RE + +.B oredir/s +.RS +The number of ICMP Redirect messages sent per second [icmpOutRedirects]. +.RE + +With the +.B TCP +keyword, statistics about TCPv4 network traffic are reported. +Note that TCPv4 statistics depend on sadc option "-S SNMP" to be +collected. +The following values are displayed (formal SNMP names between +square brackets): + +.B active/s +.RS +The number of times TCP connections have made a direct +transition to the SYN-SENT state from the CLOSED state per second [tcpActiveOpens]. +.RE + +.B passive/s +.RS +The number of times TCP connections have made a direct +transition to the SYN-RCVD state from the LISTEN state per second [tcpPassiveOpens]. +.RE + +.B iseg/s +.RS +The total number of segments received per second, including those +received in error [tcpInSegs]. This count includes segments received on +currently established connections. +.RE + +.B oseg/s +.RS +The total number of segments sent per second, including those on +current connections but excluding those containing only +retransmitted octets [tcpOutSegs]. +.RE + +With the +.B ETCP +keyword, statistics about TCPv4 network errors are reported. +Note that TCPv4 statistics depend on sadc option "-S SNMP" to be +collected. +The following values are displayed (formal SNMP names between +square brackets): + +.B atmptf/s +.RS +The number of times per second TCP connections have made a direct +transition to the CLOSED state from either the SYN-SENT +state or the SYN-RCVD state, plus the number of times per second TCP +connections have made a direct transition to the LISTEN +state from the SYN-RCVD state [tcpAttemptFails]. +.RE + +.B estres/s +.RS +The number of times per second TCP connections have made a direct +transition to the CLOSED state from either the ESTABLISHED +state or the CLOSE-WAIT state [tcpEstabResets]. +.RE + +.B retrans/s +.RS +The total number of segments retransmitted per second - that is, the +number of TCP segments transmitted containing one or more +previously transmitted octets [tcpRetransSegs]. +.RE + +.B isegerr/s +.RS +The total number of segments received in error (e.g., bad +TCP checksums) per second [tcpInErrs]. +.RE + +.B orsts/s +.RS +The number of TCP segments sent per second containing the RST flag [tcpOutRsts]. +.RE + +With the +.B UDP +keyword, statistics about UDPv4 network traffic are reported. +Note that UDPv4 statistics depend on sadc option "-S SNMP" to be +collected. +The following values are displayed (formal SNMP names between +square brackets): + +.B idgm/s +.RS +The total number of UDP datagrams delivered per second to UDP users [udpInDatagrams]. +.RE + +.B odgm/s +.RS +The total number of UDP datagrams sent per second from this entity [udpOutDatagrams]. +.RE + +.B noport/s +.RS +The total number of received UDP datagrams per second for which there +was no application at the destination port [udpNoPorts]. +.RE + +.B idgmerr/s +.RS +The number of received UDP datagrams per second that could not be +delivered for reasons other than the lack of an application +at the destination port [udpInErrors]. +.RE + +With the +.B SOCK6 +keyword, statistics on sockets in use are reported (IPv6). +Note that IPv6 statistics depend on sadc option "-S IPV6" to be +collected. +The following values are displayed: + +.B tcp6sck +.RS +Number of TCPv6 sockets currently in use. +.RE + +.B udp6sck +.RS +Number of UDPv6 sockets currently in use. +.RE + +.B raw6sck +.RS +Number of RAWv6 sockets currently in use. +.RE + +.B ip6-frag +.RS +Number of IPv6 fragments currently in use. +.RE + +With the +.B IP6 +keyword, statistics about IPv6 network traffic are reported. +Note that IPv6 statistics depend on sadc option "-S IPV6" to be +collected. +The following values are displayed (formal SNMP names between +square brackets): + +.B irec6/s +.RS +The total number of input datagrams received from +interfaces per second, including those received in error +[ipv6IfStatsInReceives]. +.RE + +.B fwddgm6/s +.RS +The number of output datagrams per second which this +entity received and forwarded to their final +destinations [ipv6IfStatsOutForwDatagrams]. +.RE + +.B idel6/s +.RS +The total number of datagrams successfully +delivered per second to IPv6 user-protocols (including ICMP) +[ipv6IfStatsInDelivers]. +.RE + +.B orq6/s +.RS +The total number of IPv6 datagrams which local IPv6 +user-protocols (including ICMP) supplied per second to IPv6 in +requests for transmission [ipv6IfStatsOutRequests]. +Note that this counter +does not include any datagrams counted in fwddgm6/s. +.RE + +.B asmrq6/s +.RS +The number of IPv6 fragments received per second which needed +to be reassembled at this interface [ipv6IfStatsReasmReqds]. +.RE + +.B asmok6/s +.RS +The number of IPv6 datagrams successfully +reassembled per second [ipv6IfStatsReasmOKs]. +.RE + +.B imcpck6/s +.RS +The number of multicast packets received per second +by the interface [ipv6IfStatsInMcastPkts]. +.RE + +.B omcpck6/s +.RS +The number of multicast packets transmitted per second +by the interface [ipv6IfStatsOutMcastPkts]. +.RE + +.B fragok6/s +.RS +The number of IPv6 datagrams that have been +successfully fragmented at this output interface per second +[ipv6IfStatsOutFragOKs]. +.RE + +.B fragcr6/s +.RS +The number of output datagram fragments that have +been generated per second as a result of fragmentation at +this output interface [ipv6IfStatsOutFragCreates]. +.RE + +With the +.B EIP6 +keyword, statistics about IPv6 network errors are reported. +Note that IPv6 statistics depend on sadc option "-S IPV6" to be +collected. +The following values are displayed (formal SNMP names between +square brackets): + +.B ihdrer6/s +.RS +The number of input datagrams discarded per second due to +errors in their IPv6 headers, including version +number mismatch, other format errors, hop count +exceeded, errors discovered in processing their +IPv6 options, etc. [ipv6IfStatsInHdrErrors] +.RE + +.B iadrer6/s +.RS +The number of input datagrams discarded per second because +the IPv6 address in their IPv6 header's destination +field was not a valid address to be received at +this entity. This count includes invalid +addresses (e.g., ::0) and unsupported addresses +(e.g., addresses with unallocated prefixes). For +entities which are not IPv6 routers and therefore +do not forward datagrams, this counter includes +datagrams discarded because the destination address +was not a local address [ipv6IfStatsInAddrErrors]. +.RE + +.B iukwnp6/s +.RS +The number of locally-addressed datagrams +received successfully but discarded per second because of an +unknown or unsupported protocol [ipv6IfStatsInUnknownProtos]. +.RE + +.B i2big6/s +.RS +The number of input datagrams that could not be +forwarded per second because their size exceeded the link MTU +of outgoing interface [ipv6IfStatsInTooBigErrors]. +.RE + +.B idisc6/s +.RS +The number of input IPv6 datagrams per second for which no +problems were encountered to prevent their +continued processing, but which were discarded +(e.g., for lack of buffer space) +[ipv6IfStatsInDiscards]. Note that this +counter does not include any datagrams discarded +while awaiting re-assembly. +.RE + +.B odisc6/s +.RS +The number of output IPv6 datagrams per second for which no +problem was encountered to prevent their +transmission to their destination, but which were +discarded (e.g., for lack of buffer space) +[ipv6IfStatsOutDiscards]. Note +that this counter would include datagrams counted +in fwddgm6/s if any such packets +met this (discretionary) discard criterion. +.RE + +.B inort6/s +.RS +The number of input datagrams discarded per second because no +route could be found to transmit them to their +destination [ipv6IfStatsInNoRoutes]. +.RE + +.B onort6/s +.RS +The number of locally generated IP datagrams discarded per second +because no route could be found to transmit them to their +destination [unknown formal SNMP name]. +.RE + +.B asmf6/s +.RS +The number of failures detected per second by the IPv6 +re-assembly algorithm (for whatever reason: timed +out, errors, etc.) [ipv6IfStatsReasmFails]. +Note that this is not +necessarily a count of discarded IPv6 fragments +since some algorithms +can lose track of the number of fragments +by combining them as they are received. +.RE + +.B fragf6/s +.RS +The number of IPv6 datagrams that have been +discarded per second because they needed to be fragmented +at this output interface but could not be +[ipv6IfStatsOutFragFails]. +.RE + +.B itrpck6/s +.RS +The number of input datagrams discarded per second because +datagram frame didn't carry enough data +[ipv6IfStatsInTruncatedPkts]. +.RE + +With the +.B ICMP6 +keyword, statistics about ICMPv6 network traffic are reported. +Note that ICMPv6 statistics depend on sadc option "-S IPV6" to be +collected. +The following values are displayed (formal SNMP names between +square brackets): + +.B imsg6/s +.RS +The total number of ICMP messages received +by the interface per second which includes all those +counted by ierr6/s [ipv6IfIcmpInMsgs]. +.RE + +.B omsg6/s +.RS +The total number of ICMP messages which this +interface attempted to send per second [ipv6IfIcmpOutMsgs]. +.RE + +.B iech6/s +.RS +The number of ICMP Echo (request) messages +received by the interface per second [ipv6IfIcmpInEchos]. +.RE + +.B iechr6/s +.RS +The number of ICMP Echo Reply messages received +by the interface per second [ipv6IfIcmpInEchoReplies]. +.RE + +.B oechr6/s +.RS +The number of ICMP Echo Reply messages sent +by the interface per second [ipv6IfIcmpOutEchoReplies]. +.RE + +.B igmbq6/s +.RS +The number of ICMPv6 Group Membership Query +messages received by the interface per second +[ipv6IfIcmpInGroupMembQueries]. +.RE + +.B igmbr6/s +.RS +The number of ICMPv6 Group Membership Response messages +received by the interface per second +[ipv6IfIcmpInGroupMembResponses]. +.RE + +.B ogmbr6/s +.RS +The number of ICMPv6 Group Membership Response +messages sent per second +[ipv6IfIcmpOutGroupMembResponses]. +.RE + +.B igmbrd6/s +.RS +The number of ICMPv6 Group Membership Reduction messages +received by the interface per second +[ipv6IfIcmpInGroupMembReductions]. +.RE + +.B ogmbrd6/s +.RS +The number of ICMPv6 Group Membership Reduction +messages sent per second +[ipv6IfIcmpOutGroupMembReductions]. +.RE + +.B irtsol6/s +.RS +The number of ICMP Router Solicit messages +received by the interface per second +[ipv6IfIcmpInRouterSolicits]. +.RE + +.B ortsol6/s +.RS +The number of ICMP Router Solicitation messages +sent by the interface per second +[ipv6IfIcmpOutRouterSolicits]. +.RE + +.B irtad6/s +.RS +The number of ICMP Router Advertisement messages +received by the interface per second +[ipv6IfIcmpInRouterAdvertisements]. +.RE + +.B inbsol6/s +.RS +The number of ICMP Neighbor Solicit messages +received by the interface per second +[ipv6IfIcmpInNeighborSolicits]. +.RE + +.B onbsol6/s +.RS +The number of ICMP Neighbor Solicitation +messages sent by the interface per second +[ipv6IfIcmpOutNeighborSolicits]. +.RE + +.B inbad6/s +.RS +The number of ICMP Neighbor Advertisement +messages received by the interface per second +[ipv6IfIcmpInNeighborAdvertisements]. +.RE + +.B onbad6/s +.RS +The number of ICMP Neighbor Advertisement +messages sent by the interface per second +[ipv6IfIcmpOutNeighborAdvertisements]. +.RE + +With the +.B EICMP6 +keyword, statistics about ICMPv6 error messages are reported. +Note that ICMPv6 statistics depend on sadc option "-S IPV6" to be +collected. +The following values are displayed (formal SNMP names between +square brackets): + +.B ierr6/s +.RS +The number of ICMP messages per second which the interface +received but determined as having ICMP-specific +errors (bad ICMP checksums, bad length, etc.) +[ipv6IfIcmpInErrors] +.RE + +.B idtunr6/s +.RS +The number of ICMP Destination Unreachable +messages received by the interface per second +[ipv6IfIcmpInDestUnreachs]. +.RE + +.B odtunr6/s +.RS +The number of ICMP Destination Unreachable +messages sent by the interface per second +[ipv6IfIcmpOutDestUnreachs]. +.RE + +.B itmex6/s +.RS +The number of ICMP Time Exceeded messages +received by the interface per second +[ipv6IfIcmpInTimeExcds]. +.RE + +.B otmex6/s +.RS +The number of ICMP Time Exceeded messages sent +by the interface per second +[ipv6IfIcmpOutTimeExcds]. +.RE + +.B iprmpb6/s +.RS +The number of ICMP Parameter Problem messages +received by the interface per second +[ipv6IfIcmpInParmProblems]. +.RE + +.B oprmpb6/s +.RS +The number of ICMP Parameter Problem messages +sent by the interface per second +[ipv6IfIcmpOutParmProblems]. +.RE + +.B iredir6/s +.RS +The number of Redirect messages received +by the interface per second +[ipv6IfIcmpInRedirects]. +.RE + +.B oredir6/s +.RS +The number of Redirect messages sent by +the interface by second +[ipv6IfIcmpOutRedirects]. +.RE + +.B ipck2b6/s +.RS +The number of ICMP Packet Too Big messages +received by the interface per second +[ipv6IfIcmpInPktTooBigs]. +.RE + +.B opck2b6/s +.RS +The number of ICMP Packet Too Big messages sent +by the interface per second +[ipv6IfIcmpOutPktTooBigs]. +.RE + +With the +.B UDP6 +keyword, statistics about UDPv6 network traffic are reported. +Note that UDPv6 statistics depend on sadc option "-S IPV6" to be +collected. +The following values are displayed (formal SNMP names between +square brackets): + +.B idgm6/s +.RS +The total number of UDP datagrams delivered per second to UDP users +[udpInDatagrams]. +.RE + +.B odgm6/s +.RS +The total number of UDP datagrams sent per second from this +entity [udpOutDatagrams]. +.RE + +.B noport6/s +.RS +The total number of received UDP datagrams per second for which there +was no application at the destination port [udpNoPorts]. +.RE + +.B idgmer6/s +.RS +The number of received UDP datagrams per second that could not be +delivered for reasons other than the lack of an application +at the destination port [udpInErrors]. +.RE + +The +.B ALL +keyword is equivalent to specifying all the keywords above and therefore all the network +activities are reported. +.RE +.RE +.IP "-o [ filename ]" +Save the readings in the file in binary form. Each reading +is in a separate record. The default value of the +.B filename +parameter is the current daily data file, the +.IR @SA_DIR@/sa dd +file. The -o option is exclusive of the -f option. +All the data available from the kernel are saved in the file (in fact, +.B sar +calls its data collector +.B sadc +with the option "-S ALL". See sadc(8) manual page). +.IP "-P { cpu [,...] | ALL }" +Report per-processor statistics for the specified processor or processors. +Specifying the +.B ALL +keyword reports statistics for each individual processor, and globally for +all processors. +Note that processor 0 is the first processor. +.IP -p +Pretty-print device names. Use this option in conjunction with option -d. +By default names are printed as +.B dev m-n +where m and n are the major and minor numbers for the device. +Use of this option displays the names of the devices as they (should) appear +in /dev. Name mappings are controlled by +.B @SYSCONFIG_DIR@/sysstat.ioconf. +.IP -q +Report queue length and load averages. The following values are displayed: + +.B runq-sz +.RS +.RS +Run queue length (number of tasks waiting for run time). +.RE + +.B plist-sz +.RS +Number of tasks in the task list. +.RE + +.B ldavg-1 +.RS +System load average for the last minute. +The load average is calculated as the average number of runnable or +running tasks (R state), and the number of tasks in uninterruptible +sleep (D state) over the specified interval. +.RE + +.B ldavg-5 +.RS +System load average for the past 5 minutes. +.RE + +.B ldavg-15 +.RS +System load average for the past 15 minutes. +.RE +.RE +.IP -r +Report memory utilization statistics. +The following values are displayed: + +.B kbmemfree +.RS +.RS +Amount of free memory available in kilobytes. +.RE + +.B kbmemused +.RS +Amount of used memory in kilobytes. This does not take into account memory +used by the kernel itself. +.RE + +.B %memused +.RS +Percentage of used memory. +.RE + +.B kbbuffers +.RS +Amount of memory used as buffers by the kernel in kilobytes. +.RE + +.B kbcached +.RS +Amount of memory used to cache data by the kernel in kilobytes. +.RE + +.B kbcommit +.RS +Amount of memory in kilobytes needed for current workload. This is an estimate of how much +RAM/swap is needed to guarantee that there never is out of memory. +.RE + +.B %commit +.RS +Percentage of memory needed for current workload in relation to the total amount of memory (RAM+swap). +This number may be greater than 100% because the kernel usually overcommits memory. + +.RE +.RE +.IP -R +Report memory statistics. The following values are displayed: + +.B frmpg/s +.RS +.RS +Number of memory pages freed by the system per second. +A negative value represents a number of pages allocated by the system. +Note that a page has a size of 4 kB or 8 kB according to the machine architecture. +.RE + +.B bufpg/s +.RS +Number of additional memory pages used as buffers by the system per second. +A negative value means fewer pages used as buffers by the system. +.RE + +.B campg/s +.RS +Number of additional memory pages cached by the system per second. +A negative value means fewer pages in the cache. +.RE +.RE +.IP "-s [ hh:mm:ss ]" +Set the starting time of the data, causing the +.B sar +command to extract records time-tagged at, or following, the time +specified. The default starting time is 08:00:00. +Hours must be given in 24-hour format. This option can be +used only when data are read from a file (option +.B -f +). +.IP -S +Report swap space utilization statistics. +The following values are displayed: + +.B kbswpfree +.RS +.RS +Amount of free swap space in kilobytes. +.RE + +.B kbswpused +.RS +Amount of used swap space in kilobytes. +.RE + +.B %swpused +.RS +Percentage of used swap space. +.RE + +.B kbswpcad +.RS +Amount of cached swap memory in kilobytes. +This is memory that once was swapped out, is swapped back in +but still also is in the swap area (if memory is needed it doesn't need +to be swapped out again because it is already in the swap area. This +saves I/O). +.RE + +.B %swpcad +.RS +Percentage of cached swap memory in relation to the amount of used swap space. +.RE +.RE +.IP -t +When reading data from a daily data file, indicate that +.B sar +should display the timestamps in the original locale time of +the data file creator. Without this option, the +.B sar +command displays the timestamps in the user's locale time. +.IP "-u [ ALL ]" +Report CPU utilization. The +.B ALL +keyword indicates that all the CPU fields should be displayed. +The report may show the following fields: + +.B %user +.RS +.RS +Percentage of CPU utilization that occurred while executing at the user +level (application). Note that this field includes time spent running +virtual processors. +.RE + +.B %usr +.RS +Percentage of CPU utilization that occurred while executing at the user +level (application). Note that this field does NOT include time spent +running virtual processors. +.RE + +.B %nice +.RS +Percentage of CPU utilization that occurred while executing at the user +level with nice priority. +.RE + +.B %system +.RS +Percentage of CPU utilization that occurred while executing at the system +level (kernel). Note that this field includes time spent servicing +hardware and software interrupts. +.RE + +.B %sys +.RS +Percentage of CPU utilization that occurred while executing at the system +level (kernel). Note that this field does NOT include time spent servicing +hardware or software interrupts. +.RE + +.B %iowait +.RS +Percentage of time that the CPU or CPUs were idle during which +the system had an outstanding disk I/O request. +.RE + +.B %steal +.RS +Percentage of time spent in involuntary wait by the virtual CPU +or CPUs while the hypervisor was servicing another virtual processor. +.RE + +.B %irq +.RS +Percentage of time spent by the CPU or CPUs to service hardware interrupts. +.RE + +.B %soft +.RS +Percentage of time spent by the CPU or CPUs to service software interrupts. +.RE + +.B %guest +.RS +Percentage of time spent by the CPU or CPUs to run a virtual processor. +.RE + +.B %idle +.RS +Percentage of time that the CPU or CPUs were idle and the system +did not have an outstanding disk I/O request. +.RE + +Note: On SMP machines a processor that does not have any activity at all +(0.00 for every field) is a disabled (offline) processor. +.RE +.IP -v +Report status of inode, file and other kernel tables. +The following values are displayed: + +.B dentunusd +.RS +.RS +Number of unused cache entries in the directory cache. +.RE + +.B file-nr +.RS +Number of file handles used by the system. +.RE + +.B inode-nr +.RS +Number of inode handlers used by the system. +.RE + +.B pty-nr +.RS +Number of pseudo-terminals used by the system. +.RE +.RE +.IP -V +Print version number then exit. +.IP -w +Report task creation and system switching activity. + +.B proc/s +.RS +.RS +Total number of tasks created per second. +.RE + +.B cswch/s +.RS +Total number of context switches per second. +.RE +.RE +.IP -W +Report swapping statistics. The following values are displayed: + +.B pswpin/s +.RS +.RS +Total number of swap pages the system brought in per second. +.RE + +.B pswpout/s +.RS +Total number of swap pages the system brought out per second. +.RE +.RE +.IP -y +Report TTY device activity. The following values are displayed: + +.B rcvin/s +.RS +.RS +Number of receive interrupts per second for current serial line. Serial line number +is given in the TTY column. +.RE + +.B xmtin/s +.RS +Number of transmit interrupts per second for current serial line. +.RE + +.B framerr/s +.RS +Number of frame errors per second for current serial line. +.RE + +.B prtyerr/s +.RS +Number of parity errors per second for current serial line. +.RE + +.B brk/s +.RS +Number of breaks per second for current serial line. +.RE + +.B ovrun/s +.RS +Number of overrun errors per second for current serial line. +.RE +.RE + +.SH ENVIRONMENT +The +.B sar +command takes into account the following environment variables: + +.IP S_TIME_FORMAT +If this variable exists and its value is +.BR ISO +then the current locale will be ignored when printing the date in the report header. +The +.B sar +command will use the ISO 8601 format (YYYY-MM-DD) instead. + +.IP S_TIME_DEF_TIME +If this variable exists and its value is +.BR UTC +then +.B sar +will save its data in UTC time (data will still be displayed in local time). +.B sar +will also use UTC time instead of local time to determine the current daily +data file located in the +.IR @SA_DIR@ +directory. This variable may be useful for servers with users located across +several timezones. +.SH EXAMPLES +.B sar -u 2 5 +.RS +Report CPU utilization for each 2 seconds. 5 lines are displayed. +.RE + +.B sar -I 14 -o int14.file 2 10 +.RS +Report statistics on IRQ 14 for each 2 seconds. 10 lines are displayed. +Data are stored in a file called +.IR int14.file . +.RE + +.B sar -r -n DEV -f @SA_DIR@/sa16 +.RS +Display memory and network statistics saved in daily data file 'sa16'. +.RE + +.B sar -A +.RS +Display all the statistics saved in current daily data file. +.SH BUGS +.I /proc +filesystem must be mounted for the +.B sar +command to work. + +All the statistics are not necessarily available, depending on the kernel version used. +.B sar +assumes that you are using at least a 2.6 kernel. +.SH FILES +.IR @SA_DIR@/sa dd +.RS +Indicate the daily data file, where the +.B dd +parameter is a number representing the day of the month. + +.RE +.IR /proc +contains various files with system statistics. +.SH AUTHOR +Sebastien Godard (sysstat orange.fr) +.SH SEE ALSO +.BR sadc (8), +.BR sa1 (8), +.BR sa2 (8), +.BR sadf (1), +.BR pidstat (1), +.BR mpstat (1), +.BR iostat (1), +.BR vmstat (8) + +.I http://pagesperso-orange.fr/sebastien.godard/ diff --git a/mpstat.c b/mpstat.c new file mode 100644 index 00000000..f410c921 --- /dev/null +++ b/mpstat.c @@ -0,0 +1,984 @@ +/* + * mpstat: per-processor statistics + * (C) 2000-2009 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "version.h" +#include "mpstat.h" +#include "common.h" +#include "rd_stats.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__ +char *sccsid(void) { return (SCCSID); } + +unsigned long long uptime[3] = {0, 0, 0}; +unsigned long long uptime0[3] = {0, 0, 0}; + +/* NOTE: Use array of _char_ for bitmaps to avoid endianness problems...*/ +unsigned char *cpu_bitmap; /* Bit 0: Global; Bit 1: 1st proc; etc. */ + +/* Structures used to store stats */ +struct stats_cpu *st_cpu[3]; +struct stats_irq *st_irq[3]; +struct stats_irqcpu *st_irqcpu[3]; +struct stats_irqcpu *st_softirqcpu[3]; + +struct tm mp_tstamp[3]; + +/* Activity flag */ +unsigned int actflags = 0; + +unsigned int flags = 0; + +/* Interval and count parameters */ +long interval = -1, count = 0; + +/* Nb of processors on the machine */ +int cpu_nr = 0; +/* Nb of interrupts per processor */ +int irqcpu_nr = 0; +/* Nb of soft interrupts per processor */ +int softirqcpu_nr = 0; + +/* + *************************************************************************** + * Print usage and exit + * + * IN: + * @progname Name of sysstat command + *************************************************************************** + */ +void usage(char *progname) +{ + fprintf(stderr, _("Usage: %s [ options ] [ [ ] ]\n"), + progname); + + fprintf(stderr, _("Options are:\n" + "[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n")); + exit(1); +} + +/* + *************************************************************************** + * SIGALRM signal handler + * + * IN: + * @sig Signal number. Set to 0 for the first time, then to SIGALRM. + *************************************************************************** + */ +void alarm_handler(int sig) +{ + signal(SIGALRM, alarm_handler); + alarm(interval); +} + +/* + *************************************************************************** + * Allocate stats structures and cpu bitmap. + * + * IN: + * @nr_cpus Number of CPUs. This is the real number of available CPUs + 1 + * because we also have to allocate a structure for CPU 'all'. + *************************************************************************** + */ +void salloc_mp_struct(int nr_cpus) +{ + int i; + + for (i = 0; i < 3; i++) { + + if ((st_cpu[i] = (struct stats_cpu *) malloc(STATS_CPU_SIZE * nr_cpus)) + == NULL) { + perror("malloc"); + exit(4); + } + memset(st_cpu[i], 0, STATS_CPU_SIZE * nr_cpus); + + if ((st_irq[i] = (struct stats_irq *) malloc(STATS_IRQ_SIZE * nr_cpus)) + == NULL) { + perror("malloc"); + exit(4); + } + memset(st_irq[i], 0, STATS_IRQ_SIZE * nr_cpus); + + if ((st_irqcpu[i] = (struct stats_irqcpu *) malloc(STATS_IRQCPU_SIZE * nr_cpus * irqcpu_nr)) + == NULL) { + perror("malloc"); + exit(4); + } + memset(st_irqcpu[i], 0, STATS_IRQCPU_SIZE * nr_cpus * irqcpu_nr); + + if ((st_softirqcpu[i] = (struct stats_irqcpu *) malloc(STATS_IRQCPU_SIZE * nr_cpus * softirqcpu_nr)) + == NULL) { + perror("malloc"); + exit(4); + } + memset(st_softirqcpu[i], 0, STATS_IRQCPU_SIZE * nr_cpus * softirqcpu_nr); + } + + if ((cpu_bitmap = (unsigned char *) malloc((nr_cpus >> 3) + 1)) == NULL) { + perror("malloc"); + exit(4); + } + memset(cpu_bitmap, 0, (nr_cpus >> 3) + 1); +} + +/* + *************************************************************************** + * Free structures and bitmap. + *************************************************************************** + */ +void sfree_mp_struct(void) +{ + int i; + + for (i = 0; i < 3; i++) { + + if (st_cpu[i]) { + free(st_cpu[i]); + } + if (st_irq[i]) { + free(st_irq[i]); + } + if (st_irqcpu[i]) { + free(st_irqcpu[i]); + } + if (st_softirqcpu[i]) { + free(st_softirqcpu[i]); + } + } + + if (cpu_bitmap) { + free(cpu_bitmap); + } +} + +/* + *************************************************************************** + * Display per CPU statistics. + * + * IN: + * @st_ic Array for per-CPU statistics. + * @ic_nr Number of interrupts (hard or soft) per CPU. + * @dis TRUE if a header line must be printed. + * @itv Interval value. + * @prev Position in array where statistics used as reference are. + * Stats used as reference may be the previous ones read, or + * the very first ones when calculating the average. + * @curr Position in array where current statistics will be saved. + * @prev_string String displayed at the beginning of a header line. This is + * the timestamp of the previous sample, or "Average" when + * displaying average stats. + * @curr_string String displayed at the beginning of current sample stats. + * This is the timestamp of the current sample, or "Average" + * when displaying average stats. + *************************************************************************** + */ +void write_irqcpu_stats(struct stats_irqcpu *st_ic[], int ic_nr, int dis, + unsigned long long itv, int prev, int curr, + char *prev_string, char *curr_string) +{ + int j = 0, offset, cpu; + struct stats_irqcpu *p, *q, *p0, *q0; + + /* + * Check if number of interrupts has changed. + * NB: A null interval value indicates that we are + * displaying statistics since system startup. + */ + if (!dis && interval) { + do { + p0 = st_ic[curr] + j; + if (p0->irq_name[0] != '\0') { + q0 = st_ic[prev] + j; + if (strcmp(p0->irq_name, q0->irq_name)) { + /* These are two different irq */ + j = -2; + } + } + j++; + } + while ((j > 0) && (j <= ic_nr)); + } + + if (dis || (j < 0)) { + /* Print header */ + printf("\n%-11s CPU", prev_string); + for (j = 0; j < ic_nr; j++) { + p0 = st_ic[curr] + j; + if (p0->irq_name[0] != '\0') { /* Nb of irq per proc may have varied... */ + printf(" %8s/s", p0->irq_name); + } + } + printf("\n"); + } + + for (cpu = 1; cpu <= cpu_nr; cpu++) { + + /* + * Check if we want stats about this CPU. + * CPU must have been explicitly selected using option -P, + * else we display every CPU. + */ + if (!(*(cpu_bitmap + (cpu >> 3)) & (1 << (cpu & 0x07))) && USE_P_OPTION(flags)) + continue; + + printf("%-11s %3d", curr_string, cpu - 1); + + for (j = 0; j < ic_nr; j++) { + p0 = st_ic[curr] + j; /* irq field set only for proc #0 */ + /* + * An empty string for irq name means it is a remaining interrupt + * which is no longer used, for example because the + * number of interrupts has decreased in /proc/interrupts. + */ + if (p0->irq_name[0] != '\0') { + q0 = st_ic[prev] + j; + offset = j; + + /* + * If we want stats for the time since system startup, + * we have p0->irq != q0->irq, since q0 structure is + * completely set to zero. + */ + if (strcmp(p0->irq_name, q0->irq_name) && interval) { + if (j) + offset = j - 1; + q0 = st_ic[prev] + offset; + if (strcmp(p0->irq_name, q0->irq_name) && (j + 1 < ic_nr)) + offset = j + 1; + q0 = st_ic[prev] + offset; + } + + if (!strcmp(p0->irq_name, q0->irq_name) || !interval) { + p = st_ic[curr] + (cpu - 1) * ic_nr + j; + q = st_ic[prev] + (cpu - 1) * ic_nr + offset; + printf(" %10.2f", + S_VALUE(q->interrupt, p->interrupt, itv)); + } + else + printf(" N/A"); + } + } + printf("\n"); + } +} + +/* + *************************************************************************** + * Core function used to display statistics + * + * IN: + * @prev Position in array where statistics used as reference are. + * Stats used as reference may be the previous ones read, or + * the very first ones when calculating the average. + * @curr Position in array where statistics for current sample are. + * @dis TRUE if a header line must be printed. + * @prev_string String displayed at the beginning of a header line. This is + * the timestamp of the previous sample, or "Average" when + * displaying average stats. + * @curr_string String displayed at the beginning of current sample stats. + * This is the timestamp of the current sample, or "Average" + * when displaying average stats. + *************************************************************************** + */ +void write_stats_core(int prev, int curr, int dis, + char *prev_string, char *curr_string) +{ + struct stats_cpu *scc, *scp; + unsigned long long itv, pc_itv, g_itv; + int cpu; + + /* Test stdout */ + TEST_STDOUT(STDOUT_FILENO); + + /* Compute time interval */ + g_itv = get_interval(uptime[prev], uptime[curr]); + + /* Reduce interval value to one processor */ + if (cpu_nr > 1) { + itv = get_interval(uptime0[prev], uptime0[curr]); + } + else { + itv = g_itv; + } + + /* Print CPU stats */ + if (DISPLAY_CPU(actflags)) { + if (dis) { + printf("\n%-11s CPU %%usr %%nice %%sys %%iowait %%irq " + "%%soft %%steal %%guest %%idle\n", + prev_string); + } + + /* Check if we want global stats among all proc */ + if (*cpu_bitmap & 1) { + + printf("%-11s all", curr_string); + + printf(" %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f\n", + ll_sp_value(st_cpu[prev]->cpu_user - st_cpu[prev]->cpu_guest, + st_cpu[curr]->cpu_user - st_cpu[curr]->cpu_guest, + g_itv), + ll_sp_value(st_cpu[prev]->cpu_nice, + st_cpu[curr]->cpu_nice, + g_itv), + ll_sp_value(st_cpu[prev]->cpu_sys, + st_cpu[curr]->cpu_sys, + g_itv), + ll_sp_value(st_cpu[prev]->cpu_iowait, + st_cpu[curr]->cpu_iowait, + g_itv), + ll_sp_value(st_cpu[prev]->cpu_hardirq, + st_cpu[curr]->cpu_hardirq, + g_itv), + ll_sp_value(st_cpu[prev]->cpu_softirq, + st_cpu[curr]->cpu_softirq, + g_itv), + ll_sp_value(st_cpu[prev]->cpu_steal, + st_cpu[curr]->cpu_steal, + g_itv), + ll_sp_value(st_cpu[prev]->cpu_guest, + st_cpu[curr]->cpu_guest, + g_itv), + (st_cpu[curr]->cpu_idle < st_cpu[prev]->cpu_idle) ? + 0.0 : /* Handle buggy kernels */ + ll_sp_value(st_cpu[prev]->cpu_idle, + st_cpu[curr]->cpu_idle, + g_itv)); + } + + for (cpu = 1; cpu <= cpu_nr; cpu++) { + + scc = st_cpu[curr] + cpu; + scp = st_cpu[prev] + cpu; + + /* Check if we want stats about this proc */ + if (!(*(cpu_bitmap + (cpu >> 3)) & (1 << (cpu & 0x07)))) + continue; + + printf("%-11s %4d", curr_string, cpu - 1); + + /* + * If the CPU is offline then it is omited from /proc/stat + * and the sum of all values is zero. + * (Remember that guest time is already included in user mode.) + */ + if ((scc->cpu_user + scc->cpu_nice + scc->cpu_sys + + scc->cpu_iowait + scc->cpu_idle + scc->cpu_steal + + scc->cpu_hardirq + scc->cpu_softirq) == 0) { + /* + * Set current struct fields (which have been set to zero) + * to values from previous iteration. Hence their values won't + * jump from zero when the CPU comes back online. + */ + *scc = *scp; + + printf(" %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f" + " %6.2f %6.2f %6.2f\n", + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + continue; + } + + /* Recalculate itv for current proc */ + pc_itv = get_per_cpu_interval(scc, scp); + + if (!pc_itv) { + /* + * If the CPU is tickless then there is no change in CPU values + * but the sum of values is not zero. + */ + printf(" %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f" + " %6.2f %6.2f %6.2f\n", + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100.0); + } + + else { + printf(" %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f" + " %6.2f %6.2f %6.2f\n", + ll_sp_value(scp->cpu_user - scp->cpu_guest, + scc->cpu_user - scc->cpu_guest, + pc_itv), + ll_sp_value(scp->cpu_nice, + scc->cpu_nice, + pc_itv), + ll_sp_value(scp->cpu_sys, + scc->cpu_sys, + pc_itv), + ll_sp_value(scp->cpu_iowait, + scc->cpu_iowait, + pc_itv), + ll_sp_value(scp->cpu_hardirq, + scc->cpu_hardirq, + pc_itv), + ll_sp_value(scp->cpu_softirq, + scc->cpu_softirq, + pc_itv), + ll_sp_value(scp->cpu_steal, + scc->cpu_steal, + pc_itv), + ll_sp_value(scp->cpu_guest, + scc->cpu_guest, + pc_itv), + (scc->cpu_idle < scp->cpu_idle) ? + 0.0 : + ll_sp_value(scp->cpu_idle, + scc->cpu_idle, + pc_itv)); + } + } + } + + /* Print total number of interrupts per processor */ + if (DISPLAY_IRQ_SUM(actflags)) { + struct stats_irq *sic, *sip; + + if (dis) { + printf("\n%-11s CPU intr/s\n", prev_string); + } + + if (*cpu_bitmap & 1) { + printf("%-11s all %9.2f\n", curr_string, + ll_s_value(st_irq[prev]->irq_nr, st_irq[curr]->irq_nr, itv)); + } + + for (cpu = 1; cpu <= cpu_nr; cpu++) { + + sic = st_irq[curr] + cpu; + sip = st_irq[prev] + cpu; + + scc = st_cpu[curr] + cpu; + scp = st_cpu[prev] + cpu; + + /* Check if we want stats about this proc */ + if (!(*(cpu_bitmap + (cpu >> 3)) & (1 << (cpu & 0x07)))) + continue; + + printf("%-11s %4d", curr_string, cpu - 1); + + /* Recalculate itv for current proc */ + pc_itv = get_per_cpu_interval(scc, scp); + + if (!pc_itv) { + /* Current CPU is offline */ + printf(" %9.2f\n", 0.0); + } + else { + printf(" %9.2f\n", + ll_s_value(sip->irq_nr, sic->irq_nr, itv)); + } + } + } + + if (DISPLAY_IRQ_CPU(actflags)) { + write_irqcpu_stats(st_irqcpu, irqcpu_nr, dis, itv, prev, curr, + prev_string, curr_string); + } + + if (DISPLAY_SOFTIRQS(actflags)) { + write_irqcpu_stats(st_softirqcpu, softirqcpu_nr, dis, itv, prev, curr, + prev_string, curr_string); + } +} + +/* + *************************************************************************** + * Print statistics average + * + * IN: + * @curr Position in array where statistics for current sample are. + * @dis TRUE if a header line must be printed. + *************************************************************************** + */ +void write_stats_avg(int curr, int dis) +{ + char string[16]; + + strncpy(string, _("Average:"), 16); + string[15] = '\0'; + write_stats_core(2, curr, dis, string, string); +} + +/* + *************************************************************************** + * Print statistics + * + * IN: + * @curr Position in array where statistics for current sample are. + * @dis TRUE if a header line must be printed. + *************************************************************************** + */ +void write_stats(int curr, int dis) +{ + char cur_time[2][16]; + + /* Get previous timestamp */ + strftime(cur_time[!curr], 16, "%X", &(mp_tstamp[!curr])); + + /* Get current timestamp */ + strftime(cur_time[curr], 16, "%X", &(mp_tstamp[curr])); + + write_stats_core(!curr, curr, dis, cur_time[!curr], cur_time[curr]); +} + +/* + *************************************************************************** + * Read stats from /proc/interrupts or /proc/softirqs. + * + * IN: + * @file /proc file to read (interrupts or softirqs). + * @ic_nr Number of interrupts (hard or soft) per CPU. + * @curr Position in array where current statistics will be saved. + * + * OUT: + * @st_ic Array for per-CPU statistics. + *************************************************************************** + */ +void read_interrupts_stat(char *file, struct stats_irqcpu *st_ic[], int ic_nr, int curr) +{ + FILE *fp; + struct stats_irq *st_irq_i; + struct stats_irqcpu *p; + char *line = NULL; + unsigned long irq = 0; + unsigned int cpu; + int cpu_index[cpu_nr], index = 0, dgt, len; + char *cp, *next; + + for (cpu = 0; cpu < cpu_nr; cpu++) { + st_irq_i = st_irq[curr] + cpu + 1; + st_irq_i->irq_nr = 0; + } + + if ((fp = fopen(file, "r")) != NULL) { + + SREALLOC(line, char, INTERRUPTS_LINE + 11 * cpu_nr); + + /* + * Parse header line to see which CPUs are online + */ + while (fgets(line, INTERRUPTS_LINE + 11 * cpu_nr, fp) != NULL) { + next = line; + while (((cp = strstr(next, "CPU")) != NULL) && (index < cpu_nr)) { + cpu = strtol(cp + 3, &next, 10); + cpu_index[index++] = cpu; + } + if (index) + /* Header line found */ + break; + } + + while ((fgets(line, INTERRUPTS_LINE + 11 * cpu_nr, fp) != NULL) && + (irq < ic_nr)) { + + /* Skip over ":" */ + if ((cp = strchr(line, ':')) == NULL) + continue; + cp++; + + p = st_ic[curr] + irq; + len = strcspn(line, ":"); + if (len >= MAX_IRQ_LEN) { + len = MAX_IRQ_LEN - 1; + } + strncpy(p->irq_name, line, len); + p->irq_name[len] = '\0'; + dgt = isdigit(line[len - 1]); + + for (cpu = 0; cpu < index; cpu++) { + p = st_ic[curr] + cpu_index[cpu] * ic_nr + irq; + st_irq_i = st_irq[curr] + cpu_index[cpu] + 1; + /* + * No need to set (st_irqcpu + cpu * irqcpu_nr)->irq: + * This is the same as st_irqcpu->irq. + */ + p->interrupt = strtoul(cp, &next, 10); + if (dgt) { + /* Sum only numerical irq (and not NMI, LOC, etc.) */ + st_irq_i->irq_nr += p->interrupt; + } + cp = next; + } + irq++; + } + + fclose(fp); + + if (line) { + free(line); + } + } + + while (irq < ic_nr) { + /* Nb of interrupts per processor has changed */ + p = st_ic[curr] + irq; + p->irq_name[0] = '\0'; /* This value means this is a dummy interrupt */ + irq++; + } +} + +/* + *************************************************************************** + * Main loop: Read stats from the relevant sources, and display them. + * + * IN: + * @dis_hdr Set to TRUE if the header line must always be printed. + * @rows Number of rows of screen. + *************************************************************************** + */ +void rw_mpstat_loop(int dis_hdr, int rows) +{ + struct stats_cpu *scc; + int cpu; + int curr = 1, dis = 1; + unsigned long lines = rows; + + /* Dont buffer data if redirected to a pipe */ + setbuf(stdout, NULL); + + /* Read stats */ + if (cpu_nr > 1) { + /* + * Init uptime0. So if /proc/uptime cannot fill it, + * this will be done by /proc/stat. + */ + uptime0[0] = 0; + read_uptime(&(uptime0[0])); + } + read_stat_cpu(st_cpu[0], cpu_nr + 1, &(uptime[0]), &(uptime0[0])); + + if (DISPLAY_IRQ_SUM(actflags)) { + read_stat_irq(st_irq[0], 1); + } + + if (DISPLAY_IRQ_SUM(actflags) || DISPLAY_IRQ_CPU(actflags)) { + /* Read this file to display int per CPU or total nr of int per CPU */ + read_interrupts_stat(INTERRUPTS, st_irqcpu, irqcpu_nr, 0); + } + + if (DISPLAY_SOFTIRQS(actflags)) { + read_interrupts_stat(SOFTIRQS, st_softirqcpu, softirqcpu_nr, 0); + } + + if (!interval) { + /* Display since boot time */ + mp_tstamp[1] = mp_tstamp[0]; + memset(st_cpu[1], 0, STATS_CPU_SIZE * (cpu_nr + 1)); + memset(st_irq[1], 0, STATS_IRQ_SIZE * (cpu_nr + 1)); + memset(st_irqcpu[1], 0, STATS_IRQCPU_SIZE * (cpu_nr + 1) * irqcpu_nr); + if (DISPLAY_SOFTIRQS(actflags)) { + memset(st_softirqcpu[1], 0, STATS_IRQCPU_SIZE * (cpu_nr + 1) * softirqcpu_nr); + } + write_stats(0, DISP_HDR); + exit(0); + } + + /* Set a handler for SIGALRM */ + alarm_handler(0); + + /* Save the first stats collected. Will be used to compute the average */ + mp_tstamp[2] = mp_tstamp[0]; + uptime[2] = uptime[0]; + uptime0[2] = uptime0[0]; + memcpy(st_cpu[2], st_cpu[0], STATS_CPU_SIZE * (cpu_nr + 1)); + memcpy(st_irq[2], st_irq[0], STATS_IRQ_SIZE * (cpu_nr + 1)); + memcpy(st_irqcpu[2], st_irqcpu[0], STATS_IRQCPU_SIZE * (cpu_nr + 1) * irqcpu_nr); + if (DISPLAY_SOFTIRQS(actflags)) { + memcpy(st_softirqcpu[2], st_softirqcpu[0], + STATS_IRQCPU_SIZE * (cpu_nr + 1) * softirqcpu_nr); + } + + pause(); + + do { + /* + * Resetting the structure not needed since every fields will be set. + * Exceptions are per-CPU structures: Some of them may not be filled + * if corresponding processor is disabled (offline). We set them to zero + * to be able to distinguish between offline and tickless CPUs. + */ + for (cpu = 1; cpu <= cpu_nr; cpu++) { + scc = st_cpu[curr] + cpu; + memset(scc, 0, STATS_CPU_SIZE); + } + + /* Get time */ + get_localtime(&(mp_tstamp[curr])); + + /* Read stats */ + if (cpu_nr > 1) { + uptime0[curr] = 0; + read_uptime(&(uptime0[curr])); + } + read_stat_cpu(st_cpu[curr], cpu_nr + 1, &(uptime[curr]), &(uptime0[curr])); + + if (DISPLAY_IRQ_SUM(actflags)) { + read_stat_irq(st_irq[curr], 1); + } + + if (DISPLAY_IRQ_SUM(actflags) || DISPLAY_IRQ_CPU(actflags)) { + read_interrupts_stat(INTERRUPTS, st_irqcpu, irqcpu_nr, curr); + } + + if (DISPLAY_SOFTIRQS(actflags)) { + read_interrupts_stat(SOFTIRQS, st_softirqcpu, softirqcpu_nr, curr); + } + + /* Write stats */ + if (!dis_hdr) { + dis = lines / rows; + if (dis) { + lines %= rows; + } + lines++; + } + write_stats(curr, dis); + + if (count > 0) { + count--; + } + if (count) { + curr ^= 1; + pause(); + } + } + while (count); + + /* Write stats average */ + write_stats_avg(curr, dis_hdr); +} + +/* + *************************************************************************** + * Main entry to the program + *************************************************************************** + */ +int main(int argc, char **argv) +{ + int opt = 0, i, actset = FALSE; + struct utsname header; + int dis_hdr = -1; + int rows = 23; + char *t; + +#ifdef USE_NLS + /* Init National Language Support */ + init_nls(); +#endif + + /* Get HZ */ + get_HZ(); + + /* How many processors on this machine ? */ + cpu_nr = get_cpu_nr(~0); + + /* Calculate number of interrupts per processor */ + irqcpu_nr = get_irqcpu_nr(INTERRUPTS, NR_IRQS, cpu_nr) + + NR_IRQCPU_PREALLOC; + /* Calculate number of soft interrupts per processor */ + softirqcpu_nr = get_irqcpu_nr(SOFTIRQS, NR_IRQS, cpu_nr) + + NR_IRQCPU_PREALLOC; + + /* + * cpu_nr: a value of 2 means there are 2 processors (0 and 1). + * In this case, we have to allocate 3 structures: global, proc0 and proc1. + */ + salloc_mp_struct(cpu_nr + 1); + + while (++opt < argc) { + + if (!strcmp(argv[opt], "-I")) { + if (argv[++opt]) { + actset = TRUE; + if (!strcmp(argv[opt], K_SUM)) { + /* Display total number of interrupts per CPU */ + actflags |= M_D_IRQ_SUM; + } + else if (!strcmp(argv[opt], K_CPU)) { + /* Display interrupts per CPU */ + actflags |= M_D_IRQ_CPU; + } + else if (!strcmp(argv[opt], K_SCPU)) { + /* Display soft interrupts per CPU */ + actflags |= M_D_SOFTIRQS; + } + else if (!strcmp(argv[opt], K_ALL)) { + actflags |= M_D_IRQ_SUM + M_D_IRQ_CPU + M_D_SOFTIRQS; + } + else { + usage(argv[0]); + } + } + else { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-P")) { + /* '-P ALL' can be used on UP machines */ + if (argv[++opt]) { + flags |= F_P_OPTION; + dis_hdr++; + + for (t = strtok(argv[opt], ","); t; t = strtok(NULL, ",")) { + if (!strcmp(t, K_ALL)) { + if (cpu_nr) { + dis_hdr = 9; + } + /* + * Set bit for every processor. + * Also indicate to display stats for CPU 'all'. + */ + memset(cpu_bitmap, 0xff, ((cpu_nr + 1) >> 3) + 1); + } + else { + if (strspn(t, DIGITS) != strlen(t)) { + usage(argv[0]); + } + i = atoi(t); /* Get cpu number */ + if (i >= cpu_nr) { + fprintf(stderr, _("Not that many processors!\n")); + exit(1); + } + i++; + *(cpu_bitmap + (i >> 3)) |= 1 << (i & 0x07); + } + } + } + else { + usage(argv[0]); + } + } + + else if (!strncmp(argv[opt], "-", 1)) { + for (i = 1; *(argv[opt] + i); i++) { + + switch (*(argv[opt] + i)) { + + case 'A': + actflags |= M_D_CPU + M_D_IRQ_SUM + M_D_IRQ_CPU + M_D_SOFTIRQS; + actset = TRUE; + /* Select all processors */ + flags |= F_P_OPTION; + memset(cpu_bitmap, 0xff, ((cpu_nr + 1) >> 3) + 1); + break; + + case 'u': + /* Display CPU */ + actflags |= M_D_CPU; + break; + + case 'V': + /* Print version number */ + print_version(); + break; + + default: + usage(argv[0]); + } + } + } + + else if (interval < 0) { + /* Get interval */ + if (strspn(argv[opt], DIGITS) != strlen(argv[opt])) { + usage(argv[0]); + } + interval = atol(argv[opt]); + if (interval < 0) { + usage(argv[0]); + } + count = -1; + } + + else if (count <= 0) { + /* Get count value */ + if ((strspn(argv[opt], DIGITS) != strlen(argv[opt])) || + !interval) { + usage(argv[0]); + } + count = atol(argv[opt]); + if (count < 1) { + usage(argv[0]); + } + } + + else { + usage(argv[0]); + } + } + + /* Default: Display CPU */ + if (!actset) { + actflags |= M_D_CPU; + } + + if (count_bits(&actflags, sizeof(unsigned int)) > 1) { + dis_hdr = 9; + } + + if (!USE_P_OPTION(flags)) { + /* Option -P not used: Set bit 0 (global stats among all proc) */ + *cpu_bitmap = 1; + } + if (dis_hdr < 0) { + dis_hdr = 0; + } + if (!dis_hdr) { + /* Get window size */ + rows = get_win_height(); + } + if (interval < 0) { + /* Interval not set => display stats since boot time */ + interval = 0; + } + + /* Get time */ + get_localtime(&(mp_tstamp[0])); + + /* Get system name, release number and hostname */ + uname(&header); + print_gal_header(&(mp_tstamp[0]), header.sysname, header.release, + header.nodename, header.machine, cpu_nr); + + /* Main loop */ + rw_mpstat_loop(dis_hdr, rows); + + /* Free structures */ + sfree_mp_struct(); + + return 0; +} diff --git a/mpstat.h b/mpstat.h new file mode 100644 index 00000000..99d86ce8 --- /dev/null +++ b/mpstat.h @@ -0,0 +1,77 @@ +/* + * mpstat: per-processor statistics + * (C) 2000-2009 by Sebastien Godard (sysstat orange.fr) + */ + +#ifndef _MPSTAT_H +#define _MPSTAT_H + +/* + *************************************************************************** + * mpstat's specific system files. + *************************************************************************** + */ + +#define SOFTIRQS "/proc/softirqs" + +/* + *************************************************************************** + * Activities definitions. + *************************************************************************** + */ + +#define M_D_CPU 0x0001 +#define M_D_IRQ_SUM 0x0002 +#define M_D_IRQ_CPU 0x0004 +#define M_D_SOFTIRQS 0x0008 + +#define DISPLAY_CPU(m) (((m) & M_D_CPU) == M_D_CPU) +#define DISPLAY_IRQ_SUM(m) (((m) & M_D_IRQ_SUM) == M_D_IRQ_SUM) +#define DISPLAY_IRQ_CPU(m) (((m) & M_D_IRQ_CPU) == M_D_IRQ_CPU) +#define DISPLAY_SOFTIRQS(m) (((m) & M_D_SOFTIRQS) == M_D_SOFTIRQS) + +/* + *************************************************************************** + * Keywords and constants. + *************************************************************************** + */ + +/* Indicate that option -P has been used */ +#define F_P_OPTION 0x01 + +#define USE_P_OPTION(m) (((m) & F_P_OPTION) == F_P_OPTION) + +#define K_SUM "SUM" +#define K_CPU "CPU" +#define K_SCPU "SCPU" + +#define NR_IRQCPU_PREALLOC 3 + +#define MAX_IRQ_LEN 16 + +/* + *************************************************************************** + * Structures used to store statistics. + *************************************************************************** + */ + +/* + * stats_irqcpu->irq: IRQ#-A + * stats_irqcpu->interrupt: number of IRQ#-A for proc 0 + * stats_irqcpu->irq: IRQ#-B + * stats_irqcpu->interrupt: number of IRQ#-B for proc 0 + * ... + * stats_irqcpu->irq: (undef'd) + * stats_irqcpu->interrupt: number of IRQ#-A for proc 1 + * stats_irqcpu->irq: (undef'd) + * stats_irqcpu->interrupt: number of IRQ#-B for proc 1 + * ... + */ +struct stats_irqcpu { + unsigned int interrupt __attribute__ ((aligned (4))); + char irq_name[MAX_IRQ_LEN]; +}; + +#define STATS_IRQCPU_SIZE (sizeof(struct stats_irqcpu)) + +#endif diff --git a/nfsiostat.c b/nfsiostat.c new file mode 100644 index 00000000..05a7dfa2 --- /dev/null +++ b/nfsiostat.c @@ -0,0 +1,653 @@ +/* + * nfsiostat: report NFS I/O statistics + * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved + * Written by Ivana Varekova + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include + +#include "version.h" +#include "nfsiostat.h" +#include "common.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__ +char *sccsid(void) { return (SCCSID); } + +unsigned long long uptime[2] = {0, 0}; +unsigned long long uptime0[2] = {0, 0}; +struct io_nfs_stats *st_ionfs[2]; +struct io_hdr_stats *st_hdr_ionfs; + +int ionfs_nr = 0; /* Nb of NFS mounted directories found */ +int cpu_nr = 0; /* Nb of processors on the machine */ +int flags = 0; /* Flag for common options and system state */ + +long interval = 0; +char timestamp[64]; + + +/* + *************************************************************************** + * Print usage and exit. + * + * IN: + * @progname Name of sysstat command. + *************************************************************************** + */ +void usage(char *progname) +{ + fprintf(stderr, _("Usage: %s [ options ] [ [ ] ]\n"), + progname); + + fprintf(stderr, _("Options are:\n" + "[ -h ] [ -k | -m ] [ -t ] [ -V ]\n")); + exit(1); +} + +/* + *************************************************************************** + * SIGALRM signal handler. + * + * IN: + * @sig Signal number. Set to 0 for the first time, then to SIGALRM. + *************************************************************************** + */ +void alarm_handler(int sig) +{ + signal(SIGALRM, alarm_handler); + alarm(interval); +} + +/* + *************************************************************************** + * Find number of NFS-mounted points that are registered in + * /proc/self/mountstats. + * + * RETURNS: + * Number of NFS-mounted points. + *************************************************************************** + */ +int get_nfs_mount_nr(void) +{ + FILE *fp; + char line[8192]; + char type_name[10]; + unsigned int nfs = 0; + + if ((fp = fopen(NFSMOUNTSTATS, "r")) == NULL) + /* File non-existent */ + return 0; + + while (fgets(line, 8192, fp) != NULL) { + + if ((strstr(line, "mounted")) && (strstr(line, "on")) && + (strstr(line, "with")) && (strstr(line, "fstype"))) { + + sscanf(strstr(line, "fstype") + 6, "%10s", type_name); + if ((!strncmp(type_name, "nfs", 3)) && (strncmp(type_name, "nfsd", 4))) { + nfs ++; + } + } + } + + fclose(fp); + + return nfs; +} + +/* + *************************************************************************** + * Set every nfs_io entry to inactive state (unregistered). + *************************************************************************** + */ +void set_entries_inactive(void) +{ + int i; + struct io_hdr_stats *shi = st_hdr_ionfs; + + for (i = 0; i < ionfs_nr; i++, shi++) { + shi->active = FALSE; + } +} + +/* + *************************************************************************** + * Free inactive entries (mark them as unused). + *************************************************************************** + */ +void free_inactive_entries(void) +{ + int i; + struct io_hdr_stats *shi = st_hdr_ionfs; + + for (i = 0; i < ionfs_nr; i++, shi++) { + if (!shi->active) { + shi->used = FALSE; + } + } +} + +/* + *************************************************************************** + * Allocate and init structures, according to system state. + *************************************************************************** + */ +void io_sys_init(void) +{ + int i; + + /* How many processors on this machine? */ + cpu_nr = get_cpu_nr(~0); + + /* Get number of NFS directories in /proc/self/mountstats */ + if ((ionfs_nr = get_nfs_mount_nr()) > 0) { + ionfs_nr += NR_NFS_PREALLOC; + } + st_hdr_ionfs = (struct io_hdr_stats *) calloc(ionfs_nr, IO_HDR_STATS_SIZE); + + /* Allocate structures for number of NFS directories found */ + for (i = 0; i < 2; i++) { + if ((st_ionfs[i] = + (struct io_nfs_stats *) calloc(ionfs_nr, IO_NFS_STATS_SIZE)) == NULL) { + perror("malloc"); + exit(4); + } + } +} + +/* + *************************************************************************** + * Free various structures. + *************************************************************************** +*/ +void io_sys_free(void) +{ + int i; + + /* Free I/O NFS directories structures */ + for (i = 0; i < 2; i++) { + + if (st_ionfs[i]) { + free(st_ionfs[i]); + } + } + + if (st_hdr_ionfs) { + free(st_hdr_ionfs); + } +} + +/* + *************************************************************************** + * Save stats for current NFS filesystem. + * + * IN: + * @name Name of NFS filesystem. + * @curr Index in array for current sample statistics. + * @st_io Structure with NFS statistics to save. + * @ionfs_nr Number of NFS filesystems. + * @st_hdr_ionfs Pointer on structures describing an NFS filesystem. + * + * OUT: + * @st_hdr_ionfs Pointer on structures describing an NFS filesystem. + *************************************************************************** + */ +void save_stats(char *name, int curr, void *st_io, int ionfs_nr, + struct io_hdr_stats *st_hdr_ionfs) +{ + int i; + struct io_hdr_stats *st_hdr_ionfs_i; + struct io_nfs_stats *st_ionfs_i; + + /* Look for NFS directory in data table */ + for (i = 0; i < ionfs_nr; i++) { + st_hdr_ionfs_i = st_hdr_ionfs + i; + if (!strcmp(st_hdr_ionfs_i->name, name)) { + break; + } + } + + if (i == ionfs_nr) { + /* + * This is a new filesystem: Look for an unused entry to store it. + */ + for (i = 0; i < ionfs_nr; i++) { + st_hdr_ionfs_i = st_hdr_ionfs + i; + if (!st_hdr_ionfs_i->used) { + /* Unused entry found... */ + st_hdr_ionfs_i->used = TRUE; /* Indicate it is now used */ + strcpy(st_hdr_ionfs_i->name, name); + st_ionfs_i = st_ionfs[!curr] + i; + memset(st_ionfs_i, 0, IO_NFS_STATS_SIZE); + break; + } + } + } + if (i < ionfs_nr) { + st_hdr_ionfs_i = st_hdr_ionfs + i; + st_hdr_ionfs_i->active = TRUE; + st_ionfs_i = st_ionfs[curr] + i; + *st_ionfs_i = *((struct io_nfs_stats *) st_io); + } + /* + * else it was a new NFS directory + * but there was no free structure to store it. + */ +} + +/* + *************************************************************************** + * Read NFS-mount directories stats from /proc/self/mountstats. + * + * IN: + * @curr Index in array for current sample statistics. + *************************************************************************** + */ +void read_nfs_stat(int curr) +{ + FILE *fp; + int sw = 0; + char line[256]; + char *xprt_line; + char nfs_name[MAX_NAME_LEN]; + char mount[10], on[10], prefix[10], aux[32]; + char operation[16]; + struct io_nfs_stats snfs; + long int v1; + + /* Every I/O NFS entry is potentially unregistered */ + set_entries_inactive(); + + if ((fp = fopen(NFSMOUNTSTATS, "r")) == NULL) + return; + + sprintf(aux, "%%%ds %%10s %%10s", + MAX_NAME_LEN < 200 ? MAX_NAME_LEN : 200); + + while (fgets(line, 256, fp) != NULL) { + + /* Read NFS directory name */ + if (!strncmp(line, "device", 6)) { + sw = 0; + sscanf(line + 6, aux, nfs_name, mount, on); + if ((!strncmp(mount, "mounted", 7)) && (!strncmp(on, "on", 2))) { + sw = 1; + } + } + + sscanf(line, "%10s", prefix); + if (sw && (!strncmp(prefix, "bytes:", 6))) { + /* Read the stats for the last NFS-mounted directory */ + sscanf(strstr(line, "bytes:") + 6, "%llu %llu %llu %llu %llu %llu", + &snfs.rd_normal_bytes, &snfs.wr_normal_bytes, + &snfs.rd_direct_bytes, &snfs.wr_direct_bytes, + &snfs.rd_server_bytes, &snfs.wr_server_bytes); + sw = 2; + } + + if ((sw == 2) && (!strncmp(prefix, "xprt:", 5))) { + /* + * Read extended statistic for the last NFS-mounted directory + * - number of sent rpc requests. + */ + xprt_line = (strstr(line, "xprt:") + 6); + /* udp, tcp or rdma data */ + if (!strncmp(xprt_line, "udp", 3)) { + /* port bind_count sends recvs (bad_xids req_u bklog_u) */ + sscanf(strstr(xprt_line, "udp") + 4, "%*u %*u %lu", + &snfs.rpc_sends); + } + if (!strncmp(xprt_line, "tcp", 3)) { + /* + * port bind_counter connect_count connect_time idle_time + * sends recvs (bad_xids req_u bklog_u) + */ + sscanf(strstr(xprt_line, "tcp") + 4, + "%*u %*u %*u %*u %*d %lu", + &snfs.rpc_sends); + } + if (!strncmp(xprt_line,"rdma", 4)) { + /* + * 0(port) bind_count connect_count connect_time idle_time + * sends recvs (bad_xids req_u bklog_u...) + */ + sscanf(strstr(xprt_line, "rdma") + 5, + "%*u %*u %*u %*u %*d %lu", + &snfs.rpc_sends); + } + sw = 3; + } + + if ((sw == 3) && (!strncmp(prefix, "per-op", 6))) { + sw = 4; + while (sw == 4) { + fgets(line, 256, fp); + sscanf(line, "%15s %lu", operation, &v1); + if (!strncmp(operation, "READ:", 5)) { + snfs.nfs_rops = v1; + } + else if (!strncmp(operation, "WRITE:", 6)) { + snfs.nfs_wops = v1; + save_stats(nfs_name, curr, &snfs, ionfs_nr, st_hdr_ionfs); + sw = 0; + } + } + } + } + + fclose(fp); + + /* Free structures corresponding to unregistered filesystems */ + free_inactive_entries(); +} + +/* + *************************************************************************** + * Display NFS stats header. + * + * OUT: + * @fctr Conversion factor. + *************************************************************************** + */ +void write_nfs_stat_header(int *fctr) +{ + printf("Filesystem: "); + if (DISPLAY_KILOBYTES(flags)) { + printf(" rkB_nor/s wkB_nor/s rkB_dir/s wkB_dir/s" + " rkB_svr/s wkB_svr/s"); + *fctr = 1024; + } + else if (DISPLAY_MEGABYTES(flags)) { + printf(" rMB_nor/s wMB_nor/s rMB_dir/s wMB_dir/s" + " rMB_svr/s wMB_svr/s"); + *fctr = 1024 * 1024; + } + else { + printf(" rBlk_nor/s wBlk_nor/s rBlk_dir/s wBlk_dir/s" + " rBlk_svr/s wBlk_svr/s"); + *fctr = 512; + } + printf(" ops/s rops/s wops/s\n"); +} + +/* + *************************************************************************** + * Write NFS stats read from /proc/self/mountstats. + * + * IN: + * @curr Index in array for current sample statistics. + * @itv Interval of time. + * @fctr Conversion factor. + * @shi Structures describing the NFS filesystems. + * @ioi Current sample statistics. + * @ioj Previous sample statistics. + *************************************************************************** + */ +void write_nfs_stat(int curr, unsigned long long itv, int fctr, + struct io_hdr_stats *shi, struct io_nfs_stats *ioni, + struct io_nfs_stats *ionj) +{ + if (DISPLAY_HUMAN_READ(flags)) { + printf("%-22s\n%23s", shi->name, ""); + } + else { + printf("%-22s ", shi->name); + } + printf("%12.2f %12.2f %12.2f %12.2f %12.2f %12.2f %9.2f %9.2f %9.2f\n", + S_VALUE(ionj->rd_normal_bytes, ioni->rd_normal_bytes, itv) / fctr, + S_VALUE(ionj->wr_normal_bytes, ioni->wr_normal_bytes, itv) / fctr, + S_VALUE(ionj->rd_direct_bytes, ioni->rd_direct_bytes, itv) / fctr, + S_VALUE(ionj->wr_direct_bytes, ioni->wr_direct_bytes, itv) / fctr, + S_VALUE(ionj->rd_server_bytes, ioni->rd_server_bytes, itv) / fctr, + S_VALUE(ionj->wr_server_bytes, ioni->wr_server_bytes, itv) / fctr, + S_VALUE(ionj->rpc_sends, ioni->rpc_sends, itv), + S_VALUE(ionj->nfs_rops, ioni->nfs_rops, itv), + S_VALUE(ionj->nfs_wops, ioni->nfs_wops, itv)); +} + +/* + *************************************************************************** + * Print everything now (stats and uptime). + * + * IN: + * @curr Index in array for current sample statistics. + * @rectime Current date and time. + *************************************************************************** + */ +void write_stats(int curr, struct tm *rectime) +{ + int i, fctr = 1; + unsigned long long itv; + struct io_hdr_stats *shi; + struct io_nfs_stats *ioni, *ionj; + + /* Test stdout */ + TEST_STDOUT(STDOUT_FILENO); + + /* Print time stamp */ + if (DISPLAY_TIMESTAMP(flags)) { + if (DISPLAY_ISO(flags)) { + strftime(timestamp, sizeof(timestamp), "%FT%T%z", rectime); + } + else { + strftime(timestamp, sizeof(timestamp), "%x %X", rectime); + } + printf("%s\n", timestamp); + } + + /* Interval is multiplied by the number of processors */ + itv = get_interval(uptime[!curr], uptime[curr]); + + if (cpu_nr > 1) { + /* On SMP machines, reduce itv to one processor (see note above) */ + itv = get_interval(uptime0[!curr], uptime0[curr]); + } + + shi = st_hdr_ionfs; + + /* Display NFS stats header */ + write_nfs_stat_header(&fctr); + + for (i = 0; i < ionfs_nr; i++, shi++) { + if (shi->used) { + ioni = st_ionfs[curr] + i; + ionj = st_ionfs[!curr] + i; + write_nfs_stat(curr, itv, fctr, shi, ioni, ionj); + } + } + printf("\n"); +} + +/* + *************************************************************************** + * Main loop: Read stats from the relevant sources and display them. + * + * IN: + * @count Number of lines of stats to print. + * @rectime Current date and time. + *************************************************************************** + */ +void rw_io_stat_loop(long int count, struct tm *rectime) +{ + int curr = 1; + + /* Don't buffer data if redirected to a pipe */ + setbuf(stdout, NULL); + + do { + if (cpu_nr > 1) { + /* + * Read system uptime (only for SMP machines). + * Init uptime0. So if /proc/uptime cannot fill it, + * this will be done by /proc/stat. + */ + uptime0[curr] = 0; + read_uptime(&(uptime0[curr])); + } + + /* Read NFS directories stats */ + read_nfs_stat(curr); + + /* Get time */ + get_localtime(rectime); + + /* Print results */ + write_stats(curr, rectime); + + if (count > 0) { + count--; + } + if (count) { + curr ^= 1; + pause(); + } + } + while (count); +} + +/* + *************************************************************************** + * Main entry to the nfsiostat program. + *************************************************************************** + */ +int main(int argc, char **argv) +{ + int it = 0; + int opt = 1; + int i; + long count = 1; + struct utsname header; + struct tm rectime; + +#ifdef USE_NLS + /* Init National Language Support */ + init_nls(); +#endif + + /* Get HZ */ + get_HZ(); + + /* Process args... */ + while (opt < argc) { + + if (!strncmp(argv[opt], "-", 1)) { + for (i = 1; *(argv[opt] + i); i++) { + + switch (*(argv[opt] + i)) { + + case 'h': + /* Display an easy-to-read NFS report */ + flags |= I_D_HUMAN_READ; + break; + + case 'k': + if (DISPLAY_MEGABYTES(flags)) { + usage(argv[0]); + } + /* Display stats in kB/s */ + flags |= I_D_KILOBYTES; + break; + + case 'm': + if (DISPLAY_KILOBYTES(flags)) { + usage(argv[0]); + } + /* Display stats in MB/s */ + flags |= I_D_MEGABYTES; + break; + + case 't': + /* Display timestamp */ + flags |= I_D_TIMESTAMP; + break; + + case 'V': + /* Print version number and exit */ + print_version(); + break; + + default: + usage(argv[0]); + } + } + opt++; + } + + else if (!it) { + interval = atol(argv[opt++]); + if (interval < 0) { + usage(argv[0]); + } + count = -1; + it = 1; + } + + else if (it > 0) { + count = atol(argv[opt++]); + if ((count < 1) || !interval) { + usage(argv[0]); + } + it = -1; + } + else { + usage(argv[0]); + } + } + + if (!interval) { + count = 1; + } + + /* Init structures according to machine architecture */ + io_sys_init(); + + get_localtime(&rectime); + + /* Get system name, release number and hostname */ + uname(&header); + if (print_gal_header(&rectime, header.sysname, header.release, + header.nodename, header.machine, cpu_nr)) { + flags |= I_D_ISO; + } + printf("\n"); + + /* Set a handler for SIGALRM */ + alarm_handler(0); + + /* Main loop */ + rw_io_stat_loop(count, &rectime); + + /* Free structures */ + io_sys_free(); + + return 0; +} diff --git a/nfsiostat.h b/nfsiostat.h new file mode 100644 index 00000000..6315e898 --- /dev/null +++ b/nfsiostat.h @@ -0,0 +1,52 @@ +/* + * nfsiostat: Report NFS I/O statistics + * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved + * Written by Ivana Varekova + */ + +#ifndef _NFSIOSTAT_H +#define _NFSIOSTAT_H + +#include "common.h" + +#define NFSMOUNTSTATS "/proc/self/mountstats" + +/* I_: iostat - D_: Display - F_: Flag */ +#define I_D_TIMESTAMP 0x001 +#define I_D_KILOBYTES 0x002 +#define I_D_MEGABYTES 0x004 +#define I_D_ISO 0x008 +#define I_D_HUMAN_READ 0x010 + +#define DISPLAY_TIMESTAMP(m) (((m) & I_D_TIMESTAMP) == I_D_TIMESTAMP) +#define DISPLAY_KILOBYTES(m) (((m) & I_D_KILOBYTES) == I_D_KILOBYTES) +#define DISPLAY_MEGABYTES(m) (((m) & I_D_MEGABYTES) == I_D_MEGABYTES) +#define DISPLAY_ISO(m) (((m) & I_D_ISO) == I_D_ISO) +#define DISPLAY_HUMAN_READ(m) (((m) & I_D_HUMAN_READ) == I_D_HUMAN_READ) + +/* Preallocation constats */ +#define NR_NFS_PREALLOC 2 + +struct io_nfs_stats { + unsigned long long rd_normal_bytes __attribute__ ((aligned (8))); + unsigned long long wr_normal_bytes __attribute__ ((packed)); + unsigned long long rd_direct_bytes __attribute__ ((packed)); + unsigned long long wr_direct_bytes __attribute__ ((packed)); + unsigned long long rd_server_bytes __attribute__ ((packed)); + unsigned long long wr_server_bytes __attribute__ ((packed)); + unsigned long rpc_sends __attribute__ ((packed)); + unsigned long nfs_rops __attribute__ ((packed)); + unsigned long nfs_wops __attribute__ ((packed)); +}; + +#define IO_NFS_STATS_SIZE (sizeof(struct io_nfs_stats)) + +struct io_hdr_stats { + unsigned int active __attribute__ ((aligned (4))); + unsigned int used __attribute__ ((packed)); + char name[MAX_NAME_LEN]; +}; + +#define IO_HDR_STATS_SIZE (sizeof(struct io_hdr_stats)) + +#endif /* _NFSIOSTAT_H */ diff --git a/nls/README-nls b/nls/README-nls new file mode 100644 index 00000000..cbfb242a --- /dev/null +++ b/nls/README-nls @@ -0,0 +1,69 @@ +WHAT IS NLS? +------------ +NLS stands for National Language Support. It encompasses the features that make +a program able to support different languages and cultural habits. +This touches the messages displayed on the screen, but also the format used to +display the dates or the numbers for example. + + +HOW I ENABLE NLS WITH SYSSTAT? +------------------------------ +NLS is enabled by default when you configure sysstat (running "./configure"). +But you can disable it if you want: Use the option "--disable-nls" with +./configure or answer 'y' (for 'yes') to the question: +"Disable National Language Support (NLS)? (y/n) [--disable-nls]" +if you use the interactive configuration script (iconfig). + + +OK, BUT HOW DO I USE IT NOW? +---------------------------- +To see sysstat's messages in your own language, you have to set your LANG +environment variable to the proper value. For example, in France you may +want to set it to "fr_FR", although other possibilities exist. If this does +not work for your language, see below for how to add a new translation. + +If you use bash and you want to configure your system for a French environment, +enter: + +$ export LANG=fr_FR + +('$' is the prompt). +If you use the (Tab) C shell, you would have entered: + +% setenv LANG fr_FR + +('%' is the prompt). +Here is a complete example with iostat: + +$ export LANG=en_US +$ iostat -V +sysstat version 5.1.4 +(C) Sebastien Godard +Usage: iostat [ options... ] [ [ ] ] +Options are: +[ -c | -d ] [ -k ] [ -m ] [ -t ] [ -V ] [ -x ] +[ { [ ... ] | ALL } ] [ -p [ { | ALL } ] ] + +$ export LANG=fr_FR +$ iostat -V +sysstat version 5.1.4 +(C) Sebastien Godard +Utilisation: iostat [ options... ] [ [ ] ] +Options possibles: +[ -c | -d ] [ -k ] [ -m ] [ -t ] [ -V ] [ -x ] +[ { [ ... ] | ALL } ] [ -p [ { | ALL } ] ] + + +HOW CAN I ADD OR UPDATE A TRANSLATION? +-------------------------------------- +At the present time, sysstat is already translated into several languages. +If, however, the translation to your language is incomplete or entirely +missing, you can update it or add a new one by contacting the team for +your language at the Translation Project -- http://translationproject.org/ . +There you can get the latest sysstat PO file for your language, or the +latest blank POT file. When you have made the translation complete, send it +to your team leader or to the team's mailing list. + +-- +Sebastien Godard (sysstat orange.fr) + diff --git a/nls/af.po b/nls/af.po new file mode 100644 index 00000000..8bdbd4b0 --- /dev/null +++ b/nls/af.po @@ -0,0 +1,195 @@ +# NLS support for the sysstat package. +# Copyright (C) 1999 Free Software Foundation, Inc. +# Sébastien GODARD , 1999. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 3.0\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2007-12-19 14:02+0100\n" +"PO-Revision-Date: 2000-01-12 20:17\n" +"Last-Translator: Gert Brits \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat weergawe %s\n" + +#: common.c:160 common.c:385 ioconf.c:459 mpstat.c:265 sa_common.c:601 +#: sadc.c:476 sadc.c:485 sadc.c:530 sadc.c:620 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Probleem met oopmaak van %s: %s\n" + +#: common.c:199 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Kan nie soveel proseseerders hanteer nie !\n" + +#: iostat.c:74 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" +msgstr "" +"Gebruik: %s [ opsies... ] [ [ ] ]\n" +"Opsies moontlik:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" + +#: iostat.c:1119 +#, c-format +msgid "Time: %s\n" +msgstr "Tyd: %s\n" + +#: iostat.c:1435 +#, c-format +msgid "-x and -p options are mutually exclusive\n" +msgstr "Opsies -x en -p is beide uitgesluit\n" + +#: mpstat.c:66 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -P { | ALL } ] [ -V ]\n" +msgstr "" +"Gebruik: %s [ opsies... ] [ [ ] ]\n" +"Opsies moontlik:\n" +"[ -P { | ALL } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:226 pidstat.c:1148 sar.c:740 +msgid "Average:" +msgstr "Gemideld:" + +#: mpstat.c:563 sar.c:157 +#, c-format +msgid "Not that many processors!\n" +msgstr "Nie soveel proseseerders nie !\n" + +#: pidstat.c:72 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Gebruik: %s [ opsies... ] [ [ ] ]\n" +"Opsies moontlik:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:166 sar.c:1419 +#, c-format +msgid "Requested activities not available\n" +msgstr "Aangevraagte aktiviteite nie beskikbaar nie\n" + +#: sa_common.c:572 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Probleem gekry met die lees van die sisteem aktiviteit leer: %s\n" + +#: sa_common.c:581 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Einde van sisteem aktiviteit leer onbeplan geeindig\n" + +#: sa_common.c:608 sadc.c:549 +#, c-format +msgid "Invalid system activity file: %s (%#x)\n" +msgstr "Ongemagtige aktiviteit proses: %s (%#x)\n" + +#: sa_common.c:632 +#, c-format +msgid "Requested activities not available in file\n" +msgstr "Aangevraagte data is nie beskikbaar in leer nie\n" + +#: sadc.c:83 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" +msgstr "" +"Gebruik: %s [ opsies... ] [ [ ] ] [ ]\n" +"Opsies moontlik:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" + +#: sadc.c:110 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Probleem met skryf van sisteem aktiviteit leer: %s\n" + +#: sadc.c:361 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Probleem met skryf van sisteem aktiviteit hoof: %s\n" + +#: sadc.c:568 +#, c-format +msgid "Cannot append data to that file\n" +msgstr "Kan nie data byskryf by die file nie\n" + +#: sadf.c:78 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Gebruik: %s [ opsies... ] [ [ ] ] [ ]\n" +"Opsies moontlik:\n" +"[ -d [ -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sar.c:76 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Gebruik: %s [ opsies... ] [ [ ] ]\n" +"Opsies moontlik:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:149 +#, c-format +msgid "Not an SMP machine...\n" +msgstr "Nie 'n SMP rekenaar nie...\n" + +#: sar.c:1261 +#, c-format +msgid "Invalid data format\n" +msgstr "Verkeerde data formaat\n" + +#: sar.c:1633 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Opsies -f en -o is beide uitgesluit\n" + +#: sar.c:1639 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Kan nie van sisteem aktiviteit leer lees nie (gebruik opsie -f)\n" diff --git a/nls/cs.po b/nls/cs.po new file mode 100644 index 00000000..2fcfb49d --- /dev/null +++ b/nls/cs.po @@ -0,0 +1,408 @@ +# Czech translations for sysstat package. +# Copyright (C) 2010 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the sysstat package. +# +# Marek ÄŒernocký , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 9.1.4\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-07-24 10:55+0200\n" +"PO-Revision-Date: 2010-08-23 22:41+0200\n" +"Last-Translator: Marek ÄŒernocký \n" +"Language-Team: Czech \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: cs\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Použití: %s [pÅ™epínaÄe] [ []]\n" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" +"PÅ™epínaÄe jsou:\n" +"[-h] [-k|-m] [-t] [-V]\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat verze %s\n" + +#: ioconf.c:490 rd_stats.c:72 rd_stats.c:1831 sa_common.c:1052 sadc.c:593 +#: sadc.c:602 sadc.c:662 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Nelze otevřít %s: %s\n" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" +"PÅ™epínaÄe jsou:\n" +"[-c] [-d] [-N] [-k|-m] [-t] [-V] [-x] [-z]\n" +"[ […]|ALL] [-p [[,…]|ALL]] [--debuginfo]\n" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"PÅ™epínaÄe jsou:\n" +"[-c] [-d] [-N] [-k|-m] [-t] [-V] [-x] [-z]\n" +"[ […]|ALL] [-p [[,…]|ALL]]\n" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Nelze najít data na disku\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"PÅ™epínaÄe jsou:\n" +"[-A] [-I {SUM|CPU|SCPU|ALL}] [-u] [-P {[,…]|ALL}] [-V]\n" + +#: mpstat.c:530 pidstat.c:1806 sar.c:359 +msgid "Average:" +msgstr "PrůmÄ›r:" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "Tolik procesorů není!\n" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"PÅ™epínaÄe jsou:\n" +"[-C ] [-d] [-h] [-I] [-l] [-r] [-s]\n" +"[-t] [-u] [-V] [-w]\n" +"[-p {[,…]|SELF|ALL}] [-T {TASK|CHILD|ALL}]\n" + +#: pidstat.c:199 sar.c:977 +#, c-format +msgid "Requested activities not available\n" +msgstr "Požadované aktivity nejsou dostupné\n" + +#: rd_stats.c:1877 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Nelze obsloužit tolik procesorů!\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Chyba pÅ™i Ätení souboru se systémovými aktivitami: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "NeoÄekávaný konec souboru se systémovými aktivitami\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Soubor vytvoÅ™en pomocí sar/sadc z balíku sysstat verze %d.%d.%d" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Neplatný soubor se systémovými aktivitami: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "SouÄasná verze sysstat již neumí Äíst formát tohoto souboru (%#x)\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Požadované aktivity nejsou v souboru %s dostupné\n" + +#: sadc.c:81 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Použití: %s [pÅ™epínaÄe] [ []] []\n" + +#: sadc.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"PÅ™epínaÄe jsou:\n" +"[-C ] [-F] [-L] [-V]\n" +"[-S {INT|DISK|IPV6|POWER|SNMP|XDISK|ALL|XALL}]\n" + +#: sadc.c:206 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Nelze zapsat data do souboru se systémovými aktivitami: %s\n" + +#: sadc.c:480 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Nelze zapsat hlaviÄku souboru se systémovými aktivitami: %s\n" + +#: sadc.c:756 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Nelze pÅ™ipojit data do tohoto souboru (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Použití: %s [pÅ™epínaÄe] [ []] []\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"PÅ™epínaÄe jsou:\n" +"[-d|-D|-H|-p|-x] [-C] [-h] [-t] [-V]\n" +"[-P {[,…]|ALL}] [-s []] [-e []]\n" +"[-- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Datový soubor se systémovými aktivitami: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "PoÄítaÄ: " + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Velikost „long int“: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "Seznam aktivit:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"PÅ™epínaÄe jsou:\n" +"[-A] [-b] [-B] [-C] [-d] [-h] [-p] [-q] [-r]\n" +"[-R] [-S] [-t] [-u [ALL]] [-v] [-V] [-w] [-W] [-y]\n" +"[-I {[,…]|SUM|ALL|XALL}] [-P {[,…]|ALL}]\n" +"[-m {[,…]|ALL}] [-n {[,…]|ALL}]\n" +"[-o []|-f []]\n" +"[-i ] [-s []] [-e []]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "Hlavní pÅ™epínaÄe a výstupní sestavy:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tStatistiky pÅ™enosové rychlosti V/V\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tStatistiky stránkování\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tStatistiky blokového zařízení\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I {|SUM|ALL|XALL}\n" +"\t\tStatistiky pÅ™eruÅ¡ení\n" + +#: sar.c:132 +#, c-format +msgid "" +"\t-m { [,...] | ALL }\n" +"\t\tPower management statistics\n" +"\t\tKeywords are:\n" +"\t\tCPU\tCPU clock frequency\n" +"\t\tFAN\tFans speed\n" +"\t\tTEMP\tDevices temperature\n" +msgstr "" +"\t-m {[,…]|ALL}\n" +"\t\tStatistiky správy napájení\n" +"\t\tKlíÄová slova jsou:\n" +"\t\tCPU\tFrekvence procesoru\n" +"\t\tFAN\tRychlost ventilátoru\n" +"\t\tTEMP\tTeplota zařízení\n" + +#: sar.c:138 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n {[,…]|ALL}\n" +"\t\tStatistiky sítÄ›\n" +"\t\tKlíÄová slova jsou:\n" +"\t\tDEV\tSíťové rozhraní\n" +"\t\tEDEV\tSíťové rozhraní (chyby)\n" +"\t\tNFS\tKlient NFS\n" +"\t\tNFSD\tServer NFS\n" +"\t\tSOCK\tSokety\t(v4)\n" +"\t\tIP\tProvoz IP\t(v4)\n" +"\t\tEIP\tProvoz IP\t(v4) (chyby)\n" +"\t\tICMP\tProvoz ICMP\t(v4)\n" +"\t\tEICMP\tProvoz ICMP\t(v4) (chyby)\n" +"\t\tTCP\tProvoz TCP\t(v4)\n" +"\t\tETCP\tProvoz TCP\t(v4) (chyby)\n" +"\t\tUDP\tProvoz UDP\t(v4)\n" +"\t\tSOCK6\tSokety\t(v6)\n" +"\t\tIP6\tProvoz IP\t(v6)\n" +"\t\tEIP6\tProvoz IP\t(v6) (chyby)\n" +"\t\tICMP6\tProvoz ICMP\t(v6)\n" +"\t\tEICMP6\tProvoz ICMP\t(v6) (chyby)\n" +"\t\tUDP6\tProvoz UDP\t(v6)\n" + +#: sar.c:159 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tStatistiky délky fronty a průmÄ›rného vytížení\n" + +#: sar.c:160 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tStatistiky využití pamÄ›ti\n" + +#: sar.c:161 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tStatistiky pamÄ›ti\n" + +#: sar.c:162 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tStatistiky využití odkládacího prostoru\n" + +#: sar.c:163 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ALL]\n" +"\t\tStatistiky využití procesoru\n" + +#: sar.c:165 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tStatistiky tabulky jádra\n" + +#: sar.c:166 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tStatistiky vytváření úloh a systémového pÅ™epínání\n" + +#: sar.c:167 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tStatistiky odkládání na disk\n" + +#: sar.c:168 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tStatistiky zařízení TTY\n" + +#: sar.c:211 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "NeoÄekávaný konec sbírání dat\n" + +#: sar.c:779 +#, c-format +msgid "Invalid data format\n" +msgstr "Neplatný formát dat\n" + +#: sar.c:783 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Používání nesprávného sbÄ›raÄe dat z jiné verze sysstat\n" + +#: sar.c:803 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Nekonzistentní vstupní data\n" + +#: sar.c:1224 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "PÅ™epínaÄe -f a -o se navzájem vyluÄují\n" + +#: sar.c:1230 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "NeÄte se ze souboru se systémovými aktivitami (použijte pÅ™epínaÄ -f)\n" + +#: sar.c:1331 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Nelze najít sbÄ›raÄ dat (%s)\n" diff --git a/nls/da.po b/nls/da.po new file mode 100644 index 00000000..a7a66943 --- /dev/null +++ b/nls/da.po @@ -0,0 +1,413 @@ +# Danish translation of the sysstat package. +# Copyright (C) 2010 Free Software Foundation, Inc. +# This file is distributed under the same license as the sysstat package. +# +# John Damm Soerensen , 2007. +# Keld Simonsen , 2009. +# Joe Hansen , 2008, 2009, 2010. +# +# power management -> strømstyring +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat-9.1.4\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-07-24 10:55+0200\n" +"PO-Revision-Date: 2010-08-01 09:19+0200\n" +"Last-Translator: Joe Hansen \n" +"Language-Team: Danish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Brug: %s [ flag ] [ [ ] ]\n" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" +"Flag er:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat version %s\n" + +#: ioconf.c:490 rd_stats.c:72 rd_stats.c:1831 sa_common.c:1052 sadc.c:593 +#: sadc.c:602 sadc.c:662 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Kan ikke Ã¥bne %s: %s\n" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" +"Flag er:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"Flag er:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Kan ikke lokalisere diskdata\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"Flag er:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:530 pidstat.c:1806 sar.c:359 +msgid "Average:" +msgstr "Middel:" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "Der er ikke sÃ¥ mange cpuer!\n" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Flag er:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:199 sar.c:977 +#, c-format +msgid "Requested activities not available\n" +msgstr "Angivne aktiviteter er ikke tilgængelig\n" + +#: rd_stats.c:1877 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Kan ikke hÃ¥ndtere sÃ¥ mange cpuer!\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Læsefejl ved indlæsning af aktivitetsfil: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Uventet afslutning pÃ¥ systemaktivitetsfil\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Fil oprettet ved brug af sar/sadc fra sysstat version %d.%d.%d" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Ugyldig systemaktivitetsfil: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "Nuværende sysstat version kan ikke længere læse formatet pÃ¥ denne fil (%#x)\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Angivne aktiviteter findes ikke i filen %s\n" + +#: sadc.c:81 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Brug: %s [ flag ] [ [ ] ] [ ]\n" + +#: sadc.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"Flag er:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:206 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Kan ikke skrive data til systemaktivitetsfil: %s\n" + +#: sadc.c:480 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Kan ikke skrive systemaktivitetsfilhoved: %s\n" + +#: sadc.c:756 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Kan ikke tilføje data til den fil (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Brug: %s [ flag... ] [ [ ] ] [ ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Flag er:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Systemaktivitetsdatafil: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "Vært: " + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Størrelse pÃ¥ en lang int: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "Oversigt over aktiviteter:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Flag er:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "Vigtigste flag og rapporter:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tI/O og statistik for overførelsesrate\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tPagingstatistik\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tStatistik for blokenhed\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tStatistik for afbrydelser\n" + +# clock ? tog fra KDE ksysguard (klok) +#: sar.c:132 +#, c-format +msgid "" +"\t-m { [,...] | ALL }\n" +"\t\tPower management statistics\n" +"\t\tKeywords are:\n" +"\t\tCPU\tCPU clock frequency\n" +"\t\tFAN\tFans speed\n" +"\t\tTEMP\tDevices temperature\n" +msgstr "" +"\t-m { [,...] | ALL }\n" +"\t\tStatistik for strømstyring\n" +"\t\tNøgleord er:\n" +"\t\tCPU\tCPU-klokfrekvens\n" +"\t\tFAN\tBlæserhastighed\n" +"\t\tTEMP\tEnheders temperatur\n" + +#: sar.c:138 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { [,...] | ALL }\n" +"\t\tNetværksstatistik\n" +"\t\tNøgleord er:\n" +"\t\tDEV\tNetværksgrænseflader\n" +"\t\tEDEV\tNetværksgrænseflader (fejl)\n" +"\t\tNFS\tNFS-klient\n" +"\t\tNFSD\tNFS-server\n" +"\t\tSOCK\tSokler\t(v4)\n" +"\t\tIP\tIP-trafik\t(v4)\n" +"\t\tEIP\tIP-trafik\t(v4) (fejl)\n" +"\t\tICMP\tICMP-trafik\t(v4)\n" +"\t\tEICMP\tICMP-trafik\t(v4) (fejl)\n" +"\t\tTCP\tTCP-trafik\t(v4)\n" +"\t\tETCP\tTCP-trafik\t(v4) (fejl)\n" +"\t\tUDP\tUDP-trafik\t(v4)\n" +"\t\tSOCK6\tSokler\t(v6)\n" +"\t\tIP6\tIP-trafik\t(v6)\n" +"\t\tEIP6\tIP-trafik\t(v6) (fejl)\n" +"\t\tICMP6\tICMP-trafik\t(v6)\n" +"\t\tEICMP6\tICMP-trafik\t(v6) (fejl)\n" +"\t\tUDP6\tUDP-trafik\t(v6)\n" + +#: sar.c:159 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tStatistik for kølængde og gennemsnitlig belastning\n" + +#: sar.c:160 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tStatistik for hukommelsesforbrug\n" + +#: sar.c:161 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tHukommelsesstatistik\n" + +#: sar.c:162 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tStatistik for swappladsforbrug\n" + +#: sar.c:163 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tStatistik for CPU-forbrug\n" + +#: sar.c:165 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tStatistik for kernetabel\n" + +#: sar.c:166 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tOpgaveoprettelse og statistik for systemskift\n" + +#: sar.c:167 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tStatistik for swapping\n" + +#: sar.c:168 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tTTY enhedsstatistik\n" + +#: sar.c:211 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Uventet afslutning pÃ¥ dataindsamling\n" + +#: sar.c:779 +#, c-format +msgid "Invalid data format\n" +msgstr "Ugyldig dataformat\n" + +#: sar.c:783 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Bruger en forkert dataindsamler fra en anden sysstat version\n" + +#: sar.c:803 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Inkonsistent inddata\n" + +#: sar.c:1224 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "flagene -f og -o udelukker hinanden\n" + +#: sar.c:1230 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Læsning sker ikke fra en systemaktivitetsfil (brug flaget -f)\n" + +#: sar.c:1331 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Kan ikke lokalisere dataindsamleren (%s)\n" diff --git a/nls/de.po b/nls/de.po new file mode 100644 index 00000000..8af934e3 --- /dev/null +++ b/nls/de.po @@ -0,0 +1,414 @@ +# NLS support for the sysstat package. +# Copyright (C) 1999 Free Software Foundation, Inc. +# This file is distributed under the same license as the sysstat package. +# Sébastien GODARD , 1999. +# Roland Illig , 2009, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 9.1.3\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-06-26 09:01+0200\n" +"PO-Revision-Date: 2010-06-29 23:54+0100\n" +"Last-Translator: Roland Illig \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: German\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Aufruf: %s [ optionen... ] [ [ ] ]\n" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" +"Optionen sind:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat version %s\n" + +#: ioconf.c:490 rd_stats.c:69 rd_stats.c:1842 sa_common.c:1052 sadc.c:586 +#: sadc.c:595 sadc.c:655 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Kann nicht öffnen %s: %s\n" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" +"Optionen sind:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"Optionen sind:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Kann die Plattendaten nicht finden\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"Optionen sind:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:530 pidstat.c:1806 sar.c:354 +msgid "Average:" +msgstr "Durchschn.:" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "Nicht so viel Prozessoren!\n" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Optionen sind:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:199 sar.c:972 +#, c-format +msgid "Requested activities not available\n" +msgstr "Die angeforderte Aktion ist nicht verfügbar.\n" + +#: rd_stats.c:1888 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Es sind zuviele Prozessoren vorhanden!\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Fehler beim lesen der Systemaktivitätendatei: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Unerwartetes Ende der Systemaktivitätendatei\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Diese Datei wurde erzeugt mit sar/sadc von sysstat Version %d.%d.%d" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Ungültige Systemaktivitätendatei: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "Diese Version von sysstat kann das Format dieser Datei (%#x) nicht mehr lesen\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Angeforderte Aktivität ist nicht verfügbar in Datei %s\n" + +#: sadc.c:76 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Aufruf: %s [ optionen... ] [ [ ] ] [ ]\n" + +#: sadc.c:79 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"Optionen sind:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:199 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Kann keine Daten in die Systemaktivitätendatei schreiben: %s\n" + +#: sadc.c:473 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Kann den Kopf der Systemaktivitätendatei nicht schreiben: %s\n" + +#: sadc.c:749 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "An die Datei \"%s\" können keine Daten angehängt werden\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Aufruf: %s [ optionen ] [ [ ] ] [ ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Optionen sind:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Systemaktivitätendatei: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "Rechner: " + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Größe eines Longint: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "Liste der Aktivitäten:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Optionen sind:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "Hauptoptionen und Berichte:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tI/O- und Transferraten-Statistik\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tPaging-Statistik\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tBlockgeräte-Statistik\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupt-Statistik\n" + +#: sar.c:132 +#, c-format +msgid "\t-m\tPower management statistics\n" +msgstr "\t-m\tEnergieverwaltungs-Statistik\n" + +#: sar.c:133 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { [,...] | ALL }\n" +"\t\tNetzwerk-Statistik\n" +"\t\tWörter sind:\n" +"\t\tDEV\tNetzwerkschnittstellen\n" +"\t\tEDEV\tNetzwerkschnittstellen (Fehler)\n" +"\t\tNFS\tNFS-Client\n" +"\t\tNFSD\tNFS-Server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP-Verkehr\t(v4)\n" +"\t\tEIP\tIP-Verkehr\t(v4) (Fehler)\n" +"\t\tICMP\tICMP-Verkehr\t(v4)\n" +"\t\tEICMP\tICMP-Verkehr\t(v4) (Fehler)\n" +"\t\tTCP\tTCP-Verkehr\t(v4)\n" +"\t\tETCP\tTCP-Verkehr\t(v4) (Fehler)\n" +"\t\tUDP\tUDP-Verkehr\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP-Verkehr\t(v6)\n" +"\t\tEIP6\tIP-Verkehr\t(v6) (Fehler)\n" +"\t\tICMP6\tICMP-Verkehr\t(v6)\n" +"\t\tEICMP6\tICMP-Verkehr\t(v6) (Fehler)\n" +"\t\tUDP6\tUDP-Verkehr\t(v6)\n" + +#: sar.c:154 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tWarteschlangen- und Systemauslastungs-Statistik\n" + +#: sar.c:155 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tSpeicherverbrauchs-Statistik\n" + +#: sar.c:156 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tSpeicher-Statistik\n" + +#: sar.c:157 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tAuslagerungsspeicher-Statistik\n" + +#: sar.c:158 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tCPU-Verbrauchs-Statistik\n" + +#: sar.c:160 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tKernel-Tabellen-Statistik\n" + +#: sar.c:161 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tTask-Erzeugungs- und Systemwechsel-Statistik\n" + +#: sar.c:162 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tAuslagerungs-Statistik\n" + +#: sar.c:163 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tTTY-Geräte-Statistik\n" + +#: sar.c:206 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Unerwartetes Ende der gesammelten Daten\n" + +#: sar.c:774 +#, c-format +msgid "Invalid data format\n" +msgstr "ungültiges Datenformat\n" + +#: sar.c:778 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Datensammler von einer anderen sysstat-Version in Benutzung\n" + +#: sar.c:798 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Inkonsistente Eingabedaten\n" + +#: sar.c:1207 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Die Optionen -f und -o schließen sich gegenseitig aus\n" + +#: sar.c:1213 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Bitte -f Option zur Angabe der Systemaktivitätendatei verwenden\n" + +#: sar.c:1314 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Kann den Datensammler \"%s\" nicht finden\n" + +#~ msgid "Time: %s\n" +#~ msgstr "Zeit: %s\n" + +#~ msgid "-x and -p options are mutually exclusive\n" +#~ msgstr "Die Optionen -x und -p schließen sich gegenseitig aus\n" + +#~ msgid "" +#~ "Usage: %s [ options... ] [ [ ] ] [ ]\n" +#~ "Options are:\n" +#~ "[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" +#~ msgstr "" +#~ "Aufruf: %s [ optionen... ] [ [ ] ] [ ]\n" +#~ "mögliche Optionen:\n" +#~ "[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" + +#~ msgid "Not an SMP machine...\n" +#~ msgstr "Keine SMP-Maschine...\n" diff --git a/nls/es.po b/nls/es.po new file mode 100644 index 00000000..c0f6d204 --- /dev/null +++ b/nls/es.po @@ -0,0 +1,195 @@ +# NLS support for the sysstat package. +# Copyright (C) 1999 Free Software Foundation, Inc. +# Sébastien GODARD , 1999. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 1.1\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2007-12-19 14:02+0100\n" +"PO-Revision-Date: 1999-11-11 19:00\n" +"Last-Translator: Fernando Félix Redondo \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat versión %s\n" + +#: common.c:160 common.c:385 ioconf.c:459 mpstat.c:265 sa_common.c:601 +#: sadc.c:476 sadc.c:485 sadc.c:530 sadc.c:620 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Imposible abrir %s: %s\n" + +#: common.c:199 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "¡No pueden manejarse tantos procesadores!\n" + +#: iostat.c:74 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" +msgstr "" +"Uso: %s [ opciones... ] [ [ ] ]\n" +"Opciones posibles:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" + +#: iostat.c:1119 +#, c-format +msgid "Time: %s\n" +msgstr "Tiempo: %s\n" + +#: iostat.c:1435 +#, c-format +msgid "-x and -p options are mutually exclusive\n" +msgstr "-x y -p son opciones mutuamente excluyentes\n" + +#: mpstat.c:66 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -P { | ALL } ] [ -V ]\n" +msgstr "" +"Uso: %s [ opciones... ] [ [ ] ]\n" +"Opciones posibles:\n" +"[ -P { | ALL } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:226 pidstat.c:1148 sar.c:740 +msgid "Average:" +msgstr "Media:" + +#: mpstat.c:563 sar.c:157 +#, c-format +msgid "Not that many processors!\n" +msgstr "No hay tantos procesadores!\n" + +#: pidstat.c:72 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Uso: %s [ opciones... ] [ [ ] ]\n" +"Opciones posibles:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:166 sar.c:1419 +#, c-format +msgid "Requested activities not available\n" +msgstr "Las actividades solicitadas no están disponibles\n" + +#: sa_common.c:572 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Error en la lectura del fichero de actividad del sistema: %s\n" + +#: sa_common.c:581 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Final inesperado del fichero de actividad del sistema\n" + +#: sa_common.c:608 sadc.c:549 +#, c-format +msgid "Invalid system activity file: %s (%#x)\n" +msgstr "Fichero de actividad del sistema inválido: %s (%#x)\n" + +#: sa_common.c:632 +#, c-format +msgid "Requested activities not available in file\n" +msgstr "La actividad demandada no está disponible en el fichero\n" + +#: sadc.c:83 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" +msgstr "" +"Uso: %s [ opciones... ] [ [ ] ] [ ]\n" +"Opciones posibles:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" + +#: sadc.c:110 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Imposible escribir los datos en el fichero de actividad del sistema: %s\n" + +#: sadc.c:361 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Imposible escribir la cabecera del fichero de actividad del sistema: %s\n" + +#: sadc.c:568 +#, c-format +msgid "Cannot append data to that file\n" +msgstr "No pueden añadirse datos a ese fichero\n" + +#: sadf.c:78 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Uso: %s [ opciones... ] [ [ ] ] [ ]\n" +"Opciones posibles:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sar.c:76 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Uso: %s [ opciones... ] [ [ ] ]\n" +"Opciones posibles:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:149 +#, c-format +msgid "Not an SMP machine...\n" +msgstr "No es un multiprocesador...\n" + +#: sar.c:1261 +#, c-format +msgid "Invalid data format\n" +msgstr "Formato de datos inválido\n" + +#: sar.c:1633 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "-f y -o son opciones mutuamente excluyentes\n" + +#: sar.c:1639 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "No se esta leyendo de un fichero de actividad del sistema (utilice la opción -f)\n" diff --git a/nls/eu.po b/nls/eu.po new file mode 100644 index 00000000..89493a66 --- /dev/null +++ b/nls/eu.po @@ -0,0 +1,370 @@ +# Basque translation of sysstat. +# Copyright (C) 2010 Free Software Foundation, Inc. +# This file is distributed under the same license as the sysstat package. +# Mikel Olasagasti Uranga , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat-9.1.1\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-02-21 11:47+0100\n" +"PO-Revision-Date: 2010-03-16 10:32+0100\n" +"Last-Translator: Mikel Olasagasti \n" +"Language-Team: Basque \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat %s bertsioa\n" + +#: ioconf.c:490 rd_stats.c:69 rd_stats.c:1842 sa_common.c:1052 sadc.c:589 +#: sadc.c:598 sadc.c:658 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Ezin da %s ireki: %s\n" + +#: iostat.c:81 mpstat.c:86 pidstat.c:77 sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Erabilera: %s [ aukerak ] [ [ ] ]\n" + +#: iostat.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"Aukerak:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" + +#: iostat.c:340 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Ezin da diska data aurkitu\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"Aukerak:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +#: mpstat.c:504 pidstat.c:1683 sar.c:354 +msgid "Average:" +msgstr "Batezbestekoa:" + +#: mpstat.c:847 +#, c-format +msgid "Not that many processors!\n" +msgstr "Ez daude horrenbeste prozesadore!\n" + +#: pidstat.c:80 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Aukerak:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:197 sar.c:972 +#, c-format +msgid "Requested activities not available\n" +msgstr "Eskatutako jarduera ez dago eskuragarri\n" + +#: rd_stats.c:1888 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Ezin dira horrenbeste prozesadore kudeatu!\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Arazoren bat gertatu da sistemako jarduera fitxategia irakurtzean: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Ustekabeko sistema jarduera fitxategi amaiera\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "sysstat %d.%d.%d bertsioko sar/sadc erabiliaz sortutako fitxategia" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Baliogabeko sistema jarduera fitxategia: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "Uneko sysstat bertsioak ez da dagoeneko gai fitxategi honen formatua irakurtzeko (%#x)\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Eskatutako jarduerak ez daude eskuragarri %s fitxategian\n" + +#: sadc.c:76 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Erabilera: %s [ aukerak ] [ [ ] ] [ ]\n" + +#: sadc.c:79 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"Aukerak:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:199 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Ezin da daturik idatzi sistema jarduera fitxategian: %s\n" + +#: sadc.c:476 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Ezin da sistema jarduera fitxategi goiburua idatzi: %s\n" + +#: sadc.c:752 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Ezin da daturik erantsi fitxategi horri (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Erabilera: %s [ aukerak ] [ [ ] ] [ ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Aukerak:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Sistema jarduera datu fitxategia: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "Ostalaria:" + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Long int baten tamaina: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "Jarduera zerrenda:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Aukerak:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "Aukera eta txosten nagusiak:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tI/O eta transferentzia tasa estatistikak\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tOrrikatze estatistikak\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tBloke gailu estatistikak\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tEtendura estatistikak\n" + +#: sar.c:132 +#, c-format +msgid "\t-m\tPower management statistics\n" +msgstr "\t-m\tEnergia-kudeaketa estatistikak\n" + +#: sar.c:133 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { [,...] | ALL }\n" +"\t\tSare estatistikak statistics\n" +"\t\tGako-hitzak:\n" +"\t\tDEV\tSare-interfazeak\n" +"\t\tEDEV\tSare-interfazeak (erroreak)\n" +"\t\tNFS\tNFS bezeroa\n" +"\t\tNFSD\tNFS zerbitzaria\n" +"\t\tSOCK\tSocket-ak\t(v4)\n" +"\t\tIP\tIP trafikoa\t(v4)\n" +"\t\tEIP\tIP trafikoa\t(v4) (erroreak)\n" +"\t\tICMP\tICMP trafikoa\t(v4)\n" +"\t\tEICMP\tICMP trafikoa\t(v4) (erroreak)\n" +"\t\tTCP\tTCP trafikoa\t(v4)\n" +"\t\tETCP\tTCP trafikoa\t(v4) (erroreak)\n" +"\t\tUDP\tUDP trafikoa\t(v4)\n" +"\t\tSOCK6\tSocket-ak\t(v6)\n" +"\t\tIP6\tIP trafikoa\t(v6)\n" +"\t\tEIP6\tIP trafikoa\t(v6) (erroreak)\n" +"\t\tICMP6\tICMP trafikoa\t(v6)\n" +"\t\tEICMP6\tICMP trafikoa\t(v6) (erroreak)\n" +"\t\tUDP6\tUDP trafikoa\t(v6)\n" + +#: sar.c:154 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tIlera luzeera eta karga batezbestekoaren estatistikak\n" + +#: sar.c:155 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tMemoria erabilera estatistikak\n" + +#: sar.c:156 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tMemoria estatistikak\n" + +#: sar.c:157 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tSwap espazio erabileraren estatistikak\n" + +#: sar.c:158 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tPUZ erabilera estatistikak\n" + +#: sar.c:160 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tKernel taula estatistikak\n" + +#: sar.c:161 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tAtaza sortze eta sistema kommutazio estatistikak\n" + +#: sar.c:162 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tSwapping estatistikak\n" + +#: sar.c:163 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tTTY gailu estatistikak\n" + +#: sar.c:206 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Ustekabeko datu biltze amaiera\n" + +#: sar.c:774 +#, c-format +msgid "Invalid data format\n" +msgstr "Baliogabeko datu formatua\n" + +#: sar.c:778 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "sysstat bertsio ezberdin bateko datu biltzaile okerra erabiltzen\n" + +#: sar.c:798 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Kontraesankor datu sarrera\n" + +#: sar.c:1207 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "-f eta -o aukerak elkar-ukatzaileak dira\n" + +#: sar.c:1213 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Ez da sistema jarduera fitxategi batetik irakurtzen (erabili -f aukera)\n" + +#: sar.c:1314 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Ezin da datu biltzailea aurkitu (%s)\n" diff --git a/nls/fi.po b/nls/fi.po new file mode 100644 index 00000000..d7bb53fe --- /dev/null +++ b/nls/fi.po @@ -0,0 +1,491 @@ +# Finnish messages for sysstat. +# Copyright © 2010 Free Software Foundation, Inc. +# This file is distributed under the same license as the sysstat package. +# Jorma Karvonen , 2008. +# Jorma Karvonen , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 9.1.4\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-07-24 10:55+0200\n" +"PO-Revision-Date: 2010-07-30 14:43+0200\n" +"Last-Translator: Jorma Karvonen \n" +"Language-Team: Finnish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: KBabel 1.11.4\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Käyttö: %s [ valitsimet ] [ [ ] ]\n" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" +"Valitsimet ovat:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat-versio %s\n" + +#: ioconf.c:490 rd_stats.c:72 rd_stats.c:1831 sa_common.c:1052 sadc.c:593 +#: sadc.c:602 sadc.c:662 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Ei voida avata %s: %s\n" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" +"Valitsimet ovat:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"Valitsimet ovat:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Levydataa ei löydy\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"Valitsimet ovat:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +#: mpstat.c:530 pidstat.c:1806 sar.c:359 +msgid "Average:" +msgstr "Keskiarvo:" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "Ei niin monta suoritinta!\n" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Valitsimet ovat:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +# Pyydetyt voi olla tilanteesta riippuen halutut, tiedustellut, kyseiset, haetut tms. +#: pidstat.c:199 sar.c:977 +#, c-format +msgid "Requested activities not available\n" +msgstr "Pyydetyt toiminnot eivät ole käytettävissä\n" + +#: rd_stats.c:1877 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Ei voida käsitellä niin montaa suoritinta!\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Virhe luettaessa järjestelmätoimintojen lokitiedostoa: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Järjestelmätoimintojen lokitiedoston loppu odottamaton\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Tiedosto luotu käyttäen â€sarâ€- tai â€sadcâ€-käskyä sysstat-versiosta %d.%d.%d" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Virheellinen järjestelmätoimintojen lokitiedosto: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "Nykyinen sysstat-versio ei voi enää lukea tämän tiedoston (%#x) muotoa\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Pyydetyt toiminnot eivät ole käytettävissä tiedostossa %s\n" + +#: sadc.c:81 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Käyttö: %s [ valitsimet ] [ [ ] ] [ ]\n" + +#: sadc.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"Valitsimet ovat:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:206 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Ei voida kirjoittaa tietoja järjestelmätoimintojen lokitiedostoon: %s\n" + +#: sadc.c:480 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Ei voida kirjoittaa järjestelmätoimintojen lokitiedoston otsaketta: %s\n" + +# Tässä haluttuun sana voidaan korvata tilanteessa osuvammalla sanalla, esim. pyydettyyn, toivottuun, valittuun, kyseiseen tms. +#: sadc.c:756 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Tietoja ei voida liittää haluttuun tiedostoon (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Käyttö: %s [ valitsimet ] [ [ ] ] [ ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Valitsimet ovat:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Järjestelmätoimintojen lokitiedosto: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "Tietokone: " + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Muuttujatyypin â€long int†koko: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "Toimintojen luettelo:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Valitsimet ovat:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "Päävalitsimet ja -ilmoitukset ovat:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tSiirräntä- ja siirtonopeustilastot\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tSivutustilastot\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tLohkolaitetilastot\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tKeskeytysten tilasto\n" + +#: sar.c:132 +#, c-format +msgid "" +"\t-m { [,...] | ALL }\n" +"\t\tPower management statistics\n" +"\t\tKeywords are:\n" +"\t\tCPU\tCPU clock frequency\n" +"\t\tFAN\tFans speed\n" +"\t\tTEMP\tDevices temperature\n" +msgstr "" +"\t-m { [,...] | ALL }\n" +"\t\tTehonhallntatilastot\n" +"\t\tAvainsanoja ovat:\n" +"\t\tCPU\tProsessorin kellotaajuus\n" +"\t\tFAN\tTuulettimen nopeus\n" +"\t\tTEMP\tLaitteen lämpötila\n" + +#: sar.c:138 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { [,...] | ALL }\n" +"\t\tVerkkotilastot\n" +"\t\tAvainsanoja ovat:\n" +"\t\tDEV\tVerkkoliittymät\n" +"\t\tEDEV\tVerkkoliittymät (virheet)\n" +"\t\tNFS\tNFS-asiakas\n" +"\t\tNFSD\tNFS-palvelin\n" +"\t\tSOCK\tPistokkeet\t(v4)\n" +"\t\tIP\tIP-liikenne\t(v4)\n" +"\t\tEIP\tIP-liikenne\t(v4) (virheet)\n" +"\t\tICMP\tICMP-liikenne\t(v4)\n" +"\t\tEICMP\tICMP-liikenne\t(v4) (virheet)\n" +"\t\tTCP\tTCP-liikenne\t(v4)\n" +"\t\tETCP\tTCP-liikenne\t(v4) (virheet)\n" +"\t\tUDP\tUDP-liikenne\t(v4)\n" +"\t\tSOCK6\tPistokkeet\t(v6)\n" +"\t\tIP6\tIP-liikenne\t(v6)\n" +"\t\tEIP6\tIP-liikenne\t(v6) (virheet)\n" +"\t\tICMP6\tICMP-liikenne\t(v6)\n" +"\t\tEICMP6\tICMP-liikenne\t(v6) (virheet)\n" +"\t\tUDP6\tUDP-liikenne\t(v6)\n" + +#: sar.c:159 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tJonopituus- ja latauskeskiarvotilastot\n" + +#: sar.c:160 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tMuistin käyttöastetilastot\n" + +#: sar.c:161 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tMuistitilastot\n" + +#: sar.c:162 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tNäennäismuistitilan käyttöastetilastot\n" + +#: sar.c:163 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tSuorittimen käyttöastetilastot\n" + +#: sar.c:165 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tKäyttöjärjestelmäytimen taulutilastot\n" + +#: sar.c:166 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tTehtävän luonti- ja järjestelmänvaihtotilastot\n" + +#: sar.c:167 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tNäennäismuisti vaihtamistilastot\n" + +#: sar.c:168 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tTTY-laitetilastot\n" + +#: sar.c:211 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Tiedonkeräyksen loppu odottamaton\n" + +#: sar.c:779 +#, c-format +msgid "Invalid data format\n" +msgstr "Virheellinen datamuoto\n" + +#: sar.c:783 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Käytetään väärää datakerääjää eri sysstat-versiosta\n" + +#: sar.c:803 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Epäjohdonmukainen syötedata\n" + +#: sar.c:1224 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "valitsimet â€-f†ja â€-o†ovat vastavuoroisesti poissulkevia\n" + +#: sar.c:1230 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Ei lueta järjestelmätoimintojen lokitiedostosta (käytä valitsinta â€-fâ€)\n" + +#: sar.c:1331 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Datakerääjää (%s) ei löydy\n" + +#~ msgid "\t-m\tPower management statistics\n" +#~ msgstr "\t-m\tTehonhallintatilastot\n" + +#~ msgid "Usage:" +#~ msgstr "Käyttö:" + +#~ msgid "options..." +#~ msgstr "valitsimet..." + +#~ msgid "interval" +#~ msgstr "aikaväli" + +#~ msgid "count" +#~ msgstr "lukumäärä" + +#~ msgid "device" +#~ msgstr "laite" + +#~ msgid "Time: %s\n" +#~ msgstr "Aika: %s\n" + +#~ msgid "-x and -p options are mutually exclusive\n" +#~ msgstr "valitsimet â€-x†ja â€-p†ovat keskenään poissulkevia\n" + +#~ msgid "cpu" +#~ msgstr "suoritin" + +#~ msgid "command" +#~ msgstr "käsky" + +#~ msgid "outfile" +#~ msgstr "tulostetiedosto" + +#~ msgid "comment" +#~ msgstr "kommentti" + +#~ msgid "datafile" +#~ msgstr "datatiedosto" + +#~ msgid "hh:mm:ss" +#~ msgstr "hh.mm.ss" + +#~ msgid "sar_options..." +#~ msgstr "sar_valitsimet..." + +#~ msgid "Activity flag: %#x\n" +#~ msgstr "Toimintolippu: %#x\n" + +#~ msgid "Number of CPU: %u\n" +#~ msgstr "Suorittimien lukumäärä: %u\n" + +#~ msgid "Number of interrupts per CPU: %u\n" +#~ msgstr "Keskeytysten lukumäärä suoritinta kohden: %u\n" + +#~ msgid "Number of disks: %u\n" +#~ msgstr "Levyjen lukumäärä: %u\n" + +#~ msgid "Number of serial lines: %u\n" +#~ msgstr "Sarjalinjojen lukumäärä: %u\n" + +#~ msgid "Number of network interfaces: %u\n" +#~ msgstr "Verkkoliitäntöjen lukumäärä: %u\n" + +#~ msgid "int" +#~ msgstr "keskeytyspyyntö" + +#~ msgid "filename" +#~ msgstr "tiedostonimi" + +#~ msgid "Not an SMP machine...\n" +#~ msgstr "Ei ole symmetrinen monisuoritinkone...\n" + +#~ msgid "" +#~ "Usage: %s [ options... ] [ [ ] ] [ ]\n" +#~ "Options are:\n" +#~ "[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" +#~ msgstr "" +#~ "Käyttö: %s [ valitsimet... ] [ [ ] ] [ ]\n" +#~ "Valitsimet ovat:\n" +#~ "[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" diff --git a/nls/fr.po b/nls/fr.po new file mode 100644 index 00000000..83eb89e3 --- /dev/null +++ b/nls/fr.po @@ -0,0 +1,428 @@ +# NLS support for the sysstat package. +# Copyright (C) 2008 Free Software Foundation, Inc. +# This file is distributed under the same license as the sysstat package. +# Sébastien GODARD , 1999. +# Nicolas Provost , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 9.1.4\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-07-24 10:55+0200\n" +"PO-Revision-Date: 2010-08-01 09:28+0100\n" +"Last-Translator: Nicolas Provost \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Utilisation : %s [ options... ] [ [ ] ]\n" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" +"Options possibles :\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat version %s\n" + +#: ioconf.c:490 rd_stats.c:72 rd_stats.c:1831 sa_common.c:1052 sadc.c:593 +#: sadc.c:602 sadc.c:662 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Impossible d'ouvrir %s : %s\n" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" +"Options possibles :\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"Options possibles :\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Impossible de trouver les données du disque\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"Options possibles :\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:530 pidstat.c:1806 sar.c:359 +msgid "Average:" +msgstr "Moyenne :" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "Pas tant de processeurs !\n" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Options possibles :\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:199 sar.c:977 +#, c-format +msgid "Requested activities not available\n" +msgstr "Statistiques demandées non disponibles\n" + +#: rd_stats.c:1877 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Impossible de gérer autant de processeurs !\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Erreur lors de la lecture du fichier d'activité système : %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Fin du fichier d'activité système inattendue\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Fichier créé par sar/sadc depuis la version %d.%d.%d de sysstat" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Fichier d'activité système non valide : %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "La version courante de sysstat ne peut plus lire le format de ce fichier (%#x)\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Activités demandées non enregistrées dans le fichier %s\n" + +#: sadc.c:81 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Utilisation : %s [ options... ] [ [ ] ] [ ]\n" + +#: sadc.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"Options possibles :\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:206 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Impossible d'écrire les données dans le fichier d'activité système : %s\n" + +#: sadc.c:480 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Impossible d'écrire l'entête du fichier d'activité système : %s\n" + +#: sadc.c:756 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Impossible d'ajouter des données à la fin de ce fichier (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Utilisation: %s [ options... ] [ [ ] ] [ ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Options possibles :\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Fichier des données d'activité système : %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "Hôte : " + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Taille d'un \"long int\" : %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "Liste de statistiques :\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Options possibles :\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "Options principales et rapports :\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tStatistiques entrées/sorties et taux de transfert\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tStatistiques pages mémoire\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tStatistiques périphériques par blocs\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tStatistiques interruptions\n" + +#: sar.c:132 +#, c-format +msgid "" +"\t-m { [,...] | ALL }\n" +"\t\tPower management statistics\n" +"\t\tKeywords are:\n" +"\t\tCPU\tCPU clock frequency\n" +"\t\tFAN\tFans speed\n" +"\t\tTEMP\tDevices temperature\n" +msgstr "" +"\t-m { [,...] | ALL }\n" +"\t\tStatistiques de gestion énergie\n" +"\t\tMots-clefs possibles :\n" +"\t\tCPU\tfréquence CPU\n" +"\t\tFAN\tvitesse ventilateurs\n" +"\t\tTEMP\ttempérature périphériques\n" + +#: sar.c:138 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { [,...] | ALL }\n" +"\t\tStatistiques réseau\n" +"\t\tMots-clés possibles :\n" +"\t\tDEV\tInterfaces réseau\n" +"\t\tEDEV\tInterfaces réseau (erreurs)\n" +"\t\tNFS\tClient NFS\n" +"\t\tNFSD\tServeur NFS\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tTrafic IP\t(v4)\n" +"\t\tEIP\tTrafic IP\t(v4) (erreurs)\n" +"\t\tICMP\tTrafic ICMP\t(v4)\n" +"\t\tEICMP\tTrafic ICMP\t(v4) (erreurs)\n" +"\t\tTCP\tTrafic TCP\t(v4)\n" +"\t\tETCP\tTrafic TCP\t(v4) (erreurs)\n" +"\t\tUDP\tTrafic UDP\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tTrafic IP\t(v6)\n" +"\t\tEIP6\tTrafic\t(v6) (erreurs)\n" +"\t\tICMP6\tTrafic ICMP\t(v6)\n" +"\t\tEICMP6\tTrafic ICMP\t(v6) (erreurs)\n" +"\t\tUDP6\tTrafic UDP\t(v6)\n" + +#: sar.c:159 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tStatistiques longueur de queue et charge moyenne\n" + +#: sar.c:160 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tStatistiques d'utilisation mémoire\n" + +#: sar.c:161 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tStatistiques mémoire\n" + +#: sar.c:162 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tStatistiques d'utilisation de l'espace d'échange\n" + +#: sar.c:163 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tStatistiques d'utlisation CPU\n" + +#: sar.c:165 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tStatistiques table noyau\n" + +#: sar.c:166 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tStatistiques de création et commutation de tâches par le système\n" + +#: sar.c:167 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tStatistiques d'échange (mémoire)\n" + +#: sar.c:168 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tStatistiques périph. consoles (TTY)\n" + +#: sar.c:211 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Fin inattendue de collecte des données\n" + +#: sar.c:779 +#, c-format +msgid "Invalid data format\n" +msgstr "Format de données non valide\n" + +#: sar.c:783 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Utilisation d'un mauvais collecteur de données venant d'une autre version de sysstat\n" + +#: sar.c:803 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Données inconsistantes en entrée\n" + +#: sar.c:1224 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Les options -f et -o ne peuvent être utilisées ensemble\n" + +#: sar.c:1230 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Pas de fichier d'activité système lisible (utilisez l'option -f)\n" + +#: sar.c:1331 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Impossible de trouver le collecteur de données (%s)\n" + +#~ msgid "\t-m\tPower management statistics\n" +#~ msgstr "\t-m\tStatistiques gestion d'énergie\n" + +#~ msgid "-x and -p options are mutually exclusive\n" +#~ msgstr "Les options -x et -p ne peuvent être utilisées ensemble\n" + +#~ msgid "Time: %s\n" +#~ msgstr "Heure : %s\n" + +#~ msgid "" +#~ "Usage: %s [ options... ] [ [ ] ] [ ]\n" +#~ "Options are:\n" +#~ "[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" +#~ msgstr "" +#~ "Utilisation: %s [ options... ] [ [ ] ] [ ]\n" +#~ "Options possibles:\n" +#~ "[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" + +#~ msgid "Not an SMP machine...\n" +#~ msgstr "Pas une machine multiprocesseur...\n" diff --git a/nls/id.po b/nls/id.po new file mode 100644 index 00000000..c3105bc4 --- /dev/null +++ b/nls/id.po @@ -0,0 +1,423 @@ +# Indonesian translations for sysstat package. +# Copyright (C) 2008 THE sysstat'S COPYRIGHT HOLDER +# This file is distributed under the same license as the sysstat package. +# Andhika Padmawan , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 9.1.4\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-07-24 10:55+0200\n" +"PO-Revision-Date: 2010-07-31 21:51+0700\n" +"Last-Translator: Andhika Padmawan \n" +"Language-Team: Indonesian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Penggunaan: %s [ opsi ] [ [ ] ]\n" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" +"Opsinya adalah:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat versi %s\n" + +#: ioconf.c:490 rd_stats.c:72 rd_stats.c:1831 sa_common.c:1052 sadc.c:593 +#: sadc.c:602 sadc.c:662 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Tak dapat membuka %s: %s\n" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" +"Opsinya adalah:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"Opsinya adalah:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Tak dapat menemukan data cakram\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"Opsinya adalah:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +#: mpstat.c:530 pidstat.c:1806 sar.c:359 +msgid "Average:" +msgstr "Rata-rata:" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "Tidak sebanyak itu prosesor!\n" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Opsinya adalah:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:199 sar.c:977 +#, c-format +msgid "Requested activities not available\n" +msgstr "Aktivitas yang diminta tak tersedia\n" + +#: rd_stats.c:1877 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Tak dapat menangani begitu banyak prosesor!\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Galat ketika membaca berkas aktivitas sistem: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Akhir berkas aktivitas sistem tak diharapkan\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Berkas dibuat menggunakan sar/sadc dari sysstat versi %d.%d.%d" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Berkas aktivitas sistem tak sah: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "Versi sysstat saat ini tak dapat lagi membaca format berkas ini (%#x)\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Aktivitas yang diminta tak tersedia di berkas %s\n" + +#: sadc.c:81 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Penggunaan: %s [ opsi... ] [ [ ] ] [ ]\n" + +#: sadc.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"Opsinya adalah:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:206 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Tak dapat menulis data ke berkas aktivitas sistem: %s\n" + +#: sadc.c:480 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Tak dapat menulis tajuk berkas aktivitas sistem: %s\n" + +#: sadc.c:756 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Tak dapat menambah data ke berkas tersebut (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Penggunaan: %s [ opsi ] [ [ ] ] [ ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Opsinya adalah:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Berkas data aktivitas sistem: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "Host: " + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Ukuran interval panjang: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "Senarai aktivitas:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "Opsi utama dan laporan:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tI/O dan statistik rasio transfer\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tStatistik halaman\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tStatistik divais blok\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterupsi statistik\n" + +#: sar.c:132 +#, c-format +msgid "" +"\t-m { [,...] | ALL }\n" +"\t\tPower management statistics\n" +"\t\tKeywords are:\n" +"\t\tCPU\tCPU clock frequency\n" +"\t\tFAN\tFans speed\n" +"\t\tTEMP\tDevices temperature\n" +msgstr "" +"\t-m { [,...] | ALL }\n" +"\t\tStatistik manajemen daya\n" +"\t\tKata kuncinya adalah:\n" +"\t\tCPU\tFrekuensi jam CPU\n" +"\t\tFAN\tKecepatan kipas\n" +"\t\tTEMP\tTemperatur divais\n" + +#: sar.c:138 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { [,...] | ALL }\n" +"\t\tStatistik jaringan\n" +"\t\tKata kunci adalah:\n" +"\t\tDEV\tAntarmuka jaringan\n" +"\t\tEDEV\tAntarmuka jaringan (galat)\n" +"\t\tNFS\tKlien NFS\n" +"\t\tNFSD\tKlien NFS\n" +"\t\tSOCK\tSoket\t(v4)\n" +"\t\tIP\tLalu lintas IP\t(v4)\n" +"\t\tEIP\tLalu lintas IP\t(v4) (galat)\n" +"\t\tICMP\tLalu lintas ICMP\t(v4)\n" +"\t\tEICMP\tLalu lintas ICMP\t(v4) (galat)\n" +"\t\tTCP\tLalu lintas TCP\t(v4)\n" +"\t\tETCP\tLalu lintas TCP\t(v4) (galat)\n" +"\t\tUDP\tLalu lintas UDP\t(v4)\n" +"\t\tSOCK6\tSoket\t(v6)\n" +"\t\tIP6\tLalu lintas IP\t(v6)\n" +"\t\tEIP6\tLalu lintas IP\t(v6) (galat)\n" +"\t\tICMP6\tLalu lintas ICMP\t(v6)\n" +"\t\tEICMP6\tLalu lintas ICMP\t(v6) (galat)\n" +"\t\tUDP6\tLalu lintas UDP\t(v6)\n" + +#: sar.c:159 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tPanjang antrean dan statistik rata-rata muatan\n" + +#: sar.c:160 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tStatistik utilisasi memori\n" + +#: sar.c:161 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tStatistik memori\n" + +#: sar.c:162 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tStatistik utilisasi ruang swap\n" + +#: sar.c:163 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tStatistik utilisasi CPU\n" + +#: sar.c:165 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tStatistik tabel kernel\n" + +#: sar.c:166 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tStatistik penukar sistem dan pembuatan tugas\n" + +#: sar.c:167 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tStatistik swap\n" + +#: sar.c:168 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tStatistik divais TTY\n" + +#: sar.c:211 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Akhir pengumpulan data tak diharapkan\n" + +#: sar.c:779 +#, c-format +msgid "Invalid data format\n" +msgstr "Format data tak sah\n" + +#: sar.c:783 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Menggunakan pengumpul data yang salah dari versi sysstat yang berbeda\n" + +#: sar.c:803 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Data masukan tidak konsisten\n" + +#: sar.c:1224 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "opsi -f dan -o secara mutual eksklusif\n" + +#: sar.c:1230 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Tak membaca dari berkas aktivitas sistem (gunakan opsi -f)\n" + +#: sar.c:1331 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Tak dapat menemukan pengumpul data (%s)\n" + +#~ msgid "\t-m\tPower management statistics\n" +#~ msgstr "\t-m\tStatistik manajemen daya\n" + +#~ msgid "-x and -p options are mutually exclusive\n" +#~ msgstr "opsi -x dan -p secara mutual eksklusif\n" + +#~ msgid "" +#~ "\t-n { DEV | EDEV | NFS | NFSD | SOCK |\n" +#~ "\t IP | EIP | ICMP | EICMP | TCP | ETCP | UDP | ALL }\n" +#~ "\t\tNetwork statistics\n" +#~ msgstr "" +#~ "\t-n { DEV | EDEV | NFS | NFSD | SOCK |\n" +#~ "\t IP | EIP | ICMP | EICMP | TCP | ETCP | UDP | ALL }\n" +#~ "\t\tStatistik jaringan\n" + +#~ msgid "Time: %s\n" +#~ msgstr "Waktu: %s\n" diff --git a/nls/it.po b/nls/it.po new file mode 100644 index 00000000..9b9236b1 --- /dev/null +++ b/nls/it.po @@ -0,0 +1,420 @@ +# ITALIAN TRANSLATION OF SYSSTAT +# COPYRIGHT (C) 2008-2009-2010 THE SYSSTAT'S COPYRIGHT HOLDER +# This file is distributed under the same license as the sysstat package. +# +# Vincenzo Campanella , 2008, 2009, 2010. +msgid "" +msgstr "" +"Project-Id-Version: sysstat-9.1.4\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-07-24 10:55+0200\n" +"PO-Revision-Date: 2010-07-31 11:53+0200\n" +"Last-Translator: Vincenzo Campanella \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Uso: %s [ opzioni ] [ [ ] ]\n" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" +"Le opzioni sono:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat versione %s\n" + +#: ioconf.c:490 rd_stats.c:72 rd_stats.c:1831 sa_common.c:1052 sadc.c:593 +#: sadc.c:602 sadc.c:662 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Impossibile aprire %s: %s\n" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" +"Le opzioni sono:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"Le opzioni sono:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Impossibile trovare i dati concernenti il disco\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"Le opzioni sono:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +#: mpstat.c:530 pidstat.c:1806 sar.c:359 +msgid "Average:" +msgstr "Media:" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "Non così tanti processori.\n" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Le opzioni sono:\n" +"[[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:199 sar.c:977 +#, c-format +msgid "Requested activities not available\n" +msgstr "Le statistiche richieste non sono disponibili\n" + +#: rd_stats.c:1877 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Impossibile gestire così tanti processori.\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Errore durante la lettura del file delle statistiche del sistema: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Il file delle statistiche del sistema è terminato in modo inatteso\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "File creato usando sar/sadc da sysstat versione %d.%d.%d" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "File delle statistiche del sistema non valido: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "La versione attuale di sysstat non è più in grado di leggere il formato di questo file (%#x)\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Le statistiche richieste non sono disponibili nel file %s\n" + +#: sadc.c:81 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Uso: %s [ opzioni ] [ [ ] ] [ ]\n" + +#: sadc.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"Le opzioni sono:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:206 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Impossibile scrivere dati nel file delle statistiche del sistema: %s\n" + +#: sadc.c:480 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Impossibile scrivere l'intestazione del file delle statistiche del sistema: %s\n" + +#: sadc.c:756 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Impossibile aggiungere dati a quel file (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Uso: %s [ opzioni ] [ [ ] ] [ ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Le opzioni sono:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "File delle statistiche del sistema: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "Host: " + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Dimensione di un «long int»: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "Elenco delle statistiche:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Le opzioni sono:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "Opzioni e rapporti principali:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tStatistiche sull'I/O e sulla velocità di trasferimento\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tStatistiche sulla paginazione\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tStatistiche sui device a blocco\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tStatistiche sugli interrupt\n" + +#: sar.c:132 +#, c-format +msgid "" +"\t-m { [,...] | ALL }\n" +"\t\tPower management statistics\n" +"\t\tKeywords are:\n" +"\t\tCPU\tCPU clock frequency\n" +"\t\tFAN\tFans speed\n" +"\t\tTEMP\tDevices temperature\n" +msgstr "" +"\t-m { [,...] | ALL }\n" +"\t\tStatistiche sulla gestione dell'alimentazione\n" +"\t\tLe parole chiave sono:\n" +"\t\tCPU\tfrequenza del clock della CPU\n" +"\t\tFAN\tVelocità delle ventole\n" +"\t\tTEMP\tTemperatura dei dispositivi\n" + +#: sar.c:138 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { [,...] | ALL }\n" +"\t\tStatistiche di rete\n" +"\t\tLe parole chiave sono:\n" +"\t\tDEV\tInterfacce di rete\n" +"\t\tEDEV\tInterfacce di rete (errori)\n" +"\t\tNFS\tClient NFS\n" +"\t\tNFSD\tServer NFS\n" +"\t\tSOCK\tSocket\t(v4)\n" +"\t\tIP\tTraffico IP\t(v4)\n" +"\t\tEIP\tTraffico IP\t(v4) (errori)\n" +"\t\tICMP\tTraffico ICMP\t(v4)\n" +"\t\tEICMP\tTraffico ICMP\t(v4) (errori)\n" +"\t\tTCP\tTraffico TCP\t(v4)\n" +"\t\tETCP\tTraffico TCP\t(v4) (errori)\n" +"\t\tUDP\tTraffico UDP\t(v4)\n" +"\t\tSOCK6\tSocket\t(v6)\n" +"\t\tIP6\tTraffico IP\t(v6)\n" +"\t\tEIP6\tTraffico IP\t(v6) (errori)\n" +"\t\tICMP6\tTraffico ICMP\t(v6)\n" +"\t\tEICMP6\tTraffico ICMP\t(v6) (errori)\n" +"\t\tUDP6\tTraffico UDP\t(v6)\n" + +#: sar.c:159 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tStatistiche sulla media della lunghezza della coda e del carico\n" + +#: sar.c:160 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tStatistiche sull'uso della memoria\n" + +#: sar.c:161 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tStatistiche sulla memoria\n" + +#: sar.c:162 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tStatistiche sull'uso dello spazio di swap\n" + +#: sar.c:163 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tStatistiche sull'uso della CPU\n" + +#: sar.c:165 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tStatistiche sulla tabella del kernel\n" + +#: sar.c:166 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tStatistiche sulla creazione di attività e sui cambiamenti del sistema\n" + +#: sar.c:167 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tStatistiche sullo swap\n" + +#: sar.c:168 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tStatistiche sui device TTY\n" + +#: sar.c:211 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Fine inattesa della raccolta dei dati\n" + +#: sar.c:779 +#, c-format +msgid "Invalid data format\n" +msgstr "Formato dei dati non valido\n" + +#: sar.c:783 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Utilizzo di un collettore di dati errato da una versione differente di sysstat\n" + +#: sar.c:803 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Dati in ingresso inconsistenti\n" + +#: sar.c:1224 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Le opzioni -f e -o si escludono a vicenda\n" + +#: sar.c:1230 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "La lettura non avviene da un file delle statistiche del sistema (usare l'opzione -f)\n" + +#: sar.c:1331 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Impossibile trovare il collettore dei dati (%s)\n" + +#~ msgid "\t-m\tPower management statistics\n" +#~ msgstr "\t-B\tStatistiche sulla gestione dell'energia\n" + +#~ msgid "-x and -p options are mutually exclusive\n" +#~ msgstr "Le opzioni -x e -p si escludono a vicenda\n" + +#~ msgid "" +#~ "\t-n { DEV | EDEV | NFS | NFSD | SOCK |\n" +#~ "\t IP | EIP | ICMP | EICMP | TCP | ETCP | UDP | ALL }\n" +#~ "\t\tNetwork statistics\n" +#~ msgstr "" +#~ "\t-n { DEV | EDEV | NFS | NFSD | SOCK |\n" +#~ "\t IP | EIP | ICMP | EICMP | TCP | ETCP | UDP | ALL }\n" +#~ "\t\tStatistiche sulla rete\n" diff --git a/nls/ja.po b/nls/ja.po new file mode 100644 index 00000000..40afd17c --- /dev/null +++ b/nls/ja.po @@ -0,0 +1,368 @@ +# NLS support for the sysstat package. +# This file is distributed under the same license as the sysstat package. +# Copyright (C) 1999-2009 Free Software Foundation, Inc. +# Sebastien GODARD , 1999. +# Japanese translation by Hideki Yamane (Debian-JP) , 2008-2009. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 9.0.3\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2009-05-17 16:16+0200\n" +"PO-Revision-Date: 2009-11-12 06:06+0900\n" +"Last-Translator: Hideki Yamane (Debian-JP) \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat ãƒãƒ¼ã‚¸ãƒ§ãƒ³ %s\n" + +#: ioconf.c:479 iostat.c:504 rd_stats.c:69 rd_stats.c:2126 rd_stats.c:2243 +#: sa_common.c:1052 sadc.c:591 sadc.c:600 sadc.c:660 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "%s ã‚’é–‹ã‘ã¾ã›ã‚“: %s\n" + +#: iostat.c:81 mpstat.c:83 pidstat.c:77 sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "使ã„æ–¹: %s [ オプション ] [ <é–“éš”> [ <回数> ] ]\n" + +#: iostat.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"利用å¯èƒ½ãªã‚ªãƒ—ション:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ <デãƒã‚¤ã‚¹> [ ... ] | ALL ] [ -p [ <デãƒã‚¤ã‚¹> [,...] | ALL ] ]\n" + +#: mpstat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"利用å¯èƒ½ãªã‚ªãƒ—ション:\n" +"[ -A ] [ -I { SUM | CPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:457 pidstat.c:1683 sar.c:354 +msgid "Average:" +msgstr "å¹³å‡å€¤:" + +#: mpstat.c:769 +#, c-format +msgid "Not that many processors!\n" +msgstr "ãã‚“ãªã« CPU ã¯ã‚ã‚Šã¾ã›ã‚“!\n" + +#: pidstat.c:80 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"利用å¯èƒ½ãªã‚ªãƒ—ション:\n" +"[ -C <コマンド> ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:197 sar.c:968 +#, c-format +msgid "Requested activities not available\n" +msgstr "è¦æ±‚ã•ã‚ŒãŸå‹•ä½œæƒ…å ±ã¯åˆ©ç”¨ã§ãã¾ã›ã‚“\n" + +#: rd_stats.c:2289 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "ãã‚“ãªã«å¤§é‡ã®ãƒ—ロセッサã¯æ‰±ãˆã¾ã›ã‚“!\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "システム動作情報ファイルã®èª­ã¿è¾¼ã¿ä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒèµ·ãã¾ã—ãŸ: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "システム動作情報ファイルãŒé€”中ã§äºˆæœŸç„¡ã終了ã—ã¾ã—ãŸ\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "sysstat ãƒãƒ¼ã‚¸ãƒ§ãƒ³ %d.%d.%d ã® sar/sadc を使ã£ã¦ä½œã‚‰ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "システム動作情報ファイルã®å½¢å¼ãŒæ­£ã—ãã‚ã‚Šã¾ã›ã‚“: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "sysstat ã®ç¾åœ¨ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã§ã¯ã“ã®ãƒ‡ãƒ¼ã‚¿ãƒ•ã‚¡ã‚¤ãƒ« (%#x) ã®å½¢å¼ã‚’読ã¿è¾¼ã‚ãªããªã£ã¦ã„ã¾ã™\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "è¦æ±‚ã•ã‚ŒãŸå‹•ä½œæƒ…å ±ã¯ãƒ•ã‚¡ã‚¤ãƒ« %s 内ã«ã¯ã‚ã‚Šã¾ã›ã‚“\n" + +#: sadc.c:76 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "使ã„æ–¹: %s [ オプション ] [ <é–“éš”> [ <回数> ] ] [ <出力ファイル> ]\n" + +#: sadc.c:79 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"利用å¯èƒ½ãªã‚ªãƒ—ション:\n" +"[ -C <コメント> ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:199 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "システム動作情報ファイルã«æ›¸ãè¾¼ã¿ãŒã§ãã¾ã›ã‚“: %s\n" + +#: sadc.c:478 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "システム動作情報ファイルã®ãƒ˜ãƒƒãƒ€ã«æ›¸ãè¾¼ã¿ãŒã§ãã¾ã›ã‚“: %s\n" + +#: sadc.c:754 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "ファイル (%s) ã«ãƒ‡ãƒ¼ã‚¿ã‚’追加ã§ãã¾ã›ã‚“\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "使ã„æ–¹: %s [ オプション ] [ <é–“éš”> [ <回数> ] ] [ <データファイルå> ]\n" + +#: sadf.c:88 +#, fuzzy, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"利用å¯èƒ½ãªã‚ªãƒ—ション:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:541 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "システム動作情報ファイル: %s (%#x)\n" + +#: sadf.c:550 +#, c-format +msgid "Host: " +msgstr "ホストå: " + +#: sadf.c:556 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "long int ã®ã‚µã‚¤ã‚º: %d\n" + +#: sadf.c:558 +#, c-format +msgid "List of activities:\n" +msgstr "動作情報ã®ãƒªã‚¹ãƒˆ:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ] [ -R ]\n" +"[ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"利用å¯èƒ½ãªã‚ªãƒ—ション:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ] [ -R ]\n" +"[ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -o [ <ファイルå> ] | -f [ <ファイルå> ] ]\n" +"[ -i <é–“éš”> ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "主è¦ãªã‚ªãƒ—ションã¨ãã®çµæžœ:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tI/O ã¨è»¢é€çŽ‡ã®çŠ¶æ³\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tページングã®çŠ¶æ…‹\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tブロックデãƒã‚¤ã‚¹ã®çŠ¶æ…‹\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\t割り込ã¿çŠ¶æ³\n" + +#: sar.c:132 +#, c-format +msgid "\t-m\tPower management statistics\n" +msgstr "\t-m\t電力管ç†çŠ¶æ³\n" + +#: sar.c:133 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { <キーワード> [,...] | ALL }\n" +"\t\tãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯ã®çŠ¶æ…‹\n" +"\t\tキーワード一覧:\n" +"\t\tDEV\tãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ã‚¤ã‚¹\n" +"\t\tEDEV\tãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ã‚¤ã‚¹ (エラー)\n" +"\t\tNFS\tNFS クライアント\n" +"\t\tNFSD\tNFS サーãƒ\n" +"\t\tSOCK\tソケット\t(v4)\n" +"\t\tIP\tIP トラフィック\t(v4)\n" +"\t\tEIP\tIP トラフィック\t(v4) (エラー)\n" +"\t\tICMP\tICMP トラフィック\t(v4)\n" +"\t\tEICMP\tICMP トラフィック\t(v4) (エラー)\n" +"\t\tTCP\tTCP トラフィック\t(v4)\n" +"\t\tETCP\tTCP トラフィック\t(v4) (エラー)\n" +"\t\tUDP\tUDP トラフィック\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP トラフィック\t(v6)\n" +"\t\tEIP6\tIP トラフィック\t(v6) (エラー)\n" +"\t\tICMP6\tICMP トラフィック\t(v6)\n" +"\t\tEICMP6\tICMP トラフィック\t(v6) (エラー)\n" +"\t\tUDP6\tUDP トラフィック\t(v6)\n" + +#: sar.c:154 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tQキューã®é•·ã•ã¨ãƒ­ãƒ¼ãƒ‰ã‚¢ãƒ™ãƒ¬ãƒ¼ã‚¸ã®çŠ¶æ…‹\n" + +#: sar.c:155 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tメモリ利用率ã®çŠ¶æ…‹\n" + +#: sar.c:156 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tメモリã®çŠ¶æ³\n" + +#: sar.c:157 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tスワップ領域ã®åˆ©ç”¨çŠ¶æ³\n" + +#: sar.c:158 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tCPU 利用ã®åˆ©ç”¨çŠ¶æ³\n" + +#: sar.c:160 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tカーãƒãƒ«ã®ãƒ†ãƒ¼ãƒ–ル状態\n" + +#: sar.c:161 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tタスクã®ä½œæˆã¨ã‚·ã‚¹ãƒ†ãƒ ã‚¹ã‚¤ãƒƒãƒã®çŠ¶æ…‹\n" + +# , c-format +#: sar.c:162 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tスワップã®çŠ¶æ…‹\n" + +# , c-format +#: sar.c:163 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tTTY デãƒã‚¤ã‚¹ã®çŠ¶æ…‹\n" + +#: sar.c:206 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "データã®åŽé›†ãŒäºˆæœŸç„¡ã終了ã—ã¾ã—ãŸ\n" + +#: sar.c:774 +#, c-format +msgid "Invalid data format\n" +msgstr "データ形å¼ãŒæ­£ã—ãã‚ã‚Šã¾ã›ã‚“\n" + +#: sar.c:778 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "ç•°ãªã‚‹ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® sysstat ã®ãƒ‡ãƒ¼ã‚¿åŽé›†ãƒ—ログラムã«ã‚ˆã‚‹ä¸æ­£ãªãƒ‡ãƒ¼ã‚¿ã‚’使ã£ã¦ã„ã¾ã™\n" + +#: sar.c:798 +#, c-format +msgid "Inconsistent input data\n" +msgstr "矛盾ã—ãŸå…¥åŠ›ãƒ‡ãƒ¼ã‚¿ã§ã™\n" + +#: sar.c:1203 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "-f 㨠-o オプションã¯ç›¸äº’ã«æŽ’ä»–çš„ã§ã™\n" + +#: sar.c:1209 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "システム動作情報ファイルã®èª­ã¿è¾¼ã¿ãŒã‚ã‚Šã¾ã›ã‚“ (-f オプションを使ã£ã¦ãã ã•ã„)\n" + +#: sar.c:1310 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "データåŽé›†ãƒ—ログラム (%s) ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“\n" diff --git a/nls/ky.po b/nls/ky.po new file mode 100644 index 00000000..0c174ab0 --- /dev/null +++ b/nls/ky.po @@ -0,0 +1,196 @@ +# Translation of 'sysstat' messages to Kirghiz. +# Copyright (C) 1999 Free Software Foundation, Inc. +# Ilyas Bakirov , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 8.0.4\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2007-12-19 14:02+0100\n" +"PO-Revision-Date: 2007-12-21 16:53+0600\n" +"Last-Translator: Ilyas Bakirov \n" +"Language-Team: Kirghiz \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Kyrgyz\n" +"X-Poedit-Country: KYRGYZSTAN\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat верÑиÑÑÑ‹ %s\n" + +#: common.c:160 common.c:385 ioconf.c:459 mpstat.c:265 sa_common.c:601 +#: sadc.c:476 sadc.c:485 sadc.c:530 sadc.c:620 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Cannot open %s: %s\n" + +#: common.c:199 +#, fuzzy, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Мынча көп процеÑÑор аткыраалынбайт!\n" + +#: iostat.c:74 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" +msgstr "" +"Колдонуу: %s [ опциÑлар... ] [ <интервал> [ <ÑÑептегич> ] ]\n" +"ОпциÑлар төмөнкүдөй:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ <жабдык> [ ... ] | ALL ] [ -p [ <жабдык> | ALL ] ]\n" + +#: iostat.c:1119 +#, c-format +msgid "Time: %s\n" +msgstr "Убакыт: %s\n" + +#: iostat.c:1435 +#, fuzzy, c-format +msgid "-x and -p options are mutually exclusive\n" +msgstr "-x and -p options are mutually exclusive\n" + +#: mpstat.c:66 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -P { | ALL } ] [ -V ]\n" +msgstr "" +"Колдонуу: %s [ опциÑлар... ] [ <интервал> [ <ÑÑептегич> ] ]\n" +"ОпциÑлар төмөнкүдөй:\n" +"[ -P { | ALL } ] [ -V ]\n" + +#: mpstat.c:226 pidstat.c:1148 sar.c:740 +msgid "Average:" +msgstr "Орточо:" + +#: mpstat.c:563 sar.c:157 +#, c-format +msgid "Not that many processors!\n" +msgstr "Мынча көп процеÑÑор ÑмеÑ!\n" + +#: pidstat.c:72 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Колдонуу: %s [ опциÑлар... ] [ <интервал> [ <ÑÑептегич> ] ]\n" +"ОпциÑлар төмөнкүдөй:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:166 sar.c:1419 +#, c-format +msgid "Requested activities not available\n" +msgstr "Талап кылынган активдүүлүктөр жок\n" + +#: sa_common.c:572 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "СиÑтемдик активдүүлүктү окууда ката чыкты: %s\n" + +#: sa_common.c:581 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "СиÑтемдик активдүүлүк файлдын күтүлбөгөн Ñоңу\n" + +#: sa_common.c:608 sadc.c:549 +#, c-format +msgid "Invalid system activity file: %s (%#x)\n" +msgstr "СиÑтемдик активдүүлүк файлы туура ÑмеÑ: %s (%#x)\n" + +#: sa_common.c:632 +#, c-format +msgid "Requested activities not available in file\n" +msgstr "Талап кылынган активдүүлүктөр жок\n" + +#: sadc.c:83 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" +msgstr "" +"Колдонуу: %s [ опциÑлар... ] [ <интервал> [ <ÑÑептегич> ] ] [ <чыгыш_файлы> ]\n" +"ОпциÑлар төмөнкүдөй:\n" +"[ -C <комментарий> ] [ -d ] [ -F ] [ -I ] [ -V ]\n" + +#: sadc.c:110 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Берилиштер ÑиÑтемдик активдүүлүк файлга жазаалынган жок: %s\n" + +#: sadc.c:361 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "СиÑтемдик активдүүлүктүн башат файлы жазаалынган жок: %s\n" + +#: sadc.c:568 +#, c-format +msgid "Cannot append data to that file\n" +msgstr "Берилиштер тиги файлга кошоалынган жок\n" + +#: sadf.c:78 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Колдонуу: %s [ опциÑлар... ] [ <интервал> [ <ÑÑептегич> ] ] [ <файл_аты> ]\n" +"ОпциÑлар төмөнкүдөй:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sar.c:76 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Колдонуу: %s [ опциÑлар... ] [ <интервал> [ <ÑÑептегич> ] ]\n" +"ОпциÑлар төмөнкүдөй:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i <интервал> ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ <файл_аты> ] | -f [ <файл_аты> ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:149 +#, c-format +msgid "Not an SMP machine...\n" +msgstr "Көп процеÑÑорлуу машина ÑмеÑ...\n" + +#: sar.c:1261 +#, c-format +msgid "Invalid data format\n" +msgstr "Берилиштердин форматы туура ÑмеÑ\n" + +#: sar.c:1633 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "-f жана -o опциÑлар бир бирин жойюшат\n" + +#: sar.c:1639 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "СиÑтемдик активдүүлүктөн окуубай жатабыз (-f опциÑÑын колдонуңуз)\n" diff --git a/nls/lv.po b/nls/lv.po new file mode 100644 index 00000000..249d1044 --- /dev/null +++ b/nls/lv.po @@ -0,0 +1,395 @@ +# translation of sysstat to Latvian +# Copyright (C) 2009 sysstat +# This file is distributed under the same license as the sysstat package. +# +# Rihards Prieditis , 2009, 2010. +msgid "" +msgstr "" +"Project-Id-Version: sysstat-9.1.3\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-06-26 09:01+0200\n" +"PO-Revision-Date: 2010-07-07 10:50+0100\n" +"Last-Translator: Rihards PriedÄ«tis \n" +"Language-Team: Latvian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "LietoÅ¡ana: %s [izvÄ“les] [ []]\n" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" +"IzvÄ“les ir:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat versija %s\n" + +#: ioconf.c:490 rd_stats.c:69 rd_stats.c:1842 sa_common.c:1052 sadc.c:586 +#: sadc.c:595 sadc.c:655 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Nevar atvÄ“rt %s: %s\n" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" +"IzvÄ“les ir:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"IzvÄ“les ir:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Nevar atrast diska datus\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"IzvÄ“les ir:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +#: mpstat.c:530 pidstat.c:1806 sar.c:354 +msgid "Average:" +msgstr "VidÄ“ji:" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "Ne tik daudz procesoru!\n" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"IzvÄ“les ir:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:199 sar.c:972 +#, c-format +msgid "Requested activities not available\n" +msgstr "PieprasÄ«tÄs darbÄ«bas nav pieejamas\n" + +#: rd_stats.c:1888 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Nevar vadÄ«t tik daudz procesoru!\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Kļūda lasot sistÄ“mas aktivitÄtes failu: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "NegaidÄ«tas beigas sistÄ“mas aktivitÄtes failam\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Fails izveidots izmantojot sar/sadc no sysstat versijas %d.%d.%d" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "NederÄ«gs sistÄ“mas aktivitÄtes fails: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "PatreizÄ“jÄ sysstat versija nav spÄ“jÄ«ga lasÄ«t formÄtu Å¡im failam (%#x)\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "PieprasÄ«tÄs darbÄ«bas nav pieejamas failÄ %s\n" + +#: sadc.c:76 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "LietoÅ¡ana: %s [ izvÄ“les ] [ [ ] ] [ ]\n" + +#: sadc.c:79 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"IzvÄ“les ir:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:199 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Nevar ierakstÄ«t datus sistÄ“mas aktivitÄtes failÄ: %s\n" + +#: sadc.c:473 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Nevar ierakstÄ«t virsrakstu sistÄ“mas aktivitÄtes failÄ: %s\n" + +#: sadc.c:749 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Nevar apvienot datus sistÄ“mas aktivitÄtes failÄ: %s\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "LietoÅ¡ana: %s [ IzvÄ“les ] [ [ ] ] [ ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"IzvÄ“les ir:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "SistÄ“mas aktivitÄtes datu fails: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "Resursdators:" + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "IzmÄ“rs lielajam int: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "DarbÄ«bu saraksts:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"IzvÄ“les ir:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "GalvenÄs iespÄ“jas un ziņojumi:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tI/O un pÄrraides Ätrums statistika\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tLapoÅ¡anas statistika\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tBloku ierÄ«ces statistika\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tPÄrtraukumu statistika\n" + +#: sar.c:132 +#, c-format +msgid "\t-m\tPower management statistics\n" +msgstr "\t-m\tEnerÄ£ijas pÄrvaldÄ«bas statistika\n" + +#: sar.c:133 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { [,...] | ALL }\n" +"\t\tTÄ«kla statistika\n" +"\t\tAtslÄ“gas vÄrdi ir:\n" +"\t\tDEV\tTÄ«kla interfeisi\n" +"\t\tEDEV\tTÄ«kla interfeisi (kļūdas)\n" +"\t\tNFS\tNFS klienti\n" +"\t\tNFSD\tNFS serveri\n" +"\t\tSOCK\tSoketi\t(v4)\n" +"\t\tIP\tIP plÅ«sma\t(v4)\n" +"\t\tEIP\tIP plÅ«sma\t(v4) (kļūdas)\n" +"\t\tICMP\tICMP plÅ«sma\t(v4)\n" +"\t\tEICMP\tICMP plÅ«sma\t(v4) (kļūdas)\n" +"\t\tTCP\tTCP plÅ«sma\t(v4)\n" +"\t\tETCP\tTCP plÅ«sma\t(v4) (kļūdas)\n" +"\t\tUDP\tUDP plÅ«sma\t(v4)\n" +"\t\tSOCK6\tSoketi\t(v6)\n" +"\t\tIP6\tIP plÅ«sma\t(v6)\n" +"\t\tEIP6\tIP plÅ«sma\t(v6) (kļūdas)\n" +"\t\tICMP6\tICMP plÅ«sma\t(v6)\n" +"\t\tEICMP6\tICMP plÅ«sam\t(v6) (kļūdas)\n" +"\t\tUDP6\tUDP plÅ«smas\t(v6)\n" + +#: sar.c:154 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tRindas garums un vidÄ“jÄs noslodzes statistika\n" + +#: sar.c:155 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tAtmiņas izmantoÅ¡anas statistika\n" + +#: sar.c:156 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tAtmiņas statistika\n" + +#: sar.c:157 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tApmaiņas vietas izmantoÅ¡anas statistika\n" + +#: sar.c:158 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tCPU izmantoÅ¡anas statistika\n" + +#: sar.c:160 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tKodola tabulas statistika\n" + +#: sar.c:161 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tUzdevumu izveidoÅ¡anas un sistemas pÄrslÄ“gÅ¡anas statistika\n" + +#: sar.c:162 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tApmaiņas statistika\n" + +#: sar.c:163 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tTTY ierÄ«ces statistika\n" + +#: sar.c:206 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "NegaidÄ«tas datu vÄkÅ¡anas beigas\n" + +#: sar.c:774 +#, c-format +msgid "Invalid data format\n" +msgstr "NederÄ«gs datu formÄts\n" + +#: sar.c:778 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Tiek izmantots nepareizs datu vÄcÄ“js, no iepriekÅ¡Ä“jÄs sysstat versijas\n" + +#: sar.c:798 +#, c-format +msgid "Inconsistent input data\n" +msgstr "NesaderÄ«gs datu ievads\n" + +#: sar.c:1207 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "-f un -o iespÄ“jas ir savstarpÄ“ji izslÄ“dzoÅ¡as\n" + +#: sar.c:1213 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Netiek lasÄ«ts no sistÄ“mas aktivitÄtes faila (izmantojies -f iespÄ“ju)\n" + +#: sar.c:1314 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Nevar atrast datu vÄcÄ“ju (%s)\n" diff --git a/nls/mt.po b/nls/mt.po new file mode 100644 index 00000000..3af3f5c1 --- /dev/null +++ b/nls/mt.po @@ -0,0 +1,333 @@ +# Maltese translation for sysstat. +# This file is distributed under the same license as the sysstat package. +# NAME OF AUTHOR , 2008. +msgid "" +msgstr "" +"Project-Id-Version: sysstat-8.1.7\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2008-11-12 13:38+0100\n" +"PO-Revision-Date: 2008-11-13 20:16+0100\n" +"Last-Translator: Michel Bugeja \n" +"Language-Team: Maltese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-Language: Maltese\n" +"X-Poedit-Country: Malta\n" +"X-Poedit-SourceCharset: UTF-8\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat Verżjoni %s\n" + +#: ioconf.c:479 iostat.c:509 rd_stats.c:69 rd_stats.c:1791 rd_stats.c:1898 +#: sa_common.c:1033 sadc.c:498 sadc.c:507 sadc.c:567 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Ma nistax niftaħ %s: %s\n" + +#: iostat.c:80 mpstat.c:83 pidstat.c:77 sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Użu: %s [ opzjonijiet ] [ [ ] ]\n" + +#: iostat.c:83 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" +msgstr "" +"Opzjonijiet:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" + +#: iostat.c:1692 +#, c-format +msgid "-x and -p options are mutually exclusive\n" +msgstr "opzjonijiet -x u -p huma eskulissivi għal xulxin\n" + +#: mpstat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | ALL } ] [ -u ] [ -P { | ALL } ] [ -V ]\n" +msgstr "" +"Opzjonijiet:\n" +"[ -A ] [ -I { SUM | CPU | ALL } ] [ -u ] [ -P { | ALL } ] [ -V ]\n" + +#: mpstat.c:433 pidstat.c:1681 sar.c:333 +msgid "Average:" +msgstr "Medja:" + +#: mpstat.c:742 +#, c-format +msgid "Not that many processors!\n" +msgstr "Mhux daqstant processors!\n" + +#: pidstat.c:80 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Opzjonijiet:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:197 sar.c:943 +#, c-format +msgid "Requested activities not available\n" +msgstr "L-attivita' rikjesti mhux disponibbli\n" + +#: rd_stats.c:1944 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Ma nistax inlaħħaq ma dawn il-processors kollha!\n" + +#: sa_common.c:847 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Problema waqt il-qari tal-fajl tal-attivita' tas-sistema: %s\n" + +#: sa_common.c:857 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Tmiem tal-fajl tal-attivita' tas-sistema bla mistenni\n" + +#: sa_common.c:875 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Fajl maħluq minn sar/sadc minn sysstat verżjoni %d.%d.%d" + +#: sa_common.c:906 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Fajl tal-attivita' tas-sistema mhux validu: %s\n" + +#: sa_common.c:913 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "Il-verżjoni kurrenti ta' sysstat mhux kapaÄ‹i taqra aktar format ta' dan il-fajl (%#x)\n" + +#: sa_common.c:1116 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Attivitajiet rikjesti mhux disponibbil fil-fajl %s\n" + +#: sadc.c:78 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Użu: %s [ opzjonijiet ] [ [ ] ] [ ]\n" + +#: sadc.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -S { INT | DISK | SNMP | ALL } ] [ -F ] [ -L ] [ -V ]\n" +msgstr "" +"Opzjonijiet:\n" +"[ -C ] [ -S { INT | DISK | SNMP | ALL } ] [ -F ] [ -L ] [ -V ]\n" + +#: sadc.c:107 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Ma nistax nikteb data fil-fajl tal-attivita' tas-sistema: %s\n" + +#: sadc.c:385 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Ma nistax nikteb it-titlu fir-ras tal-fajl tal-attivita' tas-sistema: %s\n" + +#: sadc.c:661 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Ma nistax inżid data Ä¡o dak il-fajl (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Użu: %s [ opzjonijiet ] [ [ ] ] [ ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Opzjonijiet:\n" +"[ -d | -D | -H | -p | -x ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:527 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Fajl tad-data tal-attivita' tas-sistema: %s (%#x)\n" + +#: sadf.c:536 +#, c-format +msgid "Host: " +msgstr "Host: " + +#: sadf.c:542 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Qis ta' long int: %d\n" + +#: sadf.c:544 +#, c-format +msgid "List of activities:\n" +msgstr "Lista ta' attivita':\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ] [ -R ]\n" +"[ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | IP | EIP | ICMP | EICMP | TCP | ETCP | UDP | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Opzjonijiet:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ] [ -R ]\n" +"[ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | IP | EIP | ICMP | EICMP | TCP | ETCP | UDP | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "" +"\n" +"Main options and reports:\n" +msgstr "" +"\n" +"Opzjonijiet prinÄ‹ipali u rapporti:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tStatistika fuq I/O u rata ta' transferiment\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tStatistika fuq Paging\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tStatistika fuq block device\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tStatistika fuq Interrupts\n" + +#: sar.c:132 +#, c-format +msgid "" +"\t-n { DEV | EDEV | NFS | NFSD | SOCK |\n" +"\t IP | EIP | ICMP | EICMP | TCP | ETCP | UDP | ALL }\n" +"\t\tNetwork statistics\n" +msgstr "" +"\t-n { DEV | EDEV | NFS | NFSD | SOCK |\n" +"\t IP | EIP | ICMP | EICMP | TCP | ETCP | UDP | ALL }\n" +"\t\tStatistika fuq Network\n" + +#: sar.c:135 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tStatistika fuq Queue length and load average\n" + +#: sar.c:136 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tStatistika fuq użu tal-memorja\n" + +#: sar.c:137 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tStatistika fuq Memorja\n" + +#: sar.c:138 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tStatistika fuq użu ta' Swap space\n" + +#: sar.c:139 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tStatistika fuq użu ta' CPU\n" + +#: sar.c:141 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tStatistika fuq Kernel table\n" + +#: sar.c:142 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tStatistika fuq Task creation and system switching\n" + +#: sar.c:143 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tStatistika fuq swapping\n" + +#: sar.c:144 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tStatistika fuq apparat TTY\n" + +#: sar.c:189 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Tmiem ta' Ä¡bir tad-data bla mistenni\n" + +#: sar.c:749 +#, c-format +msgid "Invalid data format\n" +msgstr "Format tad-data huwa nvalidu\n" + +#: sar.c:753 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Nuża data collector ħażin minn verżjoni differenti ta' sysstat\n" + +#: sar.c:773 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Data mdaħħla mijhiex konsistenti\n" + +#: sar.c:1178 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Opzjoni -f and -o huma esklussivi fil-konfront ta' xulxin\n" + +#: sar.c:1184 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Mhux naqra minn fajl ta' attivita tas-sistema (uża opzjoni -f)\n" + +#: sar.c:1285 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Ma nistax insib id-data collector (%s)\n" diff --git a/nls/nb.po b/nls/nb.po new file mode 100644 index 00000000..9ea8d4c8 --- /dev/null +++ b/nls/nb.po @@ -0,0 +1,195 @@ +# NLS support for the sysstat package. +# Copyright (C) 1999 Free Software Foundation, Inc. +# Sébastien GODARD , 1999. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 1.1\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2007-12-19 14:02+0100\n" +"PO-Revision-Date: 1999-11-07 23:42\n" +"Last-Translator: Roy Sigurd Karlsbakk \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat versjon %s\n" + +#: common.c:160 common.c:385 ioconf.c:459 mpstat.c:265 sa_common.c:601 +#: sadc.c:476 sadc.c:485 sadc.c:530 sadc.c:620 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Kan ikke åpne %s: %s\n" + +#: common.c:199 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Kan ikke håndtere så mange prosessorer!\n" + +#: iostat.c:74 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" +msgstr "" +"Bruk: %s [ valg... ] [ [ ] ]\n" +"Mulige valg:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" + +#: iostat.c:1119 +#, c-format +msgid "Time: %s\n" +msgstr "Tid: %s\n" + +#: iostat.c:1435 +#, c-format +msgid "-x and -p options are mutually exclusive\n" +msgstr "Valgene -x og -p kan ikke brukes samtidig\n" + +#: mpstat.c:66 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -P { | ALL } ] [ -V ]\n" +msgstr "" +"Bruk: %s [ valg... ] [ [ ] ]\n" +"Mulige valg:\n" +"[ -P { | alle } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:226 pidstat.c:1148 sar.c:740 +msgid "Average:" +msgstr "Gj.snitt:" + +#: mpstat.c:563 sar.c:157 +#, c-format +msgid "Not that many processors!\n" +msgstr "Ikke så mange prosessorer!\n" + +#: pidstat.c:72 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Bruk: %s [ valg... ] [ [ ] ]\n" +"Mulige valg:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:166 sar.c:1419 +#, c-format +msgid "Requested activities not available\n" +msgstr "Forespurt statistikk ikke tilgjengelige\n" + +#: sa_common.c:572 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Feil ved lesing av aktivitetslogg: %s\n" + +#: sa_common.c:581 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Uventet slutt på aktivitetslogg\n" + +#: sa_common.c:608 sadc.c:549 +#, c-format +msgid "Invalid system activity file: %s (%#x)\n" +msgstr "Ugyldig aktivitetslogg: %s (%#x)\n" + +#: sa_common.c:632 +#, c-format +msgid "Requested activities not available in file\n" +msgstr "Forespurt statistikk ikke tilgjengelig i aktivitetslogg\n" + +#: sadc.c:83 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" +msgstr "" +"Bruk: %s [ valg... ] [ [ ] ] [ ]\n" +"Mulige valg:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" + +#: sadc.c:110 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Kan ikke skrive data til aktivitetslogg: %s\n" + +#: sadc.c:361 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Kan ikke skrive hode for aktivitetslogg: %s\n" + +#: sadc.c:568 +#, c-format +msgid "Cannot append data to that file\n" +msgstr "Kan ikke skrive mer data til den filen\n" + +#: sadf.c:78 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Bruk: %s [ valg... ] [ [ ] ] [ ]\n" +"Mulige valg:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sar.c:76 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Bruk: %s [ valg... ] [ [ ] ]\n" +"Mulige valg:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:149 +#, c-format +msgid "Not an SMP machine...\n" +msgstr "Ikke SMP-maskin...\n" + +#: sar.c:1261 +#, c-format +msgid "Invalid data format\n" +msgstr "Ugyldig dataformat\n" + +#: sar.c:1633 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Valgene -f og -o kan ikke brukes samtidig\n" + +#: sar.c:1639 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Leser ikke fra aktivitetslogg (bruk valget -f)\n" diff --git a/nls/nl.po b/nls/nl.po new file mode 100644 index 00000000..82043903 --- /dev/null +++ b/nls/nl.po @@ -0,0 +1,418 @@ +# Dutch translations for sysstat. +# This file is distributed under the same license as the sysstat package. +# +# Bram Schoenmakers , 2007. +# Erwin Poeze , 2009, 2010. +# Benno Schulenberg , 2008, 2010. +msgid "" +msgstr "" +"Project-Id-Version: sysstat-9.1.4\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-07-24 10:55+0200\n" +"PO-Revision-Date: 2010-07-31 15:29+0200\n" +"Last-Translator: Benno Schulenberg \n" +"Language-Team: Dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 1.0\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Gebruik: %s [OPTIE...] [ []]\n" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" +"Mogelijke opties zijn:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat-versie %s\n" + +#: ioconf.c:490 rd_stats.c:72 rd_stats.c:1831 sa_common.c:1052 sadc.c:593 +#: sadc.c:602 sadc.c:662 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Kan %s niet openen: %s\n" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" +"Mogelijke opties zijn:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"Mogelijke opties zijn:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Kan de schijfgegevens niet vinden\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"Mogelijke opties zijn:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:530 pidstat.c:1806 sar.c:359 +msgid "Average:" +msgstr "Gemiddeld:" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "Er zijn niet zoveel processoren!\n" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Mogelijke opties zijn:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:199 sar.c:977 +#, c-format +msgid "Requested activities not available\n" +msgstr "De gevraagde activiteiten zijn niet beschikbaar\n" + +#: rd_stats.c:1877 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Kan niet zoveel processoren bijhouden!\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Er is een fout opgetreden bij het uitlezen van het activiteitsbestand: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Onverwacht einde van activiteitsbestand\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Bestand is aangemaakt met 'sar/sadc' door sysstat-versie %d.%d.%d." + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Ongeldig systeemactiviteitsbestand: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "Deze versie van sysstat kan de indeling (%#x) van dit bestand niet meer lezen\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "De gevraagde activiteiten zijn niet beschikbaar in bestand %s\n" + +#: sadc.c:81 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Gebruik: %s [OPTIE...] [ []] []\n" + +#: sadc.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"Mogelijke opties zijn:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:206 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Kan geen gegevens schrijven naar het activiteitsbestand: %s\n" + +#: sadc.c:480 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Kan geen kopregels schrijven naar het activiteitsbestand: %s\n" + +#: sadc.c:756 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Kan geen gegevens toevoegen aan bestand %s\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Gebruik: %s [OPTIE...] [ []] []\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Mogelijke opties zijn:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Systeemactiviteitsbestand: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "Host: " + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Lengte van lange integer: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "Lijst van activiteiten:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Mogelijke opties zijn:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ALL] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "Hoofdopties en -rapporten:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tStatistieken I/O- en overdrachtsnelheid\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tPaging-statistieken\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tBlokapparaatstatistieken\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterruptstatistieken\n" + +#: sar.c:132 +#, c-format +msgid "" +"\t-m { [,...] | ALL }\n" +"\t\tPower management statistics\n" +"\t\tKeywords are:\n" +"\t\tCPU\tCPU clock frequency\n" +"\t\tFAN\tFans speed\n" +"\t\tTEMP\tDevices temperature\n" +msgstr "" +"\t-m { [,...] | ALL }\n" +"\t\tEnergiebeheerstatistieken\n" +"\t\tMogelijke sleutelwoorden:\n" +"\t\tCPU\tprocessorklokfrequentie\n" +"\t\tFAN\tventilatorsnelheid\n" +"\t\tTEMP\tapparaattemperatuur\n" + +#: sar.c:138 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwerkstatistieken\n" +"\t\tMogelijke sleutelwoorden:\n" +"\t\tDEV\tnetwerkinterfaces\n" +"\t\tEDEV\tnetwerkinterfaces (fouten)\n" +"\t\tNFS\tNFS-cliënt\n" +"\t\tNFSD\tNFS-server\n" +"\t\tSOCK\tsockets\t(v4)\n" +"\t\tIP\tIP-verkeer\t(v4)\n" +"\t\tEIP\tIP-verkeer\t(v4) (fouten)\n" +"\t\tICMP\tICMP-verkeer\t(v4)\n" +"\t\tEICMP\tICMP-verkeer\t(v4) (fouten)\n" +"\t\tTCP\tTCP-verkeer\t(v4)\n" +"\t\tETCP\tTCP-verkeer\t(v4) (fouten)\n" +"\t\tUDP\tUDP-verkeer\t(v4)\n" +"\t\tSOCK6\tsockets\t(v6)\n" +"\t\tIP6\tIP-verkeer\t(v6)\n" +"\t\tEIP6\tIP-verkeer\t(v6) (fouten)\n" +"\t\tICMP6\tICMP-verkeer\t(v6)\n" +"\t\tEICMP6\tICMP-verkeer\t(v6) (fouten)\n" +"\t\tUDP6\tUDP-verkeer\t(v6)\n" + +#: sar.c:159 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tStatistieken van wachtrijlengte en gemiddelde belasting\n" + +#: sar.c:160 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tGeheugenbenuttingsstatistieken\n" + +#: sar.c:161 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tGeheugenstatistieken\n" + +#: sar.c:162 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tStatistieken van swap-ruimtebenutting\n" + +#: sar.c:163 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tStatistieken van processorbenutting\n" + +#: sar.c:165 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tStatistieken van kerneltabel\n" + +#: sar.c:166 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tStatistieken van taakcreatie en systeemschakeling\n" + +#: sar.c:167 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tSwapping-statistieken\n" + +#: sar.c:168 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tStatistieken van TTY-apparaat\n" + +#: sar.c:211 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Onverwacht einde van verzamelen van gegevens\n" + +#: sar.c:779 +#, c-format +msgid "Invalid data format\n" +msgstr "Ongeldige gegevensindeling\n" + +#: sar.c:783 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Een verkeerde gegevensverzamelaar van een andere sysstat-versie wordt gebruikt\n" + +#: sar.c:803 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Inconsistente gegevens gelezen\n" + +#: sar.c:1224 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Opties '-f' en '-o' gaan niet samen.\n" + +#: sar.c:1230 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Er wordt geen activiteitsbestand gelezen (gebruik optie '-f')\n" + +#: sar.c:1331 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Kan de gegevensverzamelaar niet vinden (%s)\n" + +#~ msgid "\t-m\tPower management statistics\n" +#~ msgstr "\t-m\tEnergiebeheerstatistieken\n" + +#~ msgid "-x and -p options are mutually exclusive\n" +#~ msgstr "Opties '-x' en '-p' gaan niet samen.\n" + +#~ msgid "Time: %s\n" +#~ msgstr "Tijd: %s\n" diff --git a/nls/nn.po b/nls/nn.po new file mode 100644 index 00000000..58837c41 --- /dev/null +++ b/nls/nn.po @@ -0,0 +1,195 @@ +# NLS support for the sysstat package. +# Copyright (C) 1999 Free Software Foundation, Inc. +# Sébastien GODARD , 1999. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 1.1\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2007-12-19 14:02+0100\n" +"PO-Revision-Date: 1999-11-07 23:42\n" +"Last-Translator: Roy Sigurd Karlsbakk \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat versjon %s\n" + +#: common.c:160 common.c:385 ioconf.c:459 mpstat.c:265 sa_common.c:601 +#: sadc.c:476 sadc.c:485 sadc.c:530 sadc.c:620 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Kan ikkje opna %s: %s\n" + +#: common.c:199 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Kan ikkje handtera så mange prosessorar!\n" + +#: iostat.c:74 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" +msgstr "" +"Bruk: %s [ val... ] [ [ ] ]\n" +"Mogelege val:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" + +#: iostat.c:1119 +#, c-format +msgid "Time: %s\n" +msgstr "Tid: %s\n" + +#: iostat.c:1435 +#, c-format +msgid "-x and -p options are mutually exclusive\n" +msgstr "Vala -x og -p kan ikkje brukast samtidig\n" + +#: mpstat.c:66 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -P { | ALL } ] [ -V ]\n" +msgstr "" +"Bruk: %s [ val... ] [ [ ] ]\n" +"Mogelege val:\n" +"[ -P { | alle } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:226 pidstat.c:1148 sar.c:740 +msgid "Average:" +msgstr "Gj.snitt:" + +#: mpstat.c:563 sar.c:157 +#, c-format +msgid "Not that many processors!\n" +msgstr "Ikkje så mange prosessorar!\n" + +#: pidstat.c:72 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Bruk: %s [ val... ] [ [ ] ]\n" +"Mogelege val:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:166 sar.c:1419 +#, c-format +msgid "Requested activities not available\n" +msgstr "Forspørja statistikk ikkje tilgjengelige\n" + +#: sa_common.c:572 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Feil ved lesing av aktivitetslogg: %s\n" + +#: sa_common.c:581 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Uventa slutt på aktivitetslogg\n" + +#: sa_common.c:608 sadc.c:549 +#, c-format +msgid "Invalid system activity file: %s (%#x)\n" +msgstr "Ugyldig aktivitetslogg: %s (%#x)\n" + +#: sa_common.c:632 +#, c-format +msgid "Requested activities not available in file\n" +msgstr "Forspørja statistikk ikkje tilgjengelig i aktivitetslogg\n" + +#: sadc.c:83 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" +msgstr "" +"Bruk: %s [ val... ] [ [ ] ] [ ]\n" +"Mogelege val:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" + +#: sadc.c:110 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Kan ikkje skriva data til aktivitetslogg: %s\n" + +#: sadc.c:361 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Kan ikkje skriva hode for aktivitetslogg: %s\n" + +#: sadc.c:568 +#, c-format +msgid "Cannot append data to that file\n" +msgstr "Kan ikkje skriva meir data til den fila\n" + +#: sadf.c:78 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Bruk: %s [ val... ] [ [ ] ] [ ]\n" +"Mogelege val:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sar.c:76 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Bruk: %s [ val... ] [ [ ] ]\n" +"Mogelege val:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:149 +#, c-format +msgid "Not an SMP machine...\n" +msgstr "Ikkje SMP-maskin...\n" + +#: sar.c:1261 +#, c-format +msgid "Invalid data format\n" +msgstr "Ugyldig dataformat\n" + +#: sar.c:1633 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Vala -f og -o kan ikkje brukast samtidig\n" + +#: sar.c:1639 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Leser ikkje fra aktivitetslogg (bruk valet -f)\n" diff --git a/nls/pl.po b/nls/pl.po new file mode 100644 index 00000000..eaf3c894 --- /dev/null +++ b/nls/pl.po @@ -0,0 +1,371 @@ +# Polish NLS support for the sysstat package. +# Copyright (C) 1999 Sébastien GODARD (msgids). +# This file is distributed under the same license as the sysstat package. +# Robert Luberda , 2008 - 2009 +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 9.1.1\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-02-21 11:47+0100\n" +"PO-Revision-Date: 2010-03-14 19:05+0100\n" +"Last-Translator: Robert Luberda \n" +"Language-Team: Polish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat w wersji %s\n" + +#: ioconf.c:490 rd_stats.c:69 rd_stats.c:1842 sa_common.c:1052 sadc.c:589 +#: sadc.c:598 sadc.c:658 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Nie można otworzyć %s: %s\n" + +#: iostat.c:81 mpstat.c:86 pidstat.c:77 sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Użycie: %s [ opcje ] [ [ ] ]\n" + +#: iostat.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"Opcje to:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" + +#: iostat.c:340 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Nie można znaleźć danych o dyskach\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"Opcje to:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:504 pidstat.c:1683 sar.c:354 +msgid "Average:" +msgstr "Åšrednia:" + +#: mpstat.c:847 +#, c-format +msgid "Not that many processors!\n" +msgstr "Nie ma aż tylu procesorów!\n" + +#: pidstat.c:80 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Opcje to:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:197 sar.c:972 +#, c-format +msgid "Requested activities not available\n" +msgstr "Żądane statystyki nie sÄ… dostÄ™pne\n" + +#: rd_stats.c:1888 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Zbyt dużo procesorów!\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "BÅ‚Ä…d podczas czytania pliku aktywnoÅ›ci systemu: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Niespodziewany koniec pliku aktywnoÅ›ci systemu\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Plik utworzony przez sar/sadc z wersji %d.%d.%d pakietu sysstat" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Niepoprawny plik aktywnoÅ›ci systemu: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "Bieżąca wersja pakietu sysstat nie obsÅ‚uguje już formatu tego pliku (%#x)\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Żądane statystyki nie sÄ… dostÄ™pne w pliku %s\n" + +#: sadc.c:76 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Użycie: %s [ opcje ] [ [ ] ] [ ]\n" + +#: sadc.c:79 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"Opcje to:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:199 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Nie można zapisać danych do pliku aktywnoÅ›ci systemu: %s\n" + +#: sadc.c:476 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Nie można zapisać nagłówka pliku aktywnoÅ›ci systemu: %s\n" + +#: sadc.c:752 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Nie można dopisać danych do tego pliku (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Użycie: %s [ opcje ] [ [ ] ] [ ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Opcje to:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Plik z danymi o aktywnoÅ›ci systemu: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "System: " + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Rozmiar typu long int: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "Lista aktywnoÅ›ci:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Opcje to:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "Główne opcje i raporty:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tStatystyki I/O i prÄ™dkoÅ›ci transferu danych\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tStatystyki stronicowania\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tStatystyki urzÄ…dzeÅ„ blokowych\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tStatystyki przerwaÅ„\n" + +#: sar.c:132 +#, c-format +msgid "\t-m\tPower management statistics\n" +msgstr "\t-B\tStatystyki zarzÄ…dzania energiÄ…\n" + +#: sar.c:133 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { [,...] | ALL }\n" +"\t\tStatystyki sieciowe\n" +"\t\tSÅ‚owa kluczowe to:\n" +"\t\tDEV\tInterfejsy sieciowe\n" +"\t\tEDEV\tInterfejsy sieciowe (bÅ‚Ä™dy)\n" +"\t\tNFS\tKlient NFS\n" +"\t\tNFSD\tSerwer NFS \n" +"\t\tSOCK\tSokety\t(v4)\n" +"\t\tIP\tRuch IP\t(v4)\n" +"\t\tEIP\tRuch IP\t(v4) (bÅ‚Ä™dy)\n" +"\t\tICMP\tRuch ICMP\t(v4)\n" +"\t\tEICMP\tRuch ICMP\t(v4) (bÅ‚Ä™dy)\n" +"\t\tTCP\tRuch TCP\t(v4)\n" +"\t\tETCP\tRuch TCP\t(v4) (bÅ‚Ä™dy)\n" +"\t\tUDP\tRuch UDP\t(v4)\n" +"\t\tSOCK6\tSokety\t(v6)\n" +"\t\tIP6\tRuch IP\t(v6)\n" +"\t\tEIP6\tRuch IP\t(v6) (bÅ‚Ä™dy)\n" +"\t\tICMP6\tRuch ICMP\t(v6)\n" +"\t\tEICMP6\tRuch ICMP\t(v6) (bÅ‚Ä™dy)\n" +"\t\tUDP6\tRuch UDP\t(v6)\n" + +#: sar.c:154 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tStatystyki kolejkowania procesów i Å›redniego obciążenia systemu\n" + +#: sar.c:155 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tStatystyki wykorzystania pamiÄ™ci\n" + +#: sar.c:156 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tStatystyki pamiÄ™ci\n" + +#: sar.c:157 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tStatystyki wykorzystania przestrzeni wymiany\n" + +#: sar.c:158 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tStatystyki wykorzystania procesora\n" + +#: sar.c:160 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tStatystyki tabeli jÄ…dra\n" + +#: sar.c:161 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tStatystyki tworzenia zadaÅ„ i przeÅ‚Ä…czania systemu\n" + +#: sar.c:162 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tStatystyki wymiany\n" + +#: sar.c:163 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tStatystyki terminali\n" + +#: sar.c:206 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Niespodziewany koniec zbieranych danych\n" + +#: sar.c:774 +#, c-format +msgid "Invalid data format\n" +msgstr "Niepoprawny format danych\n" + +#: sar.c:778 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Używany program do zbierania danych pochodzi z innej wersji pakietu sysstat\n" + +#: sar.c:798 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Niespójne dane wejÅ›ciowe\n" + +#: sar.c:1207 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Opcje -f i -o siÄ™ wykluczajÄ…\n" + +#: sar.c:1213 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Czytanie danych nie z pliku aktywnoÅ›ci systemu (proszÄ™ użyć opcji -f)\n" + +#: sar.c:1314 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Nie można znaleźć programu do zbierania danych (%s)\n" diff --git a/nls/pt.po b/nls/pt.po new file mode 100644 index 00000000..1a329c47 --- /dev/null +++ b/nls/pt.po @@ -0,0 +1,195 @@ +# NLS support for the sysstat package. +# Copyright (C) 1999 Free Software Foundation, Inc. +# Sébastien GODARD , 1999. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 1.1\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2007-12-19 14:02+0100\n" +"PO-Revision-Date: 1999-05-28 20:27\n" +"Last-Translator: Frederic L. W. Meunier \n" +"Language-Team: Brazilian portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat versão %s\n" + +#: common.c:160 common.c:385 ioconf.c:459 mpstat.c:265 sa_common.c:601 +#: sadc.c:476 sadc.c:485 sadc.c:530 sadc.c:620 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Impossível abrir %s: %s\n" + +#: common.c:199 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Não posso usar tantos processadores!\n" + +#: iostat.c:74 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" +msgstr "" +"Utilização: %s [ opções... ] [ [ ] ]\n" +"Opções são:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" + +#: iostat.c:1119 +#, c-format +msgid "Time: %s\n" +msgstr "Hora: %s\n" + +#: iostat.c:1435 +#, c-format +msgid "-x and -p options are mutually exclusive\n" +msgstr "As opções -x e -p não podem ser utilizadas juntas\n" + +#: mpstat.c:66 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -P { | ALL } ] [ -V ]\n" +msgstr "" +"Utilização: %s [ opções... ] [ [ ] ]\n" +"Opções são:\n" +"[ -P { | ALL } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:226 pidstat.c:1148 sar.c:740 +msgid "Average:" +msgstr "Média:" + +#: mpstat.c:563 sar.c:157 +#, c-format +msgid "Not that many processors!\n" +msgstr "Não tantos processadores!\n" + +#: pidstat.c:72 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Utilização: %s [ opções... ] [ [ ] ]\n" +"Opções são:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:166 sar.c:1419 +#, c-format +msgid "Requested activities not available\n" +msgstr "Atividades pedidas não estão disponíveis\n" + +#: sa_common.c:572 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Erro durante a leitura do arquivo de atividade do sistema: %s\n" + +#: sa_common.c:581 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Fim do arquivo de atividade do sistema inesperado\n" + +#: sa_common.c:608 sadc.c:549 +#, c-format +msgid "Invalid system activity file: %s (%#x)\n" +msgstr "Arquivo de atividade do sistema inválido: %s (%#x)\n" + +#: sa_common.c:632 +#, c-format +msgid "Requested activities not available in file\n" +msgstr "Atividades pedidas não foram gravadas no arquivo\n" + +#: sadc.c:83 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" +msgstr "" +"Utilização: %s [ opções... ] [ [ ] ] [ ]\n" +"Opções são:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" + +#: sadc.c:110 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Impossível escrever os dados no arquivo de atividade do sistema: %s\n" + +#: sadc.c:361 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Impossível escrever cabeçalho do arquivo de atividade do sistema: %s\n" + +#: sadc.c:568 +#, c-format +msgid "Cannot append data to that file\n" +msgstr "Não posso adicionar dados neste arquivo\n" + +#: sadf.c:78 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Utilização: %s [ opções... ] [ [ ] ] [ ]\n" +"Opções são:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sar.c:76 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Utilização: %s [ opções... ] [ [ ] ]\n" +"Possíveis opções:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:149 +#, c-format +msgid "Not an SMP machine...\n" +msgstr "Não é uma máquina multiprocessadora...\n" + +#: sar.c:1261 +#, c-format +msgid "Invalid data format\n" +msgstr "Formato de dados inválido\n" + +#: sar.c:1633 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "As opções -f e -o não podem ser utilizadas juntas\n" + +#: sar.c:1639 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Não lendo de um arquivo de atividade do sistema (utilize a opção -f)\n" diff --git a/nls/pt_BR.po b/nls/pt_BR.po new file mode 100644 index 00000000..138392da --- /dev/null +++ b/nls/pt_BR.po @@ -0,0 +1,395 @@ +# Brazilian Portuguese translations for sysstat package. +# Copyright (C) 2010 Free Software Foundation +# This file is distributed under the same license as the sysstat package. +# João Victor Duarte Martins , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 9.1.3\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-06-26 09:01+0200\n" +"PO-Revision-Date: 2010-06-29 12:51-0300\n" +"Last-Translator: João Victor Duarte Martins \n" +"Language-Team: Brazilian Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Uso: %s [ opções ] [ [ ]\n" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V]\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat versão %s\n" + +#: ioconf.c:490 rd_stats.c:69 rd_stats.c:1842 sa_common.c:1052 sadc.c:586 +#: sadc.c:595 sadc.c:655 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Não é possível abrir %s: %s\n" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" +"As opções são:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"As opções são:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Não é possível dados do disco\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"As opções são:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +#: mpstat.c:530 pidstat.c:1806 sar.c:354 +msgid "Average:" +msgstr "Média:" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "Não esse tanto de processadores!\n" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"As opções são:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:199 sar.c:972 +#, c-format +msgid "Requested activities not available\n" +msgstr "As atividade requisitadas não estão disponíveis\n" + +#: rd_stats.c:1888 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Não é possível lidar com tantos processadores!\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Erro ao ler o arquivo de atividades do sistema: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Fim inesperado do arquivo de atividades do sistema\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Arquivo criado usando o sar/sadc da versão %d.%d.%d do sysstat" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Arquivo de atividades do sistema inválido: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "A versão atual do sysstat não consegue mais ler o formato deste arquivo (%#x)\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Atividades requisitadas não estão disponíveis no arquivo %s\n" + +#: sadc.c:76 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Uso: %s [ opções ] [ [ ] ] [ ]\n" + +#: sadc.c:79 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"As opções são:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:199 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Não é possível escrever dados no arquivo de atividades do sistema: %s\n" + +#: sadc.c:473 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Não é possível escrever o cabeçalho do arquivo de atividades do sistema: %s\n" + +#: sadc.c:749 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Não é possível inserir dados no final deste arquivo (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Uso: %s [ opções ] [ [ ] ] [ ]\n" + +# TODO verificar o que é +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"As opções são:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Arquivo de dados das atividades do sistema: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "Computador: " + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Tamanho de um 'long int': %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "Lista de atividades:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"As opções são:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "Opções principais e relatórios:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tE/S e estatísticas de taxa de transferência\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tEstatísticas de paginação\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tEstatísticas de dispositivos de bloco\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tEstatísticas de Interrupção\n" + +#: sar.c:132 +#, c-format +msgid "\t-m\tPower management statistics\n" +msgstr "\t-B\tEstatísticas de gerencia de energia\n" + +#: sar.c:133 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { [,...] | ALL }\n" +"\t\tEstatísticas de Rede\n" +"\t\tPalavras chave são:\n" +"\t\tDEV\tInterfaces de Rede\n" +"\t\tEDEV\tInterfaces de Rede (erros)\n" +"\t\tNFS\tCliente NFS\n" +"\t\tNFSD\tServidor NFS\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tTráfico IP\t(v4)\n" +"\t\tEIP\tTráfico IP\t(v4) (erros)\n" +"\t\tICMP\tTráfico ICMP\t(v4)\n" +"\t\tEICMP\tTráfico ICMP\t(v4) (erros)\n" +"\t\tTCP\tTráfico TCP\t(v4)\n" +"\t\tETCP\tTráfico TCP\t(v4) (erros)\n" +"\t\tUDP\tTráfico UDP\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tTráfico IP\t(v6)\n" +"\t\tEIP6\tTráfico IP\t(v6) (erros)\n" +"\t\tICMP6\tTráfico ICMP\t(v6)\n" +"\t\tEICMP6\tTráfico ICMP\t(v6) (erros)\n" +"\t\tUDP6\tTráfico UDP\t(v6)\n" + +#: sar.c:154 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tTamanho da fila e estatísticas da média de carga\n" + +#: sar.c:155 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tEstatísticas de utilização de memória\n" + +#: sar.c:156 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tEstatísticas de memória\n" + +#: sar.c:157 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tEstatísticas de utilização de espaço de permuta (Swap)\n" + +#: sar.c:158 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tEstatística de utilização da UCP\n" + +#: sar.c:160 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tEstatísticas da tabela do Núcleo (Kernel)\n" + +#: sar.c:161 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tEstatísticas de criação de tarefas e trocas de contexto\n" + +#: sar.c:162 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tEstatísticas de Permutação de Memória (Swapping)\n" + +#: sar.c:163 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tEstatísticas de dispositivos TTY\n" + +#: sar.c:206 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Fim inesperado da coleta de dados\n" + +#: sar.c:774 +#, c-format +msgid "Invalid data format\n" +msgstr "Formato de dados inválido\n" + +#: sar.c:778 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Usando um coletador de dados errado de uma versão diferente do sysstat\n" + +#: sar.c:798 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Dados de entrada inconsistentes\n" + +#: sar.c:1207 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "As opções -f e -o são mutuamente exclusivas\n" + +#: sar.c:1213 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Não está sendo lido de um arquivo de atividade do sistema (utilize a opção -f)\n" + +#: sar.c:1314 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Não é possível encontrar o coletor de dados (%s)\n" diff --git a/nls/ro.po b/nls/ro.po new file mode 100644 index 00000000..8f7244b5 --- /dev/null +++ b/nls/ro.po @@ -0,0 +1,195 @@ +# NLS support for the sysstat package. +# Copyright (C) 2003 Free Software Foundation, Inc. +# Eugen Hoanca , 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 4.1.2\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2007-12-19 14:02+0100\n" +"PO-Revision-Date: 2003-03-12 10:21+0200\n" +"Last-Translator: Eugen Hoanca \n" +"Language-Team: Romanian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat versiunea %s\n" + +#: common.c:160 common.c:385 ioconf.c:459 mpstat.c:265 sa_common.c:601 +#: sadc.c:476 sadc.c:485 sadc.c:530 sadc.c:620 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Nu se poate deschide %s: %s\n" + +#: common.c:199 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Numar prea mare de procesoare!\n" + +#: iostat.c:74 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" +msgstr "" +"Utilizare: %s [ optiuni... ] [ [ ] ]\n" +"Optiuni disponibile:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" + +#: iostat.c:1119 +#, c-format +msgid "Time: %s\n" +msgstr "Ora: %s\n" + +#: iostat.c:1435 +#, c-format +msgid "-x and -p options are mutually exclusive\n" +msgstr "Optiunile -x si -p se exclud reciproc\n" + +#: mpstat.c:66 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -P { | ALL } ] [ -V ]\n" +msgstr "" +"Utilizare: %s [ optiuni... ] [ [ ] ]\n" +"Optiuni disponibile:\n" +"[ -P { | ALL } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:226 pidstat.c:1148 sar.c:740 +msgid "Average:" +msgstr "Media:" + +#: mpstat.c:563 sar.c:157 +#, c-format +msgid "Not that many processors!\n" +msgstr "Prea multe procesoare specificate!\n" + +#: pidstat.c:72 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Utilizare: %s [ optiuni... ] [ [ ] ]\n" +"Optiuni disponibile:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:166 sar.c:1419 +#, c-format +msgid "Requested activities not available\n" +msgstr "Statistica solicitata nu este disponibila\n" + +#: sa_common.c:572 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "A aparut o eroare la citirea fisierului de activitate al sistemului: %s\n" + +#: sa_common.c:581 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Sfarsit neasteptat al fisierului de activitate al sistemului\n" + +#: sa_common.c:608 sadc.c:549 +#, c-format +msgid "Invalid system activity file: %s (%#x)\n" +msgstr "Fisier de activitate a sistemului invalid: %s (%#x)\n" + +#: sa_common.c:632 +#, c-format +msgid "Requested activities not available in file\n" +msgstr "Activitatile solicitate nu se regasesc in fisier\n" + +#: sadc.c:83 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" +msgstr "" +"Utilizare: %s [ optiuni... ] [ [ ] ] [ ]\n" +"Optiuni disponibile:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" + +#: sadc.c:110 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Nu se poate scrie in fisierul de activitate sistem: %s\n" + +#: sadc.c:361 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Nu se poate scrie headerul fisierului de activitate sistem: %s\n" + +#: sadc.c:568 +#, c-format +msgid "Cannot append data to that file\n" +msgstr "Nu se pot adauga date in acel fisier\n" + +#: sadf.c:78 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Utilizare: %s [ optiuni... ] [ [ ] ] [ ]\n" +"Optiuni disponibile:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sar.c:76 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Utilizare: %s [ optiuni... ] [ [ ] ]\n" +"Optiuni disponibile:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:149 +#, c-format +msgid "Not an SMP machine...\n" +msgstr "Nu este sistem multiprocesor...\n" + +#: sar.c:1261 +#, c-format +msgid "Invalid data format\n" +msgstr "Format invalid de data\n" + +#: sar.c:1633 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Optiunile -f si -o se exclud reciproc\n" + +#: sar.c:1639 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Nu se citeste dintr-un fisier activitate sistem (utilizati -f)\n" diff --git a/nls/ru.po b/nls/ru.po new file mode 100644 index 00000000..9b9e41ab --- /dev/null +++ b/nls/ru.po @@ -0,0 +1,414 @@ +# translation of sysstat-9.1.4.ru.po to Russian +# NLS support for the sysstat package. +# Copyright (C) 1999, 2009, 2010 Free Software Foundation, Inc. +# This file is distributed under the same license as the sysstat package. +# +# SИbastien GODARD , 1999. +# Dennis Selsky , 2002. +# Yuri Kozlov , 2009, 2010. +msgid "" +msgstr "" +"Project-Id-Version: sysstat 9.1.4\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-07-24 10:55+0200\n" +"PO-Revision-Date: 2010-07-31 08:41+0400\n" +"Last-Translator: Yuri Kozlov \n" +"Language-Team: Russian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "ИÑпользование: %s [ параметры ] [ <интервал> [ <Ñчётчик> ] ]\n" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" +"Параметры:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat, верÑÐ¸Ñ %s\n" + +#: ioconf.c:490 rd_stats.c:72 rd_stats.c:1831 sa_common.c:1052 sadc.c:593 +#: sadc.c:602 sadc.c:662 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Ðе удалоÑÑŒ открыть %s: %s\n" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" +"Параметры:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ <уÑÑ‚Ñ€-во> [...] | ALL ] [ -p [ <уÑÑ‚Ñ€-во> [,...] | ALL ] ] [ --debuginfo ]\n" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"Параметры:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ <уÑÑ‚Ñ€-во> [...] | ALL ] [ -p [ <уÑÑ‚Ñ€-во> [,...] | ALL ] ]\n" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Ðе удалоÑÑŒ найти данные диÑка\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"Параметры:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { <ЦП> [,...] | ALL } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:530 pidstat.c:1806 sar.c:359 +msgid "Average:" +msgstr "Среднее:" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "Ðет такого количеÑтва процеÑÑоров в ÑиÑтеме!\n" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Параметры:\n" +"[ -C <команда> ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:199 sar.c:977 +#, c-format +msgid "Requested activities not available\n" +msgstr "Запрошенный показатель недоÑтупен\n" + +#: rd_stats.c:1877 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Ðевозможно обработать так много процеÑÑоров!\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Ошибка Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð° ÑиÑтемных показателей: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Ðеожиданный конец файла ÑиÑтемных показателей\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Файл Ñоздан Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ sar/sadc из sysstat верÑии %d.%d.%d" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Ðеправильный файл ÑиÑтемных показателей: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "Ð¢ÐµÐºÑƒÑ‰Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ sysstat больше не поддерживает формат Ñтого файла (%#x)\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Запрашиваемые показатели из файла %s недоÑтупны\n" + +#: sadc.c:81 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "ИÑпользование: %s [ параметры ] [ <интервал> [ <Ñчётчик> ] ] [ <вых_файл> ]\n" + +#: sadc.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"Параметры:\n" +"[ -C <комм.> ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:206 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Ðе удалоÑÑŒ запиÑать данные в файл ÑиÑтемных показателей: %s\n" + +#: sadc.c:480 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Ðе удалоÑÑŒ запиÑать заголовок в файл ÑиÑтемных показателей: %s\n" + +#: sadc.c:756 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Ðе удалоÑÑŒ добавить данные в Ñтот файл (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "ИÑпользование: %s [ параметры ] [ <интервал> [ <Ñчётчик> ] ] [ <файл_данных> ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Параметры:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { <ЦП> [,...] | ALL } ] [ -s [ <чч:мм:ÑÑ> ] ] [ -e [ <чч:мм:ÑÑ> ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Ðеправильный файл ÑиÑтемных показателей: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "ХоÑÑ‚: " + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Размер long int: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "СпиÑок показателей:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Параметры:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { <целое> [,...] | SUM | ALL | XALL } ] [ -P { <ЦП> [,...] | ALL } ]\n" +"[ -m { <ключ_Ñлово> [,...] | ALL } ] [ -n { <ключ_Ñлово> [,...] | ALL } ]\n" +"[ -o [ <имÑ_файла> ] | -f [ <имÑ_файла> ] ]\n" +"[ -i <интервалl> ] [ -s [ <чч:мм:ÑÑ> ] ] [ -e [ <чч:мм:ÑÑ> ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "ОÑновные параметры и отчёты:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tСтатиÑтика по Ð’Ð’/ВЫВ и ÑкороÑти передачи\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tСтатиÑтика по обмену Ñтраниц\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tСтатиÑтика по блочным уÑтройÑтвам\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { <целое> | SUM | ALL | XALL }\n" +"\t\tСтатиÑтика по прерываниÑм\n" + +#: sar.c:132 +#, c-format +msgid "" +"\t-m { [,...] | ALL }\n" +"\t\tPower management statistics\n" +"\t\tKeywords are:\n" +"\t\tCPU\tCPU clock frequency\n" +"\t\tFAN\tFans speed\n" +"\t\tTEMP\tDevices temperature\n" +msgstr "" +"\t-m { <ключ_Ñлово> [,...] | ALL }\n" +"\t\tСтатиÑтика ÑƒÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð¿Ð¸Ñ‚Ð°Ð½Ð¸ÐµÐ¼\n" +"\t\tКлючевые Ñлова:\n" +"\t\tCPU\tчаÑтота работы ЦП\n" +"\t\tFAN\tÑкороÑÑ‚ÑŒ Ð²Ñ€Ð°Ñ‰ÐµÐ½Ð¸Ñ Ð²ÐµÐ½Ñ‚Ð¸Ð»Ñторов\n" +"\t\tTEMP\tтемпература уÑтройÑтв\n" + +#: sar.c:138 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { <ключ_Ñлово> [,...] | ALL }\n" +"\t\tÐ¡ÐµÑ‚ÐµÐ²Ð°Ñ ÑтатиÑтика\n" +"\t\tКлючевые Ñлова:\n" +"\t\tDEV\tСетевые интерфейÑÑ‹\n" +"\t\tEDEV\tСетевые интерфейÑÑ‹ (ошибки)\n" +"\t\tNFS\tКлиент NFS\n" +"\t\tNFSD\tСервер NFS\n" +"\t\tSOCK\tСокеты\t(v4)\n" +"\t\tIP\tIP трафик\t(v4)\n" +"\t\tEIP\tIP трафик\t(v4) (errors)\n" +"\t\tICMP\tICMP трафик\t(v4)\n" +"\t\tEICMP\tICMP трафик\t(v4) (errors)\n" +"\t\tTCP\tTCP трафик\t(v4)\n" +"\t\tETCP\tTCP трафик\t(v4) (errors)\n" +"\t\tUDP\tUDP трафик\t(v4)\n" +"\t\tSOCK6\tСокеты\t(v6)\n" +"\t\tIP6\tIP трафик\t(v6)\n" +"\t\tEIP6\tIP трафик\t(v6) (errors)\n" +"\t\tICMP6\tICMP трафик\t(v6)\n" +"\t\tEICMP6\tICMP трафик\t(v6) (errors)\n" +"\t\tUDP6\tUDP трафик\t(v6)\n" + +#: sar.c:159 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tСтатиÑтика по длине и Ñредней загрузке очереди\n" + +#: sar.c:160 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tСтатиÑтика по иÑпользованию памÑти\n" + +#: sar.c:161 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tСтатиÑтика по памÑти\n" + +#: sar.c:162 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tСтатиÑтика по иÑпользованию облаÑти подкачки\n" + +#: sar.c:163 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tСтатиÑтика по иÑпользованию ЦП\n" + +#: sar.c:165 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tСтатиÑтика по таблице Ñдра\n" + +#: sar.c:166 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tСтатиÑтика по Ñозданию задач и ÑиÑтемным переключениÑм\n" + +#: sar.c:167 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tСтатиÑтика по подкачке\n" + +#: sar.c:168 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tСтатиÑтика по уÑтройÑтвам TTY\n" + +#: sar.c:211 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Ðеожиданно закончилиÑÑŒ Ñобираемые данные\n" + +#: sar.c:779 +#, c-format +msgid "Invalid data format\n" +msgstr "Ðеправильный формат данных\n" + +#: sar.c:783 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "ИÑпользуетÑÑ Ð¾ÑˆÐ¸Ð±Ð¾Ñ‡Ð½Ð¾Ðµ ÑредÑтво Ñбора данных от другой верÑии sysstat\n" + +#: sar.c:803 +#, c-format +msgid "Inconsistent input data\n" +msgstr "ÐеÑоглаÑованные входные данные\n" + +#: sar.c:1224 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Параметры -f и -o ÑвлÑÑŽÑ‚ÑÑ Ð²Ð·Ð°Ð¸Ð¼Ð¾Ð¸Ñключающими\n" + +#: sar.c:1230 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Ðе выполнÑем чтение из файла ÑиÑтемных показателей (иÑпользуйте параметр -f)\n" + +#: sar.c:1331 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Ðе удалоÑÑŒ найти ÑредÑтво Ñбора данных (%s)\n" + +#~ msgid "\t-m\tPower management statistics\n" +#~ msgstr "\t-B\tСтатиÑтика по управлению питанием\n" diff --git a/nls/sk.po b/nls/sk.po new file mode 100644 index 00000000..c1c9f433 --- /dev/null +++ b/nls/sk.po @@ -0,0 +1,195 @@ +# NLS support for the sysstat package. +# Copyright (C) 1999 Free Software Foundation, Inc. +# Sébastien GODARD , 1999. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 4.1.3\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2007-12-19 14:02+0100\n" +"PO-Revision-Date: 2003-05-17 19:30\n" +"Last-Translator: Miroslav David \n" +"Language-Team: Slovak\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat verzia %s\n" + +#: common.c:160 common.c:385 ioconf.c:459 mpstat.c:265 sa_common.c:601 +#: sadc.c:476 sadc.c:485 sadc.c:530 sadc.c:620 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Nie je mo¾né otvori» %s: %s\n" + +#: common.c:199 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Nie je mo¾né obslú¾i» toµko procesorov!\n" + +#: iostat.c:74 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" +msgstr "" +"Pou¾itie: %s [ voµby... ] [ [ ] ]\n" +"Mo¾né voµby:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" + +#: iostat.c:1119 +#, c-format +msgid "Time: %s\n" +msgstr "Èas: %s\n" + +#: iostat.c:1435 +#, c-format +msgid "-x and -p options are mutually exclusive\n" +msgstr "Voµby -x a -p sa navzájom vyluèujú\n" + +#: mpstat.c:66 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -P { | ALL } ] [ -V ]\n" +msgstr "" +"Pou¾itie: %s [ voµby... ] [ [ ] ]\n" +"Mo¾né voµby:\n" +"[ -P { | ALL } ] [ -V ]\n" + +# sar.c: +#: mpstat.c:226 pidstat.c:1148 sar.c:740 +msgid "Average:" +msgstr "Priemer:" + +#: mpstat.c:563 sar.c:157 +#, c-format +msgid "Not that many processors!\n" +msgstr "Nie a¾ tak veµa procesorov!\n" + +#: pidstat.c:72 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Pou¾itie: %s [ voµby... ] [ [ ] ]\n" +"Mo¾né voµby:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:166 sar.c:1419 +#, c-format +msgid "Requested activities not available\n" +msgstr "®iadané ¹tatistiky nie sú dostupné\n" + +#: sa_common.c:572 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Chyba poèas èítania súboru aktivity systému: %s\n" + +#: sa_common.c:581 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Neoèakávaný koniec súboru aktivity systému\n" + +#: sa_common.c:608 sadc.c:549 +#, c-format +msgid "Invalid system activity file: %s (%#x)\n" +msgstr "Nesprávny súbor aktivity systému: %s (%#x)\n" + +#: sa_common.c:632 +#, c-format +msgid "Requested activities not available in file\n" +msgstr "®iadané ¹tatistiky nie sú dostupné v súbore\n" + +#: sadc.c:83 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" +msgstr "" +"Pou¾itie: %s [ voµby... ] [ [ ] ] [ ]\n" +"Mo¾né voµby:\n" +"[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" + +#: sadc.c:110 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Nie je mo¾né zapísa» údaje do súboru aktivity systému: %s\n" + +#: sadc.c:361 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Nie je mo¾né zapísa» hlavièku súboru aktivity systému: %s\n" + +#: sadc.c:568 +#, c-format +msgid "Cannot append data to that file\n" +msgstr "Nie je mo¾né dopísa» údaje do toho súboru\n" + +#: sadf.c:78 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ] [ ]\n" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Pou¾itie: %s [ voµby... ] [ [ ] ] [ ]\n" +"Mo¾né voµby:\n" +"[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" + +#: sar.c:76 +#, c-format +msgid "" +"Usage: %s [ options... ] [ [ ] ]\n" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Pou¾itie: %s [ voµby... ] [ [ ] ]\n" +"Mo¾né voµby:\n" +"[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +"[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:149 +#, c-format +msgid "Not an SMP machine...\n" +msgstr "Poèítaè nie je multiprocesorový...\n" + +#: sar.c:1261 +#, c-format +msgid "Invalid data format\n" +msgstr "Nesprávny formát údajov\n" + +#: sar.c:1633 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Voµby -f a -o sa navzájom vyluèujú\n" + +#: sar.c:1639 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Nie je èítané zo súboru aktivity systému (pou¾i voµbu -f)\n" diff --git a/nls/sv.po b/nls/sv.po new file mode 100644 index 00000000..51dcb688 --- /dev/null +++ b/nls/sv.po @@ -0,0 +1,310 @@ +# Swedish translation of the sysstat package. +# Copyright (C) 1999, 2006, 2008 Free Software Foundation, Inc. +# Daniel Nylander , 2006, 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 8.1.1\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2008-02-09 18:30+0100\n" +"PO-Revision-Date: 2008-02-10 18:30+0100\n" +"Last-Translator: Daniel Nylander \n" +"Language-Team: Swedish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: common.c:58 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat version %s\n" + +#: common.c:197 common.c:449 ioconf.c:471 mpstat.c:324 sa_common.c:810 +#: sadc.c:590 sadc.c:599 sadc.c:660 sadc.c:761 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Kan inte öppna %s: %s\n" + +#: common.c:241 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Kan inte hantera så många processorer!\n" + +#: iostat.c:78 mpstat.c:71 pidstat.c:77 sadc.c:81 sadf.c:81 sar.c:79 +msgid "Usage:" +msgstr "Användning:" + +#: iostat.c:78 mpstat.c:71 pidstat.c:77 sadc.c:81 sadf.c:81 sar.c:79 +msgid "options..." +msgstr "flaggor..." + +#: iostat.c:78 mpstat.c:72 pidstat.c:77 sadc.c:81 sadf.c:81 sar.c:79 sar.c:89 +msgid "interval" +msgstr "intervall" + +#: iostat.c:78 mpstat.c:72 pidstat.c:77 sadc.c:81 sadf.c:82 sar.c:79 +msgid "count" +msgstr "antal" + +#: iostat.c:80 mpstat.c:74 pidstat.c:79 sadc.c:83 sadf.c:84 sar.c:81 +#, c-format +msgid "Options are:\n" +msgstr "Flaggor är:\n" + +#: iostat.c:84 +msgid "device" +msgstr "enhet" + +#: iostat.c:1245 +#, c-format +msgid "Time: %s\n" +msgstr "Tid: %s\n" + +#: iostat.c:1575 +#, c-format +msgid "-x and -p options are mutually exclusive\n" +msgstr "flaggorna -x och -p är ömsesidigt uteslutande\n" + +#: mpstat.c:77 sadf.c:89 sar.c:89 +msgid "cpu" +msgstr "processor" + +# sar.c: +#: mpstat.c:279 pidstat.c:1364 sar.c:962 +msgid "Average:" +msgstr "Genomsnitt:" + +#: mpstat.c:630 sar.c:169 +#, c-format +msgid "Not that many processors!\n" +msgstr "Inte så många processorer!\n" + +#: pidstat.c:83 +msgid "command" +msgstr "kommando" + +#: pidstat.c:177 sar.c:1717 +#, c-format +msgid "Requested activities not available\n" +msgstr "Begärda aktiviteter är inte tillgängliga\n" + +#: sa_common.c:708 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Fel vid inläsning av systemaktivitetsfil: %s\n" + +#: sa_common.c:718 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Oväntat slut på systemaktivitetsfil\n" + +#: sa_common.c:736 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Fil skapad med sar/sadc från sysstat version %d.%d.%d" + +#: sa_common.c:766 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Ogiltig systemaktivitetsfil: %s\n" + +#: sa_common.c:773 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "Aktuell version av sysstat kan inte längre läsa formatet på denna fil (%#x)\n" + +#: sa_common.c:853 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Begärda aktiviteter inte tillgängliga i filen %s\n" + +#: sadc.c:81 +msgid "outfile" +msgstr "utfil" + +#: sadc.c:86 +msgid "comment" +msgstr "kommentar" + +#: sadc.c:111 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Kan inte skriva data till systemaktivitetsfil: %s\n" + +#: sadc.c:445 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Kan inte skriva systemaktivitetsfilhuvud: %s\n" + +#: sadc.c:706 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Kan inte lägga till data till den filen (%s)\n" + +#: sadf.c:82 +msgid "datafile" +msgstr "datafil" + +#: sadf.c:89 sar.c:90 +msgid "hh:mm:ss" +msgstr "hh:mm:ss" + +#: sadf.c:89 +msgid "sar_options..." +msgstr "sar_flaggor..." + +#: sadf.c:1767 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Systemaktivitetsfil: %s (%#x)\n" + +#: sadf.c:1775 +#, c-format +msgid "Host: " +msgstr "Värd: " + +#: sadf.c:1780 +#, c-format +msgid "Activity flag: %#x\n" +msgstr "Aktivitetsflagga: %#x\n" + +#: sadf.c:1781 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Storlek på en lång int: %d\n" + +#: sadf.c:1782 +#, c-format +msgid "Number of CPU: %u\n" +msgstr "Antal processorer: %u\n" + +#: sadf.c:1783 +#, c-format +msgid "Number of interrupts per CPU: %u\n" +msgstr "Antal avbrott per processor: %u\n" + +#: sadf.c:1784 +#, c-format +msgid "Number of disks: %u\n" +msgstr "Antal diskar: %u\n" + +# Osäker +#: sadf.c:1785 +#, c-format +msgid "Number of serial lines: %u\n" +msgstr "Antal serieterminaler: %u\n" + +#: sadf.c:1786 +#, c-format +msgid "Number of network interfaces: %u\n" +msgstr "Antal nätverksgränssnitt: %u\n" + +#: sar.c:89 +msgid "int" +msgstr "int" + +#: sar.c:89 +msgid "filename" +msgstr "filnamn" + +#: sar.c:161 +#, c-format +msgid "Not an SMP machine...\n" +msgstr "Inte en flerprocessorsmaskin...\n" + +#: sar.c:1545 +#, c-format +msgid "Invalid data format\n" +msgstr "Ogiltigt dataformat\n" + +#: sar.c:1549 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Använder fel datainsamlare från en annan version av sysstat\n" + +#: sar.c:1932 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "flaggorna -f och -o är ömsesidigt uteslutande\n" + +#: sar.c:1938 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Läser inte från en systemaktivitetsfil (använd flaggan -f)\n" + +#: sar.c:2036 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Kan inte hitta datainsamlaren (%s)\n" + +#~ msgid "" +#~ "Usage: %s [ options... ] [ [ ] ]\n" +#~ "Options are:\n" +#~ "[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +#~ "[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" +#~ msgstr "" +#~ "Användning: %s [ flaggor... ] [ [ ] ]\n" +#~ "Flaggor:\n" +#~ "[ -c ] [ -d ] [ -N ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +#~ "[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" + +#~ msgid "" +#~ "Usage: %s [ options... ] [ [ ] ]\n" +#~ "Options are:\n" +#~ "[ -P { | ALL } ] [ -V ]\n" +#~ msgstr "" +#~ "Användning: %s [ flaggor... ] [ [ ] ]\n" +#~ "Flaggor:\n" +#~ "[ -P { | ALL } ] [ -V ]\n" + +#~ msgid "" +#~ "Usage: %s [ options... ] [ [ ] ]\n" +#~ "Options are:\n" +#~ "[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +#~ "[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +#~ msgstr "" +#~ "Användning: %s [ flaggor... ] [ [ ] ]\n" +#~ "Flaggor:\n" +#~ "[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +#~ "[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#~ msgid "" +#~ "Usage: %s [ options... ] [ [ ] ] [ ]\n" +#~ "Options are:\n" +#~ "[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" +#~ msgstr "" +#~ "Användning: %s [ flaggor... ] [ [ ] ] [ ]\n" +#~ "Flaggor:\n" +#~ "[ -C ] [ -d ] [ -F ] [ -I ] [ -V ]\n" + +#~ msgid "" +#~ "Usage: %s [ options... ] [ [ ] ] [ ]\n" +#~ "Options are:\n" +#~ "[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +#~ "[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +#~ "[ -- ]\n" +#~ msgstr "" +#~ "Användning: %s [ flaggor... ] [ [ ] ] [ ]\n" +#~ "Flaggor:\n" +#~ "[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]\n" +#~ "[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +#~ "[ -- ]\n" + +#~ msgid "" +#~ "Usage: %s [ options... ] [ [ ] ]\n" +#~ "Options are:\n" +#~ "[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +#~ "[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +#~ "[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +#~ "[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +#~ "[ -o [ ] | -f [ ] ]\n" +#~ "[ -s [ ] ] [ -e [ ] ]\n" +#~ msgstr "" +#~ "Användning: %s [ flaggor... ] [ [ ] ]\n" +#~ "Flaggor:\n" +#~ "[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i ] [ -p ] [ -q ]\n" +#~ "[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +#~ "[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +#~ "[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +#~ "[ -o [ ] | -f [ ] ]\n" +#~ "[ -s [ ] ] [ -e [ ] ]\n" diff --git a/nls/sysstat.pot b/nls/sysstat.pot new file mode 100644 index 00000000..59ec8872 --- /dev/null +++ b/nls/sysstat.pot @@ -0,0 +1,350 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-09-04 08:21+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "" + +#: ioconf.c:490 rd_stats.c:72 rd_stats.c:1831 sa_common.c:1052 sadc.c:593 +#: sadc.c:602 sadc.c:662 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | " +"ALL } ] [ -V ]\n" +msgstr "" + +#: mpstat.c:530 pidstat.c:1806 sar.c:360 +msgid "Average:" +msgstr "" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" + +#: pidstat.c:199 sar.c:978 +#, c-format +msgid "Requested activities not available\n" +msgstr "" + +#: rd_stats.c:1877 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "" + +#: sa_common.c:932 +#, c-format +msgid "" +"Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "" + +#: sadc.c:81 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "" + +#: sadc.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" + +#: sadc.c:206 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "" + +#: sadc.c:480 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "" + +#: sadc.c:756 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "" + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" + +#: sar.c:132 +#, c-format +msgid "" +"\t-m { [,...] | ALL }\n" +"\t\tPower management statistics\n" +"\t\tKeywords are:\n" +"\t\tCPU\tCPU clock frequency\n" +"\t\tFAN\tFans speed\n" +"\t\tIN\tVoltage inputs\n" +"\t\tTEMP\tDevices temperature\n" +msgstr "" + +#: sar.c:139 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" + +#: sar.c:160 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "" + +#: sar.c:161 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "" + +#: sar.c:162 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "" + +#: sar.c:163 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "" + +#: sar.c:164 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" + +#: sar.c:166 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "" + +#: sar.c:167 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "" + +#: sar.c:168 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "" + +#: sar.c:169 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "" + +#: sar.c:212 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "" + +#: sar.c:780 +#, c-format +msgid "Invalid data format\n" +msgstr "" + +#: sar.c:784 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "" + +#: sar.c:804 +#, c-format +msgid "Inconsistent input data\n" +msgstr "" + +#: sar.c:1225 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "" + +#: sar.c:1231 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "" + +#: sar.c:1332 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "" diff --git a/nls/vi.po b/nls/vi.po new file mode 100644 index 00000000..4ba00d5d --- /dev/null +++ b/nls/vi.po @@ -0,0 +1,410 @@ +# Vietnamese translation for Sys Stat. +# Copyright © 2010 Free Software Foundation, Inc. +# This file is distributed under the same license as the sysstat package. +# Clytie Siddall , 2007-2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 9.1.1\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-02-21 11:47+0100\n" +"PO-Revision-Date: 2010-03-06 19:48+0930\n" +"Last-Translator: Clytie Siddall \n" +"Language-Team: Vietnamese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: LocFactoryEditor 1.8\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat phiên bản %s\n" + +#: ioconf.c:490 rd_stats.c:69 rd_stats.c:1842 sa_common.c:1052 sadc.c:589 +#: sadc.c:598 sadc.c:658 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "Không thể mở %s: %s\n" + +#: iostat.c:81 mpstat.c:86 pidstat.c:77 sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "Sá»­ dụng: %s [ tùy_chá»n... ] [ [ <đếm> ] ]\n" + +#: iostat.c:84 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"Tùy chá»n:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [ ... ] | ALL ] [ -p [ [,...] | ALL ] ]\n" +"\n" +"ALL\ttất cả\n" + +#: iostat.c:340 +#, c-format +msgid "Cannot find disk data\n" +msgstr "Không tìm thấy dữ liệu vá» Ä‘Ä©a\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"Tùy chá»n:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +"\n" +"SUM\ttổng\n" +"CPU, cpu\tÄ‘Æ¡n vị xá»­ lý trung tâm\n" +"ALL\ttất cả\n" + +#: mpstat.c:504 pidstat.c:1683 sar.c:354 +msgid "Average:" +msgstr "Trung bình:" + +#: mpstat.c:847 +#, c-format +msgid "Not that many processors!\n" +msgstr "Quá nhiá»u bá»™ xá»­ lý !\n" + +#: pidstat.c:80 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"Tùy chá»n:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +"\n" +"SELF\t\tmình\n" +"ALL\t\ttất cả\n" +"TASK\tcông việc\n" +"CHILD\tcon\n" + +#: pidstat.c:197 sar.c:972 +#, c-format +msgid "Requested activities not available\n" +msgstr "Hoạt Ä‘á»™ng yêu cầu vẫn không sẵn sàng\n" + +#: rd_stats.c:1888 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "Quá nhiá»u bá»™ xá»­ lý để xá»­ lý !\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "Gặp lá»—i khi Ä‘á»c tập tin hoạt Ä‘á»™ng hệ thống: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "Gặp kết thúc bất thÆ°á»ng trong tập tin hoạt Ä‘á»™ng hệ thống\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "Tập tin được tạo dùng sar/sadc từ sysstat phiên bản %d.%d.%d" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "Tập tin hoạt Ä‘á»™ng hệ thống không hợp lệ: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "Phiên bản sysstat hiện thá»i không còn có khả năng Ä‘á»c lại định dạng của tập tin này (%#x)\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "Hoạt Ä‘á»™ng đã yêu cầu vẫn không sẵn sàng trong tập tin %s\n" + +#: sadc.c:76 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Sá»­ dụng: %s [ tùy_chá»n... ] [ [ <đếm> ] ] [ ]\n" + +#: sadc.c:79 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"Tuỳ chá»n:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +"\n" +"DISK\tÄ‘Ä©a\n" +"POWER\tÄ‘iện năng\n" +"ALL\t\ttất cả\n" + +#: sadc.c:199 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "Không thể ghi dữ liệu vào tập tin hoạt Ä‘á»™ng hệ thống: %s\n" + +#: sadc.c:476 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "Không thể ghi phần đầu tập tin hoạt Ä‘á»™ng hệ thống: %s\n" + +#: sadc.c:752 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "Không thể phụ thêm dữ liệu vào tập tin đó (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "Sá»­ dụng: %s [ tùy_chá»n... ] [ [ <đếm> ] ] [ ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"Tùy chá»n:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +"\n" +"ALL\ttất cả\n" +"gi:ph:gy\t\tgiá»:phút:giây (hai chữ số)\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "Tập tin dữ liệu hoạt Ä‘á»™ng hệ thống: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "Máy:" + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "Kích cỡ của má»™t số nguyên dài: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "Danh sách các hoạt Ä‘á»™ng:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"Tùy chá»n:\n" +" -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +"n\n" +"ALL\ttất cả\n" +"int\tsố nguyên (viết tắt)\n" +"SUM\ttổng\n" +"XALL\tkhông phải tất cả\n" +"cpu\tÄ‘Æ¡n vị xá»­ lý trung tâm\n" +"DEV\tthiết bị (viết tắt)\n" +"SOCK\tổ cắm (viết tắt)\n" +"hh:mm:ss\tgiá»:phút:giây (má»—i phần có hai chữ số)\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "Tùy chá»n và thông báo chính:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tI/O và thống kê tá»· lệ truyá»n\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\tthống kê dàn trang\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tthống kê thiết bị khối\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\thống kê gián Ä‘oạn\n" +"\n" +"int\tsố nguyên\n" +"SUM\ttổng\n" +"ALL\ttất cả\n" +"XALL\tkhông phải tất cả\n" + +#: sar.c:132 +#, c-format +msgid "\t-m\tPower management statistics\n" +msgstr "\t-m\tthống kê quản lý Ä‘iện năng\n" + +#: sar.c:133 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { [,...] | ALL }\n" +"\n" +"[ALL\ttất cả]\n" +"\n" +"\t\tThống kê chạy mạng\n" +"\n" +"\t\tTừ khoá:\n" +"\t\tDEV\tCác giao diện mạng\n" +"\t\tEDEV\tCác giao diện mạng (lá»—i)\n" +"\t\tNFS\tỨng dụng khách NFS\n" +"\t\tNFSD\tTrình phục vụ NFS\n" +"\t\tSOCK\tCác ổ cắm\t(v4)\n" +"\t\tIP\tTrá»ng tải IP\t(v4)\n" +"\t\tEIP\tTrá»ng tải IP\t(v4) (lá»—i)\n" +"\t\tICMP\tTrá»ng tải ICMP\t(v4)\n" +"\t\tEICMP\tTrá»ng tải ICMP\t(v4) (lá»—i)\n" +"\t\tTCP\tTrá»ng tải TCP\t(v4)\n" +"\t\tETCP\tTrá»ng tải TCP\t(v4) (lá»—i)\n" +"\t\tUDP\tTrá»ng tải UDP\t(v4)\n" +"\t\tSOCK6\tCác ổ cắm\t(v6)\n" +"\t\tIP6\tTrá»ng tải IP\t(v6)\n" +"\t\tEIP6\tTrá»ng tải IP\t(v6) (lá»—i)\n" +"\t\tICMP6\tTrá»ng tải ICMP\t(v6)\n" +"\t\tEICMP6\tTrá»ng tải ICMP\t(v6) (lá»—i)\n" +"\t\tUDP6\tTrá»ng tải UDP\t(v6)\n" + +#: sar.c:154 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\tthống kê vá» chiá»u dài hàng đợi và tải trá»ng trung bình\n" + +#: sar.c:155 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\tthống kê sá»­ dụng bá»™ nhá»›\n" + +#: sar.c:156 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\tthống kê bá»™ nhá»›\n" + +#: sar.c:157 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\tthống kê vùng trao đổi\n" + +#: sar.c:158 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tthống kê sá»­ dụng CPU\n" +"\n" +"ALL\ttất cả\n" + +#: sar.c:160 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tthống kê bảng hạt nhân\n" + +#: sar.c:161 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\tthống kê vá» tạo công việc và chuyển đổi hệ thống\n" + +#: sar.c:162 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\tthống kê trao đổi\n" + +#: sar.c:163 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tthống kê thiết bị TTY\n" + +#: sar.c:206 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "Kết thúc bất thÆ°á»ng khi thu thập dữ liệu\n" + +#: sar.c:774 +#, c-format +msgid "Invalid data format\n" +msgstr "Äịnh dạng dữ liệu không hợp lệ\n" + +#: sar.c:778 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "Dùng má»™t bá»™ thu thập không đúng từ má»™t phiên bản sysstat khác\n" + +#: sar.c:798 +#, c-format +msgid "Inconsistent input data\n" +msgstr "Dữ liệu nhập vào không phải thống nhất\n" + +#: sar.c:1207 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "Hai tùy chá»n « -f » và « -o » loại từ lẫn nhau\n" + +#: sar.c:1213 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "Không phải Ä‘á»c từ tập tin hoạt Ä‘á»™ng hệ thống (dùng tùy chá»n « -f »)\n" + +#: sar.c:1314 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "Không tìm thấy bá»™ thu thập dữ liệu (%s)\n" diff --git a/nls/zh_CN.po b/nls/zh_CN.po new file mode 100644 index 00000000..6722c348 --- /dev/null +++ b/nls/zh_CN.po @@ -0,0 +1,472 @@ +# Chinese translations for sysstat package +# sysstat 软件包的简体中文翻译. +# Copyright (C) 2010 THE sysstat'S COPYRIGHT HOLDER +# This file is distributed under the same license as the sysstat package. +# Ji ZhengYu , 2008, 2009, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 9.1.3\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2010-06-26 09:01+0200\n" +"PO-Revision-Date: 2010-07-06 15:22+0800\n" +"Last-Translator: Ji ZhengYu \n" +"Language-Team: Chinese (simplified) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: cifsiostat.c:69 iostat.c:79 mpstat.c:86 nfsiostat.c:68 pidstat.c:78 +#: sar.c:88 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "用法: %s [ 选项 ] [ <时间间隔> [ <次数> ] ]\n" + +#: cifsiostat.c:72 nfsiostat.c:71 +#, c-format +msgid "" +"Options are:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" +msgstr "" +"选项:\n" +"[ -h ] [ -k | -m ] [ -t ] [ -V ]\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat 版本 %s\n" + +#: ioconf.c:490 rd_stats.c:69 rd_stats.c:1842 sa_common.c:1052 sadc.c:586 +#: sadc.c:595 sadc.c:655 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "无法打开 %s: %s\n" + +#: iostat.c:82 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ] [ --debuginfo ]\n" +msgstr "" +"选项:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ <设备> [...] | ALL ] [ -p [ <设备> [,...] | ALL ] ] [ --debuginfo ]\n" + +#: iostat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ [...] | ALL ] [ -p [ [,...] | ALL ] ]\n" +msgstr "" +"选项:\n" +"[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n" +"[ <设备> [...] | ALL ] [ -p [ <设备> [,...] | ALL ] ]\n" + +#: iostat.c:312 +#, c-format +msgid "Cannot find disk data\n" +msgstr "无法找到ç£ç›˜æ•°æ®\n" + +#: mpstat.c:89 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" +msgstr "" +"选项:\n" +"[ -A ] [ -I { SUM | CPU | SCPU | ALL } ] [ -u ] [ -P { [,...] | ALL } ] [ -V ]\n" + +#: mpstat.c:530 pidstat.c:1806 sar.c:354 +msgid "Average:" +msgstr "å¹³å‡æ—¶é—´:" + +#: mpstat.c:873 +#, c-format +msgid "Not that many processors!\n" +msgstr "处ç†å™¨å®žåœ¨å¤ªå¤šï¼\n" + +#: pidstat.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"选项:\n" +"[ -C <命令> ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" +"[ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { <进程å·> [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:199 sar.c:972 +#, c-format +msgid "Requested activities not available\n" +msgstr "所需的è¿è¡Œè®°å½•æ— æ³•èŽ·å¾—\n" + +#: rd_stats.c:1888 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "处ç†å™¨å¤ªå¤šï¼Œæ— æ³•å¤„ç†ï¼\n" + +#: sa_common.c:866 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "查看系统è¿è¡Œè®°å½•æ—¶å‡ºé”™: %s\n" + +#: sa_common.c:876 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "系统è¿è¡Œè®°å½•æ–‡ä»¶çš„结尾有未知错误\n" + +#: sa_common.c:894 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "文件由 sysstat %d.%d.%d 中的 sar/sadc 创建。" + +#: sa_common.c:925 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "无效的系统è¿è¡Œè®°å½•æ–‡ä»¶: %s\n" + +#: sa_common.c:932 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "当å‰ç‰ˆæœ¬çš„ sysstat 已无法读å–æ­¤æ–‡ä»¶æ ¼å¼ (%#x)\n" + +#: sa_common.c:1135 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "所需的è¿è¡Œè®°å½•åœ¨æ­¤æ–‡ä»¶ %s 中无法获得\n" + +#: sadc.c:76 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "用法: %s [ 选项 ] [ <时间间隔> [ <次数> ] ] [ <输出文件> ]\n" + +#: sadc.c:79 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" +msgstr "" +"选项:\n" +"[ -C <注释> ] [ -F ] [ -L ] [ -V ]\n" +"[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n" + +#: sadc.c:199 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "无法将数æ®å†™å…¥ç³»ç»Ÿè¿è¡Œè®°å½•æ–‡ä»¶: %s\n" + +#: sadc.c:473 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "无法写系统è¿è¡Œè®°å½•æ–‡ä»¶å¼€å§‹éƒ¨åˆ†: %s\n" + +#: sadc.c:749 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "无法å‘文件 (%s) 中追加记录\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "用法: %s [ 选项 ] [ <时间间隔> [ <次数> ] ] [ <æ•°æ®æ–‡ä»¶> ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"选项:\n" +"[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { [,...] | ALL } ] [ -s [ <æ—¶:分:秒> ] ] [ -e [ <æ—¶:分:秒> ] ]\n" +"[ -- ]\n" + +#: sadf.c:609 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "系统è¿è¡Œè®°å½•æ•°æ®æ–‡ä»¶: %s (%#x)\n" + +#: sadf.c:618 +#, c-format +msgid "Host: " +msgstr "主机:" + +#: sadf.c:624 +#, c-format +msgid "Size of a long int: %d\n" +msgstr "长整型数的字节大å°: %d\n" + +#: sadf.c:626 +#, c-format +msgid "List of activities:\n" +msgstr "è¿è¡Œè®°å½•åˆ—表:\n" + +#: sar.c:104 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { [,...] | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"选项:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ]\n" +"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { <中断> [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" +"[ -n { <关键è¯> [,...] | ALL } ]\n" +"[ -o [ <文件å> ] | -f [ <文件å> ] ]\n" +"[ -i <时间间隔> ] [ -s [ <æ—¶:分:秒> ] ] [ -e [ <æ—¶:分:秒> ] ]\n" + +#: sar.c:126 +#, c-format +msgid "Main options and reports:\n" +msgstr "主选项和报告:\n" + +#: sar.c:127 +#, c-format +msgid "\t-b\tI/O and transfer rate statistics\n" +msgstr "\t-b\tI/O 和传输速率信æ¯çŠ¶å†µ\n" + +#: sar.c:128 +#, c-format +msgid "\t-B\tPaging statistics\n" +msgstr "\t-B\t分页状况\n" + +#: sar.c:129 +#, c-format +msgid "\t-d\tBlock device statistics\n" +msgstr "\t-d\tå—设备状况\n" + +#: sar.c:130 +#, c-format +msgid "" +"\t-I { | SUM | ALL | XALL }\n" +"\t\tInterrupts statistics\n" +msgstr "" +"\t-I { <中断> | SUM | ALL | XALL }\n" +"\t\t中断信æ¯çŠ¶å†µ\n" + +#: sar.c:132 +#, c-format +msgid "\t-m\tPower management statistics\n" +msgstr "\t-m\t电æºç®¡ç†ä¿¡æ¯çŠ¶å†µ\n" + +#: sar.c:133 +#, c-format +msgid "" +"\t-n { [,...] | ALL }\n" +"\t\tNetwork statistics\n" +"\t\tKeywords are:\n" +"\t\tDEV\tNetwork interfaces\n" +"\t\tEDEV\tNetwork interfaces (errors)\n" +"\t\tNFS\tNFS client\n" +"\t\tNFSD\tNFS server\n" +"\t\tSOCK\tSockets\t(v4)\n" +"\t\tIP\tIP traffic\t(v4)\n" +"\t\tEIP\tIP traffic\t(v4) (errors)\n" +"\t\tICMP\tICMP traffic\t(v4)\n" +"\t\tEICMP\tICMP traffic\t(v4) (errors)\n" +"\t\tTCP\tTCP traffic\t(v4)\n" +"\t\tETCP\tTCP traffic\t(v4) (errors)\n" +"\t\tUDP\tUDP traffic\t(v4)\n" +"\t\tSOCK6\tSockets\t(v6)\n" +"\t\tIP6\tIP traffic\t(v6)\n" +"\t\tEIP6\tIP traffic\t(v6) (errors)\n" +"\t\tICMP6\tICMP traffic\t(v6)\n" +"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" +"\t\tUDP6\tUDP traffic\t(v6)\n" +msgstr "" +"\t-n { <关键è¯> [,...] | ALL }\n" +"\t\t网络统计信æ¯\n" +"\t\t关键è¯å¯ä»¥æ˜¯ï¼š\n" +"\t\tDEV\t网å¡\n" +"\t\tEDEV\tç½‘å¡ (错误)\n" +"\t\tNFS\tNFS 客户端\n" +"\t\tNFSD\tNFS æœåŠ¡å™¨\n" +"\t\tSOCK\tSockets (套接字)\t(v4)\n" +"\t\tIP\tIP æµ\t(v4)\n" +"\t\tEIP\tIP æµ\t(v4) (错误)\n" +"\t\tICMP\tICMP æµ\t(v4)\n" +"\t\tEICMP\tICMP æµ\t(v4) (错误)\n" +"\t\tTCP\tTCP æµ\t(v4)\n" +"\t\tETCP\tTCP æµ\t(v4) (错误)\n" +"\t\tUDP\tUDP æµ\t(v4)\n" +"\t\tSOCK6\tSockets (套接字)\t(v6)\n" +"\t\tIP6\tIP æµ\t(v6)\n" +"\t\tEIP6\tIP æµ\t(v6) (错误)\n" +"\t\tICMP6\tICMP æµ\t(v6)\n" +"\t\tEICMP6\tICMP æµ\t(v6) (错误)\n" +"\t\tUDP6\tUDP æµ\t(v6)\n" + +#: sar.c:154 +#, c-format +msgid "\t-q\tQueue length and load average statistics\n" +msgstr "\t-q\t队列长度和平å‡è´Ÿè½½\n" + +#: sar.c:155 +#, c-format +msgid "\t-r\tMemory utilization statistics\n" +msgstr "\t-r\t内存利用率\n" + +#: sar.c:156 +#, c-format +msgid "\t-R\tMemory statistics\n" +msgstr "\t-R\t内存状况\n" + +#: sar.c:157 +#, c-format +msgid "\t-S\tSwap space utilization statistics\n" +msgstr "\t-S\t交æ¢ç©ºé—´åˆ©ç”¨çŽ‡\n" + +#: sar.c:158 +#, c-format +msgid "" +"\t-u [ ALL ]\n" +"\t\tCPU utilization statistics\n" +msgstr "" +"\t-u [ ALL ]\n" +"\t\tCPU 利用率\n" + +#: sar.c:160 +#, c-format +msgid "\t-v\tKernel table statistics\n" +msgstr "\t-v\tKernel table 状况\n" + +#: sar.c:161 +#, c-format +msgid "\t-w\tTask creation and system switching statistics\n" +msgstr "\t-w\t任务创建与系统转æ¢ç»Ÿè®¡ä¿¡æ¯\n" + +#: sar.c:162 +#, c-format +msgid "\t-W\tSwapping statistics\n" +msgstr "\t-W\t交æ¢ä¿¡æ¯\n" + +#: sar.c:163 +#, c-format +msgid "\t-y\tTTY device statistics\n" +msgstr "\t-y\tTTY 设备状况\n" + +#: sar.c:206 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "æ•°æ®æµç»“尾有未知错误\n" + +#: sar.c:774 +#, c-format +msgid "Invalid data format\n" +msgstr "无效的数æ®æ ¼å¼\n" + +#: sar.c:778 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "正在使用æ¥è‡ªä¸åŒç‰ˆæœ¬ sysstat 的错误的数æ®æ”¶é›†å™¨\n" + +#: sar.c:798 +#, c-format +msgid "Inconsistent input data\n" +msgstr "所å–æ•°æ®å‰åŽä¸ä¸€è‡´\n" + +#: sar.c:1207 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "-f å’Œ -o 选项ä¸èƒ½åŒæ—¶ä½¿ç”¨\n" + +#: sar.c:1213 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "无法查看系统活动记录文件 (用 -f 选项)\n" + +#: sar.c:1314 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "无法找到数æ®æ”¶é›†å™¨ (%s)\n" + +#~ msgid "-x and -p options are mutually exclusive\n" +#~ msgstr "-x å’Œ -p 选项ä¸èƒ½åŒæ—¶ä½¿ç”¨\n" + +#~ msgid "" +#~ "\t-n { DEV | EDEV | NFS | NFSD | SOCK |\n" +#~ "\t IP | EIP | ICMP | EICMP | TCP | ETCP | UDP | ALL }\n" +#~ "\t\tNetwork statistics\n" +#~ msgstr "" +#~ "\t-n { DEV | EDEV | NFS | NFSD | SOCK |\n" +#~ "\t IP | EIP | ICMP | EICMP | TCP | ETCP | UDP | ALL }\n" +#~ "\t\t网络信æ¯çŠ¶å†µ\n" + +#~ msgid "Time: %s\n" +#~ msgstr "时间: %s\n" + +#~ msgid "Usage:" +#~ msgstr "用法:" + +#~ msgid "options..." +#~ msgstr "选项..." + +#~ msgid "interval" +#~ msgstr "é—´éš”" + +#~ msgid "count" +#~ msgstr "次数" + +#~ msgid "device" +#~ msgstr "设备å" + +#~ msgid "cpu" +#~ msgstr "cpu" + +#~ msgid "command" +#~ msgstr "命令" + +#~ msgid "outfile" +#~ msgstr "输出文件" + +#~ msgid "comment" +#~ msgstr "注释" + +#~ msgid "datafile" +#~ msgstr "æ•°æ®æ–‡ä»¶" + +#~ msgid "hh:mm:ss" +#~ msgstr "æ—¶:分:秒" + +#~ msgid "sar_options..." +#~ msgstr "sar 选项..." + +#~ msgid "Activity flag: %#x\n" +#~ msgstr "è¿è¡Œæ ‡è®°: %#x\n" + +#~ msgid "Number of CPU: %u\n" +#~ msgstr "CPU æ•°é‡: %u\n" + +#~ msgid "Number of interrupts per CPU: %u\n" +#~ msgstr "æ¯ä¸ª CPU 的中断数目: %u\n" + +#~ msgid "Number of disks: %u\n" +#~ msgstr "ç£ç›˜æ•°é‡: %u\n" + +#~ msgid "Number of serial lines: %u\n" +#~ msgstr "串行数é‡: %u\n" + +#~ msgid "Number of network interfaces: %u\n" +#~ msgstr "网å¡æ•°é‡: %u\n" + +#~ msgid "int" +#~ msgstr "æ•´åž‹æ•°" + +#~ msgid "filename" +#~ msgstr "文件å" + +#~ msgid "Not an SMP machine...\n" +#~ msgstr "éžå¯¹ç§°å¤šå¤„ç†æœºå™¨...\n" diff --git a/nls/zh_TW.po b/nls/zh_TW.po new file mode 100644 index 00000000..d9aca074 --- /dev/null +++ b/nls/zh_TW.po @@ -0,0 +1,245 @@ +# Chinese (traditional) translations for sysstat. +# Copyright (C) 2008 THE sysstat'S COPYRIGHT HOLDER +# This file is distributed under the same license as the sysstat package. +# Zi-You Dai , 2008. +# +# +msgid "" +msgstr "" +"Project-Id-Version: sysstat 8.1.5\n" +"Report-Msgid-Bugs-To: sysstat orange.fr\n" +"POT-Creation-Date: 2008-07-12 18:20+0200\n" +"PO-Revision-Date: 2008-08-18 18:49+0800\n" +"Last-Translator: Zi-You Dai \n" +"Language-Team: Chinese (traditional) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: common.c:57 +#, c-format +msgid "sysstat version %s\n" +msgstr "sysstat 版本 %s\n" + +#: ioconf.c:479 iostat.c:462 rd_stats.c:69 rd_stats.c:1469 rd_stats.c:1576 +#: sa_common.c:984 sadc.c:478 sadc.c:487 sadc.c:547 +#, c-format +msgid "Cannot open %s: %s\n" +msgstr "無法打開 %s: %s\n" + +#: iostat.c:80 mpstat.c:83 pidstat.c:77 sar.c:89 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ]\n" +msgstr "用法: %s [ é¸é … ] [ <時間間隔> [ <計算> ] ]\n" + +#: iostat.c:83 +#, c-format +msgid "" +"Options are:\n" +"[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[ [ ... ] | ALL ] [ -p [ | ALL ] ]\n" +msgstr "" +"é¸é …是:\n" +"[-c ]·[ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n" +"[·<è£ç½®> ·[...]·|· ALL ]·[ -p [ <è£ç½®> | ALL ] ]\n" + +#: iostat.c:1268 +#, c-format +msgid "Time: %s\n" +msgstr "時間: %s\n" + +#: iostat.c:1645 +#, c-format +msgid "-x and -p options are mutually exclusive\n" +msgstr "-x å’Œ -p é¸é …互相排斥\n" + +#: mpstat.c:86 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -I { SUM | CPU | ALL } ] [ -u ] [ -P { | ALL } ] [ -V ]\n" +msgstr "" +"é¸é …是:\n" +"[ -A ] [ -I { SUM | CPU | ALL } ] [ -u ] [ -P { | ALL } ] [ -V ]\n" + +#: mpstat.c:403 pidstat.c:1362 sar.c:287 +msgid "Average:" +msgstr "å¹³å‡æ™‚間:" + +#: mpstat.c:708 +#, c-format +msgid "Not that many processors!\n" +msgstr "沒有那麼多處ç†å™¨ï¼\n" + +#: pidstat.c:80 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" +msgstr "" +"é¸é …是:\n" +"[ -C <命令> ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n" +"[ -p { | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n" + +#: pidstat.c:181 sar.c:892 +#, c-format +msgid "Requested activities not available\n" +msgstr "所需的é‹è¡Œè¨˜éŒ„無法å–å¾—\n" + +#: rd_stats.c:1622 +#, c-format +msgid "Cannot handle so many processors!\n" +msgstr "處ç†å™¨å¤ªå¤šç„¡æ³•è™•ç†ï¼\n" + +#: sa_common.c:800 +#, c-format +msgid "Error while reading system activity file: %s\n" +msgstr "讀å–系統é‹è¡Œè¨˜éŒ„時出錯: %s\n" + +#: sa_common.c:810 +#, c-format +msgid "End of system activity file unexpected\n" +msgstr "系統é‹è¡Œè¨˜éŒ„文件的çµå°¾æœ‰æœªçŸ¥éŒ¯èª¤\n" + +#: sa_common.c:828 +#, c-format +msgid "File created using sar/sadc from sysstat version %d.%d.%d" +msgstr "從 sysstat 版本 %d,%d,%d 使用 sar/sadc 建立檔案" + +#: sa_common.c:858 +#, c-format +msgid "Invalid system activity file: %s\n" +msgstr "無效的系統é‹è¡Œè¨˜éŒ„檔案: %s\n" + +#: sa_common.c:865 +#, c-format +msgid "Current sysstat version can no longer read the format of this file (%#x)\n" +msgstr "ç›®å‰çš„ sysstat 版本已無法讀å–æ­¤æª”æ¡ˆæ ¼å¼ (%#x)\n" + +#: sa_common.c:1058 +#, c-format +msgid "Requested activities not available in file %s\n" +msgstr "所需的é‹è¡Œè¨˜éŒ„在此檔案 %s 中無法ç²å¾—\n" + +#: sadc.c:78 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "用法: %s [ é¸é … ] [ <時間間隔> [ <計算> ] ] [ <輸出檔> ]\n" + +#: sadc.c:81 +#, c-format +msgid "" +"Options are:\n" +"[ -C ] [ -S { INT | DISK | ALL } ] [ -F ] [ -L ] [ -V ]\n" +msgstr "" +"é¸é …是:\n" +"[ -C <命令> ] [ -S { INT | DISK | ALL } ] [ -F ] [ -L ] [ -V ]\n" + +#: sadc.c:107 +#, c-format +msgid "Cannot write data to system activity file: %s\n" +msgstr "無法將數據寫入系統é‹è¡Œè¨˜éŒ„檔案: %s\n" + +#: sadc.c:364 +#, c-format +msgid "Cannot write system activity file header: %s\n" +msgstr "無法寫入系統é‹è¡Œè¨˜éŒ„檔案的檔頭: %s\n" + +#: sadc.c:641 +#, c-format +msgid "Cannot append data to that file (%s)\n" +msgstr "ä¸èƒ½å¢žåŠ æ•¸æ“šåˆ°è©²æª”案 (%s)\n" + +#: sadf.c:85 +#, c-format +msgid "Usage: %s [ options ] [ [ ] ] [ ]\n" +msgstr "用法: %s [ é¸é … ] [ <時間間隔> [ <計算> ] ] [ <數據檔> ]\n" + +#: sadf.c:88 +#, c-format +msgid "" +"Options are:\n" +"[ -d | -D | -H | -p | -x ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" +"[ -- ]\n" +msgstr "" +"é¸é …是:\n" +"[ -d | -D | -H | -p | -x ] [ -h ] [ -t ] [ -V ]\n" +"[ -P { | ALL } ] [ -s [ ] ] [ -e [ ·] ]\n" +"[·--··]\n" + +#: sadf.c:526 +#, c-format +msgid "System activity data file: %s (%#x)\n" +msgstr "系統é‹è¡Œè¨˜éŒ„數據檔: %s (%#x)\n" + +#: sadf.c:535 +#, c-format +msgid "Host: " +msgstr "主機:" + +#: sadf.c:540 +#, fuzzy, c-format +msgid "Size of a long int: %d\n" +msgstr "整數大å°éŽé•·ï¼š %d\n" + +#: sadf.c:542 +#, c-format +msgid "List of activities:\n" +msgstr "é‹è¡Œè¨˜éŒ„清單:\n" + +#: sar.c:92 +#, c-format +msgid "" +"Options are:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -p ] [ -q ] [ -r ] [ -R ]\n" +"[ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ ] | -f [ ] ]\n" +"[ -i ] [ -s [ ] ] [ -e [ ] ]\n" +msgstr "" +"é¸é …是:\n" +"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -p ] [ -q ] [ -r ] [ -R ]\n" +"[ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" +"[ -I { | SUM | ALL | XALL } ] [ -P { | ALL } ]\n" +"[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]\n" +"[ -o [ <檔å> ] | -f [ <檔å> ] ]\n" +"[ -i <時間間隔> ] [ -s [ ] ] [ -e [ ] ]\n" + +#: sar.c:143 +#, c-format +msgid "End of data collecting unexpected\n" +msgstr "數據çµå°¾æœ‰æœªçŸ¥éŒ¯èª¤\n" + +#: sar.c:703 +#, c-format +msgid "Invalid data format\n" +msgstr "無效的數據格å¼\n" + +#: sar.c:707 +#, c-format +msgid "Using a wrong data collector from a different sysstat version\n" +msgstr "從一個ä¸åŒçš„ sysstat 版本,使用了錯誤的數據收集器\n" + +#: sar.c:727 +#, c-format +msgid "Inconsistent input data\n" +msgstr "ä¸ä¸€è‡´çš„數據輸入\n" + +#: sar.c:1121 +#, c-format +msgid "-f and -o options are mutually exclusive\n" +msgstr "-f å’Œ -oé¸é …是互相排斥的\n" + +#: sar.c:1127 +#, c-format +msgid "Not reading from a system activity file (use -f option)\n" +msgstr "無法查看系統活動記錄檔 (使用 -f é¸é …)\n" + +#: sar.c:1224 +#, c-format +msgid "Cannot find the data collector (%s)\n" +msgstr "無法找到數據收集器 (%s)\n" diff --git a/pidstat.c b/pidstat.c new file mode 100644 index 00000000..aa0f9842 --- /dev/null +++ b/pidstat.c @@ -0,0 +1,2178 @@ +/* + * pidstat: Report statistics for Linux tasks + * (C) 2007-2010 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "version.h" +#include "pidstat.h" +#include "common.h" +#include "rd_stats.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__ +char *sccsid(void) { return (SCCSID); } + +unsigned long long uptime[3] = {0, 0, 0}; +unsigned long long uptime0[3] = {0, 0, 0}; +struct pid_stats *st_pid_list[3] = {NULL, NULL, NULL}; +unsigned int *pid_array = NULL; +struct pid_stats st_pid_null; +struct tm ps_tstamp[3]; +char commstr[MAX_COMM_LEN]; + +unsigned int pid_nr = 0; /* Nb of PID to display */ +unsigned int pid_array_nr = 0; +int cpu_nr = 0; /* Nb of processors on the machine */ +unsigned long tlmkb; /* Total memory in kB */ +long interval = -1; +long count = 0; +unsigned int pidflag = 0; /* General flags */ +unsigned int tskflag = 0; /* TASK/CHILD stats */ +unsigned int actflag = 0; /* Activity flag */ + + +/* + *************************************************************************** + * Print usage and exit. + * + * IN: + * @progname Name of sysstat command + *************************************************************************** + */ +void usage(char *progname) +{ + fprintf(stderr, _("Usage: %s [ options ] [ [ ] ]\n"), + progname); + + fprintf(stderr, _("Options are:\n" + "[ -C ] [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ]\n" + "[ -t ] [ -u ] [ -V ] [ -w ]\n" + "[ -p { [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n")); + exit(1); +} + +/* + *************************************************************************** + * SIGALRM signal handler. + * + * IN: + * @sig Signal number. Set to 0 for the first time, then to SIGALRM. + *************************************************************************** + */ +void alarm_handler(int sig) +{ + signal(SIGALRM, alarm_handler); + alarm(interval); +} + +/* + *************************************************************************** + * Initialize uptime variables. + *************************************************************************** + */ +void init_stats(void) +{ + memset(&st_pid_null, 0, PID_STATS_SIZE); +} + +/* + *************************************************************************** + * Allocate structures for PIDs entered on command line. + * + * IN: + * @len Number of PIDs entered on the command line. + *************************************************************************** + */ +void salloc_pid_array(unsigned int len) +{ + if ((pid_array = (unsigned int *) malloc(sizeof(int) * len)) == NULL) { + perror("malloc"); + exit(4); + } + memset(pid_array, 0, sizeof(int) * len); +} + +/* + *************************************************************************** + * Allocate structures for PIDs to read. + * + * IN: + * @len Number of PIDs (and TIDs) on the system. + *************************************************************************** + */ +void salloc_pid(unsigned int len) +{ + int i; + + for (i = 0; i < 3; i++) { + if ((st_pid_list[i] = (struct pid_stats *) malloc(PID_STATS_SIZE * len)) == NULL) { + perror("malloc"); + exit(4); + } + memset(st_pid_list[i], 0, PID_STATS_SIZE * len); + } +} + +/* + *************************************************************************** + * Free PID list structures. + *************************************************************************** + */ +void sfree_pid(void) +{ + int i; + + for (i = 0; i < 3; i++) { + if (st_pid_list[i]) { + free(st_pid_list[i]); + } + } +} + +/* + *************************************************************************** + * Check flags and set default values. + *************************************************************************** + */ +void check_flags(void) +{ + unsigned int act = 0; + + /* Display CPU usage for active tasks by default */ + if (!actflag) { + actflag |= P_A_CPU; + } + + if (!DISPLAY_PID(pidflag)) { + pidflag |= P_D_ACTIVE_PID + P_D_PID + P_D_ALL_PID; + } + + if (!tskflag) { + tskflag |= P_TASK; + } + + /* Check that requested activities are available */ + if (DISPLAY_TASK_STATS(tskflag)) { + act |= P_A_CPU + P_A_MEM + P_A_IO + P_A_CTXSW + P_A_STACK; + } + if (DISPLAY_CHILD_STATS(tskflag)) { + act |= P_A_CPU + P_A_MEM; + } + + actflag &= act; + + if (!actflag) { + fprintf(stderr, _("Requested activities not available\n")); + exit(1); + } +} + +/* + *************************************************************************** + * Look for the PID in the list of PIDs entered on the command line, and + * store it if necessary. + * + * IN: + * @pid_array_nr Length of the PID list. + * @pid PID to search. + * + * OUT: + * @pid_array_nr New length of the PID list. + * + * RETURNS: + * Returns the position of the PID in the list. + *************************************************************************** + */ +int update_pid_array(unsigned int *pid_array_nr, unsigned int pid) +{ + unsigned int i; + + for (i = 0; i < *pid_array_nr; i++) { + if (pid_array[i] == pid) + break; + } + + if (i == *pid_array_nr) { + /* PID not found: Store it */ + (*pid_array_nr)++; + pid_array[i] = pid; + } + + return i; +} + +/* + *************************************************************************** + * Display process command name or command line. + * + * IN: + * @pst Pointer on structure with process stats and command line. + *************************************************************************** + */ +void print_comm(struct pid_stats *pst) +{ + char *p; + + if (DISPLAY_CMDLINE(pidflag) && strlen(pst->cmdline)) { + p = pst->cmdline; + } + else { + p = pst->comm; + } + + printf(" %s%s\n", pst->tgid ? "|__" : "", p); +} + +/* + *************************************************************************** + * Read /proc/meminfo. + *************************************************************************** + */ +void read_proc_meminfo(void) +{ + struct stats_memory st_mem; + + memset(&st_mem, 0, STATS_MEMORY_SIZE); + read_meminfo(&st_mem); + tlmkb = st_mem.tlmkb; +} + +/* + *************************************************************************** + * Read stats from /proc/#[/task/##]/stat. + * + * IN: + * @pid Process whose stats are to be read. + * @pst Pointer on structure where stats will be saved. + * @tgid If !=0, thread whose stats are to be read. + * + * OUT: + * @pst Pointer on structure where stats have been saved. + * @thread_nr Number of threads of the process. + * + * RETURNS: + * 0 if stats have been successfully read, and 1 otherwise. + *************************************************************************** + */ +int read_proc_pid_stat(unsigned int pid, struct pid_stats *pst, + unsigned int *thread_nr, unsigned int tgid) +{ + FILE *fp; + char filename[128], format[256], comm[MAX_COMM_LEN + 1]; + size_t len; + + if (tgid) { + sprintf(filename, TASK_STAT, tgid, pid); + } + else { + sprintf(filename, PID_STAT, pid); + } + + if ((fp = fopen(filename, "r")) == NULL) + /* No such process */ + return 1; + + sprintf(format, "%%*d (%%%ds %%*s %%*d %%*d %%*d %%*d %%*d %%*u %%lu %%lu" + " %%lu %%lu %%lu %%lu %%lu %%lu %%*d %%*d %%u %%*u %%*d %%lu %%lu" + " %%*u %%*u %%*u %%*u %%*u %%*u %%*u %%*u %%*u %%*u %%*u %%*u %%*u" + " %%*u %%u %%*u %%*u %%*u %%lu %%lu\\n", MAX_COMM_LEN); + + fscanf(fp, format, comm, + &pst->minflt, &pst->cminflt, &pst->majflt, &pst->cmajflt, + &pst->utime, &pst->stime, &pst->cutime, &pst->cstime, + thread_nr, &pst->vsz, &pst->rss, &pst->processor, + &pst->gtime, &pst->cgtime); + + fclose(fp); + + /* Convert to kB */ + pst->vsz >>= 10; + pst->rss = PG_TO_KB(pst->rss); + + strncpy(pst->comm, comm, MAX_COMM_LEN); + pst->comm[MAX_COMM_LEN - 1] = '\0'; + + /* Remove trailing ')' */ + len = strlen(pst->comm); + if (len && (pst->comm[len - 1] == ')')) { + pst->comm[len - 1] = '\0'; + } + + pst->pid = pid; + pst->tgid = tgid; + return 0; +} + +/* + ***************************************************************************** + * Read stats from /proc/#[/task/##]/status. + * + * IN: + * @pid Process whose stats are to be read. + * @pst Pointer on structure where stats will be saved. + * @tgid If !=0, thread whose stats are to be read. + * + * OUT: + * @pst Pointer on structure where stats have been saved. + * + * RETURNS: + * 0 if stats have been successfully read, and 1 otherwise. + ***************************************************************************** + */ +int read_proc_pid_status(unsigned int pid, struct pid_stats *pst, + unsigned int tgid) +{ + FILE *fp; + char filename[128], line[256]; + + if (tgid) { + sprintf(filename, TASK_STATUS, tgid, pid); + } + else { + sprintf(filename, PID_STATUS, pid); + } + + if ((fp = fopen(filename, "r")) == NULL) + /* No such process */ + return 1; + + while (fgets(line, 256, fp) != NULL) { + + if (!strncmp(line, "voluntary_ctxt_switches:", 24)) { + sscanf(line + 25, "%lu", &pst->nvcsw); + } + else if (!strncmp(line, "nonvoluntary_ctxt_switches:", 27)) { + sscanf(line + 28, "%lu", &pst->nivcsw); + } + } + + fclose(fp); + + pst->pid = pid; + pst->tgid = tgid; + return 0; +} + +/* + ***************************************************************************** + * Read information from /proc/#[/task/##}/smaps. + * + * @pid Process whose stats are to be read. + * @pst Pointer on structure where stats will be saved. + * @tgid If !=0, thread whose stats are to be read. + * + * OUT: + * @pst Pointer on structure where stats have been saved. + * + * RETURNS: + * 0 if stats have been successfully read, and 1 otherwise. + ***************************************************************************** + */ +int read_proc_pid_smap(unsigned int pid, struct pid_stats *pst, unsigned int tgid) +{ + FILE *fp; + char filename[128], line[256]; + int state = 0; + + if (tgid) { + sprintf(filename, TASK_SMAP, tgid, pid); + } + else { + sprintf(filename, PID_SMAP, pid); + } + + if ((fp = fopen(filename, "rt")) == NULL) + /* No such process */ + return 1; + + while ((state < 3) && (fgets(line, sizeof(line), fp) != NULL)) { + switch (state) { + case 0: + if (strstr(line, "[stack]")) { + state = 1; + } + break; + case 1: + if (strstr(line, "Size:")) { + sscanf(line + sizeof("Size:"), "%lu", &pst->stack_size); + state = 2; + } + break; + case 2: + if (strstr(line, "Referenced:")) { + sscanf(line + sizeof("Referenced:"), "%lu", &pst->stack_ref); + state = 3; + } + break; + } + } + + fclose(fp); + + pst->pid = pid; + pst->tgid = tgid; + return 0; +} + +/* + ***************************************************************************** + * Read process command line from /proc/#[/task/##]/cmdline. + * + * IN: + * @pid Process whose command line is to be read. + * @pst Pointer on structure where command line will be saved. + * @tgid If !=0, thread whose command line is to be read. + * + * OUT: + * @pst Pointer on structure where command line has been saved. + * + * RETURNS: + * 0 if command line has been successfully read, and 1 otherwise (the process + * has terminated or its /proc/.../cmdline file is just empty). + ***************************************************************************** + */ +int read_proc_pid_cmdline(unsigned int pid, struct pid_stats *pst, + unsigned int tgid) +{ + FILE *fp; + char filename[128], line[MAX_CMDLINE_LEN]; + size_t len; + int i; + + if (tgid) { + sprintf(filename, TASK_CMDLINE, tgid, pid); + } + else { + sprintf(filename, PID_CMDLINE, pid); + } + + if ((fp = fopen(filename, "r")) == NULL) + /* No such process */ + return 1; + + memset(line, 0, MAX_CMDLINE_LEN); + + if ((len = fread(line, 1, MAX_CMDLINE_LEN - 1, fp)) < 0) + /* Nothing to read doesn't mean that process no longer exists */ + return 1; + + for (i = 0; i < len; i++) { + if (line[i] == '\0') { + line[i] = ' '; + } + } + + fclose(fp); + strncpy(pst->cmdline, line, MAX_CMDLINE_LEN); + return 0; +} + +/* + *************************************************************************** + * Read stats from /proc/#[/task/##]/io. + * + * IN: + * @pid Process whose stats are to be read. + * @pst Pointer on structure where stats will be saved. + * @tgid If !=0, thread whose stats are to be read. + * + * OUT: + * @pst Pointer on structure where stats have been saved. + * + * RETURNS: + * 0 if stats have been successfully read. + * Also returns 0 if current process has terminated or if its io file + * doesn't exist, but in this case, set process' F_NO_PID_IO flag to + * indicate that I/O stats should no longer be read for it. + *************************************************************************** + */ +int read_proc_pid_io(unsigned int pid, struct pid_stats *pst, + unsigned int tgid) +{ + FILE *fp; + char filename[128], line[256]; + + if (tgid) { + sprintf(filename, TASK_IO, tgid, pid); + } + else { + sprintf(filename, PID_IO, pid); + } + + if ((fp = fopen(filename, "r")) == NULL) { + /* No such process... or file non existent! */ + pst->flags |= F_NO_PID_IO; + /* + * Also returns 0 since io stats file doesn't necessarily exist, + * depending on the kernel version used. + */ + return 0; + } + + while (fgets(line, 256, fp) != NULL) { + + if (!strncmp(line, "read_bytes:", 11)) { + sscanf(line + 12, "%llu", &pst->read_bytes); + } + else if (!strncmp(line, "write_bytes:", 12)) { + sscanf(line + 13, "%llu", &pst->write_bytes); + } + else if (!strncmp(line, "cancelled_write_bytes:", 22)) { + sscanf(line + 23, "%llu", &pst->cancelled_write_bytes); + } + } + + fclose(fp); + + pst->pid = pid; + pst->tgid = tgid; + pst->flags &= ~F_NO_PID_IO; + return 0; +} + +/* + *************************************************************************** + * Read various stats for given PID. + * + * IN: + * @pid Process whose stats are to be read. + * @pst Pointer on structure where stats will be saved. + * @tgid If !=0, thread whose stats are to be read. + * + * OUT: + * @pst Pointer on structure where stats have been saved. + * @thread_nr Number of threads of the process. + * + * RETURNS: + * 0 if stats have been successfully read, and 1 otherwise. + *************************************************************************** + */ +int read_pid_stats(unsigned int pid, struct pid_stats *pst, + unsigned int *thread_nr, unsigned int tgid) +{ + if (read_proc_pid_stat(pid, pst, thread_nr, tgid)) + return 1; + + if (DISPLAY_CMDLINE(pidflag)) { + if (read_proc_pid_cmdline(pid, pst, tgid)) + return 1; + } + + if (read_proc_pid_status(pid, pst, tgid)) + return 1; + + if (DISPLAY_STACK(actflag)) { + if (read_proc_pid_smap(pid, pst, tgid)) + return 1; + } + + if (DISPLAY_IO(actflag)) + /* Assume that /proc/#/task/#/io exists! */ + return (read_proc_pid_io(pid, pst, tgid)); + + return 0; +} + +/* + *************************************************************************** + * Count number of threads in /proc/#/task directory, including the leader + * one. + * + * IN: + * @pid Process number for which the number of threads are to be counted. + * + * RETURNS: + * Number of threads for the given process (min value is 1). + * A value of 0 indicates that the process has terminated. + *************************************************************************** + */ +unsigned int count_tid(unsigned int pid) +{ + struct pid_stats pst; + unsigned int thread_nr; + + if (read_proc_pid_stat(pid, &pst, &thread_nr, 0) != 0) + /* Task no longer exists */ + return 0; + + return thread_nr; +} + +/* + *************************************************************************** + * Count number of processes (and threads). + * + * RETURNS: + * Number of processes (and threads if requested). + *************************************************************************** + */ +unsigned int count_pid(void) +{ + DIR *dir; + struct dirent *drp; + unsigned int pid = 0; + + /* Open /proc directory */ + if ((dir = opendir(PROC)) == NULL) { + perror("opendir"); + exit(4); + } + + /* Get directory entries */ + while ((drp = readdir(dir)) != NULL) { + if (isdigit(drp->d_name[0])) { + /* There is at least the TGID */ + pid++; + if (DISPLAY_TID(pidflag)) { + pid += count_tid(atoi(drp->d_name)); + } + } + } + + /* Close /proc directory */ + closedir(dir); + + return pid; +} + +/* + *************************************************************************** + * Count number of threads associated with the tasks entered on the command + * line. + * + * RETURNS: + * Number of threads (including the leading one) associated with every task + * entered on the command line. + *************************************************************************** + */ +unsigned int count_tid_in_list(void) +{ + unsigned int p, tid, pid = 0; + + for (p = 0; p < pid_array_nr; p++) { + + tid = count_tid(pid_array[p]); + + if (!tid) { + /* PID no longer exists */ + pid_array[p] = 0; + } + else { + /* TIDs + 1 TGID */ + pid += tid + 1; + } + } + + return pid; +} + +/* + *************************************************************************** + * Allocate and init structures according to system state. + *************************************************************************** + */ +void pid_sys_init(void) +{ + /* Init stat common counters */ + init_stats(); + + /* Count nb of proc */ + cpu_nr = get_cpu_nr(~0); + + if (DISPLAY_ALL_PID(pidflag)) { + /* Count PIDs and allocate structures */ + pid_nr = count_pid() + NR_PID_PREALLOC; + salloc_pid(pid_nr); + } + else if (DISPLAY_TID(pidflag)) { + /* Count total number of threads associated with tasks in list */ + pid_nr = count_tid_in_list() + NR_PID_PREALLOC; + salloc_pid(pid_nr); + } + else { + pid_nr = pid_array_nr; + salloc_pid(pid_nr); + } +} + +/* + *************************************************************************** + * Read stats for threads in /proc/#/task directory. + * + * IN: + * @curr Index in array for current sample statistics. + * @pid Process number whose threads stats are to be read. + * @index Index in process list where stats will be saved. + * + * OUT: + * @index Index in process list where next stats will be saved. + *************************************************************************** + */ +void read_task_stats(int curr, unsigned int pid, unsigned int *index) +{ + DIR *dir; + struct dirent *drp; + char filename[128]; + struct pid_stats *psti; + unsigned int thr_nr; + + /* Open /proc/#/task directory */ + sprintf(filename, PROC_TASK, pid); + if ((dir = opendir(filename)) == NULL) + return; + + while (*index < pid_nr) { + + while ((drp = readdir(dir)) != NULL) { + if (isdigit(drp->d_name[0])) + break; + } + + if (drp) { + psti = st_pid_list[curr] + (*index)++; + if (read_pid_stats(atoi(drp->d_name), psti, &thr_nr, pid)) { + /* Thread no longer exists */ + psti->pid = 0; + } + } + else + break; + } + closedir(dir); +} + +/* + *************************************************************************** + * Read various stats. + * + * IN: + * @curr Index in array for current sample statistics. + *************************************************************************** + */ +void read_stats(int curr) +{ + DIR *dir; + struct dirent *drp; + unsigned int p = 0, q, pid, thr_nr; + struct pid_stats *psti; + struct stats_cpu *st_cpu; + + /* + * Allocate two structures for CPU statistics. + * No need to init them (done by read_stat_cpu() function). + */ + if ((st_cpu = (struct stats_cpu *) malloc(STATS_CPU_SIZE * 2)) == NULL) { + perror("malloc"); + exit(4); + } + /* Read statistics for CPUs "all" and 0 */ + read_stat_cpu(st_cpu, 2, &uptime[curr], &uptime0[curr]); + free(st_cpu); + + if (DISPLAY_ALL_PID(pidflag)) { + + /* Open /proc directory */ + if ((dir = opendir(PROC)) == NULL) { + perror("opendir"); + exit(4); + } + + while (p < pid_nr) { + + /* Get directory entries */ + while ((drp = readdir(dir)) != NULL) { + if (isdigit(drp->d_name[0])) + break; + } + if (drp) { + psti = st_pid_list[curr] + p++; + pid = atoi(drp->d_name); + + if (read_pid_stats(pid, psti, &thr_nr, 0)) { + /* Process has terminated */ + psti->pid = 0; + } + + else if (DISPLAY_TID(pidflag)) { + /* Read stats for threads in task subdirectory */ + read_task_stats(curr, pid, &p); + } + } + else { + for (q = p; q < pid_nr; q++) { + psti = st_pid_list[curr] + q; + psti->pid = 0; + } + break; + } + } + + /* Close /proc directory */ + closedir(dir); + } + + else if (DISPLAY_PID(pidflag)) { + unsigned int op; + + /* Read stats for each PID in the list */ + for (op = 0; op < pid_array_nr; op++) { + + if (p >= pid_nr) + break; + psti = st_pid_list[curr] + p++; + + if (pid_array[op]) { + /* PID should still exist. So read its stats */ + if (read_pid_stats(pid_array[op], psti, &thr_nr, 0)) { + /* PID has terminated */ + psti->pid = 0; + pid_array[op] = 0; + } + else if (DISPLAY_TID(pidflag)) { + read_task_stats(curr, pid_array[op], &p); + } + } + } + /* Reset remaining structures */ + for (q = p; q < pid_nr; q++) { + psti = st_pid_list[curr] + q; + psti->pid = 0; + } + + } + /* else unknown command */ +} + +/* + *************************************************************************** + * Get current PID to display. + * First, check that PID exists. *Then* check that it's an active process + * and/or that the string (entered on the command line with options -C or + * -X) is found in command name. + * + * IN: + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @p Index in process list. + * @activity Current activity to display (CPU, memory...). + * Can be more than one if stats are displayed on one line. + * @pflag Flag indicating whether stats are to be displayed for + * individual tasks or for all their children. + * + * OUT: + * @psti Structure with PID statistics for current sample. + * @pstj Structure with PID statistics for previous sample. + * + * RETURNS: + * 0 if PID no longer exists. + * -1 if PID exists but should not be displayed. + * 1 if PID can be displayed. + *************************************************************************** + */ +int get_pid_to_display(int prev, int curr, int p, unsigned int activity, + unsigned int pflag, + struct pid_stats **psti, struct pid_stats **pstj) +{ + int q, rc; + regex_t regex; + + *psti = st_pid_list[curr] + p; + + if (!(*psti)->pid) + /* PID no longer exists */ + return 0; + + if (DISPLAY_ALL_PID(pidflag) || DISPLAY_TID(pidflag)) { + + /* Look for previous stats for same PID */ + q = p; + + do { + *pstj = st_pid_list[prev] + q; + if (((*pstj)->pid == (*psti)->pid) && + ((*pstj)->tgid == (*psti)->tgid)) + break; + q++; + if (q >= pid_nr) { + q = 0; + } + } + while (q != p); + + if (((*pstj)->pid != (*psti)->pid) || + ((*pstj)->tgid != (*psti)->tgid)) { + /* PID not found (no data previously read) */ + *pstj = &st_pid_null; + } + + if (DISPLAY_ACTIVE_PID(pidflag)) { + int isActive = FALSE; + + /* Check that it's an "active" process */ + if (DISPLAY_CPU(activity)) { + /* User time already includes guest time */ + if (((*psti)->utime != (*pstj)->utime) || + ((*psti)->stime != (*pstj)->stime)) { + isActive = TRUE; + } + else { + /* + * Process is not active but if we are showing + * child stats then we need to look there. + */ + if (DISPLAY_CHILD_STATS(pflag)) { + /* User time already includes guest time */ + if (((*psti)->cutime != (*pstj)->cutime) || + ((*psti)->cstime != (*pstj)->cstime)) { + isActive = TRUE; + } + } + } + } + + if (DISPLAY_MEM(activity) && (!isActive)) { + if (((*psti)->minflt != (*pstj)->minflt) || + ((*psti)->majflt != (*pstj)->majflt)) { + isActive = TRUE; + } + else { + if (DISPLAY_TASK_STATS(pflag)) { + if (((*psti)->vsz != (*pstj)->vsz) || + ((*psti)->rss != (*pstj)->rss)) { + isActive = TRUE; + } + } + else if (DISPLAY_CHILD_STATS(pflag)) { + if (((*psti)->cminflt != (*pstj)->cminflt) || + ((*psti)->cmajflt != (*pstj)->cmajflt)) { + isActive = TRUE; + } + } + } + } + + if (DISPLAY_IO(activity) && (!isActive) && + /* /proc/#/io file should exist to check I/O stats */ + !(NO_PID_IO((*psti)->flags))) { + if (((*psti)->read_bytes != (*pstj)->read_bytes) || + ((*psti)->write_bytes != (*pstj)->write_bytes) || + ((*psti)->cancelled_write_bytes != + (*pstj)->cancelled_write_bytes)) { + isActive = TRUE; + } + } + + if (DISPLAY_CTXSW(activity) && (!isActive)) { + if (((*psti)->nvcsw != (*pstj)->nvcsw) || + ((*psti)->nivcsw != (*pstj)->nivcsw)) { + isActive = TRUE; + } + } + + /* If PID isn't active for any of the activities then return */ + if (!isActive) + return -1; + } + } + + else if (DISPLAY_PID(pidflag)) { + + *pstj = st_pid_list[prev] + p; + } + + if (COMMAND_STRING(pidflag)) { + + if (regcomp(®ex, commstr, REG_EXTENDED | REG_NOSUB) != 0) + /* Error in preparing regex structure */ + return -1; + + rc = regexec(®ex, (*psti)->comm, 0, NULL, 0); + regfree(®ex); + + if (rc) + /* regex pattern not found in command name */ + return -1; + } + + return 1; +} + +/* + *************************************************************************** + * Display PID and TID. + * + * IN: + * @pst Current process statistics. + * @c No-op character. + *************************************************************************** + */ +void __print_line_id(struct pid_stats *pst, char c) +{ + char format[32]; + + if (DISPLAY_TID(pidflag)) { + + if (pst->tgid) { + /* This is a TID */ + sprintf(format, " %c %%9u", c); + } + else { + /* This is a PID (TGID) */ + sprintf(format, " %%9u %c", c); + } + } + else { + strcpy(format, " %9u"); + } + + printf(format, pst->pid); +} + +/* + *************************************************************************** + * Display timestamp, PID and TID. + * + * IN: + * @timestamp Current timestamp. + * @pst Current process statistics. + *************************************************************************** + */ +void print_line_id(char *timestamp, struct pid_stats *pst) +{ + printf("%-11s", timestamp); + + __print_line_id(pst, '-'); +} + +/* + *************************************************************************** + * Display all statistics for tasks in one line format. + * + * IN: + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dis TRUE if a header line must be printed. + * @itv Interval of time in jiffies. + * @g_itv Interval of time in jiffies multiplied by the number of + * processors. + * + * RETURNS: + * 0 if all the processes to display have terminated. + * <> 0 if there are still some processes left to display. + *************************************************************************** + */ +int write_pid_task_all_stats(int prev, int curr, int dis, + unsigned long long itv, + unsigned long long g_itv) +{ + struct pid_stats *psti, *pstj; + unsigned int p; + int again = 0; + + if (dis) { + PRINT_ID_HDR("# Time", pidflag); + if (DISPLAY_CPU(actflag)) { + printf(" %%usr %%system %%guest %%CPU CPU"); + } + if (DISPLAY_MEM(actflag)) { + printf(" minflt/s majflt/s VSZ RSS %%MEM"); + } + if (DISPLAY_STACK(actflag)) { + printf(" StkSize StkRef"); + } + if (DISPLAY_IO(actflag)) { + printf(" kB_rd/s kB_wr/s kB_ccwr/s"); + } + if (DISPLAY_CTXSW(actflag)) { + printf(" cswch/s nvcswch/s"); + } + printf(" Command\n"); + } + + for (p = 0; p < pid_nr; p++) { + + if (get_pid_to_display(prev, curr, p, actflag, P_TASK, + &psti, &pstj) <= 0) + continue; + + printf("%11ld", (long) time(NULL)); + __print_line_id(psti, '0'); + + if (DISPLAY_CPU(actflag)) { + printf(" %7.2f %7.2f %7.2f %7.2f", + SP_VALUE(pstj->utime - pstj->gtime, + psti->utime - psti->gtime, itv), + SP_VALUE(pstj->stime, psti->stime, itv), + SP_VALUE(pstj->gtime, psti->gtime, itv), + /* User time already includes guest time */ + IRIX_MODE_OFF(pidflag) ? + SP_VALUE(pstj->utime + pstj->stime, + psti->utime + psti->stime, g_itv) : + SP_VALUE(pstj->utime + pstj->stime, + psti->utime + psti->stime, itv)); + + printf(" %3d", psti->processor); + } + + + if (DISPLAY_MEM(actflag)) { + printf(" %9.2f %9.2f %7lu %6lu %6.2f", + S_VALUE(pstj->minflt, psti->minflt, itv), + S_VALUE(pstj->majflt, psti->majflt, itv), + psti->vsz, + psti->rss, + tlmkb ? SP_VALUE(0, psti->rss, tlmkb) : 0.0); + } + + if (DISPLAY_STACK(actflag)) { + printf(" %6lu %6lu", + psti->stack_size, + psti->stack_ref); + } + + if (DISPLAY_IO(actflag)) { + if (!NO_PID_IO(psti->flags)) + { + printf(" %9.2f %9.2f %9.2f", + S_VALUE(pstj->read_bytes, psti->read_bytes, itv) / 1024, + S_VALUE(pstj->write_bytes, psti->write_bytes, itv) / 1024, + S_VALUE(pstj->cancelled_write_bytes, + psti->cancelled_write_bytes, itv) / 1024); + } + else { + /* + * Keep the layout even though this task has no I/O + * typically threads with no I/O measurements. + */ + printf(" %9.2f %9.2f %9.2f", -1.0, -1.0, -1.0); + } + } + + if (DISPLAY_CTXSW(actflag)) { + printf(" %9.2f %9.2f", + S_VALUE(pstj->nvcsw, psti->nvcsw, itv), + S_VALUE(pstj->nivcsw, psti->nivcsw, itv)); + } + + print_comm(psti); + again = 1; + } + + return again; +} + +/* + *************************************************************************** + * Display all statistics for tasks' children in one line format + * + * IN: + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dis TRUE if a header line must be printed. + * @itv Interval of time in jiffies. + * + * RETURNS: + * 0 if all the processes to display have terminated. + * <> 0 if there are still some processes left to display. + *************************************************************************** + */ +int write_pid_child_all_stats(int prev, int curr, int dis, + unsigned long long itv) + +{ + struct pid_stats *psti, *pstj; + unsigned int p; + int again = 0; + + if (dis) { + PRINT_ID_HDR("# Time", pidflag); + if (DISPLAY_CPU(actflag)) + printf(" usr-ms system-ms guest-ms"); + if (DISPLAY_MEM(actflag)) + printf(" minflt-nr majflt-nr"); + printf(" Command\n"); + } + + for (p = 0; p < pid_nr; p++) { + + if (get_pid_to_display(prev, curr, p, actflag, P_CHILD, + &psti, &pstj) <= 0) + continue; + + printf("%11ld", (long) time(NULL)); + __print_line_id(psti, '0'); + + if (DISPLAY_CPU(actflag)) { + printf(" %9.0f %9.0f %9.0f", + (double) ((psti->utime + psti->cutime - psti->gtime - psti->cgtime) - + (pstj->utime + pstj->cutime - pstj->gtime - pstj->cgtime)) / + HZ * 1000, + (double) ((psti->stime + psti->cstime) - + (pstj->stime + pstj->cstime)) / HZ * 1000, + (double) ((psti->gtime + psti->cgtime) - + (pstj->gtime + pstj->cgtime)) / HZ * 1000); + } + + + if (DISPLAY_MEM(actflag)) { + printf(" %9lu %9lu", + (psti->minflt + psti->cminflt) - (pstj->minflt + pstj->cminflt), + (psti->majflt + psti->cmajflt) - (pstj->majflt + pstj->cmajflt)); + } + + print_comm(psti); + again = 1; + } + + return again; +} + +/* + *************************************************************************** + * Display CPU statistics for tasks. + * + * IN: + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dis TRUE if a header line must be printed. + * @disp_avg TRUE if average stats are displayed. + * @prev_string String displayed at the beginning of a header line. This is + * the timestamp of the previous sample, or "Average" when + * displaying average stats. + * @curr_string String displayed at the beginning of current sample stats. + * This is the timestamp of the current sample, or "Average" + * when displaying average stats. + * @itv Interval of time in jiffies. + * @g_itv Interval of time in jiffies multiplied by the number of + * processors. + * + * RETURNS: + * 0 if all the processes to display have terminated. + * <> 0 if there are still some processes left to display. + *************************************************************************** + */ +int write_pid_task_cpu_stats(int prev, int curr, int dis, int disp_avg, + char *prev_string, char *curr_string, + unsigned long long itv, + unsigned long long g_itv) +{ + struct pid_stats *psti, *pstj; + unsigned int p; + int again = 0; + + if (dis) { + PRINT_ID_HDR(prev_string, pidflag); + printf(" %%usr %%system %%guest %%CPU CPU Command\n"); + } + + for (p = 0; p < pid_nr; p++) { + + if (get_pid_to_display(prev, curr, p, P_A_CPU, P_TASK, + &psti, &pstj) <= 0) + continue; + + print_line_id(curr_string, psti); + printf(" %7.2f %7.2f %7.2f %7.2f", + SP_VALUE(pstj->utime - pstj->gtime, + psti->utime - psti->gtime, itv), + SP_VALUE(pstj->stime, psti->stime, itv), + SP_VALUE(pstj->gtime, psti->gtime, itv), + /* User time already includes guest time */ + IRIX_MODE_OFF(pidflag) ? + SP_VALUE(pstj->utime + pstj->stime, + psti->utime + psti->stime, g_itv) : + SP_VALUE(pstj->utime + pstj->stime, + psti->utime + psti->stime, itv)); + + if (!disp_avg) { + printf(" %3d", psti->processor); + } + else { + printf(" -"); + } + print_comm(psti); + again = 1; + } + + return again; +} + +/* + *************************************************************************** + * Display CPU statistics for tasks' children. + * + * IN: + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dis TRUE if a header line must be printed. + * @disp_avg TRUE if average stats are displayed. + * @prev_string String displayed at the beginning of a header line. This is + * the timestamp of the previous sample, or "Average" when + * displaying average stats. + * @curr_string String displayed at the beginning of current sample stats. + * This is the timestamp of the current sample, or "Average" + * when displaying average stats. + * + * RETURNS: + * 0 if all the processes to display have terminated. + * <> 0 if there are still some processes left to display. + *************************************************************************** + */ +int write_pid_child_cpu_stats(int prev, int curr, int dis, int disp_avg, + char *prev_string, char *curr_string) +{ + struct pid_stats *psti, *pstj; + unsigned int p; + int rc, again = 0; + + if (dis) { + PRINT_ID_HDR(prev_string, pidflag); + printf(" usr-ms system-ms guest-ms Command\n"); + } + + for (p = 0; p < pid_nr; p++) { + + if ((rc = get_pid_to_display(prev, curr, p, P_A_CPU, P_CHILD, + &psti, &pstj)) == 0) + /* PID no longer exists */ + continue; + + /* This will be used to compute average */ + if (!disp_avg) { + psti->uc_asum_count = pstj->uc_asum_count + 1; + } + + if (rc < 0) + /* PID should not be displayed */ + continue; + + print_line_id(curr_string, psti); + if (disp_avg) { + printf(" %9.0f %9.0f %9.0f", + (double) ((psti->utime + psti->cutime - psti->gtime - psti->cgtime) - + (pstj->utime + pstj->cutime - pstj->gtime - pstj->cgtime)) / + (HZ * psti->uc_asum_count) * 1000, + (double) ((psti->stime + psti->cstime) - + (pstj->stime + pstj->cstime)) / + (HZ * psti->uc_asum_count) * 1000, + (double) ((psti->gtime + psti->cgtime) - + (pstj->gtime + pstj->cgtime)) / + (HZ * psti->uc_asum_count) * 1000); + } + else { + printf(" %9.0f %9.0f %9.0f", + (double) ((psti->utime + psti->cutime - psti->gtime - psti->cgtime) - + (pstj->utime + pstj->cutime - pstj->gtime - pstj->cgtime)) / + HZ * 1000, + (double) ((psti->stime + psti->cstime) - + (pstj->stime + pstj->cstime)) / HZ * 1000, + (double) ((psti->gtime + psti->cgtime) - + (pstj->gtime + pstj->cgtime)) / HZ * 1000); + } + print_comm(psti); + again = 1; + } + + return again; +} + +/* + *************************************************************************** + * Display memory and/or stack size statistics for tasks. + * + * IN: + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dis TRUE if a header line must be printed. + * @disp_avg TRUE if average stats are displayed. + * @prev_string String displayed at the beginning of a header line. This is + * the timestamp of the previous sample, or "Average" when + * displaying average stats. + * @curr_string String displayed at the beginning of current sample stats. + * This is the timestamp of the current sample, or "Average" + * when displaying average stats. + * @itv Interval of time in jiffies. + * + * RETURNS: + * 0 if all the processes to display have terminated. + * <> 0 if there are still some processes left to display. + *************************************************************************** + */ +int write_pid_task_memory_stats(int prev, int curr, int dis, int disp_avg, + char *prev_string, char *curr_string, + unsigned long long itv) +{ + struct pid_stats *psti, *pstj; + unsigned int p; + int rc, again = 0; + + if (dis) { + PRINT_ID_HDR(prev_string, pidflag); + if (DISPLAY_MEM(actflag)) { + printf(" minflt/s majflt/s VSZ RSS %%MEM"); + } + if (DISPLAY_STACK(actflag)) { + printf(" StkSize StkRef"); + } + printf(" Command\n"); + } + + for (p = 0; p < pid_nr; p++) { + + if ((rc = get_pid_to_display(prev, curr, p, P_A_MEM, P_TASK, + &psti, &pstj)) == 0) + /* PID no longer exists */ + continue; + + /* This will be used to compute average */ + if (!disp_avg) { + if (DISPLAY_MEM(actflag)) { + psti->total_vsz = pstj->total_vsz + psti->vsz; + psti->total_rss = pstj->total_rss + psti->rss; + } + if (DISPLAY_STACK(actflag)) { + psti->total_stack_size = pstj->total_stack_size + psti->stack_size; + psti->total_stack_ref = pstj->total_stack_ref + psti->stack_ref; + } + psti->rt_asum_count = pstj->rt_asum_count + 1; + } + + if (rc < 0) + /* PID should not be displayed */ + continue; + + print_line_id(curr_string, psti); + + if (DISPLAY_MEM(actflag)) { + printf(" %9.2f %9.2f ", + S_VALUE(pstj->minflt, psti->minflt, itv), + S_VALUE(pstj->majflt, psti->majflt, itv)); + + if (disp_avg) { + printf("%7.0f %6.0f %6.2f", + (double) psti->total_vsz / psti->rt_asum_count, + (double) psti->total_rss / psti->rt_asum_count, + tlmkb ? + SP_VALUE(0, psti->total_rss / psti->rt_asum_count, tlmkb) + : 0.0); + } + else { + printf("%7lu %6lu %6.2f", + psti->vsz, + psti->rss, + tlmkb ? SP_VALUE(0, psti->rss, tlmkb) : 0.0); + } + } + + if (DISPLAY_STACK(actflag)) { + if (disp_avg) { + printf("%7.0f %7.0f", + (double) psti->total_stack_size / psti->rt_asum_count, + (double) psti->total_stack_ref / psti->rt_asum_count); + } + else { + printf("%7lu %7lu", + psti->stack_size, + psti->stack_ref); + } + } + + print_comm(psti); + again = 1; + } + + return again; +} + +/* + *************************************************************************** + * Display memory statistics for tasks' children. + * + * IN: + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dis TRUE if a header line must be printed. + * @disp_avg TRUE if average stats are displayed. + * @prev_string String displayed at the beginning of a header line. This is + * the timestamp of the previous sample, or "Average" when + * displaying average stats. + * @curr_string String displayed at the beginning of current sample stats. + * This is the timestamp of the current sample, or "Average" + * when displaying average stats. + * + * RETURNS: + * 0 if all the processes to display have terminated. + * <> 0 if there are still some processes left to display. + *************************************************************************** + */ +int write_pid_child_memory_stats(int prev, int curr, int dis, int disp_avg, + char *prev_string, char *curr_string) +{ + struct pid_stats *psti, *pstj; + unsigned int p; + int rc, again = 0; + + if (dis) { + PRINT_ID_HDR(prev_string, pidflag); + printf(" minflt-nr majflt-nr Command\n"); + } + + for (p = 0; p < pid_nr; p++) { + + if ((rc = get_pid_to_display(prev, curr, p, P_A_MEM, P_CHILD, + &psti, &pstj)) == 0) + /* PID no longer exists */ + continue; + + /* This will be used to compute average */ + if (!disp_avg) { + psti->rc_asum_count = pstj->rc_asum_count + 1; + } + + if (rc < 0) + /* PID should not be displayed */ + continue; + + print_line_id(curr_string, psti); + if (disp_avg) { + printf(" %9.0f %9.0f", + (double) ((psti->minflt + psti->cminflt) - + (pstj->minflt + pstj->cminflt)) / psti->rc_asum_count, + (double) ((psti->majflt + psti->cmajflt) - + (pstj->majflt + pstj->cmajflt)) / psti->rc_asum_count); + } + else { + printf(" %9lu %9lu", + (psti->minflt + psti->cminflt) - (pstj->minflt + pstj->cminflt), + (psti->majflt + psti->cmajflt) - (pstj->majflt + pstj->cmajflt)); + } + print_comm(psti); + again = 1; + } + + return again; +} + +/* + *************************************************************************** + * Display I/O statistics. + * + * IN: + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dis TRUE if a header line must be printed. + * @prev_string String displayed at the beginning of a header line. This is + * the timestamp of the previous sample, or "Average" when + * displaying average stats. + * @curr_string String displayed at the beginning of current sample stats. + * This is the timestamp of the current sample, or "Average" + * when displaying average stats. + * @itv Interval of time in jiffies. + * + * RETURNS: + * 0 if all the processes to display have terminated. + * <> 0 if there are still some processes left to display. + *************************************************************************** + */ +int write_pid_io_stats(int prev, int curr, int dis, + char *prev_string, char *curr_string, + unsigned long long itv) +{ + struct pid_stats *psti, *pstj; + unsigned int p; + int again = 0; + + if (dis) { + PRINT_ID_HDR(prev_string, pidflag); + printf(" kB_rd/s kB_wr/s kB_ccwr/s Command\n"); + } + + for (p = 0; p < pid_nr; p++) { + + if (get_pid_to_display(prev, curr, p, P_A_IO, P_NULL, + &psti, &pstj) <= 0) + continue; + + print_line_id(curr_string, psti); + printf(" %9.2f %9.2f %9.2f", + S_VALUE(pstj->read_bytes, psti->read_bytes, itv) / 1024, + S_VALUE(pstj->write_bytes, psti->write_bytes, itv) / 1024, + S_VALUE(pstj->cancelled_write_bytes, + psti->cancelled_write_bytes, itv) / 1024); + print_comm(psti); + again = 1; + } + + return again; +} + +/* + *************************************************************************** + * Display context switches statistics. + * + * IN: + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dis TRUE if a header line must be printed. + * @prev_string String displayed at the beginning of a header line. This is + * the timestamp of the previous sample, or "Average" when + * displaying average stats. + * @curr_string String displayed at the beginning of current sample stats. + * This is the timestamp of the current sample, or "Average" + * when displaying average stats. + * @itv Interval of time in jiffies. + * + * RETURNS: + * 0 if all the processes to display have terminated. + * <> 0 if there are still some processes left to display. + *************************************************************************** + */ +int write_pid_ctxswitch_stats(int prev, int curr, int dis, + char *prev_string, char *curr_string, + unsigned long long itv) +{ + struct pid_stats *psti, *pstj; + unsigned int p; + int again = 0; + + if (dis) { + PRINT_ID_HDR(prev_string, pidflag); + printf(" cswch/s nvcswch/s Command\n"); + } + + for (p = 0; p < pid_nr; p++) { + + if (get_pid_to_display(prev, curr, p, P_A_CTXSW, P_NULL, + &psti, &pstj) <= 0) + continue; + + print_line_id(curr_string, psti); + printf(" %9.2f %9.2f", + S_VALUE(pstj->nvcsw, psti->nvcsw, itv), + S_VALUE(pstj->nivcsw, psti->nivcsw, itv)); + print_comm(psti); + again = 1; + } + + return again; +} + +/* + *************************************************************************** + * Display statistics. + * + * IN: + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dis TRUE if a header line must be printed. + * @disp_avg TRUE if average stats are displayed. + * @prev_string String displayed at the beginning of a header line. This is + * the timestamp of the previous sample, or "Average" when + * displaying average stats. + * @curr_string String displayed at the beginning of current sample stats. + * This is the timestamp of the current sample, or "Average" + * when displaying average stats. + * + * RETURNS: + * 0 if all the processes to display have terminated. + * <> 0 if there are still some processes left to display. + *************************************************************************** + */ +int write_stats_core(int prev, int curr, int dis, int disp_avg, + char *prev_string, char *curr_string) +{ + unsigned long long itv, g_itv; + int again = 0; + + /* Test stdout */ + TEST_STDOUT(STDOUT_FILENO); + + /* g_itv is multiplied by the number of processors */ + g_itv = get_interval(uptime[prev], uptime[curr]); + + if (cpu_nr > 1) { + /* SMP machines */ + itv = get_interval(uptime0[prev], uptime0[curr]); + } + else { + /* UP machines */ + itv = g_itv; + } + + if (DISPLAY_ONELINE(pidflag)) { + if (DISPLAY_TASK_STATS(tskflag)) { + again += write_pid_task_all_stats(prev, curr, dis, + itv, g_itv); + } + if (DISPLAY_CHILD_STATS(tskflag)) { + again += write_pid_child_all_stats(prev, curr, dis, itv); + } + } + else { + /* Display CPU stats */ + if (DISPLAY_CPU(actflag)) { + + if (DISPLAY_TASK_STATS(tskflag)) { + again += write_pid_task_cpu_stats(prev, curr, dis, disp_avg, + prev_string, curr_string, + itv, g_itv); + } + if (DISPLAY_CHILD_STATS(tskflag)) { + again += write_pid_child_cpu_stats(prev, curr, dis, disp_avg, + prev_string, curr_string); + } + } + + /* Display memory and/or stack stats */ + if (DISPLAY_MEM(actflag) || DISPLAY_STACK(actflag)) { + + if (DISPLAY_TASK_STATS(tskflag)) { + again += write_pid_task_memory_stats(prev, curr, dis, disp_avg, + prev_string, curr_string, itv); + } + if (DISPLAY_CHILD_STATS(tskflag) && DISPLAY_MEM(actflag)) { + again += write_pid_child_memory_stats(prev, curr, dis, disp_avg, + prev_string, curr_string); + } + } + + /* Display I/O stats */ + if (DISPLAY_IO(actflag)) { + again += write_pid_io_stats(prev, curr, dis, prev_string, + curr_string, itv); + } + + /* Display context switches stats */ + if (DISPLAY_CTXSW(actflag)) { + again += write_pid_ctxswitch_stats(prev, curr, dis, prev_string, + curr_string, itv); + } + } + + if (DISPLAY_ALL_PID(pidflag)) { + again = 1; + } + + return again; +} + +/* + *************************************************************************** + * Print statistics average. + * + * IN: + * @curr Index in array for current sample statistics. + * @dis TRUE if a header line must be printed. + *************************************************************************** + */ +void write_stats_avg(int curr, int dis) +{ + char string[16]; + + strcpy(string, _("Average:")); + write_stats_core(2, curr, dis, TRUE, string, string); +} + +/* + *************************************************************************** + * Get previous and current timestamps, then display statistics. + * + * IN: + * @curr Index in array for current sample statistics. + * @dis TRUE if a header line must be printed. + * + * RETURNS: + * 0 if all the processes to display have terminated. + * <> 0 if there are still some processes left to display. + *************************************************************************** + */ +int write_stats(int curr, int dis) +{ + char cur_time[2][16]; + + /* Get previous timestamp */ + strftime(cur_time[!curr], 16, "%X", &ps_tstamp[!curr]); + + /* Get current timestamp */ + strftime(cur_time[curr], 16, "%X", &ps_tstamp[curr]); + + return (write_stats_core(!curr, curr, dis, FALSE, + cur_time[!curr], cur_time[curr])); +} + +/* + *************************************************************************** + * Main loop: Read and display PID stats. + * + * IN: + * @dis_hdr Set to TRUE if the header line must always be printed. + * @rows Number of rows of screen. + *************************************************************************** + */ +void rw_pidstat_loop(int dis_hdr, int rows) +{ + int curr = 1, dis = 1; + int again; + unsigned long lines = rows; + + /* Don't buffer data if redirected to a pipe */ + setbuf(stdout, NULL); + + if (cpu_nr > 1) { + /* + * Read system uptime (only for SMP machines). + * Init uptime0. So if /proc/uptime cannot fill it, this will be + * done by /proc/stat. + */ + uptime0[0] = 0; + read_uptime(&uptime0[0]); + } + read_stats(0); + + if (DISPLAY_MEM(actflag)) { + /* Get total memory */ + read_proc_meminfo(); + } + + if (!interval) { + /* Display since boot time */ + ps_tstamp[1] = ps_tstamp[0]; + memset(st_pid_list[1], 0, PID_STATS_SIZE * pid_nr); + write_stats(0, DISP_HDR); + exit(0); + } + + /* Set a handler for SIGALRM */ + alarm_handler(0); + + /* Save the first stats collected. Will be used to compute the average */ + ps_tstamp[2] = ps_tstamp[0]; + uptime[2] = uptime[0]; + uptime0[2] = uptime0[0]; + memcpy(st_pid_list[2], st_pid_list[0], PID_STATS_SIZE * pid_nr); + + pause(); + + do { + /* Get time */ + get_localtime(&ps_tstamp[curr]); + + if (cpu_nr > 1) { + /* + * Read system uptime (only for SMP machines). + * Init uptime0. So if /proc/uptime cannot fill it, this will be + * done by /proc/stat. + */ + uptime0[curr] = 0; + read_uptime(&(uptime0[curr])); + } + + /* Read stats */ + read_stats(curr); + + if (!dis_hdr) { + dis = lines / rows; + if (dis) { + lines %= rows; + } + lines++; + } + + /* Print results */ + again = write_stats(curr, dis); + + if (!again) + return; + + if (count > 0) { + count--; + } + + if (count) { + curr ^= 1; + pause(); + } + } + while (count); + + /* + * The one line format uses a raw time value rather than time strings + * so the average doesn't really fit. + */ + if (!DISPLAY_ONELINE(pidflag)) + { + /* Write stats average */ + write_stats_avg(curr, dis_hdr); + } +} + +/* + *************************************************************************** + * Main entry to the pidstat program. + *************************************************************************** + */ +int main(int argc, char **argv) +{ + int opt = 1, dis_hdr = -1; + int i; + unsigned int pid; + struct utsname header; + int rows = 23; + char *t; + +#ifdef USE_NLS + /* Init National Language Support */ + init_nls(); +#endif + + /* Get HZ */ + get_HZ(); + + /* Compute page shift in kB */ + get_kb_shift(); + + /* Allocate structures for device list */ + if (argc > 1) { + salloc_pid_array((argc / 2) + count_csvalues(argc, argv)); + } + + /* Process args... */ + while (opt < argc) { + + if (!strcmp(argv[opt], "-p")) { + pidflag |= P_D_PID; + if (argv[++opt]) { + + for (t = strtok(argv[opt], ","); t; t = strtok(NULL, ",")) { + if (!strcmp(t, K_ALL)) { + pidflag |= P_D_ALL_PID; + } + else if (!strcmp(t, K_SELF)) { + update_pid_array(&pid_array_nr, getpid()); + } + else { + if (strspn(t, DIGITS) != strlen(t)) { + usage(argv[0]); + } + pid = atoi(t); + if (pid < 1) { + usage(argv[0]); + } + update_pid_array(&pid_array_nr, pid); + } + } + opt++; + } + else { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-C")) { + if (argv[++opt]) { + strncpy(commstr, argv[opt++], MAX_COMM_LEN); + commstr[MAX_COMM_LEN - 1] = '\0'; + pidflag |= P_F_COMMSTR; + if (!strlen(commstr)) { + usage(argv[0]); + } + } + else { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-T")) { + if (argv[++opt]) { + if (tskflag) { + dis_hdr++; + } + if (!strcmp(argv[opt], K_P_TASK)) { + tskflag |= P_TASK; + } + else if (!strcmp(argv[opt], K_P_CHILD)) { + tskflag |= P_CHILD; + } + else if (!strcmp(argv[opt], K_P_ALL)) { + tskflag |= P_TASK + P_CHILD; + dis_hdr++; + } + else { + usage(argv[0]); + } + opt++; + } + else { + usage(argv[0]); + } + } + + else if (!strncmp(argv[opt], "-", 1)) { + for (i = 1; *(argv[opt] + i); i++) { + + switch (*(argv[opt] + i)) { + + case 'd': + /* Display I/O usage */ + actflag |= P_A_IO; + dis_hdr++; + break; + + case 'h': + /* Display stats on one line */ + pidflag |= P_D_ONELINE; + break; + + case 'I': + /* IRIX mode off */ + pidflag |= P_F_IRIX_MODE; + break; + + case 'l': + /* Display whole command line */ + pidflag |= P_D_CMDLINE; + break; + + case 'r': + /* Display memory usage */ + actflag |= P_A_MEM; + dis_hdr++; + break; + + case 's': + /* Display stack sizes */ + actflag |= P_A_STACK; + dis_hdr++; + break; + + case 't': + /* Display stats for threads */ + pidflag |= P_D_TID; + break; + + case 'u': + /* Display CPU usage */ + actflag |= P_A_CPU; + dis_hdr++; + break; + + case 'V': + /* Print version number and exit */ + print_version(); + break; + + case 'w': + /* Display context switches */ + actflag |= P_A_CTXSW; + dis_hdr++; + break; + + default: + usage(argv[0]); + } + } + opt++; + } + + else if (interval < 0) { /* Get interval */ + if (strspn(argv[opt], DIGITS) != strlen(argv[opt])) { + usage(argv[0]); + } + interval = atol(argv[opt++]); + if (interval < 0) { + usage(argv[0]); + } + count = -1; + } + + else if (count <= 0) { /* Get count value */ + if ((strspn(argv[opt], DIGITS) != strlen(argv[opt])) || + !interval) { + usage(argv[0]); + } + count = atol(argv[opt++]); + if (count < 1) { + usage(argv[0]); + } + } + else { + usage(argv[0]); + } + } + + if (interval < 0) { + /* Interval not set => display stats since boot time */ + interval = 0; + } + + /* Check flags and set default values */ + check_flags(); + + /* Init structures */ + pid_sys_init(); + + if (dis_hdr < 0) { + dis_hdr = 0; + } + if (!dis_hdr) { + if (pid_nr > 1) { + dis_hdr = 1; + } + else { + rows = get_win_height(); + } + } + + /* Get time */ + get_localtime(&(ps_tstamp[0])); + + /* Get system name, release number and hostname */ + uname(&header); + print_gal_header(&(ps_tstamp[0]), header.sysname, header.release, + header.nodename, header.machine, cpu_nr); + + /* Main loop */ + rw_pidstat_loop(dis_hdr, rows); + + /* Free structures */ + if (pid_array) { + free(pid_array); + } + sfree_pid(); + + return 0; +} diff --git a/pidstat.h b/pidstat.h new file mode 100644 index 00000000..e2fe3234 --- /dev/null +++ b/pidstat.h @@ -0,0 +1,129 @@ +/* + * pidstat: Display per-process statistics. + * (C) 2007-2009 by Sebastien Godard (sysstat orange.fr) + */ + +#ifndef _PIDSTAT_H +#define _PIDSTAT_H + + +#define K_SELF "SELF" + +#define K_P_TASK "TASK" +#define K_P_CHILD "CHILD" +#define K_P_ALL "ALL" + +#define NR_PID_PREALLOC 10 + +#define MAX_COMM_LEN 128 +#define MAX_CMDLINE_LEN 128 + +/* Activities */ +#define P_A_CPU 0x01 +#define P_A_MEM 0x02 +#define P_A_IO 0x04 +#define P_A_CTXSW 0x08 +#define P_A_STACK 0x10 + +#define DISPLAY_CPU(m) (((m) & P_A_CPU) == P_A_CPU) +#define DISPLAY_MEM(m) (((m) & P_A_MEM) == P_A_MEM) +#define DISPLAY_IO(m) (((m) & P_A_IO) == P_A_IO) +#define DISPLAY_CTXSW(m) (((m) & P_A_CTXSW) == P_A_CTXSW) +#define DISPLAY_STACK(m) (((m) & P_A_STACK) == P_A_STACK) + +/* TASK/CHILD */ +#define P_NULL 0x00 +#define P_TASK 0x01 +#define P_CHILD 0x02 + +#define DISPLAY_TASK_STATS(m) (((m) & P_TASK) == P_TASK) +#define DISPLAY_CHILD_STATS(m) (((m) & P_CHILD) == P_CHILD) + +#define P_D_PID 0x001 +#define P_D_ALL_PID 0x002 +#define P_F_IRIX_MODE 0x004 +#define P_F_COMMSTR 0x008 +#define P_D_ACTIVE_PID 0x010 +#define P_D_TID 0x020 +#define P_D_ONELINE 0x040 +#define P_D_CMDLINE 0x080 + +#define DISPLAY_PID(m) (((m) & P_D_PID) == P_D_PID) +#define DISPLAY_ALL_PID(m) (((m) & P_D_ALL_PID) == P_D_ALL_PID) +#define IRIX_MODE_OFF(m) (((m) & P_F_IRIX_MODE) == P_F_IRIX_MODE) +#define COMMAND_STRING(m) (((m) & P_F_COMMSTR) == P_F_COMMSTR) +#define DISPLAY_ACTIVE_PID(m) (((m) & P_D_ACTIVE_PID) == P_D_ACTIVE_PID) +#define DISPLAY_TID(m) (((m) & P_D_TID) == P_D_TID) +#define DISPLAY_ONELINE(m) (((m) & P_D_ONELINE) == P_D_ONELINE) +#define DISPLAY_CMDLINE(m) (((m) & P_D_CMDLINE) == P_D_CMDLINE) + +#define F_NO_PID_IO 0x01 + +#define NO_PID_IO(m) (((m) & F_NO_PID_IO) == F_NO_PID_IO) + +#define PROC "/proc" + +#define PROC_PID "/proc/%u" +#define PID_STAT "/proc/%u/stat" +#define PID_STATUS "/proc/%u/status" +#define PID_IO "/proc/%u/io" +#define PID_CMDLINE "/proc/%u/cmdline" +#define PID_SMAP "/proc/%u/smaps" + +#define PROC_TASK "/proc/%u/task" +#define TASK_STAT "/proc/%u/task/%u/stat" +#define TASK_STATUS "/proc/%u/task/%u/status" +#define TASK_IO "/proc/%u/task/%u/io" +#define TASK_CMDLINE "/proc/%u/task/%u/cmdline" +#define TASK_SMAP "/proc/%u/task/%u/smaps" + +#define PRINT_ID_HDR(_timestamp_, _flag_) do { \ + printf("\n%-11s", _timestamp_); \ + if (DISPLAY_TID(_flag_)) { \ + printf(" TGID TID"); \ + } \ + else { \ + printf(" PID"); \ + } \ + } while (0) + +struct pid_stats { + unsigned long long read_bytes __attribute__ ((aligned (8))); + unsigned long long write_bytes __attribute__ ((packed)); + unsigned long long cancelled_write_bytes __attribute__ ((packed)); + unsigned long long total_vsz __attribute__ ((packed)); + unsigned long long total_rss __attribute__ ((packed)); + unsigned long long total_stack_size __attribute__ ((packed)); + unsigned long long total_stack_ref __attribute__ ((packed)); + unsigned long minflt __attribute__ ((packed)); + unsigned long cminflt __attribute__ ((packed)); + unsigned long majflt __attribute__ ((packed)); + unsigned long cmajflt __attribute__ ((packed)); + unsigned long utime __attribute__ ((packed)); + unsigned long cutime __attribute__ ((packed)); + unsigned long stime __attribute__ ((packed)); + unsigned long cstime __attribute__ ((packed)); + unsigned long gtime __attribute__ ((packed)); + unsigned long cgtime __attribute__ ((packed)); + unsigned long vsz __attribute__ ((packed)); + unsigned long rss __attribute__ ((packed)); + unsigned long nvcsw __attribute__ ((packed)); + unsigned long nivcsw __attribute__ ((packed)); + unsigned long stack_size __attribute__ ((packed)); + unsigned long stack_ref __attribute__ ((packed)); + /* If pid is null, the process has terminated */ + unsigned int pid __attribute__ ((packed)); + /* If tgid is not null, then this PID is in fact a TID */ + unsigned int tgid __attribute__ ((packed)); + unsigned int rt_asum_count __attribute__ ((packed)); + unsigned int rc_asum_count __attribute__ ((packed)); + unsigned int uc_asum_count __attribute__ ((packed)); + unsigned int processor __attribute__ ((packed)); + unsigned int flags __attribute__ ((packed)); + char comm[MAX_COMM_LEN]; + char cmdline[MAX_CMDLINE_LEN]; +}; + +#define PID_STATS_SIZE (sizeof(struct pid_stats)) + +#endif /* _PIDSTAT_H */ diff --git a/pr_stats.c b/pr_stats.c new file mode 100644 index 00000000..5e7f092c --- /dev/null +++ b/pr_stats.c @@ -0,0 +1,2127 @@ +/* + * pr_stats.c: Functions used by sar to display statistics + * (C) 1999-2010 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include + +#include "sa.h" +#include "ioconf.h" +#include "pr_stats.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +extern unsigned int flags; +extern int dis; +extern char timestamp[][TIMESTAMP_LEN]; +extern unsigned long avg_count; + +/* + *************************************************************************** + * Display CPU statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @g_itv Interval of time in jiffies multiplied by the number + * of processors. + *************************************************************************** + */ +__print_funct_t print_cpu_stats(struct activity *a, int prev, int curr, + unsigned long long g_itv) +{ + int i; + struct stats_cpu *scc, *scp; + + if (dis) { + if (DISPLAY_CPU_DEF(a->opt_flags)) { + printf("\n%-11s CPU %%user %%nice %%system" + " %%iowait %%steal %%idle\n", + timestamp[!curr]); + } + else if (DISPLAY_CPU_ALL(a->opt_flags)) { + printf("\n%-11s CPU %%usr %%nice %%sys" + " %%iowait %%steal %%irq %%soft" + " %%guest %%idle\n", + timestamp[!curr]); + } + } + + for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) { + + /* + * The size of a->buf[...] CPU structure may be different from the default + * sizeof(struct stats_cpu) value if data have been read from a file! + * That's why we don't use a syntax like: + * scc = (struct stats_cpu *) a->buf[...] + i; + */ + scc = (struct stats_cpu *) ((char *) a->buf[curr] + i * a->msize); + scp = (struct stats_cpu *) ((char *) a->buf[prev] + i * a->msize); + + /* + * Note: a->nr is in [1, NR_CPUS + 1]. + * Bitmap size is provided for (NR_CPUS + 1) CPUs. + * Anyway, NR_CPUS may vary between the version of sysstat + * used by sadc to create a file, and the version of sysstat + * used by sar to read it... + */ + + /* Should current CPU (including CPU "all") be displayed? */ + if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) { + + /* Yes: Display it */ + printf("%-11s", timestamp[curr]); + + if (!i) { + /* This is CPU "all" */ + printf(" all"); + } + else { + printf(" %3d", i - 1); + + /* + * If the CPU is offline then it is omited from /proc/stat: + * All the fields couldn't have been read and the sum of them is zero. + * (Remember that guest time is already included in user mode.) + */ + if ((scc->cpu_user + scc->cpu_nice + scc->cpu_sys + + scc->cpu_iowait + scc->cpu_idle + scc->cpu_steal + + scc->cpu_hardirq + scc->cpu_softirq) == 0) { + /* + * Set current struct fields (which have been set to zero) + * to values from previous iteration. Hence their values won't + * jump from zero when the CPU comes back online. + */ + *scc = *scp; + + printf(" %6.2f %6.2f %6.2f" + " %6.2f %6.2f %6.2f", + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + + if (DISPLAY_CPU_ALL(a->opt_flags)) { + printf(" %6.2f %6.2f %6.2f", + 0.0, 0.0, 0.0); + } + printf("\n"); + continue; + } + + /* Recalculate interval for current proc */ + g_itv = get_per_cpu_interval(scc, scp); + + if (!g_itv) { + /* + * If the CPU is tickless then there is no change in CPU values + * but the sum of values is not zero. + */ + printf(" %6.2f %6.2f %6.2f" + " %6.2f %6.2f", + 0.0, 0.0, 0.0, 0.0, 0.0); + + if (DISPLAY_CPU_DEF(a->opt_flags)) { + printf(" %6.2f\n", 100.0); + } + else if (DISPLAY_CPU_ALL(a->opt_flags)) { + printf(" %6.2f %6.2f %6.2f %6.2f\n", + 0.0, 0.0, 0.0, 100.0); + } + continue; + } + } + + if (DISPLAY_CPU_DEF(a->opt_flags)) { + printf(" %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f\n", + ll_sp_value(scp->cpu_user, scc->cpu_user, g_itv), + ll_sp_value(scp->cpu_nice, scc->cpu_nice, g_itv), + ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq, + scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq, + g_itv), + ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv), + ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv), + scc->cpu_idle < scp->cpu_idle ? + 0.0 : + ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv)); + } + else if (DISPLAY_CPU_ALL(a->opt_flags)) { + printf(" %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f" + " %6.2f %6.2f %6.2f\n", + ll_sp_value(scp->cpu_user - scp->cpu_guest, + scc->cpu_user - scc->cpu_guest, g_itv), + ll_sp_value(scp->cpu_nice, scc->cpu_nice, g_itv), + ll_sp_value(scp->cpu_sys, scc->cpu_sys, g_itv), + ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv), + ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv), + ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, g_itv), + ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, g_itv), + ll_sp_value(scp->cpu_guest, scc->cpu_guest, g_itv), + scc->cpu_idle < scp->cpu_idle ? + 0.0 : + ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv)); + } + } + } +} + +/* + *************************************************************************** + * Display tasks creation and context switches statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_pcsw_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_pcsw + *spc = (struct stats_pcsw *) a->buf[curr], + *spp = (struct stats_pcsw *) a->buf[prev]; + + if (dis) { + printf("\n%-11s proc/s cswch/s\n", timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f\n", timestamp[curr], + S_VALUE (spp->processes, spc->processes, itv), + ll_s_value(spp->context_switch, spc->context_switch, itv)); +} + +/* + *************************************************************************** + * Display interrupts statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_irq_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + int i; + struct stats_irq *sic, *sip; + + if (dis) { + printf("\n%-11s INTR intr/s\n", timestamp[!curr]); + } + + for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) { + + sic = (struct stats_irq *) ((char *) a->buf[curr] + i * a->msize); + sip = (struct stats_irq *) ((char *) a->buf[prev] + i * a->msize); + + /* + * Note: a->nr is in [0, NR_IRQS + 1]. + * Bitmap size is provided for (NR_IRQS + 1) interrupts. + * Anyway, NR_IRQS may vary between the version of sysstat + * used by sadc to create a file, and the version of sysstat + * used by sar to read it... + */ + + /* Should current interrupt (including int "sum") be displayed? */ + if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) { + + /* Yes: Display it */ + printf("%-11s", timestamp[curr]); + if (!i) { + /* This is interrupt "sum" */ + printf(" sum"); + } + else { + printf(" %3d", i - 1); + } + + printf(" %9.2f\n", + ll_s_value(sip->irq_nr, sic->irq_nr, itv)); + } + } +} + +/* + *************************************************************************** + * Display swapping statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_swap_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_swap + *ssc = (struct stats_swap *) a->buf[curr], + *ssp = (struct stats_swap *) a->buf[prev]; + + if (dis) { + printf("\n%-11s pswpin/s pswpout/s\n", timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f\n", timestamp[curr], + S_VALUE(ssp->pswpin, ssc->pswpin, itv), + S_VALUE(ssp->pswpout, ssc->pswpout, itv)); +} + +/* + *************************************************************************** + * Display paging statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_paging_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_paging + *spc = (struct stats_paging *) a->buf[curr], + *spp = (struct stats_paging *) a->buf[prev]; + + if (dis) { + printf("\n%-11s pgpgin/s pgpgout/s fault/s majflt/s pgfree/s" + " pgscank/s pgscand/s pgsteal/s %%vmeff\n", + timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n", + timestamp[curr], + S_VALUE(spp->pgpgin, spc->pgpgin, itv), + S_VALUE(spp->pgpgout, spc->pgpgout, itv), + S_VALUE(spp->pgfault, spc->pgfault, itv), + S_VALUE(spp->pgmajfault, spc->pgmajfault, itv), + S_VALUE(spp->pgfree, spc->pgfree, itv), + S_VALUE(spp->pgscan_kswapd, spc->pgscan_kswapd, itv), + S_VALUE(spp->pgscan_direct, spc->pgscan_direct, itv), + S_VALUE(spp->pgsteal, spc->pgsteal, itv), + (spc->pgscan_kswapd + spc->pgscan_direct - + spp->pgscan_kswapd - spp->pgscan_direct) ? + SP_VALUE(spp->pgsteal, spc->pgsteal, + spc->pgscan_kswapd + spc->pgscan_direct - + spp->pgscan_kswapd - spp->pgscan_direct) : 0.0); +} + +/* + *************************************************************************** + * Display I/O and transfer rate statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_io_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_io + *sic = (struct stats_io *) a->buf[curr], + *sip = (struct stats_io *) a->buf[prev]; + + if (dis) { + printf("\n%-11s tps rtps wtps bread/s bwrtn/s\n", + timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f\n", timestamp[curr], + S_VALUE(sip->dk_drive, sic->dk_drive, itv), + S_VALUE(sip->dk_drive_rio, sic->dk_drive_rio, itv), + S_VALUE(sip->dk_drive_wio, sic->dk_drive_wio, itv), + S_VALUE(sip->dk_drive_rblk, sic->dk_drive_rblk, itv), + S_VALUE(sip->dk_drive_wblk, sic->dk_drive_wblk, itv)); +} + +/* + *************************************************************************** + * Display memory and swap statistics. This function is used to display + * instantaneous and average statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + * @dispavg TRUE if displaying average statistics. + *************************************************************************** + */ +void stub_print_memory_stats(struct activity *a, int prev, int curr, + unsigned long long itv, int dispavg) +{ + struct stats_memory + *smc = (struct stats_memory *) a->buf[curr], + *smp = (struct stats_memory *) a->buf[prev]; + static unsigned long long + avg_frmkb = 0, + avg_bufkb = 0, + avg_camkb = 0, + avg_comkb = 0; + static unsigned long long + avg_frskb = 0, + avg_tlskb = 0, + avg_caskb = 0; + + if (DISPLAY_MEMORY(a->opt_flags)) { + if (dis) { + printf("\n%-11s frmpg/s bufpg/s campg/s\n", + timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f\n", timestamp[curr], + S_VALUE((double) KB_TO_PG(smp->frmkb), (double) KB_TO_PG(smc->frmkb), itv), + S_VALUE((double) KB_TO_PG(smp->bufkb), (double) KB_TO_PG(smc->bufkb), itv), + S_VALUE((double) KB_TO_PG(smp->camkb), (double) KB_TO_PG(smc->camkb), itv)); + } + + if (DISPLAY_MEM_AMT(a->opt_flags)) { + if (dis) { + printf("\n%-11s kbmemfree kbmemused %%memused kbbuffers kbcached" + " kbcommit %%commit\n", timestamp[!curr]); + } + + if (!dispavg) { + /* Display instantaneous values */ + printf("%-11s %9lu %9lu %6.2f %9lu %9lu %9lu %7.2f\n", + timestamp[curr], + smc->frmkb, + smc->tlmkb - smc->frmkb, + smc->tlmkb ? + SP_VALUE(smc->frmkb, smc->tlmkb, smc->tlmkb) : 0.0, + smc->bufkb, + smc->camkb, + smc->comkb, + (smc->tlmkb + smc->tlskb) ? + SP_VALUE(0, smc->comkb, smc->tlmkb + smc->tlskb) : 0.0); + + /* + * Will be used to compute the average. + * We assume that the total amount of memory installed can not vary + * during the interval given on the command line. + */ + avg_frmkb += smc->frmkb; + avg_bufkb += smc->bufkb; + avg_camkb += smc->camkb; + avg_comkb += smc->comkb; + } + else { + /* Display average values */ + printf("%-11s %9.0f %9.0f %6.2f %9.0f %9.0f %9.0f %7.2f\n", + timestamp[curr], + (double) avg_frmkb / avg_count, + (double) smc->tlmkb - ((double) avg_frmkb / avg_count), + smc->tlmkb ? + SP_VALUE((double) (avg_frmkb / avg_count), smc->tlmkb, + smc->tlmkb) : + 0.0, + (double) avg_bufkb / avg_count, + (double) avg_camkb / avg_count, + (double) avg_comkb / avg_count, + (smc->tlmkb + smc->tlskb) ? + SP_VALUE(0.0, (double) (avg_comkb / avg_count), + smc->tlmkb + smc->tlskb) : + 0.0); + + /* Reset average counters */ + avg_frmkb = avg_bufkb = avg_camkb = avg_comkb = 0; + } + } + + if (DISPLAY_SWAP(a->opt_flags)) { + if (dis) { + printf("\n%-11s kbswpfree kbswpused %%swpused kbswpcad %%swpcad\n", + timestamp[!curr]); + } + + if (!dispavg) { + /* Display instantaneous values */ + printf("%-11s %9lu %9lu %6.2f %9lu %6.2f\n", + timestamp[curr], + smc->frskb, + smc->tlskb - smc->frskb, + smc->tlskb ? + SP_VALUE(smc->frskb, smc->tlskb, smc->tlskb) : 0.0, + smc->caskb, + (smc->tlskb - smc->frskb) ? + SP_VALUE(0, smc->caskb, smc->tlskb - smc->frskb) : 0.0); + + /* + * Will be used to compute the average. + * We assume that the total amount of swap space may vary. + */ + avg_frskb += smc->frskb; + avg_tlskb += smc->tlskb; + avg_caskb += smc->caskb; + } + else { + /* Display average values */ + printf("%-11s %9.0f %9.0f %6.2f %9.0f %6.2f\n", + timestamp[curr], + (double) avg_frskb / avg_count, + ((double) avg_tlskb / avg_count) - + ((double) avg_frskb / avg_count), + ((double) (avg_tlskb / avg_count)) ? + SP_VALUE((double) (avg_frskb / avg_count), + (double) (avg_tlskb / avg_count), + (double) (avg_tlskb / avg_count)) : + 0.0, + (double) (avg_caskb / avg_count), + (((double) avg_tlskb / avg_count) - + ((double) avg_frskb / avg_count)) ? + SP_VALUE(0.0, (double) (avg_caskb / avg_count), + ((double) avg_tlskb / avg_count) - + ((double) avg_frskb / avg_count)) : + 0.0); + + /* Reset average counters */ + avg_frskb = avg_tlskb = avg_caskb = 0; + } + } +} + +/* + *************************************************************************** + * Display memory and swap statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_memory_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_memory_stats(a, prev, curr, itv, FALSE); +} + +/* + *************************************************************************** + * Display average memory statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_avg_memory_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_memory_stats(a, prev, curr, itv, TRUE); +} + +/* + *************************************************************************** + * Display kernel tables statistics. This function is used to display + * instantaneous and average statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dispavg True if displaying average statistics. + *************************************************************************** + */ +void stub_print_ktables_stats(struct activity *a, int prev, int curr, int dispavg) +{ + struct stats_ktables + *skc = (struct stats_ktables *) a->buf[curr]; + static unsigned long long + avg_dentry_stat = 0, + avg_file_used = 0, + avg_inode_used = 0, + avg_pty_nr = 0; + + + if (dis) { + printf("\n%-11s dentunusd file-nr inode-nr pty-nr\n", + timestamp[!curr]); + } + + if (!dispavg) { + /* Display instantaneous values */ + printf("%-11s %9u %9u %9u %9u\n", timestamp[curr], + skc->dentry_stat, + skc->file_used, + skc->inode_used, + skc->pty_nr); + + /* + * Will be used to compute the average. + * Note: Overflow unlikely to happen but not impossible... + */ + avg_dentry_stat += skc->dentry_stat; + avg_file_used += skc->file_used; + avg_inode_used += skc->inode_used; + avg_pty_nr += skc->pty_nr; + } + else { + /* Display average values */ + printf("%-11s %9.0f %9.0f %9.0f %9.0f\n", + timestamp[curr], + (double) avg_dentry_stat / avg_count, + (double) avg_file_used / avg_count, + (double) avg_inode_used / avg_count, + (double) avg_pty_nr / avg_count); + + /* Reset average counters */ + avg_dentry_stat = avg_file_used = avg_inode_used = avg_pty_nr = 0; + } +} + +/* + *************************************************************************** + * Display kernel tables statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_ktables_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_ktables_stats(a, prev, curr, FALSE); +} + +/* + *************************************************************************** + * Display average kernel tables statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_avg_ktables_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_ktables_stats(a, prev, curr, TRUE); +} + +/* + *************************************************************************** + * Display queue and load statistics. This function is used to display + * instantaneous and average statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dispavg TRUE if displaying average statistics. + *************************************************************************** + */ +void stub_print_queue_stats(struct activity *a, int prev, int curr, int dispavg) +{ + struct stats_queue + *sqc = (struct stats_queue *) a->buf[curr]; + static unsigned long long + avg_nr_running = 0, + avg_nr_threads = 0, + avg_load_avg_1 = 0, + avg_load_avg_5 = 0, + avg_load_avg_15 = 0; + + if (dis) { + printf("\n%-11s runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15\n", + timestamp[!curr]); + } + + if (!dispavg) { + /* Display instantaneous values */ + printf("%-11s %9lu %9u %9.2f %9.2f %9.2f\n", timestamp[curr], + sqc->nr_running, + sqc->nr_threads, + (double) sqc->load_avg_1 / 100, + (double) sqc->load_avg_5 / 100, + (double) sqc->load_avg_15 / 100); + + /* Will be used to compute the average */ + avg_nr_running += sqc->nr_running; + avg_nr_threads += sqc->nr_threads; + avg_load_avg_1 += sqc->load_avg_1; + avg_load_avg_5 += sqc->load_avg_5; + avg_load_avg_15 += sqc->load_avg_15; + } + else { + /* Display average values */ + printf("%-11s %9.0f %9.0f %9.2f %9.2f %9.2f\n", timestamp[curr], + (double) avg_nr_running / avg_count, + (double) avg_nr_threads / avg_count, + (double) avg_load_avg_1 / (avg_count * 100), + (double) avg_load_avg_5 / (avg_count * 100), + (double) avg_load_avg_15 / (avg_count * 100)); + + /* Reset average counters */ + avg_nr_running = avg_nr_threads = 0; + avg_load_avg_1 = avg_load_avg_5 = avg_load_avg_15 = 0; + } +} + +/* + *************************************************************************** + * Display queue and load statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_queue_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_queue_stats(a, prev, curr, FALSE); +} + +/* + *************************************************************************** + * Display average queue and load statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_avg_queue_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_queue_stats(a, prev, curr, TRUE); +} + +/* + *************************************************************************** + * Display serial lines statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_serial_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + int i; + struct stats_serial *ssc, *ssp; + + if (dis) { + printf("\n%-11s TTY rcvin/s xmtin/s framerr/s prtyerr/s" + " brk/s ovrun/s\n", timestamp[!curr]); + } + + for (i = 0; i < a->nr; i++) { + + ssc = (struct stats_serial *) ((char *) a->buf[curr] + i * a->msize); + ssp = (struct stats_serial *) ((char *) a->buf[prev] + i * a->msize); + + if (ssc->line == 0) + continue; + + printf("%-11s %3d", timestamp[curr], ssc->line - 1); + + if ((ssc->line == ssp->line) || WANT_SINCE_BOOT(flags)) { + printf(" %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n", + S_VALUE(ssp->rx, ssc->rx, itv), + S_VALUE(ssp->tx, ssc->tx, itv), + S_VALUE(ssp->frame, ssc->frame, itv), + S_VALUE(ssp->parity, ssc->parity, itv), + S_VALUE(ssp->brk, ssc->brk, itv), + S_VALUE(ssp->overrun, ssc->overrun, itv)); + } + else { + printf(" N/A N/A N/A N/A" + " N/A N/A\n"); + } + } +} + +/* + *************************************************************************** + * Display disks statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_disk_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + int i, j; + struct stats_disk *sdc, *sdp; + struct ext_disk_stats xds; + char *dev_name; + + if (dis) { + printf("\n%-11s DEV tps rd_sec/s wr_sec/s avgrq-sz" + " avgqu-sz await svctm %%util\n", + timestamp[!curr]); + } + + for (i = 0; i < a->nr; i++) { + + sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize); + + if (!(sdc->major + sdc->minor)) + continue; + + j = check_disk_reg(a, curr, prev, i); + sdp = (struct stats_disk *) ((char *) a->buf[prev] + j * a->msize); + + /* Compute service time, etc. */ + compute_ext_disk_stats(sdc, sdp, itv, &xds); + + dev_name = NULL; + + if ((USE_PRETTY_OPTION(flags)) && (sdc->major == DEVMAP_MAJOR)) { + dev_name = transform_devmapname(sdc->major, sdc->minor); + } + + if (!dev_name) { + dev_name = get_devname(sdc->major, sdc->minor, + USE_PRETTY_OPTION(flags)); + } + + printf("%-11s %9s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n", + timestamp[curr], + /* Confusion possible here between index and minor numbers */ + dev_name, + S_VALUE(sdp->nr_ios, sdc->nr_ios, itv), + ll_s_value(sdp->rd_sect, sdc->rd_sect, itv), + ll_s_value(sdp->wr_sect, sdc->wr_sect, itv), + /* See iostat for explanations */ + xds.arqsz, + S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0, + xds.await, + xds.svctm, + xds.util / 10.0); + } +} + +/* + *************************************************************************** + * Display network interfaces statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_dev_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + int i, j; + struct stats_net_dev *sndc, *sndp; + + if (dis) { + printf("\n%-11s IFACE rxpck/s txpck/s rxkB/s txkB/s" + " rxcmp/s txcmp/s rxmcst/s\n", timestamp[!curr]); + } + + for (i = 0; i < a->nr; i++) { + + sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize); + + if (!strcmp(sndc->interface, "")) + continue; + + j = check_net_dev_reg(a, curr, prev, i); + sndp = (struct stats_net_dev *) ((char *) a->buf[prev] + j * a->msize); + + printf("%-11s %9s", timestamp[curr], sndc->interface); + + printf(" %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n", + S_VALUE(sndp->rx_packets, sndc->rx_packets, itv), + S_VALUE(sndp->tx_packets, sndc->tx_packets, itv), + S_VALUE(sndp->rx_bytes, sndc->rx_bytes, itv) / 1024, + S_VALUE(sndp->tx_bytes, sndc->tx_bytes, itv) / 1024, + S_VALUE(sndp->rx_compressed, sndc->rx_compressed, itv), + S_VALUE(sndp->tx_compressed, sndc->tx_compressed, itv), + S_VALUE(sndp->multicast, sndc->multicast, itv)); + } +} + +/* + *************************************************************************** + * Display network interface errors statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_edev_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + int i, j; + struct stats_net_edev *snedc, *snedp; + + if (dis) { + printf("\n%-11s IFACE rxerr/s txerr/s coll/s rxdrop/s" + " txdrop/s txcarr/s rxfram/s rxfifo/s txfifo/s\n", + timestamp[!curr]); + } + + for (i = 0; i < a->nr; i++) { + + snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize); + + if (!strcmp(snedc->interface, "")) + continue; + + j = check_net_edev_reg(a, curr, prev, i); + snedp = (struct stats_net_edev *) ((char *) a->buf[prev] + j * a->msize); + + printf("%-11s %9s", timestamp[curr], snedc->interface); + + printf(" %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n", + S_VALUE(snedp->rx_errors, snedc->rx_errors, itv), + S_VALUE(snedp->tx_errors, snedc->tx_errors, itv), + S_VALUE(snedp->collisions, snedc->collisions, itv), + S_VALUE(snedp->rx_dropped, snedc->rx_dropped, itv), + S_VALUE(snedp->tx_dropped, snedc->tx_dropped, itv), + S_VALUE(snedp->tx_carrier_errors, snedc->tx_carrier_errors, itv), + S_VALUE(snedp->rx_frame_errors, snedc->rx_frame_errors, itv), + S_VALUE(snedp->rx_fifo_errors, snedc->rx_fifo_errors, itv), + S_VALUE(snedp->tx_fifo_errors, snedc->tx_fifo_errors, itv)); + } +} + +/* + *************************************************************************** + * Display NFS client statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_nfs_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_nfs + *snnc = (struct stats_net_nfs *) a->buf[curr], + *snnp = (struct stats_net_nfs *) a->buf[prev]; + + if (dis) { + printf("\n%-11s call/s retrans/s read/s write/s access/s" + " getatt/s\n", timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n", timestamp[curr], + S_VALUE(snnp->nfs_rpccnt, snnc->nfs_rpccnt, itv), + S_VALUE(snnp->nfs_rpcretrans, snnc->nfs_rpcretrans, itv), + S_VALUE(snnp->nfs_readcnt, snnc->nfs_readcnt, itv), + S_VALUE(snnp->nfs_writecnt, snnc->nfs_writecnt, itv), + S_VALUE(snnp->nfs_accesscnt, snnc->nfs_accesscnt, itv), + S_VALUE(snnp->nfs_getattcnt, snnc->nfs_getattcnt, itv)); +} + +/* + *************************************************************************** + * Display NFS server statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_nfsd_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_nfsd + *snndc = (struct stats_net_nfsd *) a->buf[curr], + *snndp = (struct stats_net_nfsd *) a->buf[prev]; + + if (dis) { + printf("\n%-11s scall/s badcall/s packet/s udp/s tcp/s " + "hit/s miss/s sread/s swrite/s saccess/s sgetatt/s\n", + timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n", + timestamp[curr], + S_VALUE(snndp->nfsd_rpccnt, snndc->nfsd_rpccnt, itv), + S_VALUE(snndp->nfsd_rpcbad, snndc->nfsd_rpcbad, itv), + S_VALUE(snndp->nfsd_netcnt, snndc->nfsd_netcnt, itv), + S_VALUE(snndp->nfsd_netudpcnt, snndc->nfsd_netudpcnt, itv), + S_VALUE(snndp->nfsd_nettcpcnt, snndc->nfsd_nettcpcnt, itv), + S_VALUE(snndp->nfsd_rchits, snndc->nfsd_rchits, itv), + S_VALUE(snndp->nfsd_rcmisses, snndc->nfsd_rcmisses, itv), + S_VALUE(snndp->nfsd_readcnt, snndc->nfsd_readcnt, itv), + S_VALUE(snndp->nfsd_writecnt, snndc->nfsd_writecnt, itv), + S_VALUE(snndp->nfsd_accesscnt, snndc->nfsd_accesscnt, itv), + S_VALUE(snndp->nfsd_getattcnt, snndc->nfsd_getattcnt, itv)); +} + +/* + *************************************************************************** + * Display network sockets statistics. This function is used to display + * instantaneous and average statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + * @dispavg TRUE if displaying average statistics. + *************************************************************************** + */ +void stub_print_net_sock_stats(struct activity *a, int prev, int curr, + unsigned long long itv, int dispavg) +{ + struct stats_net_sock + *snsc = (struct stats_net_sock *) a->buf[curr]; + static unsigned long long + avg_sock_inuse = 0, + avg_tcp_inuse = 0, + avg_udp_inuse = 0, + avg_raw_inuse = 0, + avg_frag_inuse = 0, + avg_tcp_tw = 0; + + if (dis) { + printf("\n%-11s totsck tcpsck udpsck rawsck ip-frag tcp-tw\n", + timestamp[!curr]); + } + + if (!dispavg) { + /* Display instantaneous values */ + printf("%-11s %9u %9u %9u %9u %9u %9u\n", timestamp[curr], + snsc->sock_inuse, + snsc->tcp_inuse, + snsc->udp_inuse, + snsc->raw_inuse, + snsc->frag_inuse, + snsc->tcp_tw); + + /* Will be used to compute the average */ + avg_sock_inuse += snsc->sock_inuse; + avg_tcp_inuse += snsc->tcp_inuse; + avg_udp_inuse += snsc->udp_inuse; + avg_raw_inuse += snsc->raw_inuse; + avg_frag_inuse += snsc->frag_inuse; + avg_tcp_tw += snsc->tcp_tw; + } + else { + /* Display average values */ + printf("%-11s %9.0f %9.0f %9.0f %9.0f %9.0f %9.0f\n", timestamp[curr], + (double) avg_sock_inuse / avg_count, + (double) avg_tcp_inuse / avg_count, + (double) avg_udp_inuse / avg_count, + (double) avg_raw_inuse / avg_count, + (double) avg_frag_inuse / avg_count, + (double) avg_tcp_tw / avg_count); + + /* Reset average counters */ + avg_sock_inuse = avg_tcp_inuse = avg_udp_inuse = 0; + avg_raw_inuse = avg_frag_inuse = avg_tcp_tw = 0; + } +} + +/* + *************************************************************************** + * Display network sockets statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_sock_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_net_sock_stats(a, prev, curr, itv, FALSE); +} + +/* + *************************************************************************** + * Display average network sockets statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_avg_net_sock_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_net_sock_stats(a, prev, curr, itv, TRUE); +} + +/* + *************************************************************************** + * Display IP network traffic statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_ip_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_ip + *snic = (struct stats_net_ip *) a->buf[curr], + *snip = (struct stats_net_ip *) a->buf[prev]; + + if (dis) { + printf("\n%-11s irec/s fwddgm/s idel/s orq/s asmrq/s" + " asmok/s fragok/s fragcrt/s\n", timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n", + timestamp[curr], + S_VALUE(snip->InReceives, snic->InReceives, itv), + S_VALUE(snip->ForwDatagrams, snic->ForwDatagrams, itv), + S_VALUE(snip->InDelivers, snic->InDelivers, itv), + S_VALUE(snip->OutRequests, snic->OutRequests, itv), + S_VALUE(snip->ReasmReqds, snic->ReasmReqds, itv), + S_VALUE(snip->ReasmOKs, snic->ReasmOKs, itv), + S_VALUE(snip->FragOKs, snic->FragOKs, itv), + S_VALUE(snip->FragCreates, snic->FragCreates, itv)); +} + +/* + *************************************************************************** + * Display IP network error statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_eip_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_eip + *sneic = (struct stats_net_eip *) a->buf[curr], + *sneip = (struct stats_net_eip *) a->buf[prev]; + + if (dis) { + printf("\n%-11s ihdrerr/s iadrerr/s iukwnpr/s idisc/s odisc/s" + " onort/s asmf/s fragf/s\n", timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n", + timestamp[curr], + S_VALUE(sneip->InHdrErrors, sneic->InHdrErrors, itv), + S_VALUE(sneip->InAddrErrors, sneic->InAddrErrors, itv), + S_VALUE(sneip->InUnknownProtos, sneic->InUnknownProtos, itv), + S_VALUE(sneip->InDiscards, sneic->InDiscards, itv), + S_VALUE(sneip->OutDiscards, sneic->OutDiscards, itv), + S_VALUE(sneip->OutNoRoutes, sneic->OutNoRoutes, itv), + S_VALUE(sneip->ReasmFails, sneic->ReasmFails, itv), + S_VALUE(sneip->FragFails, sneic->FragFails, itv)); +} + +/* + *************************************************************************** + * Display ICMP network traffic statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_icmp_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_icmp + *snic = (struct stats_net_icmp *) a->buf[curr], + *snip = (struct stats_net_icmp *) a->buf[prev]; + + if (dis) { + printf("\n%-11s imsg/s omsg/s iech/s iechr/s oech/s" + " oechr/s itm/s itmr/s otm/s otmr/s" + " iadrmk/s iadrmkr/s oadrmk/s oadrmkr/s\n", timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f" + " %9.2f %9.2f %9.2f %9.2f\n", timestamp[curr], + S_VALUE(snip->InMsgs, snic->InMsgs, itv), + S_VALUE(snip->OutMsgs, snic->OutMsgs, itv), + S_VALUE(snip->InEchos, snic->InEchos, itv), + S_VALUE(snip->InEchoReps, snic->InEchoReps, itv), + S_VALUE(snip->OutEchos, snic->OutEchos, itv), + S_VALUE(snip->OutEchoReps, snic->OutEchoReps, itv), + S_VALUE(snip->InTimestamps, snic->InTimestamps, itv), + S_VALUE(snip->InTimestampReps, snic->InTimestampReps, itv), + S_VALUE(snip->OutTimestamps, snic->OutTimestamps, itv), + S_VALUE(snip->OutTimestampReps, snic->OutTimestampReps, itv), + S_VALUE(snip->InAddrMasks, snic->InAddrMasks, itv), + S_VALUE(snip->InAddrMaskReps, snic->InAddrMaskReps, itv), + S_VALUE(snip->OutAddrMasks, snic->OutAddrMasks, itv), + S_VALUE(snip->OutAddrMaskReps, snic->OutAddrMaskReps, itv)); +} + +/* + *************************************************************************** + * Display ICMP network error statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_eicmp_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_eicmp + *sneic = (struct stats_net_eicmp *) a->buf[curr], + *sneip = (struct stats_net_eicmp *) a->buf[prev]; + + if (dis) { + printf("\n%-11s ierr/s oerr/s idstunr/s odstunr/s itmex/s" + " otmex/s iparmpb/s oparmpb/s isrcq/s osrcq/s" + " iredir/s oredir/s\n", timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f" + " %9.2f %9.2f\n", timestamp[curr], + S_VALUE(sneip->InErrors, sneic->InErrors, itv), + S_VALUE(sneip->OutErrors, sneic->OutErrors, itv), + S_VALUE(sneip->InDestUnreachs, sneic->InDestUnreachs, itv), + S_VALUE(sneip->OutDestUnreachs, sneic->OutDestUnreachs, itv), + S_VALUE(sneip->InTimeExcds, sneic->InTimeExcds, itv), + S_VALUE(sneip->OutTimeExcds, sneic->OutTimeExcds, itv), + S_VALUE(sneip->InParmProbs, sneic->InParmProbs, itv), + S_VALUE(sneip->OutParmProbs, sneic->OutParmProbs, itv), + S_VALUE(sneip->InSrcQuenchs, sneic->InSrcQuenchs, itv), + S_VALUE(sneip->OutSrcQuenchs, sneic->OutSrcQuenchs, itv), + S_VALUE(sneip->InRedirects, sneic->InRedirects, itv), + S_VALUE(sneip->OutRedirects, sneic->OutRedirects, itv)); +} + +/* + *************************************************************************** + * Display TCP network traffic statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_tcp_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_tcp + *sntc = (struct stats_net_tcp *) a->buf[curr], + *sntp = (struct stats_net_tcp *) a->buf[prev]; + + if (dis) { + printf("\n%-11s active/s passive/s iseg/s oseg/s\n", + timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f\n", + timestamp[curr], + S_VALUE(sntp->ActiveOpens, sntc->ActiveOpens, itv), + S_VALUE(sntp->PassiveOpens, sntc->PassiveOpens, itv), + S_VALUE(sntp->InSegs, sntc->InSegs, itv), + S_VALUE(sntp->OutSegs, sntc->OutSegs, itv)); +} + +/* + *************************************************************************** + * Display TCP network error statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_etcp_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_etcp + *snetc = (struct stats_net_etcp *) a->buf[curr], + *snetp = (struct stats_net_etcp *) a->buf[prev]; + + if (dis) { + printf("\n%-11s atmptf/s estres/s retrans/s isegerr/s orsts/s\n", + timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f\n", + timestamp[curr], + S_VALUE(snetp->AttemptFails, snetc->AttemptFails, itv), + S_VALUE(snetp->EstabResets, snetc->EstabResets, itv), + S_VALUE(snetp->RetransSegs, snetc->RetransSegs, itv), + S_VALUE(snetp->InErrs, snetc->InErrs, itv), + S_VALUE(snetp->OutRsts, snetc->OutRsts, itv)); +} + +/* + *************************************************************************** + * Display UDP network traffic statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_udp_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_udp + *snuc = (struct stats_net_udp *) a->buf[curr], + *snup = (struct stats_net_udp *) a->buf[prev]; + + if (dis) { + printf("\n%-11s idgm/s odgm/s noport/s idgmerr/s\n", + timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f\n", + timestamp[curr], + S_VALUE(snup->InDatagrams, snuc->InDatagrams, itv), + S_VALUE(snup->OutDatagrams, snuc->OutDatagrams, itv), + S_VALUE(snup->NoPorts, snuc->NoPorts, itv), + S_VALUE(snup->InErrors, snuc->InErrors, itv)); +} + +/* + *************************************************************************** + * Display IPv6 sockets statistics. This function is used to display + * instantaneous and average statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + * @dispavg TRUE if displaying average statistics. + *************************************************************************** + */ +void stub_print_net_sock6_stats(struct activity *a, int prev, int curr, + unsigned long long itv, int dispavg) +{ + struct stats_net_sock6 + *snsc = (struct stats_net_sock6 *) a->buf[curr]; + static unsigned long long + avg_tcp6_inuse = 0, + avg_udp6_inuse = 0, + avg_raw6_inuse = 0, + avg_frag6_inuse = 0; + + if (dis) { + printf("\n%-11s tcp6sck udp6sck raw6sck ip6-frag\n", + timestamp[!curr]); + } + + if (!dispavg) { + /* Display instantaneous values */ + printf("%-11s %9u %9u %9u %9u\n", timestamp[curr], + snsc->tcp6_inuse, + snsc->udp6_inuse, + snsc->raw6_inuse, + snsc->frag6_inuse); + + /* Will be used to compute the average */ + avg_tcp6_inuse += snsc->tcp6_inuse; + avg_udp6_inuse += snsc->udp6_inuse; + avg_raw6_inuse += snsc->raw6_inuse; + avg_frag6_inuse += snsc->frag6_inuse; + } + else { + /* Display average values */ + printf("%-11s %9.0f %9.0f %9.0f %9.0f\n", timestamp[curr], + (double) avg_tcp6_inuse / avg_count, + (double) avg_udp6_inuse / avg_count, + (double) avg_raw6_inuse / avg_count, + (double) avg_frag6_inuse / avg_count); + + /* Reset average counters */ + avg_tcp6_inuse = avg_udp6_inuse = avg_raw6_inuse = avg_frag6_inuse = 0; + } +} + +/* + *************************************************************************** + * Display IPv6 sockets statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_sock6_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_net_sock6_stats(a, prev, curr, itv, FALSE); +} + +/* + *************************************************************************** + * Display average IPv6 sockets statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_avg_net_sock6_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_net_sock6_stats(a, prev, curr, itv, TRUE); +} + +/* + *************************************************************************** + * Display IPv6 network traffic statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_ip6_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_ip6 + *snic = (struct stats_net_ip6 *) a->buf[curr], + *snip = (struct stats_net_ip6 *) a->buf[prev]; + + if (dis) { + printf("\n%-11s irec6/s fwddgm6/s idel6/s orq6/s asmrq6/s" + " asmok6/s imcpck6/s omcpck6/s fragok6/s fragcr6/s\n", + timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n", + timestamp[curr], + S_VALUE(snip->InReceives6, snic->InReceives6, itv), + S_VALUE(snip->OutForwDatagrams6, snic->OutForwDatagrams6, itv), + S_VALUE(snip->InDelivers6, snic->InDelivers6, itv), + S_VALUE(snip->OutRequests6, snic->OutRequests6, itv), + S_VALUE(snip->ReasmReqds6, snic->ReasmReqds6, itv), + S_VALUE(snip->ReasmOKs6, snic->ReasmOKs6, itv), + S_VALUE(snip->InMcastPkts6, snic->InMcastPkts6, itv), + S_VALUE(snip->OutMcastPkts6, snic->OutMcastPkts6, itv), + S_VALUE(snip->FragOKs6, snic->FragOKs6, itv), + S_VALUE(snip->FragCreates6, snic->FragCreates6, itv)); +} + +/* + *************************************************************************** + * Display IPv6 network error statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_eip6_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_eip6 + *sneic = (struct stats_net_eip6 *) a->buf[curr], + *sneip = (struct stats_net_eip6 *) a->buf[prev]; + + if (dis) { + printf("\n%-11s ihdrer6/s iadrer6/s iukwnp6/s i2big6/s idisc6/s odisc6/s" + " inort6/s onort6/s asmf6/s fragf6/s itrpck6/s\n", + timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n", + timestamp[curr], + S_VALUE(sneip->InHdrErrors6, sneic->InHdrErrors6, itv), + S_VALUE(sneip->InAddrErrors6, sneic->InAddrErrors6, itv), + S_VALUE(sneip->InUnknownProtos6, sneic->InUnknownProtos6, itv), + S_VALUE(sneip->InTooBigErrors6, sneic->InTooBigErrors6, itv), + S_VALUE(sneip->InDiscards6, sneic->InDiscards6, itv), + S_VALUE(sneip->OutDiscards6, sneic->OutDiscards6, itv), + S_VALUE(sneip->InNoRoutes6, sneic->InNoRoutes6, itv), + S_VALUE(sneip->OutNoRoutes6, sneic->OutNoRoutes6, itv), + S_VALUE(sneip->ReasmFails6, sneic->ReasmFails6, itv), + S_VALUE(sneip->FragFails6, sneic->FragFails6, itv), + S_VALUE(sneip->InTruncatedPkts6, sneic->InTruncatedPkts6, itv)); +} + +/* + *************************************************************************** + * Display ICMPv6 network traffic statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_icmp6_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_icmp6 + *snic = (struct stats_net_icmp6 *) a->buf[curr], + *snip = (struct stats_net_icmp6 *) a->buf[prev]; + + if (dis) { + printf("\n%-11s imsg6/s omsg6/s iech6/s iechr6/s oechr6/s" + " igmbq6/s igmbr6/s ogmbr6/s igmbrd6/s ogmbrd6/s irtsol6/s ortsol6/s" + " irtad6/s inbsol6/s onbsol6/s inbad6/s onbad6/s\n", + timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f" + " %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n", timestamp[curr], + S_VALUE(snip->InMsgs6, snic->InMsgs6, itv), + S_VALUE(snip->OutMsgs6, snic->OutMsgs6, itv), + S_VALUE(snip->InEchos6, snic->InEchos6, itv), + S_VALUE(snip->InEchoReplies6, snic->InEchoReplies6, itv), + S_VALUE(snip->OutEchoReplies6, snic->OutEchoReplies6, itv), + S_VALUE(snip->InGroupMembQueries6, snic->InGroupMembQueries6, itv), + S_VALUE(snip->InGroupMembResponses6, snic->InGroupMembResponses6, itv), + S_VALUE(snip->OutGroupMembResponses6, snic->OutGroupMembResponses6, itv), + S_VALUE(snip->InGroupMembReductions6, snic->InGroupMembReductions6, itv), + S_VALUE(snip->OutGroupMembReductions6, snic->OutGroupMembReductions6, itv), + S_VALUE(snip->InRouterSolicits6, snic->InRouterSolicits6, itv), + S_VALUE(snip->OutRouterSolicits6, snic->OutRouterSolicits6, itv), + S_VALUE(snip->InRouterAdvertisements6, snic->InRouterAdvertisements6, itv), + S_VALUE(snip->InNeighborSolicits6, snic->InNeighborSolicits6, itv), + S_VALUE(snip->OutNeighborSolicits6, snic->OutNeighborSolicits6, itv), + S_VALUE(snip->InNeighborAdvertisements6, snic->InNeighborAdvertisements6, itv), + S_VALUE(snip->OutNeighborAdvertisements6, snic->OutNeighborAdvertisements6, itv)); +} + +/* + *************************************************************************** + * Display ICMPv6 network error statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_eicmp6_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_eicmp6 + *sneic = (struct stats_net_eicmp6 *) a->buf[curr], + *sneip = (struct stats_net_eicmp6 *) a->buf[prev]; + + if (dis) { + printf("\n%-11s ierr6/s idtunr6/s odtunr6/s itmex6/s otmex6/s" + " iprmpb6/s oprmpb6/s iredir6/s oredir6/s ipck2b6/s opck2b6/s\n", + timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f" + " %9.2f\n", timestamp[curr], + S_VALUE(sneip->InErrors6, sneic->InErrors6, itv), + S_VALUE(sneip->InDestUnreachs6, sneic->InDestUnreachs6, itv), + S_VALUE(sneip->OutDestUnreachs6, sneic->OutDestUnreachs6, itv), + S_VALUE(sneip->InTimeExcds6, sneic->InTimeExcds6, itv), + S_VALUE(sneip->OutTimeExcds6, sneic->OutTimeExcds6, itv), + S_VALUE(sneip->InParmProblems6, sneic->InParmProblems6, itv), + S_VALUE(sneip->OutParmProblems6, sneic->OutParmProblems6, itv), + S_VALUE(sneip->InRedirects6, sneic->InRedirects6, itv), + S_VALUE(sneip->OutRedirects6, sneic->OutRedirects6, itv), + S_VALUE(sneip->InPktTooBigs6, sneic->InPktTooBigs6, itv), + S_VALUE(sneip->OutPktTooBigs6, sneic->OutPktTooBigs6, itv)); +} + +/* + *************************************************************************** + * Display UDPv6 network traffic statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_net_udp6_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + struct stats_net_udp6 + *snuc = (struct stats_net_udp6 *) a->buf[curr], + *snup = (struct stats_net_udp6 *) a->buf[prev]; + + if (dis) { + printf("\n%-11s idgm6/s odgm6/s noport6/s idgmer6/s\n", + timestamp[!curr]); + } + + printf("%-11s %9.2f %9.2f %9.2f %9.2f\n", + timestamp[curr], + S_VALUE(snup->InDatagrams6, snuc->InDatagrams6, itv), + S_VALUE(snup->OutDatagrams6, snuc->OutDatagrams6, itv), + S_VALUE(snup->NoPorts6, snuc->NoPorts6, itv), + S_VALUE(snup->InErrors6, snuc->InErrors6, itv)); +} + +/* + *************************************************************************** + * Display CPU frequency statistics. This function is used to display + * instantaneous and average statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dispavg True if displaying average statistics. + *************************************************************************** + */ +void stub_print_pwr_cpufreq_stats(struct activity *a, int prev, int curr, int dispavg) +{ + int i; + struct stats_pwr_cpufreq *spc; + static unsigned long long + *avg_cpufreq = NULL; + + if (!avg_cpufreq) { + /* Allocate array of CPU frequency */ + if ((avg_cpufreq = (unsigned long long *) malloc(sizeof(unsigned long long) * a->nr)) + == NULL) { + perror("malloc"); + exit(4); + } + memset(avg_cpufreq, 0, sizeof(unsigned long long) * a->nr); + } + + if (dis) { + printf("\n%-11s CPU MHz\n", + timestamp[!curr]); + } + + for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) { + + /* + * The size of a->buf[...] CPU structure may be different from the default + * sizeof(struct stats_pwr_cpufreq) value if data have been read from a file! + * That's why we don't use a syntax like: + * spc = (struct stats_pwr_cpufreq *) a->buf[...] + i; + */ + spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize); + + /* + * Note: a->nr is in [1, NR_CPUS + 1]. + * Bitmap size is provided for (NR_CPUS + 1) CPUs. + * Anyway, NR_CPUS may vary between the version of sysstat + * used by sadc to create a file, and the version of sysstat + * used by sar to read it... + */ + + /* Should current CPU (including CPU "all") be displayed? */ + if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) { + + /* Yes: Display it */ + printf("%-11s", timestamp[curr]); + + if (!i) { + /* This is CPU "all" */ + printf(" all"); + } + else { + printf(" %3d", i - 1); + } + + if (!dispavg) { + /* Display instantaneous values */ + printf(" %9.2f\n", + ((double) spc->cpufreq) / 100); + /* + * Will be used to compute the average. + * Note: overflow unlikely to happen but not impossible... + */ + avg_cpufreq[i] += spc->cpufreq; + } + else { + /* Display average values */ + printf(" %9.2f\n", + (double) avg_cpufreq[i] / (100 * avg_count)); + } + } + } + + if (dispavg) { + /* Array of CPU frequency no longer needed: Free it! */ + if (avg_cpufreq) { + free(avg_cpufreq); + avg_cpufreq = NULL; + } + } +} + +/* + *************************************************************************** + * Display CPU frequency statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_pwr_cpufreq_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_pwr_cpufreq_stats(a, prev, curr, FALSE); +} + +/* + *************************************************************************** + * Display average CPU frequency statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_avg_pwr_cpufreq_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_pwr_cpufreq_stats(a, prev, curr, TRUE); +} + +/* + *************************************************************************** + * Display fan statistics. This function is used to display + * instantaneous and average statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dispavg True if displaying average statistics. + *************************************************************************** + */ +void stub_print_pwr_fan_stats(struct activity *a, int prev, int curr, int dispavg) +{ + int i; + struct stats_pwr_fan *spc; + static double *avg_fan = NULL; + static double *avg_fan_min = NULL; + + /* Allocate arrays of fan RPMs */ + if (!avg_fan) { + if ((avg_fan = (double *) malloc(sizeof(double) * a->nr)) == NULL) { + perror("malloc"); + exit(4); + } + memset(avg_fan, 0, sizeof(double) * a->nr); + } + if (!avg_fan_min) { + if ((avg_fan_min = (double *) malloc(sizeof(double) * a->nr)) == NULL) { + perror("malloc"); + exit(4); + } + memset(avg_fan_min, 0, sizeof(double) * a->nr); + } + + if (dis) { + printf("\n%-11s FAN rpm drpm %*s\n", + timestamp[!curr], MAX_SENSORS_DEV_LEN, "DEVICE"); + } + + for (i = 0; i < a->nr; i++) { + spc = (struct stats_pwr_fan *) ((char *) a->buf[curr] + i * a->msize); + + printf("%-11s %3d", timestamp[curr], i + 1); + + if (dispavg) { + /* Display average values */ + printf(" %9.2f %9.2f", + (double) avg_fan[i] / avg_count, + (double) (avg_fan[i] - avg_fan_min[i]) / avg_count); + } + else { + /* Display instantaneous values */ + printf(" %9.2f %9.2f", + spc->rpm, + spc->rpm - spc->rpm_min); + avg_fan[i] += spc->rpm; + avg_fan_min[i] += spc->rpm_min; + } + + printf(" %*s\n", MAX_SENSORS_DEV_LEN, spc->device); + } + + if (dispavg) { + if (avg_fan) { + free(avg_fan); + avg_fan = NULL; + } + if (avg_fan_min) { + free(avg_fan_min); + avg_fan_min = NULL; + } + } +} + +/* + *************************************************************************** + * Display fan statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_pwr_fan_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_pwr_fan_stats(a, prev, curr, FALSE); +} + +/* + *************************************************************************** + * Display average fan statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_avg_pwr_fan_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_pwr_fan_stats(a, prev, curr, TRUE); +} + +/* + *************************************************************************** + * Display device temperature statistics. This function is used to display + * instantaneous and average statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dispavg True if displaying average statistics. + *************************************************************************** + */ +void stub_print_pwr_temp_stats(struct activity *a, int prev, int curr, int dispavg) +{ + int i; + struct stats_pwr_temp *spc; + static double *avg_temp = NULL; + static double *avg_temp_min = NULL, *avg_temp_max = NULL; + + /* Allocate arrays of temperatures */ + if (!avg_temp) { + if ((avg_temp = (double *) malloc(sizeof(double) * a->nr)) == NULL) { + perror("malloc"); + exit(4); + } + memset(avg_temp, 0, sizeof(double) * a->nr); + } + if (!avg_temp_min) { + if ((avg_temp_min = (double *) malloc(sizeof(double) * a->nr)) == NULL) { + perror("malloc"); + exit(4); + } + memset(avg_temp_min, 0, sizeof(double) * a->nr); + } + if (!avg_temp_max) { + if ((avg_temp_max = (double *) malloc(sizeof(double) * a->nr)) == NULL) { + perror("malloc"); + exit(4); + } + memset(avg_temp_max, 0, sizeof(double) * a->nr); + } + + if (dis) { + printf("\n%-11s TEMP degC %%temp %*s\n", + timestamp[!curr], MAX_SENSORS_DEV_LEN, "DEVICE"); + } + + for (i = 0; i < a->nr; i++) { + spc = (struct stats_pwr_temp *) ((char *) a->buf[curr] + i * a->msize); + + printf("%-11s %3d", timestamp[curr], i + 1); + + if (dispavg) { + /* Display average values */ + printf(" %9.2f %9.2f", + (double) avg_temp[i] / avg_count, + (avg_temp_max[i] - avg_temp_min[i]) ? + ((double) (avg_temp[i] / avg_count) - avg_temp_min[i]) / (avg_temp_max[i] - avg_temp_min[i]) * 100 : + 0.0); + } + else { + /* Display instantaneous values */ + printf(" %9.2f %9.2f", + spc->temp, + (spc->temp_max - spc->temp_min) ? + (spc->temp - spc->temp_min) / (spc->temp_max - spc->temp_min) * 100 : + 0.0); + avg_temp[i] += spc->temp; + /* Assume that min and max temperatures cannot vary */ + avg_temp_min[i] = spc->temp_min; + avg_temp_max[i] = spc->temp_max; + } + + printf(" %*s\n", MAX_SENSORS_DEV_LEN, spc->device); + } + + if (dispavg) { + if (avg_temp) { + free(avg_temp); + avg_temp = NULL; + } + if (avg_temp_min) { + free(avg_temp_min); + avg_temp_min = NULL; + } + if (avg_temp_max) { + free(avg_temp_max); + avg_temp_max = NULL; + } + } +} + +/* + *************************************************************************** + * Display temperature statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_pwr_temp_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_pwr_temp_stats(a, prev, curr, FALSE); +} + +/* + *************************************************************************** + * Display average temperature statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_avg_pwr_temp_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_pwr_temp_stats(a, prev, curr, TRUE); +} + +/* + *************************************************************************** + * Display voltage inputs statistics. This function is used to display + * instantaneous and average statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @dispavg True if displaying average statistics. + *************************************************************************** + */ +void stub_print_pwr_in_stats(struct activity *a, int prev, int curr, int dispavg) +{ + int i; + struct stats_pwr_in *spc; + static double *avg_in = NULL; + static double *avg_in_min = NULL, *avg_in_max = NULL; + + /* Allocate arrays of voltage inputs */ + if (!avg_in) { + if ((avg_in = (double *) malloc(sizeof(double) * a->nr)) == NULL) { + perror("malloc"); + exit(4); + } + memset(avg_in, 0, sizeof(double) * a->nr); + } + if (!avg_in_min) { + if ((avg_in_min = (double *) malloc(sizeof(double) * a->nr)) == NULL) { + perror("malloc"); + exit(4); + } + memset(avg_in_min, 0, sizeof(double) * a->nr); + } + if (!avg_in_max) { + if ((avg_in_max = (double *) malloc(sizeof(double) * a->nr)) == NULL) { + perror("malloc"); + exit(4); + } + memset(avg_in_max, 0, sizeof(double) * a->nr); + } + + if (dis) { + printf("\n%-11s IN inV %%in %*s\n", + timestamp[!curr], MAX_SENSORS_DEV_LEN, "DEVICE"); + } + + for (i = 0; i < a->nr; i++) { + spc = (struct stats_pwr_in *) ((char *) a->buf[curr] + i * a->msize); + + printf("%-11s %3d", timestamp[curr], i); + + if (dispavg) { + /* Display average values */ + printf(" %9.2f %9.2f", + (double) avg_in[i] / avg_count, + (avg_in_max[i] - avg_in_min[i]) ? + ((double) (avg_in[i] / avg_count) - avg_in_min[i]) / (avg_in_max[i] - avg_in_min[i]) * 100 : + 0.0); + } + else { + /* Display instantaneous values */ + printf(" %9.2f %9.2f", + spc->in, + (spc->in_max - spc->in_min) ? + (spc->in - spc->in_min) / (spc->in_max - spc->in_min) * 100 : + 0.0); + avg_in[i] += spc->in; + /* Assume that min and max voltage inputs cannot vary */ + avg_in_min[i] = spc->in_min; + avg_in_max[i] = spc->in_max; + } + + printf(" %*s\n", MAX_SENSORS_DEV_LEN, spc->device); + } + + if (dispavg) { + if (avg_in) { + free(avg_in); + avg_in = NULL; + } + if (avg_in_min) { + free(avg_in_min); + avg_in_min = NULL; + } + if (avg_in_max) { + free(avg_in_max); + avg_in_max = NULL; + } + } +} + +/* + *************************************************************************** + * Display voltage inputs statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_pwr_in_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_pwr_in_stats(a, prev, curr, FALSE); +} + +/* + *************************************************************************** + * Display average voltage inputs statistics. + * + * IN: + * @a Activity structure with statistics. + * @prev Index in array where stats used as reference are. + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t print_avg_pwr_in_stats(struct activity *a, int prev, int curr, + unsigned long long itv) +{ + stub_print_pwr_in_stats(a, prev, curr, TRUE); +} diff --git a/pr_stats.h b/pr_stats.h new file mode 100644 index 00000000..8f6c6d96 --- /dev/null +++ b/pr_stats.h @@ -0,0 +1,106 @@ +/* + * pr_stats.h: Include file used to display system statistics + * (C) 1999-2010 by Sebastien Godard (sysstat orange.fr) + */ + +#ifndef _PR_STATS_H +#define _PR_STATS_H + +#include "common.h" + + +/* + *************************************************************************** + * Prototypes for functions used to display system statistics + *************************************************************************** + */ + +/* Functions used to display instantaneous statistics */ +extern __print_funct_t print_cpu_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_pcsw_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_irq_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_swap_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_paging_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_io_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_memory_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_ktables_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_queue_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_serial_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_disk_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_dev_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_edev_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_nfs_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_nfsd_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_sock_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_ip_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_eip_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_icmp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_eicmp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_tcp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_etcp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_udp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_sock6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_ip6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_eip6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_icmp6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_eicmp6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_net_udp6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_pwr_cpufreq_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_pwr_fan_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_pwr_temp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_pwr_in_stats + (struct activity *, int, int, unsigned long long); + +/* Functions used to display average statistics */ +extern __print_funct_t print_avg_memory_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_avg_ktables_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_avg_queue_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_avg_net_sock_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_avg_net_sock6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_avg_pwr_cpufreq_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_avg_pwr_fan_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_avg_pwr_temp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t print_avg_pwr_in_stats + (struct activity *, int, int, unsigned long long); + +#endif /* _PR_STATS_H */ diff --git a/prf_stats.c b/prf_stats.c new file mode 100644 index 00000000..f44f93ff --- /dev/null +++ b/prf_stats.c @@ -0,0 +1,4164 @@ +/* + * prf_stats.c: Funtions used by sadf to display statistics + * (C) 1999-2010 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include + +#include "sa.h" +#include "ioconf.h" +#include "prf_stats.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +static char *seps[] = {"\t", ";"}; + +extern unsigned int flags; + +/* + *************************************************************************** + * cons() - + * encapsulate a pair of ints or pair of char * into a static Cons and + * return a pointer to it. + * + * given: t - type of Cons {iv, sv} + * arg1 - unsigned long int (if iv), char * (if sv) to become + * element 'a' + * arg2 - unsigned long int (if iv), char * (if sv) to become + * element 'b' + * + * does: load a static Cons with values using the t parameter to + * guide pulling values from the arglist + * + * return: the address of it's static Cons. If you need to keep + * the contents of this Cons, copy it somewhere before calling + * cons() against to avoid overwrite. + * ie. don't do this: f( cons( iv, i, j ), cons( iv, a, b ) ); + *************************************************************************** + */ +static Cons *cons(tcons t, ...) +{ + va_list ap; + static Cons c; + + c.t = t; + + va_start(ap, t); + if (t == iv) { + c.a.i = va_arg(ap, unsigned long int); + c.b.i = va_arg(ap, unsigned long int); + } + else { + c.a.s = va_arg(ap, char *); + c.b.s = va_arg(ap, char *); + } + va_end(ap); + return(&c); +} + +/* + *************************************************************************** + * render(): + * + * given: isdb - flag, true if db printing, false if ppc printing + * pre - prefix string for output entries + * rflags - PT_.... rendering flags + * pptxt - printf-format text required for ppc output (may be null) + * dbtxt - printf-format text required for db output (may be null) + * mid - pptxt/dbtxt format args as a Cons. + * luval - %lu printable arg (PT_USEINT must be set) + * dval - %.2f printable arg (used unless PT_USEINT is set) + * + * does: print [pre]([dbtxt,arg,arg]|[pptxt,arg,arg]) \ + * (luval|dval)(|\n) + * + * return: void. + *************************************************************************** + */ +static void render(int isdb, char *pre, int rflags, const char *pptxt, + const char *dbtxt, Cons *mid, unsigned long int luval, + double dval) +{ + static int newline = 1; + const char *txt[] = {pptxt, dbtxt}; + + /* Start a new line? */ + if (newline && !DISPLAY_HORIZONTALLY(flags)) { + printf("%s", pre); + } + + /* Terminate this one ? ppc always gets a newline */ + newline = ((rflags & PT_NEWLIN) || !isdb); + + if (txt[isdb]) { + /* pp/dbtxt? */ + + printf("%s", seps[isdb]); /* Only if something actually gets printed */ + + if (mid) { + /* Got format args? */ + switch(mid->t) { + case iv: + printf(txt[isdb], mid->a.i, mid->b.i); + break; + case sv: + printf(txt[isdb], mid->a.s, mid->b.s); + break; + } + } + else { + printf(txt[isdb]); /* No args */ + } + } + + if (rflags & PT_USEINT) { + printf("%s%lu", seps[isdb], luval); + } + else { + printf("%s%.2f", seps[isdb], dval); + } + if (newline) { + printf("\n"); + } +} + +/* + *************************************************************************** + * Display CPU statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @g_itv Interval of time in jiffies multiplied by the number + * of processors. + *************************************************************************** + */ +__print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long g_itv) +{ + int i, cpu_offline; + struct stats_cpu *scc, *scp; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) { + + scc = (struct stats_cpu *) ((char *) a->buf[curr] + i * a->msize); + scp = (struct stats_cpu *) ((char *) a->buf[!curr] + i * a->msize); + + /* Should current CPU (including CPU "all") be displayed? */ + if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) { + + if (!i) { + /* This is CPU "all" */ + if (DISPLAY_CPU_DEF(a->opt_flags)) { + render(isdb, pre, + PT_NOFLAG, /* that's zero but you know what it means */ + "all\t%%user", /* all ppctext is used as format, thus '%%' */ + "-1", /* look! dbtext */ + NULL, /* no args */ + NOVAL, /* another 0, named for readability */ + ll_sp_value(scp->cpu_user, scc->cpu_user, g_itv)); + } + else if (DISPLAY_CPU_ALL(a->opt_flags)) { + render(isdb, pre, PT_NOFLAG, + "all\t%%usr", "-1", NULL, + NOVAL, + ll_sp_value(scp->cpu_user - scp->cpu_guest, + scc->cpu_user - scc->cpu_guest, + g_itv)); + } + + render(isdb, pre, PT_NOFLAG, + "all\t%%nice", NULL, NULL, + NOVAL, + ll_sp_value(scp->cpu_nice, scc->cpu_nice, g_itv)); + + if (DISPLAY_CPU_DEF(a->opt_flags)) { + render(isdb, pre, PT_NOFLAG, + "all\t%%system", NULL, NULL, + NOVAL, + ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq, + scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq, + g_itv)); + } + else if (DISPLAY_CPU_ALL(a->opt_flags)) { + render(isdb, pre, PT_NOFLAG, + "all\t%%sys", NULL, NULL, + NOVAL, + ll_sp_value(scp->cpu_sys, scc->cpu_sys, g_itv)); + } + + render(isdb, pre, PT_NOFLAG, + "all\t%%iowait", NULL, NULL, + NOVAL, + ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv)); + + render(isdb, pre, PT_NOFLAG, + "all\t%%steal", NULL, NULL, + NOVAL, + ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv)); + + if (DISPLAY_CPU_ALL(a->opt_flags)) { + render(isdb, pre, PT_NOFLAG, + "all\t%%irq", NULL, NULL, + NOVAL, + ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, g_itv)); + + render(isdb, pre, PT_NOFLAG, + "all\t%%soft", NULL, NULL, + NOVAL, + ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, g_itv)); + + render(isdb, pre, PT_NOFLAG, + "all\t%%guest", NULL, NULL, + NOVAL, + ll_sp_value(scp->cpu_guest, scc->cpu_guest, g_itv)); + } + + render(isdb, pre, pt_newlin, + "all\t%%idle", NULL, NULL, + NOVAL, + (scc->cpu_idle < scp->cpu_idle) ? + 0.0 : + ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv)); + } + else { + /* + * If the CPU is offline then it is omited from /proc/stat: + * All the fields couldn't have been read and the sum of them is zero. + * (Remember that guest time is already included in user mode.) + */ + if ((scc->cpu_user + scc->cpu_nice + scc->cpu_sys + + scc->cpu_iowait + scc->cpu_idle + scc->cpu_steal + + scc->cpu_hardirq + scc->cpu_softirq) == 0) { + /* + * Set current struct fields (which have been set to zero) + * to values from previous iteration. Hence their values won't + * jump from zero when the CPU comes back online. + */ + *scc = *scp; + + g_itv = 0; + cpu_offline = TRUE; + } + else { + /* + * Recalculate itv for current proc. + * If the result is 0, then current CPU is a tickless one. + */ + g_itv = get_per_cpu_interval(scc, scp); + cpu_offline = FALSE; + } + + if (DISPLAY_CPU_DEF(a->opt_flags)) { + render(isdb, pre, PT_NOFLAG, + "cpu%d\t%%user", /* ppc text with formatting */ + "%d", /* db text with format char */ + cons(iv, i - 1, NOVAL), /* how we pass format args */ + NOVAL, + !g_itv ? + 0.0 : /* CPU is offline or tickless */ + ll_sp_value(scp->cpu_user, scc->cpu_user, g_itv)); + } + else if (DISPLAY_CPU_ALL(a->opt_flags)) { + render(isdb, pre, PT_NOFLAG, + "cpu%d\t%%usr", "%d", cons(iv, i - 1, NOVAL), + NOVAL, + !g_itv ? + 0.0 : /* CPU is offline or tickless */ + ll_sp_value(scp->cpu_user - scp->cpu_guest, + scc->cpu_user - scc->cpu_guest, g_itv)); + } + + render(isdb, pre, PT_NOFLAG, + "cpu%d\t%%nice", NULL, cons(iv, i - 1, NOVAL), + NOVAL, + !g_itv ? + 0.0 : + ll_sp_value(scp->cpu_nice, scc->cpu_nice, g_itv)); + + if (DISPLAY_CPU_DEF(a->opt_flags)) { + render(isdb, pre, PT_NOFLAG, + "cpu%d\t%%system", NULL, cons(iv, i - 1, NOVAL), + NOVAL, + !g_itv ? + 0.0 : + ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq, + scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq, + g_itv)); + } + else if (DISPLAY_CPU_ALL(a->opt_flags)) { + render(isdb, pre, PT_NOFLAG, + "cpu%d\t%%sys", NULL, cons(iv, i - 1, NOVAL), + NOVAL, + !g_itv ? + 0.0 : + ll_sp_value(scp->cpu_sys, scc->cpu_sys, g_itv)); + } + + render(isdb, pre, PT_NOFLAG, + "cpu%d\t%%iowait", NULL, cons(iv, i - 1, NOVAL), + NOVAL, + !g_itv ? + 0.0 : + ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv)); + + render(isdb, pre, PT_NOFLAG, + "cpu%d\t%%steal", NULL, cons(iv, i - 1, NOVAL), + NOVAL, + !g_itv ? + 0.0 : + ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv)); + + if (DISPLAY_CPU_ALL(a->opt_flags)) { + render(isdb, pre, PT_NOFLAG, + "cpu%d\t%%irq", NULL, cons(iv, i - 1, NOVAL), + NOVAL, + !g_itv ? + 0.0 : + ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, g_itv)); + + render(isdb, pre, PT_NOFLAG, + "cpu%d\t%%soft", NULL, cons(iv, i - 1, NOVAL), + NOVAL, + !g_itv ? + 0.0 : + ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, g_itv)); + + render(isdb, pre, PT_NOFLAG, + "cpu%d\t%%guest", NULL, cons(iv, i - 1, NOVAL), + NOVAL, + !g_itv ? + 0.0 : + ll_sp_value(scp->cpu_guest, scc->cpu_guest, g_itv)); + } + + if (!g_itv) { + /* CPU is offline or tickless */ + render(isdb, pre, pt_newlin, + "cpu%d\t%%idle", NULL, cons(iv, i - 1, NOVAL), + NOVAL, + cpu_offline ? + 0.0 : 100.0); + } + else { + render(isdb, pre, pt_newlin, + "cpu%d\t%%idle", NULL, cons(iv, i - 1, NOVAL), + NOVAL, + (scc->cpu_idle < scp->cpu_idle) ? + 0.0 : + ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv)); + } + } + } + } +} + +/* + *************************************************************************** + * Display task creation and context switch statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_pcsw_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_pcsw + *spc = (struct stats_pcsw *) a->buf[curr], + *spp = (struct stats_pcsw *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + /* The first one as an example */ + render(isdb, /* db/ppc flag */ + pre, /* the preformatted line leader */ + PT_NOFLAG, /* is this the end of a db line? */ + "-\tproc/s", /* ppc text */ + NULL, /* db text */ + NULL, /* db/ppc text format args (Cons *) */ + NOVAL, /* %lu value (unused unless PT_USEINT) */ + /* and %.2f value, used unless PT_USEINT */ + S_VALUE(spp->processes, spc->processes, itv)); + + render(isdb, pre, pt_newlin, + "-\tcswch/s", NULL, NULL, + NOVAL, + ll_s_value(spp->context_switch, spc->context_switch, itv)); +} + +/* + *************************************************************************** + * Display interrupts statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_irq_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + int i; + struct stats_irq *sic, *sip; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) { + + sic = (struct stats_irq *) ((char *) a->buf[curr] + i * a->msize); + sip = (struct stats_irq *) ((char *) a->buf[!curr] + i * a->msize); + + /* Should current interrupt (including int "sum") be displayed? */ + if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) { + + /* Yes: Display it */ + if (!i) { + /* This is interrupt "sum" */ + render(isdb, pre, pt_newlin, + "sum\tintr/s", "-1", NULL, + NOVAL, + ll_s_value(sip->irq_nr, sic->irq_nr, itv)); + } + else { + render(isdb, pre, pt_newlin, + "i%03d\tintr/s", "%d", cons(iv, i - 1, NOVAL), + NOVAL, + ll_s_value(sip->irq_nr, sic->irq_nr, itv)); + } + } + } +} + +/* + *************************************************************************** + * Display swapping statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_swap_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_swap + *ssc = (struct stats_swap *) a->buf[curr], + *ssp = (struct stats_swap *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tpswpin/s", NULL, NULL, + NOVAL, + S_VALUE(ssp->pswpin, ssc->pswpin, itv)); + render(isdb, pre, pt_newlin, + "-\tpswpout/s", NULL, NULL, + NOVAL, + S_VALUE(ssp->pswpout, ssc->pswpout, itv)); +} + +/* + *************************************************************************** + * Display paging statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_paging_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_paging + *spc = (struct stats_paging *) a->buf[curr], + *spp = (struct stats_paging *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tpgpgin/s", NULL, NULL, + NOVAL, + S_VALUE(spp->pgpgin, spc->pgpgin, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tpgpgout/s", NULL, NULL, + NOVAL, + S_VALUE(spp->pgpgout, spc->pgpgout, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tfault/s", NULL, NULL, + NOVAL, + S_VALUE(spp->pgfault, spc->pgfault, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tmajflt/s", NULL, NULL, + NOVAL, + S_VALUE(spp->pgmajfault, spc->pgmajfault, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tpgfree/s", NULL, NULL, + NOVAL, + S_VALUE(spp->pgfree, spc->pgfree, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tpgscank/s", NULL, NULL, + NOVAL, + S_VALUE(spp->pgscan_kswapd, spc->pgscan_kswapd, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tpgscand/s", NULL, NULL, + NOVAL, + S_VALUE(spp->pgscan_direct, spc->pgscan_direct, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tpgsteal/s", NULL, NULL, + NOVAL, + S_VALUE(spp->pgsteal, spc->pgsteal, itv)); + + render(isdb, pre, pt_newlin, + "-\t%%vmeff", NULL, NULL, + NOVAL, + (spc->pgscan_kswapd + spc->pgscan_direct - + spp->pgscan_kswapd - spp->pgscan_direct) ? + SP_VALUE(spp->pgsteal, spc->pgsteal, + spc->pgscan_kswapd + spc->pgscan_direct - + spp->pgscan_kswapd - spp->pgscan_direct) : 0.0); +} + +/* + *************************************************************************** + * Display I/O and transfer rate statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_io_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_io + *sic = (struct stats_io *) a->buf[curr], + *sip = (struct stats_io *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\ttps", NULL, NULL, + NOVAL, + S_VALUE(sip->dk_drive, sic->dk_drive, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\trtps", NULL, NULL, + NOVAL, + S_VALUE(sip->dk_drive_rio, sic->dk_drive_rio, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\twtps", NULL, NULL, + NOVAL, + S_VALUE(sip->dk_drive_wio, sic->dk_drive_wio, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tbread/s", NULL, NULL, + NOVAL, + S_VALUE(sip->dk_drive_rblk, sic->dk_drive_rblk, itv)); + + render(isdb, pre, pt_newlin, + "-\tbwrtn/s", NULL, NULL, + NOVAL, + S_VALUE(sip->dk_drive_wblk, sic->dk_drive_wblk, itv)); +} + +/* + *************************************************************************** + * Display memory and swap statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_memory_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_memory + *smc = (struct stats_memory *) a->buf[curr], + *smp = (struct stats_memory *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + if (DISPLAY_MEMORY(a->opt_flags)) { + + render(isdb, pre, PT_NOFLAG, + "-\tfrmpg/s", NULL, NULL, + NOVAL, + S_VALUE((double) KB_TO_PG(smp->frmkb), + (double) KB_TO_PG(smc->frmkb), itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tbufpg/s", NULL, NULL, + NOVAL, + S_VALUE((double) KB_TO_PG(smp->bufkb), + (double) KB_TO_PG(smc->bufkb), itv)); + + render(isdb, pre, pt_newlin, + "-\tcampg/s", NULL, NULL, + NOVAL, + S_VALUE((double) KB_TO_PG(smp->camkb), + (double) KB_TO_PG(smc->camkb), itv)); + } + + if (DISPLAY_MEM_AMT(a->opt_flags)) { + + render(isdb, pre, PT_USEINT, + "-\tkbmemfree", NULL, NULL, + smc->frmkb, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\tkbmemused", NULL, NULL, + smc->tlmkb - smc->frmkb, DNOVAL); + + render(isdb, pre, PT_NOFLAG, + "-\t%%memused", NULL, NULL, NOVAL, + smc->tlmkb ? + SP_VALUE(smc->frmkb, smc->tlmkb, smc->tlmkb) : + 0.0); + + render(isdb, pre, PT_USEINT, + "-\tkbbuffers", NULL, NULL, + smc->bufkb, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\tkbcached", NULL, NULL, + smc->camkb, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\tkbcommit", NULL, NULL, + smc->comkb, DNOVAL); + + render(isdb, pre, pt_newlin, + "-\t%%commit", NULL, NULL, NOVAL, + (smc->tlmkb + smc->tlskb) ? + SP_VALUE(0, smc->comkb, smc->tlmkb + smc->tlskb) : + 0.0); + } + + if (DISPLAY_SWAP(a->opt_flags)) { + + render(isdb, pre, PT_USEINT, + "-\tkbswpfree", NULL, NULL, + smc->frskb, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\tkbswpused", NULL, NULL, + smc->tlskb - smc->frskb, DNOVAL); + + render(isdb, pre, PT_NOFLAG, + "-\t%%swpused", NULL, NULL, NOVAL, + smc->tlskb ? + SP_VALUE(smc->frskb, smc->tlskb, smc->tlskb) : + 0.0); + + render(isdb, pre, PT_USEINT, + "-\tkbswpcad", NULL, NULL, + smc->caskb, DNOVAL); + + render(isdb, pre, pt_newlin, + "-\t%%swpcad", NULL, NULL, NOVAL, + (smc->tlskb - smc->frskb) ? + SP_VALUE(0, smc->caskb, smc->tlskb - smc->frskb) : + 0.0); + } +} + +/* + *************************************************************************** + * Display kernel tables statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_ktables_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_ktables + *skc = (struct stats_ktables *) a->buf[curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_USEINT, + "-\tdentunusd", NULL, NULL, + skc->dentry_stat, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\tfile-nr", NULL, NULL, + skc->file_used, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\tinode-nr", NULL, NULL, + skc->inode_used, DNOVAL); + + render(isdb, pre, PT_USEINT | pt_newlin, + "-\tpty-nr", NULL, NULL, + skc->pty_nr, DNOVAL); +} + +/* + *************************************************************************** + * Display queue and load statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_queue_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_queue + *sqc = (struct stats_queue *) a->buf[curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_USEINT, + "-\trunq-sz", NULL, NULL, + sqc->nr_running, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\tplist-sz", NULL, NULL, + sqc->nr_threads, DNOVAL); + + render(isdb, pre, PT_NOFLAG, + "-\tldavg-1", NULL, NULL, + NOVAL, + (double) sqc->load_avg_1 / 100); + + render(isdb, pre, PT_NOFLAG, + "-\tldavg-5", NULL, NULL, + NOVAL, + (double) sqc->load_avg_5 / 100); + + render(isdb, pre, pt_newlin, + "-\tldavg-15", NULL, NULL, + NOVAL, + (double) sqc->load_avg_15 / 100); +} + +/* + *************************************************************************** + * Display serial lines statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_serial_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + int i; + struct stats_serial *ssc, *ssp; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + for (i = 0; i < a->nr; i++) { + + ssc = (struct stats_serial *) ((char *) a->buf[curr] + i * a->msize); + ssp = (struct stats_serial *) ((char *) a->buf[!curr] + i * a->msize); + + if (ssc->line == 0) + continue; + + if (ssc->line == ssp->line) { + render(isdb, pre, PT_NOFLAG, + "ttyS%d\trcvin/s", "%d", + cons(iv, ssc->line - 1, NOVAL), + NOVAL, + S_VALUE(ssp->rx, ssc->rx, itv)); + + render(isdb, pre, PT_NOFLAG, + "ttyS%d\txmtin/s", "%d", + cons(iv, ssc->line - 1, NOVAL), + NOVAL, + S_VALUE(ssp->tx, ssc->tx, itv)); + + render(isdb, pre, PT_NOFLAG, + "ttyS%d\tframerr/s", "%d", + cons(iv, ssc->line - 1, NOVAL), + NOVAL, + S_VALUE(ssp->frame, ssc->frame, itv)); + + render(isdb, pre, PT_NOFLAG, + "ttyS%d\tprtyerr/s", "%d", + cons(iv, ssc->line - 1, NOVAL), + NOVAL, + S_VALUE(ssp->parity, ssc->parity, itv)); + + render(isdb, pre, PT_NOFLAG, + "ttyS%d\tbrk/s", "%d", + cons(iv, ssc->line - 1, NOVAL), + NOVAL, + S_VALUE(ssp->brk, ssc->brk, itv)); + + render(isdb, pre, pt_newlin, + "ttyS%d\tovrun/s", "%d", + cons(iv, ssc->line - 1, NOVAL), + NOVAL, + S_VALUE(ssp->overrun, ssc->overrun, itv)); + } + } + +} + +/* + *************************************************************************** + * Display disks statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_disk_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + int i, j; + struct stats_disk *sdc, *sdp; + struct ext_disk_stats xds; + char *dev_name; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + for (i = 0; i < a->nr; i++) { + + sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize); + + if (!(sdc->major + sdc->minor)) + continue; + + j = check_disk_reg(a, curr, !curr, i); + sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize); + + /* Compute extended stats (service time, etc.) */ + compute_ext_disk_stats(sdc, sdp, itv, &xds); + + dev_name = NULL; + + if ((USE_PRETTY_OPTION(flags)) && (sdc->major == DEVMAP_MAJOR)) { + dev_name = transform_devmapname(sdc->major, sdc->minor); + } + + if (!dev_name) { + dev_name = get_devname(sdc->major, sdc->minor, + USE_PRETTY_OPTION(flags)); + } + + render(isdb, pre, PT_NOFLAG, + "%s\ttps", "%s", + cons(sv, dev_name, NULL), + NOVAL, + S_VALUE(sdp->nr_ios, sdc->nr_ios, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\trd_sec/s", NULL, + cons(sv, dev_name, NULL), + NOVAL, + ll_s_value(sdp->rd_sect, sdc->rd_sect, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\twr_sec/s", NULL, + cons(sv, dev_name, NULL), + NOVAL, + ll_s_value(sdp->wr_sect, sdc->wr_sect, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\tavgrq-sz", NULL, + cons(sv, dev_name, NULL), + NOVAL, + xds.arqsz); + + render(isdb, pre, PT_NOFLAG, + "%s\tavgqu-sz", NULL, + cons(sv, dev_name, NULL), + NOVAL, + S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0); + + render(isdb, pre, PT_NOFLAG, + "%s\tawait", NULL, + cons(sv, dev_name, NULL), + NOVAL, + xds.await); + + render(isdb, pre, PT_NOFLAG, + "%s\tsvctm", NULL, + cons(sv, dev_name, NULL), + NOVAL, + xds.svctm); + + render(isdb, pre, pt_newlin, + "%s\t%%util", NULL, + cons(sv, dev_name, NULL), + NOVAL, + xds.util / 10.0); + } +} + +/* + *************************************************************************** + * Display network interfaces statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_dev_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + int i, j; + struct stats_net_dev *sndc, *sndp; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + for (i = 0; i < a->nr; i++) { + + sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize); + + if (!strcmp(sndc->interface, "")) + continue; + + j = check_net_dev_reg(a, curr, !curr, i); + sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize); + + render(isdb, pre, PT_NOFLAG, + "%s\trxpck/s", "%s", + cons(sv, sndc->interface, NULL), /* What if the format args are strings? */ + NOVAL, + S_VALUE(sndp->rx_packets, sndc->rx_packets, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\ttxpck/s", NULL, + cons(sv, sndc->interface, NULL), + NOVAL, + S_VALUE(sndp->tx_packets, sndc->tx_packets, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\trxkB/s", NULL, + cons(sv, sndc->interface, NULL), + NOVAL, + S_VALUE(sndp->rx_bytes, sndc->rx_bytes, itv) / 1024); + + render(isdb, pre, PT_NOFLAG, + "%s\ttxkB/s", NULL, + cons(sv, sndc->interface, NULL), + NOVAL, + S_VALUE(sndp->tx_bytes, sndc->tx_bytes, itv) / 1024); + + render(isdb, pre, PT_NOFLAG, + "%s\trxcmp/s", NULL, + cons(sv, sndc->interface, NULL), + NOVAL, + S_VALUE(sndp->rx_compressed, sndc->rx_compressed, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\ttxcmp/s", NULL, + cons(sv, sndc->interface, NULL), + NOVAL, + S_VALUE(sndp->tx_compressed, sndc->tx_compressed, itv)); + + render(isdb, pre, pt_newlin, + "%s\trxmcst/s", NULL, + cons(sv, sndc->interface, NULL), + NOVAL, + S_VALUE(sndp->multicast, sndc->multicast, itv)); + } +} + +/* + *************************************************************************** + * Display network interface errors statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_edev_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + int i, j; + struct stats_net_edev *snedc, *snedp; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + for (i = 0; i < a->nr; i++) { + + snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize); + + if (!strcmp(snedc->interface, "")) + continue; + + j = check_net_edev_reg(a, curr, !curr, i); + snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize); + + render(isdb, pre, PT_NOFLAG, + "%s\trxerr/s", "%s", + cons(sv, snedc->interface, NULL), + NOVAL, + S_VALUE(snedp->rx_errors, snedc->rx_errors, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\ttxerr/s", NULL, + cons(sv, snedc->interface, NULL), + NOVAL, + S_VALUE(snedp->tx_errors, snedc->tx_errors, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\tcoll/s", NULL, + cons(sv, snedc->interface, NULL), + NOVAL, + S_VALUE(snedp->collisions, snedc->collisions, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\trxdrop/s", NULL, + cons(sv, snedc->interface, NULL), + NOVAL, + S_VALUE(snedp->rx_dropped, snedc->rx_dropped, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\ttxdrop/s", NULL, + cons(sv, snedc->interface, NULL), + NOVAL, + S_VALUE(snedp->tx_dropped, snedc->tx_dropped, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\ttxcarr/s", NULL, + cons(sv, snedc->interface, NULL), + NOVAL, + S_VALUE(snedp->tx_carrier_errors, snedc->tx_carrier_errors, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\trxfram/s", NULL, + cons(sv, snedc->interface, NULL), + NOVAL, + S_VALUE(snedp->rx_frame_errors, snedc->rx_frame_errors, itv)); + + render(isdb, pre, PT_NOFLAG, + "%s\trxfifo/s", NULL, + cons(sv, snedc->interface, NULL), + NOVAL, + S_VALUE(snedp->rx_fifo_errors, snedc->rx_fifo_errors, itv)); + + render(isdb, pre, pt_newlin, + "%s\ttxfifo/s", NULL, + cons(sv, snedc->interface, NULL), + NOVAL, + S_VALUE(snedp->tx_fifo_errors, snedc->tx_fifo_errors, itv)); + } +} + +/* + *************************************************************************** + * Display NFS client statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_nfs_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_nfs + *snnc = (struct stats_net_nfs *) a->buf[curr], + *snnp = (struct stats_net_nfs *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tcall/s", NULL, NULL, + NOVAL, + S_VALUE(snnp->nfs_rpccnt, snnc->nfs_rpccnt, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tretrans/s", NULL, NULL, + NOVAL, + S_VALUE(snnp->nfs_rpcretrans, snnc->nfs_rpcretrans, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tread/s", NULL, NULL, + NOVAL, + S_VALUE(snnp->nfs_readcnt, snnc->nfs_readcnt, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\twrite/s", NULL, NULL, + NOVAL, + S_VALUE(snnp->nfs_writecnt, snnc->nfs_writecnt, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\taccess/s", NULL, NULL, + NOVAL, + S_VALUE(snnp->nfs_accesscnt, snnc->nfs_accesscnt, itv)); + + render(isdb, pre, pt_newlin, + "-\tgetatt/s", NULL, NULL, + NOVAL, + S_VALUE(snnp->nfs_getattcnt, snnc->nfs_getattcnt, itv)); +} + +/* + *************************************************************************** + * Display NFS server statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_nfsd_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_nfsd + *snndc = (struct stats_net_nfsd *) a->buf[curr], + *snndp = (struct stats_net_nfsd *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tscall/s", NULL, NULL, + NOVAL, + S_VALUE(snndp->nfsd_rpccnt, snndc->nfsd_rpccnt, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tbadcall/s", NULL, NULL, + NOVAL, + S_VALUE(snndp->nfsd_rpcbad, snndc->nfsd_rpcbad, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tpacket/s", NULL, NULL, + NOVAL, + S_VALUE(snndp->nfsd_netcnt, snndc->nfsd_netcnt, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tudp/s", NULL, NULL, + NOVAL, + S_VALUE(snndp->nfsd_netudpcnt, snndc->nfsd_netudpcnt, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\ttcp/s", NULL, NULL, + NOVAL, + S_VALUE(snndp->nfsd_nettcpcnt, snndc->nfsd_nettcpcnt, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\thit/s", NULL, NULL, + NOVAL, + S_VALUE(snndp->nfsd_rchits, snndc->nfsd_rchits, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tmiss/s", NULL, NULL, + NOVAL, + S_VALUE(snndp->nfsd_rcmisses, snndc->nfsd_rcmisses, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tsread/s", NULL, NULL, + NOVAL, + S_VALUE(snndp->nfsd_readcnt, snndc->nfsd_readcnt, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tswrite/s", NULL, NULL, + NOVAL, + S_VALUE(snndp->nfsd_writecnt, snndc->nfsd_writecnt, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tsaccess/s", NULL, NULL, + NOVAL, + S_VALUE(snndp->nfsd_accesscnt, snndc->nfsd_accesscnt, itv)); + + render(isdb, pre, pt_newlin, + "-\tsgetatt/s", NULL, NULL, + NOVAL, + S_VALUE(snndp->nfsd_getattcnt, snndc->nfsd_getattcnt, itv)); +} + +/* + *************************************************************************** + * Display network sockets statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_sock_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_sock + *snsc = (struct stats_net_sock *) a->buf[curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_USEINT, + "-\ttotsck", NULL, NULL, + snsc->sock_inuse, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\ttcpsck", NULL, NULL, + snsc->tcp_inuse, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\tudpsck", NULL, NULL, + snsc->udp_inuse, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\trawsck", NULL, NULL, + snsc->raw_inuse, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\tip-frag", NULL, NULL, + snsc->frag_inuse, DNOVAL); + + render(isdb, pre, PT_USEINT | pt_newlin, + "-\ttcp-tw", NULL, NULL, + snsc->tcp_tw, DNOVAL); +} + +/* + *************************************************************************** + * Display IP network statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_ip_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_ip + *snic = (struct stats_net_ip *) a->buf[curr], + *snip = (struct stats_net_ip *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tirec/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InReceives, snic->InReceives, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tfwddgm/s", NULL, NULL, + NOVAL, + S_VALUE(snip->ForwDatagrams, snic->ForwDatagrams, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tidel/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InDelivers, snic->InDelivers, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\torq/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutRequests, snic->OutRequests, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tasmrq/s", NULL, NULL, + NOVAL, + S_VALUE(snip->ReasmReqds, snic->ReasmReqds, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tasmok/s", NULL, NULL, + NOVAL, + S_VALUE(snip->ReasmOKs, snic->ReasmOKs, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tfragok/s", NULL, NULL, + NOVAL, + S_VALUE(snip->FragOKs, snic->FragOKs, itv)); + + render(isdb, pre, pt_newlin, + "-\tfragcrt/s", NULL, NULL, + NOVAL, + S_VALUE(snip->FragCreates, snic->FragCreates, itv)); +} + +/* + *************************************************************************** + * Display IP network error statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_eip_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_eip + *sneic = (struct stats_net_eip *) a->buf[curr], + *sneip = (struct stats_net_eip *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tihdrerr/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InHdrErrors, sneic->InHdrErrors, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiadrerr/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InAddrErrors, sneic->InAddrErrors, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiukwnpr/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InUnknownProtos, sneic->InUnknownProtos, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tidisc/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InDiscards, sneic->InDiscards, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\todisc/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutDiscards, sneic->OutDiscards, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tonort/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutNoRoutes, sneic->OutNoRoutes, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tasmf/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->ReasmFails, sneic->ReasmFails, itv)); + + render(isdb, pre, pt_newlin, + "-\tfragf/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->FragFails, sneic->FragFails, itv)); +} + +/* + *************************************************************************** + * Display ICMP network statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_icmp + *snic = (struct stats_net_icmp *) a->buf[curr], + *snip = (struct stats_net_icmp *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\timsg/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InMsgs, snic->InMsgs, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tomsg/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutMsgs, snic->OutMsgs, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiech/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InEchos, snic->InEchos, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiechr/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InEchoReps, snic->InEchoReps, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\toech/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutEchos, snic->OutEchos, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\toechr/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutEchoReps, snic->OutEchoReps, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\titm/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InTimestamps, snic->InTimestamps, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\titmr/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InTimestampReps, snic->InTimestampReps, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\totm/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutTimestamps, snic->OutTimestamps, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\totmr/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutTimestampReps, snic->OutTimestampReps, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiadrmk/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InAddrMasks, snic->InAddrMasks, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiadrmkr/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InAddrMaskReps, snic->InAddrMaskReps, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\toadrmk/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutAddrMasks, snic->OutAddrMasks, itv)); + + render(isdb, pre, pt_newlin, + "-\toadrmkr/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutAddrMaskReps, snic->OutAddrMaskReps, itv)); +} + +/* + *************************************************************************** + * Display ICMP error message statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_eicmp_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_eicmp + *sneic = (struct stats_net_eicmp *) a->buf[curr], + *sneip = (struct stats_net_eicmp *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tierr/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InErrors, sneic->InErrors, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\toerr/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutErrors, sneic->OutErrors, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tidstunr/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InDestUnreachs, sneic->InDestUnreachs, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\todstunr/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutDestUnreachs, sneic->OutDestUnreachs, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\titmex/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InTimeExcds, sneic->InTimeExcds, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\totmex/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutTimeExcds, sneic->OutTimeExcds, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiparmpb/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InParmProbs, sneic->InParmProbs, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\toparmpb/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutParmProbs, sneic->OutParmProbs, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tisrcq/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InSrcQuenchs, sneic->InSrcQuenchs, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tosrcq/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutSrcQuenchs, sneic->OutSrcQuenchs, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiredir/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InRedirects, sneic->InRedirects, itv)); + + render(isdb, pre, pt_newlin, + "-\toredir/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutRedirects, sneic->OutRedirects, itv)); +} + +/* + *************************************************************************** + * Display TCP network statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_tcp_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_tcp + *sntc = (struct stats_net_tcp *) a->buf[curr], + *sntp = (struct stats_net_tcp *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tactive/s", NULL, NULL, + NOVAL, + S_VALUE(sntp->ActiveOpens, sntc->ActiveOpens, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tpassive/s", NULL, NULL, + NOVAL, + S_VALUE(sntp->PassiveOpens, sntc->PassiveOpens, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiseg/s", NULL, NULL, + NOVAL, + S_VALUE(sntp->InSegs, sntc->InSegs, itv)); + + render(isdb, pre, pt_newlin, + "-\toseg/s", NULL, NULL, + NOVAL, + S_VALUE(sntp->OutSegs, sntc->OutSegs, itv)); +} + +/* + *************************************************************************** + * Display TCP network error statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_etcp_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_etcp + *snetc = (struct stats_net_etcp *) a->buf[curr], + *snetp = (struct stats_net_etcp *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tatmptf/s", NULL, NULL, + NOVAL, + S_VALUE(snetp->AttemptFails, snetc->AttemptFails, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\testres/s", NULL, NULL, + NOVAL, + S_VALUE(snetp->EstabResets, snetc->EstabResets, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tretrans/s", NULL, NULL, + NOVAL, + S_VALUE(snetp->RetransSegs, snetc->RetransSegs, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tisegerr/s", NULL, NULL, + NOVAL, + S_VALUE(snetp->InErrs, snetc->InErrs, itv)); + + render(isdb, pre, pt_newlin, + "-\torsts/s", NULL, NULL, + NOVAL, + S_VALUE(snetp->OutRsts, snetc->OutRsts, itv)); +} + +/* + *************************************************************************** + * Display UDP network statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_udp_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_udp + *snuc = (struct stats_net_udp *) a->buf[curr], + *snup = (struct stats_net_udp *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tidgm/s", NULL, NULL, + NOVAL, + S_VALUE(snup->InDatagrams, snuc->InDatagrams, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\todgm/s", NULL, NULL, + NOVAL, + S_VALUE(snup->OutDatagrams, snuc->OutDatagrams, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tnoport/s", NULL, NULL, + NOVAL, + S_VALUE(snup->NoPorts, snuc->NoPorts, itv)); + + render(isdb, pre, pt_newlin, + "-\tidgmerr/s", NULL, NULL, + NOVAL, + S_VALUE(snup->InErrors, snuc->InErrors, itv)); +} + +/* + *************************************************************************** + * Display IPv6 network sockets statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_sock6_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_sock6 + *snsc = (struct stats_net_sock6 *) a->buf[curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_USEINT, + "-\ttcp6sck", NULL, NULL, + snsc->tcp6_inuse, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\tudp6sck", NULL, NULL, + snsc->udp6_inuse, DNOVAL); + + render(isdb, pre, PT_USEINT, + "-\traw6sck", NULL, NULL, + snsc->raw6_inuse, DNOVAL); + + render(isdb, pre, PT_USEINT | pt_newlin, + "-\tip6-frag", NULL, NULL, + snsc->frag6_inuse, DNOVAL); +} + +/* + *************************************************************************** + * Display IPv6 network statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_ip6_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_ip6 + *snic = (struct stats_net_ip6 *) a->buf[curr], + *snip = (struct stats_net_ip6 *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tirec6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InReceives6, snic->InReceives6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tfwddgm6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutForwDatagrams6, snic->OutForwDatagrams6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tidel6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InDelivers6, snic->InDelivers6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\torq6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutRequests6, snic->OutRequests6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tasmrq6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->ReasmReqds6, snic->ReasmReqds6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tasmok6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->ReasmOKs6, snic->ReasmOKs6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\timcpck6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InMcastPkts6, snic->InMcastPkts6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tomcpck6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutMcastPkts6, snic->OutMcastPkts6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tfragok6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->FragOKs6, snic->FragOKs6, itv)); + + render(isdb, pre, pt_newlin, + "-\tfragcr6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->FragCreates6, snic->FragCreates6, itv)); +} + +/* + *************************************************************************** + * Display IPv6 network error statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_eip6_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_eip6 + *sneic = (struct stats_net_eip6 *) a->buf[curr], + *sneip = (struct stats_net_eip6 *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tihdrer6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InHdrErrors6, sneic->InHdrErrors6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiadrer6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InAddrErrors6, sneic->InAddrErrors6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiukwnp6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InUnknownProtos6, sneic->InUnknownProtos6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\ti2big6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InTooBigErrors6, sneic->InTooBigErrors6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tidisc6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InDiscards6, sneic->InDiscards6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\todisc6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutDiscards6, sneic->OutDiscards6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tinort6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InNoRoutes6, sneic->InNoRoutes6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tonort6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutNoRoutes6, sneic->OutNoRoutes6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tasmf6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->ReasmFails6, sneic->ReasmFails6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tfragf6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->FragFails6, sneic->FragFails6, itv)); + + render(isdb, pre, pt_newlin, + "-\titrpck6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InTruncatedPkts6, sneic->InTruncatedPkts6, itv)); +} + +/* + *************************************************************************** + * Display ICMPv6 network statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_icmp6_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_icmp6 + *snic = (struct stats_net_icmp6 *) a->buf[curr], + *snip = (struct stats_net_icmp6 *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\timsg6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InMsgs6, snic->InMsgs6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tomsg6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutMsgs6, snic->OutMsgs6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiech6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InEchos6, snic->InEchos6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiechr6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InEchoReplies6, snic->InEchoReplies6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\toechr6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutEchoReplies6, snic->OutEchoReplies6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tigmbq6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InGroupMembQueries6, snic->InGroupMembQueries6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tigmbr6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InGroupMembResponses6, snic->InGroupMembResponses6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\togmbr6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutGroupMembResponses6, snic->OutGroupMembResponses6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tigmbrd6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InGroupMembReductions6, snic->InGroupMembReductions6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\togmbrd6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutGroupMembReductions6, snic->OutGroupMembReductions6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tirtsol6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InRouterSolicits6, snic->InRouterSolicits6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tortsol6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutRouterSolicits6, snic->OutRouterSolicits6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tirtad6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InRouterAdvertisements6, snic->InRouterAdvertisements6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tinbsol6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InNeighborSolicits6, snic->InNeighborSolicits6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tonbsol6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutNeighborSolicits6, snic->OutNeighborSolicits6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tinbad6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->InNeighborAdvertisements6, snic->InNeighborAdvertisements6, itv)); + + render(isdb, pre, pt_newlin, + "-\tonbad6/s", NULL, NULL, + NOVAL, + S_VALUE(snip->OutNeighborAdvertisements6, snic->OutNeighborAdvertisements6, itv)); +} + +/* + *************************************************************************** + * Display ICMPv6 error message statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_eicmp6_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_eicmp6 + *sneic = (struct stats_net_eicmp6 *) a->buf[curr], + *sneip = (struct stats_net_eicmp6 *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tierr6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InErrors6, sneic->InErrors6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tidtunr6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InDestUnreachs6, sneic->InDestUnreachs6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\todtunr6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutDestUnreachs6, sneic->OutDestUnreachs6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\titmex6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InTimeExcds6, sneic->InTimeExcds6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\totmex6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutTimeExcds6, sneic->OutTimeExcds6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiprmpb6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InParmProblems6, sneic->InParmProblems6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\toprmpb6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutParmProblems6, sneic->OutParmProblems6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tiredir6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InRedirects6, sneic->InRedirects6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\toredir6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutRedirects6, sneic->OutRedirects6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tipck2b6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->InPktTooBigs6, sneic->InPktTooBigs6, itv)); + + render(isdb, pre, pt_newlin, + "-\topck2b6/s", NULL, NULL, + NOVAL, + S_VALUE(sneip->OutPktTooBigs6, sneic->OutPktTooBigs6, itv)); +} + +/* + *************************************************************************** + * Display UDP6 network statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_net_udp6_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + struct stats_net_udp6 + *snuc = (struct stats_net_udp6 *) a->buf[curr], + *snup = (struct stats_net_udp6 *) a->buf[!curr]; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + render(isdb, pre, PT_NOFLAG, + "-\tidgm6/s", NULL, NULL, + NOVAL, + S_VALUE(snup->InDatagrams6, snuc->InDatagrams6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\todgm6/s", NULL, NULL, + NOVAL, + S_VALUE(snup->OutDatagrams6, snuc->OutDatagrams6, itv)); + + render(isdb, pre, PT_NOFLAG, + "-\tnoport6/s", NULL, NULL, + NOVAL, + S_VALUE(snup->NoPorts6, snuc->NoPorts6, itv)); + + render(isdb, pre, pt_newlin, + "-\tidgmer6/s", NULL, NULL, + NOVAL, + S_VALUE(snup->InErrors6, snuc->InErrors6, itv)); +} + +/* + *************************************************************************** + * Display CPU frequency statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_pwr_cpufreq_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + int i; + struct stats_pwr_cpufreq *spc; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) { + + spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize); + + /* Should current CPU (including CPU "all") be displayed? */ + if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) { + + if (!i) { + /* This is CPU "all" */ + render(isdb, pre, pt_newlin, + "all\tMHz", + "-1", NULL, + NOVAL, + ((double) spc->cpufreq) / 100); + } + else { + render(isdb, pre, pt_newlin, + "cpu%d\tMHz", + "%d", cons(iv, i - 1, NOVAL), + NOVAL, + ((double) spc->cpufreq) / 100); + } + } + } +} + +/* + *************************************************************************** + * Display fan statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_pwr_fan_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + int i; + struct stats_pwr_fan *spc; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + for (i = 0; i < a->nr; i++) { + spc = (struct stats_pwr_fan *) ((char *) a->buf[curr] + i * a->msize); + + if (isdb) { + render(isdb, pre, PT_USEINT, + "%s\tfan%d\trpm", + "%s", cons(iv, spc->device, i + 1, NOVAL), + i + 1, + NOVAL); + render(isdb, pre, PT_NOFLAG, + "%s\trpm", + NULL, cons(iv, spc->device, NOVAL), + NOVAL, + spc->rpm); + render(isdb, pre, pt_newlin, + "%s\tdrpm", + NULL, cons(iv, spc->device, NOVAL), + NOVAL, + spc->rpm - spc->rpm_min); + } + else { + render(isdb, pre, PT_NOFLAG, + "fan%d\trpm", + "%d", cons(iv, i + 1, NOVAL), + NOVAL, + spc->rpm); + render(isdb, pre, pt_newlin, + "fan%d\tdrpm", + "%d", cons(iv, i + 1, NOVAL), + NOVAL, + spc->rpm - spc->rpm_min); + } + } +} + +/* + *************************************************************************** + * Display temperature statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_pwr_temp_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + int i; + struct stats_pwr_temp *spc; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + for (i = 0; i < a->nr; i++) { + spc = (struct stats_pwr_temp *) ((char *) a->buf[curr] + i * a->msize); + + if (isdb) { + render(isdb, pre, PT_USEINT, + "%s\ttemp%d\tdegC", + "%s", cons(iv, spc->device, i + 1, NOVAL), + i + 1, + NOVAL); + render(isdb, pre, PT_NOFLAG, + "%s\tdegC", + NULL, cons(iv, spc->device, NOVAL), + NOVAL, + spc->temp); + render(isdb, pre, pt_newlin, + "%s\t%%temp", + NULL, cons(iv, spc->device, NOVAL), + NOVAL, + (spc->temp_max - spc->temp_min) ? + (spc->temp - spc->temp_min) / (spc->temp_max - spc->temp_min) * 100 : + 0.0); + + } + else { + render(isdb, pre, PT_NOFLAG, + "temp%d\tdegC", + "%s", cons(iv, i + 1, NOVAL), + NOVAL, + spc->temp); + render(isdb, pre, pt_newlin, + "temp%d\t%%temp", + "%s", cons(iv, i + 1, NOVAL), + NOVAL, + (spc->temp_max - spc->temp_min) ? + (spc->temp - spc->temp_min) / (spc->temp_max - spc->temp_min) * 100 : + 0.0); + } + } +} + +/* + *************************************************************************** + * Display voltage inputs statistics in selected format. + * + * IN: + * @a Activity structure with statistics. + * @isdb Flag, true if db printing, false if ppc printing. + * @pre Prefix string for output entries + * @curr Index in array for current sample statistics. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t render_pwr_in_stats(struct activity *a, int isdb, char *pre, + int curr, unsigned long long itv) +{ + int i; + struct stats_pwr_in *spc; + int pt_newlin + = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN); + + for (i = 0; i < a->nr; i++) { + spc = (struct stats_pwr_in *) ((char *) a->buf[curr] + i * a->msize); + + if (isdb) { + render(isdb, pre, PT_USEINT, + "%s\tin%d\tinV", + "%s", cons(iv, spc->device, i, NOVAL), + i, + NOVAL); + render(isdb, pre, PT_NOFLAG, + "%s\tinV", + NULL, cons(iv, spc->device, NOVAL), + NOVAL, + spc->in); + render(isdb, pre, pt_newlin, + "%s\t%%in", + NULL, cons(iv, spc->device, NOVAL), + NOVAL, + (spc->in_max - spc->in_min) ? + (spc->in - spc->in_min) / (spc->in_max - spc->in_min) * 100 : + 0.0); + + } + else { + render(isdb, pre, PT_NOFLAG, + "in%d\tinV", + "%s", cons(iv, i, NOVAL), + NOVAL, + spc->in); + render(isdb, pre, pt_newlin, + "in%d\t%%in", + "%s", cons(iv, i, NOVAL), + NOVAL, + (spc->in_max - spc->in_min) ? + (spc->in - spc->in_min) / (spc->in_max - spc->in_min) * 100 : + 0.0); + } + } +} + +/* + *************************************************************************** + * Print tabulations + * + * IN: + * @nr_tab Number of tabs to print. + *************************************************************************** + */ +void prtab(int nr_tab) +{ + int i; + + for (i = 0; i < nr_tab; i++) { + printf("\t"); + } +} + +/* + *************************************************************************** + * printf() function modified for XML display + * + * IN: + * @nr_tab Number of tabs to print. + * @fmt printf() format. + *************************************************************************** + */ +void xprintf(int nr_tab, const char *fmt, ...) +{ + static char buf[1024]; + va_list args; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + + prtab(nr_tab); + printf("%s\n", buf); +} + +/* + *************************************************************************** + * Open or close markup. + * + * IN: + * @tab Number of tabulations. + * @action Open or close action. + *************************************************************************** + */ +void xml_markup_network(int tab, int action) +{ + static int markup_state = CLOSE_XML_MARKUP; + + if (action == markup_state) + return; + markup_state = action; + + if (action == OPEN_XML_MARKUP) { + /* Open markup */ + xprintf(tab, ""); + } + else { + /* Close markup */ + xprintf(tab, ""); + } +} + +/* + *************************************************************************** + * Open or close markup. + * + * IN: + * @tab Number of tabulations. + * @action Open or close action. + *************************************************************************** + */ +void xml_markup_power_management(int tab, int action) +{ + static int markup_state = CLOSE_XML_MARKUP; + + if (action == markup_state) + return; + markup_state = action; + + if (action == OPEN_XML_MARKUP) { + /* Open markup */ + xprintf(tab, ""); + } + else { + /* Close markup */ + xprintf(tab, ""); + } +} + +/* + *************************************************************************** + * Display CPU statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @g_itv Interval of time in jiffies mutliplied by the number of + * processors. + *************************************************************************** + */ +__print_funct_t xml_print_cpu_stats(struct activity *a, int curr, int tab, + unsigned long long g_itv) +{ + int i, cpu_offline; + struct stats_cpu *scc, *scp; + char cpuno[8]; + + if (DISPLAY_CPU_DEF(a->opt_flags)) { + xprintf(tab++, ""); + } + else if (DISPLAY_CPU_ALL(a->opt_flags)) { + xprintf(tab++, ""); + } + + for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) { + + scc = (struct stats_cpu *) ((char *) a->buf[curr] + i * a->msize); + scp = (struct stats_cpu *) ((char *) a->buf[!curr] + i * a->msize); + + /* Should current CPU (including CPU "all") be displayed? */ + if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) { + + /* Yes: Display it */ + if (!i) { + /* This is CPU "all" */ + strcpy(cpuno, "all"); + } + else { + sprintf(cpuno, "%d", i - 1); + + /* + * If the CPU is offline then it is omited from /proc/stat: + * All the fields couldn't have been read and the sum of them is zero. + * (Remember that guest time is already included in user mode.) + */ + if ((scc->cpu_user + scc->cpu_nice + scc->cpu_sys + + scc->cpu_iowait + scc->cpu_idle + scc->cpu_steal + + scc->cpu_hardirq + scc->cpu_softirq) == 0) { + /* + * Set current struct fields (which have been set to zero) + * to values from previous iteration. Hence their values won't + * jump from zero when the CPU comes back online. + */ + *scc = *scp; + + g_itv = 0; + cpu_offline = TRUE; + } + else { + /* + * Recalculate interval for current proc. + * If result is 0 then current CPU is a tickless one. + */ + g_itv = get_per_cpu_interval(scc, scp); + cpu_offline = FALSE; + } + + if (!g_itv) { + /* Current CPU is offline or tickless */ + if (DISPLAY_CPU_DEF(a->opt_flags)) { + xprintf(tab, "", + i - 1, 0.0, 0.0, 0.0, 0.0, 0.0, + cpu_offline ? 0.0 : 100.0); + } + else if (DISPLAY_CPU_ALL(a->opt_flags)) { + xprintf(tab, "", + i - 1, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + cpu_offline ? 0.0 : 100.0); + } + continue; + } + } + + if (DISPLAY_CPU_DEF(a->opt_flags)) { + xprintf(tab, "", + cpuno, + ll_sp_value(scp->cpu_user, scc->cpu_user, g_itv), + ll_sp_value(scp->cpu_nice, scc->cpu_nice, g_itv), + ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq, + scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq, + g_itv), + ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv), + ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv), + scc->cpu_idle < scp->cpu_idle ? + 0.0 : + ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv)); + } + else if (DISPLAY_CPU_ALL(a->opt_flags)) { + xprintf(tab, "", + cpuno, + ll_sp_value(scp->cpu_user - scp->cpu_guest, + scc->cpu_user - scc->cpu_guest, g_itv), + ll_sp_value(scp->cpu_nice, scc->cpu_nice, g_itv), + ll_sp_value(scp->cpu_sys, scc->cpu_sys, g_itv), + ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv), + ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv), + ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, g_itv), + ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, g_itv), + ll_sp_value(scp->cpu_guest, scc->cpu_guest, g_itv), + scc->cpu_idle < scp->cpu_idle ? + 0.0 : + ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv)); + } + } + } + + if (DISPLAY_CPU_DEF(a->opt_flags)) { + xprintf(--tab, ""); + } + else if (DISPLAY_CPU_ALL(a->opt_flags)) { + xprintf(--tab, ""); + } +} + +/* + *************************************************************************** + * Display task creation and context switch statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_pcsw_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_pcsw + *spc = (struct stats_pcsw *) a->buf[curr], + *spp = (struct stats_pcsw *) a->buf[!curr]; + + /* proc/s and cswch/s */ + xprintf(tab, "", + S_VALUE(spp->processes, spc->processes, itv), + ll_s_value(spp->context_switch, spc->context_switch, itv)); +} + +/* + *************************************************************************** + * Display interrupts statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_irq_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + int i; + struct stats_irq *sic, *sip; + char irqno[8]; + + xprintf(tab++, ""); + xprintf(tab++, ""); + + for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) { + + sic = (struct stats_irq *) ((char *) a->buf[curr] + i * a->msize); + sip = (struct stats_irq *) ((char *) a->buf[!curr] + i * a->msize); + + /* Should current interrupt (including int "sum") be displayed? */ + if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) { + + /* Yes: Display it */ + if (!i) { + /* This is interrupt "sum" */ + strcpy(irqno, "sum"); + } + else { + sprintf(irqno, "%d", i - 1); + } + + xprintf(tab, "", irqno, + ll_s_value(sip->irq_nr, sic->irq_nr, itv)); + } + } + + xprintf(--tab, ""); + xprintf(--tab, ""); +} + +/* + *************************************************************************** + * Display swapping statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_swap_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_swap + *ssc = (struct stats_swap *) a->buf[curr], + *ssp = (struct stats_swap *) a->buf[!curr]; + + xprintf(tab, "", + S_VALUE(ssp->pswpin, ssc->pswpin, itv), + S_VALUE(ssp->pswpout, ssc->pswpout, itv)); +} + +/* + *************************************************************************** + * Display paging statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_paging_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_paging + *spc = (struct stats_paging *) a->buf[curr], + *spp = (struct stats_paging *) a->buf[!curr]; + + xprintf(tab, "", + S_VALUE(spp->pgpgin, spc->pgpgin, itv), + S_VALUE(spp->pgpgout, spc->pgpgout, itv), + S_VALUE(spp->pgfault, spc->pgfault, itv), + S_VALUE(spp->pgmajfault, spc->pgmajfault, itv), + S_VALUE(spp->pgfree, spc->pgfree, itv), + S_VALUE(spp->pgscan_kswapd, spc->pgscan_kswapd, itv), + S_VALUE(spp->pgscan_direct, spc->pgscan_direct, itv), + S_VALUE(spp->pgsteal, spc->pgsteal, itv), + (spc->pgscan_kswapd + spc->pgscan_direct - + spp->pgscan_kswapd - spp->pgscan_direct) ? + SP_VALUE(spp->pgsteal, spc->pgsteal, + spc->pgscan_kswapd + spc->pgscan_direct - + spp->pgscan_kswapd - spp->pgscan_direct) : 0.0); +} + +/* + *************************************************************************** + * Display I/O and transfer rate statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_io_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_io + *sic = (struct stats_io *) a->buf[curr], + *sip = (struct stats_io *) a->buf[!curr]; + + xprintf(tab, ""); + + xprintf(++tab, "%.2f", + S_VALUE(sip->dk_drive, sic->dk_drive, itv)); + + xprintf(tab, "", + S_VALUE(sip->dk_drive_rio, sic->dk_drive_rio, itv), + S_VALUE(sip->dk_drive_rblk, sic->dk_drive_rblk, itv)); + + xprintf(tab, "", + S_VALUE(sip->dk_drive_wio, sic->dk_drive_wio, itv), + S_VALUE(sip->dk_drive_wblk, sic->dk_drive_wblk, itv)); + + xprintf(--tab, ""); +} + +/* + *************************************************************************** + * Display memory statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_memory_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_memory + *smc = (struct stats_memory *) a->buf[curr], + *smp = (struct stats_memory *) a->buf[!curr]; + + xprintf(tab, ""); + + if (DISPLAY_MEM_AMT(a->opt_flags)) { + + xprintf(++tab, "%lu", + smc->frmkb); + + xprintf(tab, "%lu", + smc->tlmkb - smc->frmkb); + + xprintf(tab, "%.2f", + smc->tlmkb ? + SP_VALUE(smc->frmkb, smc->tlmkb, smc->tlmkb) : + 0.0); + + xprintf(tab, "%lu", + smc->bufkb); + + xprintf(tab, "%lu", + smc->camkb); + + xprintf(tab, "%lu", + smc->comkb); + + xprintf(tab--, "%.2f", + (smc->tlmkb + smc->tlskb) ? + SP_VALUE(0, smc->comkb, smc->tlmkb + smc->tlskb) : + 0.0); + } + + if (DISPLAY_SWAP(a->opt_flags)) { + + xprintf(++tab, "%lu", + smc->frskb); + + xprintf(tab, "%lu", + smc->tlskb - smc->frskb); + + xprintf(tab, "%.2f", + smc->tlskb ? + SP_VALUE(smc->frskb, smc->tlskb, smc->tlskb) : + 0.0); + + xprintf(tab, "%lu", + smc->caskb); + + xprintf(tab--, "%.2f", + (smc->tlskb - smc->frskb) ? + SP_VALUE(0, smc->caskb, smc->tlskb - smc->frskb) : + 0.0); + } + + if (DISPLAY_MEMORY(a->opt_flags)) { + + xprintf(++tab, "%.2f", + S_VALUE((double) KB_TO_PG(smp->frmkb), + (double) KB_TO_PG(smc->frmkb), itv)); + + xprintf(tab, "%.2f", + S_VALUE((double) KB_TO_PG(smp->bufkb), + (double) KB_TO_PG(smc->bufkb), itv)); + + xprintf(tab--, "%.2f", + S_VALUE((double) KB_TO_PG(smp->camkb), + (double) KB_TO_PG(smc->camkb), itv)); + } + + xprintf(tab, ""); +} + +/* + *************************************************************************** + * Display kernel tables statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_ktables_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_ktables + *skc = (struct stats_ktables *) a->buf[curr]; + + xprintf(tab, "", + skc->dentry_stat, + skc->file_used, + skc->inode_used, + skc->pty_nr); +} + +/* + *************************************************************************** + * Display queue and load statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_queue_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_queue + *sqc = (struct stats_queue *) a->buf[curr]; + + xprintf(tab, "", + sqc->nr_running, + sqc->nr_threads, + (double) sqc->load_avg_1 / 100, + (double) sqc->load_avg_5 / 100, + (double) sqc->load_avg_15 / 100); +} + +/* + *************************************************************************** + * Display serial lines statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_serial_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + int i; + struct stats_serial *ssc, *ssp; + + xprintf(tab, ""); + tab++; + + for (i = 0; i < a->nr; i++) { + + ssc = (struct stats_serial *) ((char *) a->buf[curr] + i * a->msize); + ssp = (struct stats_serial *) ((char *) a->buf[!curr] + i * a->msize); + + if (ssc->line == 0) + continue; + + if (ssc->line == ssp->line) { + + xprintf(tab, "", + ssc->line - 1, + S_VALUE(ssp->rx, ssc->rx, itv), + S_VALUE(ssp->tx, ssc->tx, itv), + S_VALUE(ssp->frame, ssc->frame, itv), + S_VALUE(ssp->parity, ssc->parity, itv), + S_VALUE(ssp->brk, ssc->brk, itv), + S_VALUE(ssp->overrun, ssc->overrun, itv)); + } + } + + xprintf(--tab, ""); +} + +/* + *************************************************************************** + * Display disks statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_disk_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + int i, j; + struct stats_disk *sdc, *sdp; + struct ext_disk_stats xds; + char *dev_name; + + xprintf(tab, ""); + tab++; + + for (i = 0; i < a->nr; i++) { + + sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize); + + if (!(sdc->major + sdc->minor)) + continue; + + j = check_disk_reg(a, curr, !curr, i); + sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize); + + /* Compute extended statistics values */ + compute_ext_disk_stats(sdc, sdp, itv, &xds); + + dev_name = NULL; + + if ((USE_PRETTY_OPTION(flags)) && (sdc->major == DEVMAP_MAJOR)) { + dev_name = transform_devmapname(sdc->major, sdc->minor); + } + + if (!dev_name) { + dev_name = get_devname(sdc->major, sdc->minor, + USE_PRETTY_OPTION(flags)); + } + + xprintf(tab, "", + /* Confusion possible here between index and minor numbers */ + dev_name, + S_VALUE(sdp->nr_ios, sdc->nr_ios, itv), + ll_s_value(sdp->rd_sect, sdc->rd_sect, itv), + ll_s_value(sdp->wr_sect, sdc->wr_sect, itv), + /* See iostat for explanations */ + xds.arqsz, + S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0, + xds.await, + xds.svctm, + xds.util / 10.0); + } + + xprintf(--tab, ""); +} + +/* + *************************************************************************** + * Display network interfaces statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_dev_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + int i, j; + struct stats_net_dev *sndc, *sndp; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + for (i = 0; i < a->nr; i++) { + + sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize); + + if (!strcmp(sndc->interface, "")) + continue; + + j = check_net_dev_reg(a, curr, !curr, i); + sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize); + + xprintf(tab, "", + sndc->interface, + S_VALUE(sndp->rx_packets, sndc->rx_packets, itv), + S_VALUE(sndp->tx_packets, sndc->tx_packets, itv), + S_VALUE(sndp->rx_bytes, sndc->rx_bytes, itv) / 1024, + S_VALUE(sndp->tx_bytes, sndc->tx_bytes, itv) / 1024, + S_VALUE(sndp->rx_compressed, sndc->rx_compressed, itv), + S_VALUE(sndp->tx_compressed, sndc->tx_compressed, itv), + S_VALUE(sndp->multicast, sndc->multicast, itv)); + } + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display network interfaces error statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_edev_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + int i, j; + struct stats_net_edev *snedc, *snedp; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + for (i = 0; i < a->nr; i++) { + + snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize); + + if (!strcmp(snedc->interface, "")) + continue; + + j = check_net_edev_reg(a, curr, !curr, i); + snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize); + + xprintf(tab, "", + snedc->interface, + S_VALUE(snedp->rx_errors, snedc->rx_errors, itv), + S_VALUE(snedp->tx_errors, snedc->tx_errors, itv), + S_VALUE(snedp->collisions, snedc->collisions, itv), + S_VALUE(snedp->rx_dropped, snedc->rx_dropped, itv), + S_VALUE(snedp->tx_dropped, snedc->tx_dropped, itv), + S_VALUE(snedp->tx_carrier_errors, snedc->tx_carrier_errors, itv), + S_VALUE(snedp->rx_frame_errors, snedc->rx_frame_errors, itv), + S_VALUE(snedp->rx_fifo_errors, snedc->rx_fifo_errors, itv), + S_VALUE(snedp->tx_fifo_errors, snedc->tx_fifo_errors, itv)); + } + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display NFS client statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_nfs_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_nfs + *snnc = (struct stats_net_nfs *) a->buf[curr], + *snnp = (struct stats_net_nfs *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(snnp->nfs_rpccnt, snnc->nfs_rpccnt, itv), + S_VALUE(snnp->nfs_rpcretrans, snnc->nfs_rpcretrans, itv), + S_VALUE(snnp->nfs_readcnt, snnc->nfs_readcnt, itv), + S_VALUE(snnp->nfs_writecnt, snnc->nfs_writecnt, itv), + S_VALUE(snnp->nfs_accesscnt, snnc->nfs_accesscnt, itv), + S_VALUE(snnp->nfs_getattcnt, snnc->nfs_getattcnt, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display NFS server statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_nfsd_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_nfsd + *snndc = (struct stats_net_nfsd *) a->buf[curr], + *snndp = (struct stats_net_nfsd *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(snndp->nfsd_rpccnt, snndc->nfsd_rpccnt, itv), + S_VALUE(snndp->nfsd_rpcbad, snndc->nfsd_rpcbad, itv), + S_VALUE(snndp->nfsd_netcnt, snndc->nfsd_netcnt, itv), + S_VALUE(snndp->nfsd_netudpcnt, snndc->nfsd_netudpcnt, itv), + S_VALUE(snndp->nfsd_nettcpcnt, snndc->nfsd_nettcpcnt, itv), + S_VALUE(snndp->nfsd_rchits, snndc->nfsd_rchits, itv), + S_VALUE(snndp->nfsd_rcmisses, snndc->nfsd_rcmisses, itv), + S_VALUE(snndp->nfsd_readcnt, snndc->nfsd_readcnt, itv), + S_VALUE(snndp->nfsd_writecnt, snndc->nfsd_writecnt, itv), + S_VALUE(snndp->nfsd_accesscnt, snndc->nfsd_accesscnt, itv), + S_VALUE(snndp->nfsd_getattcnt, snndc->nfsd_getattcnt, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display network socket statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_sock_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_sock + *snsc = (struct stats_net_sock *) a->buf[curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + snsc->sock_inuse, + snsc->tcp_inuse, + snsc->udp_inuse, + snsc->raw_inuse, + snsc->frag_inuse, + snsc->tcp_tw); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display IP network statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_ip_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_ip + *snic = (struct stats_net_ip *) a->buf[curr], + *snip = (struct stats_net_ip *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(snip->InReceives, snic->InReceives, itv), + S_VALUE(snip->ForwDatagrams, snic->ForwDatagrams, itv), + S_VALUE(snip->InDelivers, snic->InDelivers, itv), + S_VALUE(snip->OutRequests, snic->OutRequests, itv), + S_VALUE(snip->ReasmReqds, snic->ReasmReqds, itv), + S_VALUE(snip->ReasmOKs, snic->ReasmOKs, itv), + S_VALUE(snip->FragOKs, snic->FragOKs, itv), + S_VALUE(snip->FragCreates, snic->FragCreates, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display IP network error statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_eip_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_eip + *sneic = (struct stats_net_eip *) a->buf[curr], + *sneip = (struct stats_net_eip *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(sneip->InHdrErrors, sneic->InHdrErrors, itv), + S_VALUE(sneip->InAddrErrors, sneic->InAddrErrors, itv), + S_VALUE(sneip->InUnknownProtos, sneic->InUnknownProtos, itv), + S_VALUE(sneip->InDiscards, sneic->InDiscards, itv), + S_VALUE(sneip->OutDiscards, sneic->OutDiscards, itv), + S_VALUE(sneip->OutNoRoutes, sneic->OutNoRoutes, itv), + S_VALUE(sneip->ReasmFails, sneic->ReasmFails, itv), + S_VALUE(sneip->FragFails, sneic->FragFails, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display ICMP network statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_icmp_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_icmp + *snic = (struct stats_net_icmp *) a->buf[curr], + *snip = (struct stats_net_icmp *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(snip->InMsgs, snic->InMsgs, itv), + S_VALUE(snip->OutMsgs, snic->OutMsgs, itv), + S_VALUE(snip->InEchos, snic->InEchos, itv), + S_VALUE(snip->InEchoReps, snic->InEchoReps, itv), + S_VALUE(snip->OutEchos, snic->OutEchos, itv), + S_VALUE(snip->OutEchoReps, snic->OutEchoReps, itv), + S_VALUE(snip->InTimestamps, snic->InTimestamps, itv), + S_VALUE(snip->InTimestampReps, snic->InTimestampReps, itv), + S_VALUE(snip->OutTimestamps, snic->OutTimestamps, itv), + S_VALUE(snip->OutTimestampReps, snic->OutTimestampReps, itv), + S_VALUE(snip->InAddrMasks, snic->InAddrMasks, itv), + S_VALUE(snip->InAddrMaskReps, snic->InAddrMaskReps, itv), + S_VALUE(snip->OutAddrMasks, snic->OutAddrMasks, itv), + S_VALUE(snip->OutAddrMaskReps, snic->OutAddrMaskReps, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display ICMP error message statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_eicmp_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_eicmp + *sneic = (struct stats_net_eicmp *) a->buf[curr], + *sneip = (struct stats_net_eicmp *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(sneip->InErrors, sneic->InErrors, itv), + S_VALUE(sneip->OutErrors, sneic->OutErrors, itv), + S_VALUE(sneip->InDestUnreachs, sneic->InDestUnreachs, itv), + S_VALUE(sneip->OutDestUnreachs, sneic->OutDestUnreachs, itv), + S_VALUE(sneip->InTimeExcds, sneic->InTimeExcds, itv), + S_VALUE(sneip->OutTimeExcds, sneic->OutTimeExcds, itv), + S_VALUE(sneip->InParmProbs, sneic->InParmProbs, itv), + S_VALUE(sneip->OutParmProbs, sneic->OutParmProbs, itv), + S_VALUE(sneip->InSrcQuenchs, sneic->InSrcQuenchs, itv), + S_VALUE(sneip->OutSrcQuenchs, sneic->OutSrcQuenchs, itv), + S_VALUE(sneip->InRedirects, sneic->InRedirects, itv), + S_VALUE(sneip->OutRedirects, sneic->OutRedirects, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display TCP network statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_tcp_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_tcp + *sntc = (struct stats_net_tcp *) a->buf[curr], + *sntp = (struct stats_net_tcp *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(sntp->ActiveOpens, sntc->ActiveOpens, itv), + S_VALUE(sntp->PassiveOpens, sntc->PassiveOpens, itv), + S_VALUE(sntp->InSegs, sntc->InSegs, itv), + S_VALUE(sntp->OutSegs, sntc->OutSegs, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display TCP network error statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_etcp_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_etcp + *snetc = (struct stats_net_etcp *) a->buf[curr], + *snetp = (struct stats_net_etcp *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(snetp->AttemptFails, snetc->AttemptFails, itv), + S_VALUE(snetp->EstabResets, snetc->EstabResets, itv), + S_VALUE(snetp->RetransSegs, snetc->RetransSegs, itv), + S_VALUE(snetp->InErrs, snetc->InErrs, itv), + S_VALUE(snetp->OutRsts, snetc->OutRsts, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display UDP network statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_udp_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_udp + *snuc = (struct stats_net_udp *) a->buf[curr], + *snup = (struct stats_net_udp *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(snup->InDatagrams, snuc->InDatagrams, itv), + S_VALUE(snup->OutDatagrams, snuc->OutDatagrams, itv), + S_VALUE(snup->NoPorts, snuc->NoPorts, itv), + S_VALUE(snup->InErrors, snuc->InErrors, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display IPv6 network socket statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_sock6_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_sock6 + *snsc = (struct stats_net_sock6 *) a->buf[curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + snsc->tcp6_inuse, + snsc->udp6_inuse, + snsc->raw6_inuse, + snsc->frag6_inuse); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display IPv6 network statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_ip6_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_ip6 + *snic = (struct stats_net_ip6 *) a->buf[curr], + *snip = (struct stats_net_ip6 *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(snip->InReceives6, snic->InReceives6, itv), + S_VALUE(snip->OutForwDatagrams6, snic->OutForwDatagrams6, itv), + S_VALUE(snip->InDelivers6, snic->InDelivers6, itv), + S_VALUE(snip->OutRequests6, snic->OutRequests6, itv), + S_VALUE(snip->ReasmReqds6, snic->ReasmReqds6, itv), + S_VALUE(snip->ReasmOKs6, snic->ReasmOKs6, itv), + S_VALUE(snip->InMcastPkts6, snic->InMcastPkts6, itv), + S_VALUE(snip->OutMcastPkts6, snic->OutMcastPkts6, itv), + S_VALUE(snip->FragOKs6, snic->FragOKs6, itv), + S_VALUE(snip->FragCreates6, snic->FragCreates6, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display IPv6 network error statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_eip6_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_eip6 + *sneic = (struct stats_net_eip6 *) a->buf[curr], + *sneip = (struct stats_net_eip6 *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(sneip->InHdrErrors6, sneic->InHdrErrors6, itv), + S_VALUE(sneip->InAddrErrors6, sneic->InAddrErrors6, itv), + S_VALUE(sneip->InUnknownProtos6, sneic->InUnknownProtos6, itv), + S_VALUE(sneip->InTooBigErrors6, sneic->InTooBigErrors6, itv), + S_VALUE(sneip->InDiscards6, sneic->InDiscards6, itv), + S_VALUE(sneip->OutDiscards6, sneic->OutDiscards6, itv), + S_VALUE(sneip->InNoRoutes6, sneic->InNoRoutes6, itv), + S_VALUE(sneip->OutNoRoutes6, sneic->OutNoRoutes6, itv), + S_VALUE(sneip->ReasmFails6, sneic->ReasmFails6, itv), + S_VALUE(sneip->FragFails6, sneic->FragFails6, itv), + S_VALUE(sneip->InTruncatedPkts6, sneic->InTruncatedPkts6, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display ICMPv6 network statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_icmp6_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_icmp6 + *snic = (struct stats_net_icmp6 *) a->buf[curr], + *snip = (struct stats_net_icmp6 *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(snip->InMsgs6, snic->InMsgs6, itv), + S_VALUE(snip->OutMsgs6, snic->OutMsgs6, itv), + S_VALUE(snip->InEchos6, snic->InEchos6, itv), + S_VALUE(snip->InEchoReplies6, snic->InEchoReplies6, itv), + S_VALUE(snip->OutEchoReplies6, snic->OutEchoReplies6, itv), + S_VALUE(snip->InGroupMembQueries6, snic->InGroupMembQueries6, itv), + S_VALUE(snip->InGroupMembResponses6, snic->InGroupMembResponses6, itv), + S_VALUE(snip->OutGroupMembResponses6, snic->OutGroupMembResponses6, itv), + S_VALUE(snip->InGroupMembReductions6, snic->InGroupMembReductions6, itv), + S_VALUE(snip->OutGroupMembReductions6, snic->OutGroupMembReductions6, itv), + S_VALUE(snip->InRouterSolicits6, snic->InRouterSolicits6, itv), + S_VALUE(snip->OutRouterSolicits6, snic->OutRouterSolicits6, itv), + S_VALUE(snip->InRouterAdvertisements6, snic->InRouterAdvertisements6, itv), + S_VALUE(snip->InNeighborSolicits6, snic->InNeighborSolicits6, itv), + S_VALUE(snip->OutNeighborSolicits6, snic->OutNeighborSolicits6, itv), + S_VALUE(snip->InNeighborAdvertisements6, snic->InNeighborAdvertisements6, itv), + S_VALUE(snip->OutNeighborAdvertisements6, snic->OutNeighborAdvertisements6, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display ICMPv6 error message statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_eicmp6_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_eicmp6 + *sneic = (struct stats_net_eicmp6 *) a->buf[curr], + *sneip = (struct stats_net_eicmp6 *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(sneip->InErrors6, sneic->InErrors6, itv), + S_VALUE(sneip->InDestUnreachs6, sneic->InDestUnreachs6, itv), + S_VALUE(sneip->OutDestUnreachs6, sneic->OutDestUnreachs6, itv), + S_VALUE(sneip->InTimeExcds6, sneic->InTimeExcds6, itv), + S_VALUE(sneip->OutTimeExcds6, sneic->OutTimeExcds6, itv), + S_VALUE(sneip->InParmProblems6, sneic->InParmProblems6, itv), + S_VALUE(sneip->OutParmProblems6, sneic->OutParmProblems6, itv), + S_VALUE(sneip->InRedirects6, sneic->InRedirects6, itv), + S_VALUE(sneip->OutRedirects6, sneic->OutRedirects6, itv), + S_VALUE(sneip->InPktTooBigs6, sneic->InPktTooBigs6, itv), + S_VALUE(sneip->OutPktTooBigs6, sneic->OutPktTooBigs6, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display UDPv6 network statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_net_udp6_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + struct stats_net_udp6 + *snuc = (struct stats_net_udp6 *) a->buf[curr], + *snup = (struct stats_net_udp6 *) a->buf[!curr]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_network(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab, "", + S_VALUE(snup->InDatagrams6, snuc->InDatagrams6, itv), + S_VALUE(snup->OutDatagrams6, snuc->OutDatagrams6, itv), + S_VALUE(snup->NoPorts6, snuc->NoPorts6, itv), + S_VALUE(snup->InErrors6, snuc->InErrors6, itv)); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_network(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display CPU frequency statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_pwr_cpufreq_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + int i; + struct stats_pwr_cpufreq *spc; + char cpuno[8]; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_power_management(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab++, ""); + + for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) { + + spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize); + + /* Should current CPU (including CPU "all") be displayed? */ + if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) { + + /* Yes: Display it */ + if (!i) { + /* This is CPU "all" */ + strcpy(cpuno, "all"); + } + else { + sprintf(cpuno, "%d", i - 1); + } + + xprintf(tab, "", + cpuno, + ((double) spc->cpufreq) / 100); + } + } + + xprintf(--tab, ""); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_power_management(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display fan statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_pwr_fan_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + int i; + struct stats_pwr_fan *spc; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_power_management(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab++, ""); + + for (i = 0; i < a->nr; i++) { + spc = (struct stats_pwr_fan *) ((char *) a->buf[curr] + i * a->msize); + + xprintf(tab, "", + i + 1, + (unsigned long long) spc->rpm, + (unsigned long long) (spc->rpm - spc->rpm_min), + spc->device); + } + + xprintf(--tab, ""); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_power_management(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display temperature statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_pwr_temp_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + int i; + struct stats_pwr_temp *spc; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_power_management(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab++, ""); + + for (i = 0; i < a->nr; i++) { + spc = (struct stats_pwr_temp *) ((char *) a->buf[curr] + i * a->msize); + + xprintf(tab, "", + i + 1, + spc->temp, + (spc->temp_max - spc->temp_min) ? + (spc->temp - spc->temp_min) / (spc->temp_max - spc->temp_min) * 100 : + 0.0, + spc->device); + } + + xprintf(--tab, ""); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_power_management(tab, CLOSE_XML_MARKUP); + } +} + +/* + *************************************************************************** + * Display voltage inputs statistics in XML. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @tab Indentation in XML output. + * @itv Interval of time in jiffies. + *************************************************************************** + */ +__print_funct_t xml_print_pwr_in_stats(struct activity *a, int curr, int tab, + unsigned long long itv) +{ + int i; + struct stats_pwr_in *spc; + + if (!IS_SELECTED(a->options) || (a->nr <= 0)) + goto close_xml_markup; + + xml_markup_power_management(tab, OPEN_XML_MARKUP); + tab++; + + xprintf(tab++, ""); + + for (i = 0; i < a->nr; i++) { + spc = (struct stats_pwr_in *) ((char *) a->buf[curr] + i * a->msize); + + xprintf(tab, "", + i, + spc->in, + (spc->in_max - spc->in_min) ? + (spc->in - spc->in_min) / (spc->in_max - spc->in_min) * 100 : + 0.0, + spc->device); + } + + xprintf(--tab, ""); + tab--; + +close_xml_markup: + if (CLOSE_MARKUP(a->options)) { + xml_markup_power_management(tab, CLOSE_XML_MARKUP); + } +} diff --git a/prf_stats.h b/prf_stats.h new file mode 100644 index 00000000..a24818ff --- /dev/null +++ b/prf_stats.h @@ -0,0 +1,183 @@ +/* + * pr_stats.h: Include file used to display system statistics + * (C) 1999-2010 by Sebastien Godard (sysstat orange.fr) + */ + +#ifndef _PRF_STATS_H +#define _PRF_STATS_H + +#include "common.h" + +/* + *************************************************************************** + * Definitions for functions used by sadf. + *************************************************************************** + */ + +#define PT_NOFLAG 0x0000 /* Prevent undescribed '0' in render calls */ +#define PT_USEINT 0x0001 /* Use the integer final arg, not double */ +#define PT_NEWLIN 0x0002 /* Terminate the current output line */ + +#define NOVAL 0 /* For placeholder zeros */ +#define DNOVAL 0.0 /* Wilma! */ + +/* + * Conses are used to type independent passing + * of variable optional data into our rendering routine. + */ + +typedef enum e_tcons {iv, sv} tcons; /* Types of conses */ + +typedef struct { + tcons t; /* Type in {iv,sv} */ + union { + unsigned long int i; + char *s; + } a, b; /* Value pair, either ints or char *s */ +} Cons; + +/* + *************************************************************************** + * Prototypes for functions used to display system statistics + *************************************************************************** + */ + +/* Functions used to display statistics in the format selected by sadf */ +extern __print_funct_t render_pcsw_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_cpu_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_irq_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_swap_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_paging_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_io_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_memory_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_ktables_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_queue_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_serial_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_disk_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_dev_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_edev_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_nfs_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_nfsd_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_sock_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_ip_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_eip_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_icmp_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_eicmp_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_tcp_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_etcp_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_udp_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_sock6_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_ip6_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_eip6_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_icmp6_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_eicmp6_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_net_udp6_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_pwr_cpufreq_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_pwr_fan_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_pwr_temp_stats + (struct activity *, int, char *, int, unsigned long long); +extern __print_funct_t render_pwr_in_stats + (struct activity *, int, char *, int, unsigned long long); + +/* Functions used to display statistics in XML */ +extern void xprintf + (int, const char *, ...); +extern __print_funct_t xml_print_cpu_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_pcsw_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_irq_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_swap_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_paging_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_io_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_memory_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_ktables_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_queue_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_serial_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_disk_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_dev_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_edev_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_nfs_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_nfsd_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_sock_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_ip_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_eip_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_icmp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_eicmp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_tcp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_etcp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_udp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_sock6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_ip6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_eip6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_icmp6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_eicmp6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_net_udp6_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_pwr_cpufreq_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_pwr_fan_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_pwr_temp_stats + (struct activity *, int, int, unsigned long long); +extern __print_funct_t xml_print_pwr_in_stats + (struct activity *, int, int, unsigned long long); + +#endif /* _PRF_STATS_H */ diff --git a/rd_stats.c b/rd_stats.c new file mode 100644 index 00000000..f84c14da --- /dev/null +++ b/rd_stats.c @@ -0,0 +1,2237 @@ +/* + * rd_stats.c: Read system statistics + * (C) 1999-2010 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "rd_stats.h" +#include "ioconf.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +#ifdef HAVE_SENSORS +#include "sensors/sensors.h" +#endif + +/* + *************************************************************************** + * Read CPU statistics and machine uptime. + * + * IN: + * @st_cpu Structure where stats will be saved. + * @nbr Total number of CPU (including cpu "all"). + * + * OUT: + * @st_cpu Structure with statistics. + * @uptime Machine uptime multiplied by the number of processors. + * @uptime0 Machine uptime. Filled only if previously set to zero. + *************************************************************************** + */ +void read_stat_cpu(struct stats_cpu *st_cpu, int nbr, + unsigned long long *uptime, unsigned long long *uptime0) +{ + FILE *fp; + struct stats_cpu *st_cpu_i; + struct stats_cpu sc; + char line[8192]; + int proc_nb; + + if ((fp = fopen(STAT, "r")) == NULL) { + fprintf(stderr, _("Cannot open %s: %s\n"), STAT, strerror(errno)); + exit(2); + } + + while (fgets(line, 8192, fp) != NULL) { + + if (!strncmp(line, "cpu ", 4)) { + + /* + * All the fields don't necessarily exist, + * depending on the kernel version used. + */ + memset(st_cpu, 0, STATS_CPU_SIZE); + + /* + * Read the number of jiffies spent in the different modes + * (user, nice, etc.) among all proc. CPU usage is not reduced + * to one processor to avoid rounding problems. + */ + sscanf(line + 5, "%llu %llu %llu %llu %llu %llu %llu %llu %llu", + &st_cpu->cpu_user, + &st_cpu->cpu_nice, + &st_cpu->cpu_sys, + &st_cpu->cpu_idle, + &st_cpu->cpu_iowait, + &st_cpu->cpu_hardirq, + &st_cpu->cpu_softirq, + &st_cpu->cpu_steal, + &st_cpu->cpu_guest); + + /* + * Compute the uptime of the system in jiffies (1/100ths of a second + * if HZ=100). + * Machine uptime is multiplied by the number of processors here. + * + * NB: Don't add cpu_guest because cpu_user already includes it. + */ + *uptime = st_cpu->cpu_user + st_cpu->cpu_nice + + st_cpu->cpu_sys + st_cpu->cpu_idle + + st_cpu->cpu_iowait + st_cpu->cpu_hardirq + + st_cpu->cpu_steal + st_cpu->cpu_softirq; + } + + else if (!strncmp(line, "cpu", 3)) { + if (nbr > 1) { + /* All the fields don't necessarily exist */ + memset(&sc, 0, STATS_CPU_SIZE); + /* + * Read the number of jiffies spent in the different modes + * (user, nice, etc) for current proc. + * This is done only on SMP machines. + */ + sscanf(line + 3, "%d %llu %llu %llu %llu %llu %llu %llu %llu %llu", + &proc_nb, + &sc.cpu_user, + &sc.cpu_nice, + &sc.cpu_sys, + &sc.cpu_idle, + &sc.cpu_iowait, + &sc.cpu_hardirq, + &sc.cpu_softirq, + &sc.cpu_steal, + &sc.cpu_guest); + + if (proc_nb < (nbr - 1)) { + st_cpu_i = st_cpu + proc_nb + 1; + *st_cpu_i = sc; + } + /* + * else additional CPUs have been dynamically registered + * in /proc/stat. + */ + + if (!proc_nb && !*uptime0) { + /* + * Compute uptime reduced to one proc using proc#0. + * Done if /proc/uptime was unavailable. + * + * NB: Don't add cpu_guest because cpu_user already + * includes it. + */ + *uptime0 = sc.cpu_user + sc.cpu_nice + + sc.cpu_sys + sc.cpu_idle + + sc.cpu_iowait + sc.cpu_steal + + sc.cpu_hardirq + sc.cpu_softirq; + } + } + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read processes (tasks) creation and context switches statistics from + * /proc/stat + * + * IN: + * @st_pcsw Structure where stats will be saved. + * + * OUT: + * @st_pcsw Structure with statistics. + *************************************************************************** + */ +void read_stat_pcsw(struct stats_pcsw *st_pcsw) +{ + FILE *fp; + char line[8192]; + + if ((fp = fopen(STAT, "r")) == NULL) + return; + + while (fgets(line, 8192, fp) != NULL) { + + if (!strncmp(line, "ctxt ", 5)) { + /* Read number of context switches */ + sscanf(line + 5, "%llu", &st_pcsw->context_switch); + } + + else if (!strncmp(line, "processes ", 10)) { + /* Read number of processes created since system boot */ + sscanf(line + 10, "%lu", &st_pcsw->processes); + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read interrupts statistics from /proc/stat. + * + * IN: + * @st_irq Structure where stats will be saved. + * @nbr Number of interrupts to read, including the total number + * of interrupts. + * + * OUT: + * @st_irq Structure with statistics. + *************************************************************************** + */ +void read_stat_irq(struct stats_irq *st_irq, int nbr) +{ + FILE *fp; + struct stats_irq *st_irq_i; + char line[8192]; + int i, pos; + + if ((fp = fopen(STAT, "r")) == NULL) + return; + + while (fgets(line, 8192, fp) != NULL) { + + if (!strncmp(line, "intr ", 5)) { + /* Read total number of interrupts received since system boot */ + sscanf(line + 5, "%llu", &st_irq->irq_nr); + pos = strcspn(line + 5, " ") + 5; + + for (i = 1; i < nbr; i++) { + st_irq_i = st_irq + i; + sscanf(line + pos, " %llu", &st_irq_i->irq_nr); + pos += strcspn(line + pos + 1, " ") + 1; + } + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read queue and load statistics from /proc/loadavg. + * + * IN: + * @st_queue Structure where stats will be saved. + * + * OUT: + * @st_queue Structure with statistics. + *************************************************************************** + */ +void read_loadavg(struct stats_queue *st_queue) +{ + FILE *fp; + int load_tmp[3]; + + if ((fp = fopen(LOADAVG, "r")) == NULL) + return; + + /* Read load averages and queue length */ + fscanf(fp, "%d.%d %d.%d %d.%d %ld/%d %*d\n", + &load_tmp[0], &st_queue->load_avg_1, + &load_tmp[1], &st_queue->load_avg_5, + &load_tmp[2], &st_queue->load_avg_15, + &st_queue->nr_running, + &st_queue->nr_threads); + + fclose(fp); + + st_queue->load_avg_1 += load_tmp[0] * 100; + st_queue->load_avg_5 += load_tmp[1] * 100; + st_queue->load_avg_15 += load_tmp[2] * 100; + + if (st_queue->nr_running) { + /* Do not take current process into account */ + st_queue->nr_running--; + } +} + +/* + *************************************************************************** + * Read memory statistics from /proc/meminfo. + * + * IN: + * @st_memory Structure where stats will be saved. + * + * OUT: + * @st_memory Structure with statistics. + *************************************************************************** + */ +void read_meminfo(struct stats_memory *st_memory) +{ + FILE *fp; + char line[128]; + + if ((fp = fopen(MEMINFO, "r")) == NULL) + return; + + while (fgets(line, 128, fp) != NULL) { + + if (!strncmp(line, "MemTotal:", 9)) { + /* Read the total amount of memory in kB */ + sscanf(line + 9, "%lu", &st_memory->tlmkb); + } + else if (!strncmp(line, "MemFree:", 8)) { + /* Read the amount of free memory in kB */ + sscanf(line + 8, "%lu", &st_memory->frmkb); + } + else if (!strncmp(line, "Buffers:", 8)) { + /* Read the amount of buffered memory in kB */ + sscanf(line + 8, "%lu", &st_memory->bufkb); + } + else if (!strncmp(line, "Cached:", 7)) { + /* Read the amount of cached memory in kB */ + sscanf(line + 7, "%lu", &st_memory->camkb); + } + else if (!strncmp(line, "SwapCached:", 11)) { + /* Read the amount of cached swap in kB */ + sscanf(line + 11, "%lu", &st_memory->caskb); + } + else if (!strncmp(line, "SwapTotal:", 10)) { + /* Read the total amount of swap memory in kB */ + sscanf(line + 10, "%lu", &st_memory->tlskb); + } + else if (!strncmp(line, "SwapFree:", 9)) { + /* Read the amount of free swap memory in kB */ + sscanf(line + 9, "%lu", &st_memory->frskb); + } + else if (!strncmp(line, "Committed_AS:", 13)) { + /* Read the amount of commited memory in kB */ + sscanf(line + 13, "%lu", &st_memory->comkb); + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read swapping statistics from /proc/vmstat. + * + * IN: + * @st_swap Structure where stats will be saved. + * + * OUT: + * @st_swap Structure with statistics. + *************************************************************************** + */ +void read_vmstat_swap(struct stats_swap *st_swap) +{ + FILE *fp; + char line[128]; + + if ((fp = fopen(VMSTAT, "r")) == NULL) + return; + + while (fgets(line, 128, fp) != NULL) { + + if (!strncmp(line, "pswpin ", 7)) { + /* Read number of swap pages brought in */ + sscanf(line + 7, "%lu", &st_swap->pswpin); + } + else if (!strncmp(line, "pswpout ", 8)) { + /* Read number of swap pages brought out */ + sscanf(line + 8, "%lu", &st_swap->pswpout); + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read paging statistics from /proc/vmstat. + * + * IN: + * @st_paging Structure where stats will be saved. + * + * OUT: + * @st_paging Structure with statistics. + *************************************************************************** + */ +void read_vmstat_paging(struct stats_paging *st_paging) +{ + FILE *fp; + char line[128]; + unsigned long pgtmp; + + if ((fp = fopen(VMSTAT, "r")) == NULL) + return; + + st_paging->pgsteal = 0; + st_paging->pgscan_kswapd = st_paging->pgscan_direct = 0; + + while (fgets(line, 128, fp) != NULL) { + + if (!strncmp(line, "pgpgin ", 7)) { + /* Read number of pages the system paged in */ + sscanf(line + 7, "%lu", &st_paging->pgpgin); + } + else if (!strncmp(line, "pgpgout ", 8)) { + /* Read number of pages the system paged out */ + sscanf(line + 8, "%lu", &st_paging->pgpgout); + } + else if (!strncmp(line, "pgfault ", 8)) { + /* Read number of faults (major+minor) made by the system */ + sscanf(line + 8, "%lu", &st_paging->pgfault); + } + else if (!strncmp(line, "pgmajfault ", 11)) { + /* Read number of faults (major only) made by the system */ + sscanf(line + 11, "%lu", &st_paging->pgmajfault); + } + else if (!strncmp(line, "pgfree ", 7)) { + /* Read number of pages freed by the system */ + sscanf(line + 7, "%lu", &st_paging->pgfree); + } + else if (!strncmp(line, "pgsteal_", 8)) { + /* Read number of pages stolen by the system */ + sscanf(strchr(line, ' '), "%lu", &pgtmp); + st_paging->pgsteal += pgtmp; + } + else if (!strncmp(line, "pgscan_kswapd_", 14)) { + /* Read number of pages scanned by the kswapd daemon */ + sscanf(strchr(line, ' '), "%lu", &pgtmp); + st_paging->pgscan_kswapd += pgtmp; + } + else if (!strncmp(line, "pgscan_direct_", 14)) { + /* Read number of pages scanned directly */ + sscanf(strchr(line, ' '), "%lu", &pgtmp); + st_paging->pgscan_direct += pgtmp; + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read I/O and transfer rates statistics from /proc/diskstats. + * + * IN: + * @st_io Structure where stats will be saved. + * + * OUT: + * @st_io Structure with statistics. + *************************************************************************** + */ +void read_diskstats_io(struct stats_io *st_io) +{ + FILE *fp; + char line[256]; + char dev_name[MAX_NAME_LEN]; + unsigned int major, minor; + unsigned long rd_ios, wr_ios; + unsigned long long rd_sec, wr_sec; + + if ((fp = fopen(DISKSTATS, "r")) == NULL) + return; + + while (fgets(line, 256, fp) != NULL) { + + if (sscanf(line, "%u %u %s %lu %*u %llu %*u %lu %*u %llu", + &major, &minor, dev_name, + &rd_ios, &rd_sec, &wr_ios, &wr_sec) == 7) { + + if (is_device(dev_name)) { + /* + * OK: It's a device and not a partition. + * Note: Structure should have been initialized first! + */ + st_io->dk_drive += rd_ios + wr_ios; + st_io->dk_drive_rio += rd_ios; + st_io->dk_drive_rblk += (unsigned int) rd_sec; + st_io->dk_drive_wio += wr_ios; + st_io->dk_drive_wblk += (unsigned int) wr_sec; + } + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read block devices statistics from /proc/diskstats. + * + * IN: + * @st_disk Structure where stats will be saved. + * @nbr Maximum number of block devices. + * @read_part True if disks *and* partitions should be read; False if only + * disks are read. + * + * OUT: + * @st_disk Structure with statistics. + *************************************************************************** + */ +void read_diskstats_disk(struct stats_disk *st_disk, int nbr, int read_part) +{ + FILE *fp; + char line[256]; + char dev_name[MAX_NAME_LEN]; + int dsk = 0; + struct stats_disk *st_disk_i; + unsigned int major, minor; + unsigned long rd_ios, wr_ios, rd_ticks, wr_ticks; + unsigned long tot_ticks, rq_ticks; + unsigned long long rd_sec, wr_sec; + + if ((fp = fopen(DISKSTATS, "r")) == NULL) + return; + + while ((fgets(line, 256, fp) != NULL) && (dsk < nbr)) { + + if (sscanf(line, "%u %u %s %lu %*u %llu %lu %lu %*u %llu" + " %lu %*u %lu %lu", + &major, &minor, dev_name, + &rd_ios, &rd_sec, &rd_ticks, &wr_ios, &wr_sec, &wr_ticks, + &tot_ticks, &rq_ticks) == 11) { + + if (!rd_ios && !wr_ios) + /* Unused device: ignore it */ + continue; + if (read_part || is_device(dev_name)) { + st_disk_i = st_disk + dsk++; + st_disk_i->major = major; + st_disk_i->minor = minor; + st_disk_i->nr_ios = rd_ios + wr_ios; + st_disk_i->rd_sect = rd_sec; + st_disk_i->wr_sect = wr_sec; + st_disk_i->rd_ticks = rd_ticks; + st_disk_i->wr_ticks = wr_ticks; + st_disk_i->tot_ticks = tot_ticks; + st_disk_i->rq_ticks = rq_ticks; + } + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read serial lines statistics from /proc/tty/driver/serial. + * + * IN: + * @st_serial Structure where stats will be saved. + * @nbr Maximum number of serial lines. + * + * OUT: + * @st_serial Structure with statistics. + *************************************************************************** + */ +void read_tty_driver_serial(struct stats_serial *st_serial, int nbr) +{ + FILE *fp; + struct stats_serial *st_serial_i; + int sl = 0; + char line[256]; + char *p; + + if ((fp = fopen(SERIAL, "r")) == NULL) + return; + + while ((fgets(line, 256, fp) != NULL) && (sl < nbr)) { + + if ((p = strstr(line, "tx:")) != NULL) { + st_serial_i = st_serial + sl; + sscanf(line, "%u", &st_serial_i->line); + /* + * A value of 0 means an unused structure. + * So increment it to make sure it is not null. + */ + (st_serial_i->line)++; + /* + * Read the number of chars transmitted and received by + * current serial line. + */ + sscanf(p + 3, "%u", &st_serial_i->tx); + if ((p = strstr(line, "rx:")) != NULL) { + sscanf(p + 3, "%u", &st_serial_i->rx); + } + if ((p = strstr(line, "fe:")) != NULL) { + sscanf(p + 3, "%u", &st_serial_i->frame); + } + if ((p = strstr(line, "pe:")) != NULL) { + sscanf(p + 3, "%u", &st_serial_i->parity); + } + if ((p = strstr(line, "brk:")) != NULL) { + sscanf(p + 4, "%u", &st_serial_i->brk); + } + if ((p = strstr(line, "oe:")) != NULL) { + sscanf(p + 3, "%u", &st_serial_i->overrun); + } + + sl++; + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read kernel tables statistics from various system files. + * + * IN: + * @st_ktables Structure where stats will be saved. + * + * OUT: + * @st_ktables Structure with statistics. + *************************************************************************** + */ +void read_kernel_tables(struct stats_ktables *st_ktables) +{ + FILE *fp; + unsigned int parm; + + /* Open /proc/sys/fs/dentry-state file */ + if ((fp = fopen(FDENTRY_STATE, "r")) != NULL) { + fscanf(fp, "%*d %u", + &st_ktables->dentry_stat); + fclose(fp); + } + + /* Open /proc/sys/fs/file-nr file */ + if ((fp = fopen(FFILE_NR, "r")) != NULL) { + fscanf(fp, "%u %u", + &st_ktables->file_used, &parm); + fclose(fp); + /* + * The number of used handles is the number of allocated ones + * minus the number of free ones. + */ + st_ktables->file_used -= parm; + } + + /* Open /proc/sys/fs/inode-state file */ + if ((fp = fopen(FINODE_STATE, "r")) != NULL) { + fscanf(fp, "%u %u", + &st_ktables->inode_used, &parm); + fclose(fp); + /* + * The number of inuse inodes is the number of allocated ones + * minus the number of free ones. + */ + st_ktables->inode_used -= parm; + } + + /* Open /proc/sys/kernel/pty/nr file */ + if ((fp = fopen(PTY_NR, "r")) != NULL) { + fscanf(fp, "%u", + &st_ktables->pty_nr); + fclose(fp); + } +} + +/* + *************************************************************************** + * Read network interfaces statistics from /proc/net/dev. + * + * IN: + * @st_net_dev Structure where stats will be saved. + * @nbr Maximum number of network interfaces. + * + * OUT: + * @st_net_dev Structure with statistics. + *************************************************************************** + */ +void read_net_dev(struct stats_net_dev *st_net_dev, int nbr) +{ + FILE *fp; + struct stats_net_dev *st_net_dev_i; + char line[256]; + char iface[MAX_IFACE_LEN]; + int dev = 0; + int pos; + + if ((fp = fopen(NET_DEV, "r")) == NULL) + return; + + while ((fgets(line, 256, fp) != NULL) && (dev < nbr)) { + + pos = strcspn(line, ":"); + if (pos < strlen(line)) { + st_net_dev_i = st_net_dev + dev; + strncpy(iface, line, MINIMUM(pos, MAX_IFACE_LEN - 1)); + iface[MINIMUM(pos, MAX_IFACE_LEN - 1)] = '\0'; + sscanf(iface, "%s", st_net_dev_i->interface); /* Skip heading spaces */ + sscanf(line + pos + 1, "%lu %lu %*u %*u %*u %*u %lu %lu %lu %lu " + "%*u %*u %*u %*u %*u %lu", + &st_net_dev_i->rx_bytes, + &st_net_dev_i->rx_packets, + &st_net_dev_i->rx_compressed, + &st_net_dev_i->multicast, + &st_net_dev_i->tx_bytes, + &st_net_dev_i->tx_packets, + &st_net_dev_i->tx_compressed); + dev++; + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read network interfaces errors statistics from /proc/net/dev. + * + * IN: + * @st_net_edev Structure where stats will be saved. + * @nbr Maximum number of network interfaces. + * + * OUT: + * @st_net_edev Structure with statistics. + *************************************************************************** + */ +void read_net_edev(struct stats_net_edev *st_net_edev, int nbr) +{ + FILE *fp; + struct stats_net_edev *st_net_edev_i; + static char line[256]; + char iface[MAX_IFACE_LEN]; + int dev = 0; + int pos; + + if ((fp = fopen(NET_DEV, "r")) == NULL) + return; + + while ((fgets(line, 256, fp) != NULL) && (dev < nbr)) { + + pos = strcspn(line, ":"); + if (pos < strlen(line)) { + st_net_edev_i = st_net_edev + dev; + strncpy(iface, line, MINIMUM(pos, MAX_IFACE_LEN - 1)); + iface[MINIMUM(pos, MAX_IFACE_LEN - 1)] = '\0'; + sscanf(iface, "%s", st_net_edev_i->interface); /* Skip heading spaces */ + sscanf(line + pos + 1, "%*u %*u %lu %lu %lu %lu %*u %*u %*u %*u " + "%lu %lu %lu %lu %lu", + &st_net_edev_i->rx_errors, + &st_net_edev_i->rx_dropped, + &st_net_edev_i->rx_fifo_errors, + &st_net_edev_i->rx_frame_errors, + &st_net_edev_i->tx_errors, + &st_net_edev_i->tx_dropped, + &st_net_edev_i->tx_fifo_errors, + &st_net_edev_i->collisions, + &st_net_edev_i->tx_carrier_errors); + dev++; + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read NFS client statistics from /proc/net/rpc/nfs. + * + * IN: + * @st_net_nfs Structure where stats will be saved. + * + * OUT: + * @st_net_nfs Structure with statistics. + *************************************************************************** + */ +void read_net_nfs(struct stats_net_nfs *st_net_nfs) +{ + FILE *fp; + char line[256]; + unsigned int getattcnt = 0, accesscnt = 0, readcnt = 0, writecnt = 0; + + if ((fp = fopen(NET_RPC_NFS, "r")) == NULL) + return; + + memset(st_net_nfs, 0, STATS_NET_NFS_SIZE); + + while (fgets(line, 256, fp) != NULL) { + + if (!strncmp(line, "rpc ", 4)) { + sscanf(line + 4, "%u %u", + &st_net_nfs->nfs_rpccnt, &st_net_nfs->nfs_rpcretrans); + } + else if (!strncmp(line, "proc3 ", 6)) { + sscanf(line + 6, "%*u %*u %u %*u %*u %u %*u %u %u", + &getattcnt, &accesscnt, &readcnt, &writecnt); + + st_net_nfs->nfs_getattcnt += getattcnt; + st_net_nfs->nfs_accesscnt += accesscnt; + st_net_nfs->nfs_readcnt += readcnt; + st_net_nfs->nfs_writecnt += writecnt; + } + else if (!strncmp(line, "proc4 ", 6)) { + sscanf(line + 6, "%*u %*u %u %u " + "%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %u %u", + &readcnt, &writecnt, &accesscnt, &getattcnt); + + st_net_nfs->nfs_getattcnt += getattcnt; + st_net_nfs->nfs_accesscnt += accesscnt; + st_net_nfs->nfs_readcnt += readcnt; + st_net_nfs->nfs_writecnt += writecnt; + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read NFS server statistics from /proc/net/rpc/nfsd. + * + * IN: + * @st_net_nfsd Structure where stats will be saved. + * + * OUT: + * @st_net_nfsd Structure with statistics. + *************************************************************************** + */ +void read_net_nfsd(struct stats_net_nfsd *st_net_nfsd) +{ + FILE *fp; + char line[256]; + unsigned int getattcnt = 0, accesscnt = 0, readcnt = 0, writecnt = 0; + + if ((fp = fopen(NET_RPC_NFSD, "r")) == NULL) + return; + + memset(st_net_nfsd, 0, STATS_NET_NFSD_SIZE); + + while (fgets(line, 256, fp) != NULL) { + + if (!strncmp(line, "rc ", 3)) { + sscanf(line + 3, "%u %u", + &st_net_nfsd->nfsd_rchits, &st_net_nfsd->nfsd_rcmisses); + } + else if (!strncmp(line, "net ", 4)) { + sscanf(line + 4, "%u %u %u", + &st_net_nfsd->nfsd_netcnt, &st_net_nfsd->nfsd_netudpcnt, + &st_net_nfsd->nfsd_nettcpcnt); + } + else if (!strncmp(line, "rpc ", 4)) { + sscanf(line + 4, "%u %u", + &st_net_nfsd->nfsd_rpccnt, &st_net_nfsd->nfsd_rpcbad); + } + else if (!strncmp(line, "proc3 ", 6)) { + sscanf(line + 6, "%*u %*u %u %*u %*u %u %*u %u %u", + &getattcnt, &accesscnt, &readcnt, &writecnt); + + st_net_nfsd->nfsd_getattcnt += getattcnt; + st_net_nfsd->nfsd_accesscnt += accesscnt; + st_net_nfsd->nfsd_readcnt += readcnt; + st_net_nfsd->nfsd_writecnt += writecnt; + + } + else if (!strncmp(line, "proc4ops ", 9)) { + sscanf(line + 9, "%*u %*u %*u %*u %u " + "%*u %*u %*u %*u %*u %u " + "%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %u " + "%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %u", + &accesscnt, &getattcnt, &readcnt, &writecnt); + + st_net_nfsd->nfsd_getattcnt += getattcnt; + st_net_nfsd->nfsd_accesscnt += accesscnt; + st_net_nfsd->nfsd_readcnt += readcnt; + st_net_nfsd->nfsd_writecnt += writecnt; + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read network sockets statistics from /proc/net/sockstat. + * + * IN: + * @st_net_sock Structure where stats will be saved. + * + * OUT: + * @st_net_sock Structure with statistics. + *************************************************************************** + */ +void read_net_sock(struct stats_net_sock *st_net_sock) +{ + FILE *fp; + char line[96]; + char *p; + + if ((fp = fopen(NET_SOCKSTAT, "r")) == NULL) + return; + + while (fgets(line, 96, fp) != NULL) { + + if (!strncmp(line, "sockets:", 8)) { + /* Sockets */ + sscanf(line + 14, "%u", &st_net_sock->sock_inuse); + } + else if (!strncmp(line, "TCP:", 4)) { + /* TCP sockets */ + sscanf(line + 11, "%u", &st_net_sock->tcp_inuse); + if ((p = strstr(line, "tw")) != NULL) { + sscanf(p + 2, "%u", &st_net_sock->tcp_tw); + } + } + else if (!strncmp(line, "UDP:", 4)) { + /* UDP sockets */ + sscanf(line + 11, "%u", &st_net_sock->udp_inuse); + } + else if (!strncmp(line, "RAW:", 4)) { + /* RAW sockets */ + sscanf(line + 11, "%u", &st_net_sock->raw_inuse); + } + else if (!strncmp(line, "FRAG:", 5)) { + /* FRAGments */ + sscanf(line + 12, "%u", &st_net_sock->frag_inuse); + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read IP network traffic statistics from /proc/net/snmp. + * + * IN: + * @st_net_ip Structure where stats will be saved. + * + * OUT: + * @st_net_ip Structure with statistics. + *************************************************************************** + */ +void read_net_ip(struct stats_net_ip *st_net_ip) +{ + FILE *fp; + char line[1024]; + int sw = FALSE; + + if ((fp = fopen(NET_SNMP, "r")) == NULL) + return; + + while (fgets(line, 1024, fp) != NULL) { + + if (!strncmp(line, "Ip:", 3)) { + if (sw) { + sscanf(line + 3, "%*u %*u %lu %*u %*u %lu %*u %*u " + "%lu %lu %*u %*u %*u %lu %lu %*u %lu %*u %lu", + &st_net_ip->InReceives, + &st_net_ip->ForwDatagrams, + &st_net_ip->InDelivers, + &st_net_ip->OutRequests, + &st_net_ip->ReasmReqds, + &st_net_ip->ReasmOKs, + &st_net_ip->FragOKs, + &st_net_ip->FragCreates); + + break; + } + else { + sw = TRUE; + } + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read IP network error statistics from /proc/net/snmp. + * + * IN: + * @st_net_eip Structure where stats will be saved. + * + * OUT: + * @st_net_eip Structure with statistics. + *************************************************************************** + */ +void read_net_eip(struct stats_net_eip *st_net_eip) +{ + FILE *fp; + char line[1024]; + int sw = FALSE; + + if ((fp = fopen(NET_SNMP, "r")) == NULL) + return; + + while (fgets(line, 1024, fp) != NULL) { + + if (!strncmp(line, "Ip:", 3)) { + if (sw) { + sscanf(line + 3, "%*u %*u %*u %lu %lu %*u %lu %lu " + "%*u %*u %lu %lu %*u %*u %*u %lu %*u %lu", + &st_net_eip->InHdrErrors, + &st_net_eip->InAddrErrors, + &st_net_eip->InUnknownProtos, + &st_net_eip->InDiscards, + &st_net_eip->OutDiscards, + &st_net_eip->OutNoRoutes, + &st_net_eip->ReasmFails, + &st_net_eip->FragFails); + + break; + } + else { + sw = TRUE; + } + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read ICMP network traffic statistics from /proc/net/snmp. + * + * IN: + * @st_net_icmp Structure where stats will be saved. + * + * OUT: + * @st_net_icmp Structure with statistics. + *************************************************************************** + */ +void read_net_icmp(struct stats_net_icmp *st_net_icmp) +{ + FILE *fp; + char line[1024]; + int sw = FALSE; + + if ((fp = fopen(NET_SNMP, "r")) == NULL) + return; + + while (fgets(line, 1024, fp) != NULL) { + + if (!strncmp(line, "Icmp:", 5)) { + if (sw) { + sscanf(line + 5, "%lu %*u %*u %*u %*u %*u %*u " + "%lu %lu %lu %lu %lu %lu %lu %*u %*u %*u %*u " + "%*u %*u %lu %lu %lu %lu %lu %lu", + &st_net_icmp->InMsgs, + &st_net_icmp->InEchos, + &st_net_icmp->InEchoReps, + &st_net_icmp->InTimestamps, + &st_net_icmp->InTimestampReps, + &st_net_icmp->InAddrMasks, + &st_net_icmp->InAddrMaskReps, + &st_net_icmp->OutMsgs, + &st_net_icmp->OutEchos, + &st_net_icmp->OutEchoReps, + &st_net_icmp->OutTimestamps, + &st_net_icmp->OutTimestampReps, + &st_net_icmp->OutAddrMasks, + &st_net_icmp->OutAddrMaskReps); + + break; + } + else { + sw = TRUE; + } + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read ICMP network error statistics from /proc/net/snmp. + * + * IN: + * @st_net_eicmp Structure where stats will be saved. + * + * OUT: + * @st_net_eicmp Structure with statistics. + *************************************************************************** + */ +void read_net_eicmp(struct stats_net_eicmp *st_net_eicmp) +{ + FILE *fp; + char line[1024]; + int sw = FALSE; + + if ((fp = fopen(NET_SNMP, "r")) == NULL) + return; + + while (fgets(line, 1024, fp) != NULL) { + + if (!strncmp(line, "Icmp:", 5)) { + if (sw) { + sscanf(line + 5, "%*u %lu %lu %lu %lu %lu %lu %*u %*u " + "%*u %*u %*u %*u %*u %lu %lu %lu %lu %lu %lu", + &st_net_eicmp->InErrors, + &st_net_eicmp->InDestUnreachs, + &st_net_eicmp->InTimeExcds, + &st_net_eicmp->InParmProbs, + &st_net_eicmp->InSrcQuenchs, + &st_net_eicmp->InRedirects, + &st_net_eicmp->OutErrors, + &st_net_eicmp->OutDestUnreachs, + &st_net_eicmp->OutTimeExcds, + &st_net_eicmp->OutParmProbs, + &st_net_eicmp->OutSrcQuenchs, + &st_net_eicmp->OutRedirects); + + break; + } + else { + sw = TRUE; + } + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read TCP network traffic statistics from /proc/net/snmp. + * + * IN: + * @st_net_tcp Structure where stats will be saved. + * + * OUT: + * @st_net_tcp Structure with statistics. + *************************************************************************** + */ +void read_net_tcp(struct stats_net_tcp *st_net_tcp) +{ + FILE *fp; + char line[1024]; + int sw = FALSE; + + if ((fp = fopen(NET_SNMP, "r")) == NULL) + return; + + while (fgets(line, 1024, fp) != NULL) { + + if (!strncmp(line, "Tcp:", 4)) { + if (sw) { + sscanf(line + 4, "%*u %*u %*u %*d %lu %lu " + "%*u %*u %*u %lu %lu", + &st_net_tcp->ActiveOpens, + &st_net_tcp->PassiveOpens, + &st_net_tcp->InSegs, + &st_net_tcp->OutSegs); + + break; + } + else { + sw = TRUE; + } + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read TCP network error statistics from /proc/net/snmp. + * + * IN: + * @st_net_etcp Structure where stats will be saved. + * + * OUT: + * @st_net_etcp Structure with statistics. + *************************************************************************** + */ +void read_net_etcp(struct stats_net_etcp *st_net_etcp) +{ + FILE *fp; + char line[1024]; + int sw = FALSE; + + if ((fp = fopen(NET_SNMP, "r")) == NULL) + return; + + while (fgets(line, 1024, fp) != NULL) { + + if (!strncmp(line, "Tcp:", 4)) { + if (sw) { + sscanf(line + 4, "%*u %*u %*u %*d %*u %*u " + "%lu %lu %*u %*u %*u %lu %lu %lu", + &st_net_etcp->AttemptFails, + &st_net_etcp->EstabResets, + &st_net_etcp->RetransSegs, + &st_net_etcp->InErrs, + &st_net_etcp->OutRsts); + + break; + } + else { + sw = TRUE; + } + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read UDP network traffic statistics from /proc/net/snmp. + * + * IN: + * @st_net_udp Structure where stats will be saved. + * + * OUT: + * @st_net_udp Structure with statistics. + *************************************************************************** + */ +void read_net_udp(struct stats_net_udp *st_net_udp) +{ + FILE *fp; + char line[1024]; + int sw = FALSE; + + if ((fp = fopen(NET_SNMP, "r")) == NULL) + return; + + while (fgets(line, 1024, fp) != NULL) { + + if (!strncmp(line, "Udp:", 4)) { + if (sw) { + sscanf(line + 4, "%lu %lu %lu %lu", + &st_net_udp->InDatagrams, + &st_net_udp->NoPorts, + &st_net_udp->InErrors, + &st_net_udp->OutDatagrams); + + break; + } + else { + sw = TRUE; + } + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read IPv6 network sockets statistics from /proc/net/sockstat6. + * + * IN: + * @st_net_sock6 Structure where stats will be saved. + * + * OUT: + * @st_net_sock6 Structure with statistics. + *************************************************************************** + */ +void read_net_sock6(struct stats_net_sock6 *st_net_sock6) +{ + FILE *fp; + char line[96]; + + if ((fp = fopen(NET_SOCKSTAT6, "r")) == NULL) + return; + + while (fgets(line, 96, fp) != NULL) { + + if (!strncmp(line, "TCP6:", 5)) { + /* TCPv6 sockets */ + sscanf(line + 12, "%u", &st_net_sock6->tcp6_inuse); + } + else if (!strncmp(line, "UDP6:", 5)) { + /* UDPv6 sockets */ + sscanf(line + 12, "%u", &st_net_sock6->udp6_inuse); + } + else if (!strncmp(line, "RAW6:", 5)) { + /* IPv6 RAW sockets */ + sscanf(line + 12, "%u", &st_net_sock6->raw6_inuse); + } + else if (!strncmp(line, "FRAG6:", 6)) { + /* IPv6 FRAGments */ + sscanf(line + 13, "%u", &st_net_sock6->frag6_inuse); + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read IPv6 network traffic statistics from /proc/net/snmp6. + * + * IN: + * @st_net_ip6 Structure where stats will be saved. + * + * OUT: + * @st_net_ip6 Structure with statistics. + *************************************************************************** + */ +void read_net_ip6(struct stats_net_ip6 *st_net_ip6) +{ + FILE *fp; + char line[128]; + + if ((fp = fopen(NET_SNMP6, "r")) == NULL) + return; + + while (fgets(line, 128, fp) != NULL) { + + if (!strncmp(line, "Ip6InReceives ", 14)) { + sscanf(line + 14, "%lu", &st_net_ip6->InReceives6); + } + else if (!strncmp(line, "Ip6OutForwDatagrams ", 20)) { + sscanf(line + 20, "%lu", &st_net_ip6->OutForwDatagrams6); + } + else if (!strncmp(line, "Ip6InDelivers ", 14)) { + sscanf(line + 14, "%lu", &st_net_ip6->InDelivers6); + } + else if (!strncmp(line, "Ip6OutRequests ", 15)) { + sscanf(line + 15, "%lu", &st_net_ip6->OutRequests6); + } + else if (!strncmp(line, "Ip6ReasmReqds ", 14)) { + sscanf(line + 14, "%lu", &st_net_ip6->ReasmReqds6); + } + else if (!strncmp(line, "Ip6ReasmOKs ", 12)) { + sscanf(line + 12, "%lu", &st_net_ip6->ReasmOKs6); + } + else if (!strncmp(line, "Ip6InMcastPkts ", 15)) { + sscanf(line + 15, "%lu", &st_net_ip6->InMcastPkts6); + } + else if (!strncmp(line, "Ip6OutMcastPkts ", 16)) { + sscanf(line + 16, "%lu", &st_net_ip6->OutMcastPkts6); + } + else if (!strncmp(line, "Ip6FragOKs ", 11)) { + sscanf(line + 11, "%lu", &st_net_ip6->FragOKs6); + } + else if (!strncmp(line, "Ip6FragCreates ", 15)) { + sscanf(line + 15, "%lu", &st_net_ip6->FragCreates6); + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read IPv6 network error statistics from /proc/net/snmp6. + * + * IN: + * @st_net_eip6 Structure where stats will be saved. + * + * OUT: + * @st_net_eip6 Structure with statistics. + *************************************************************************** + */ +void read_net_eip6(struct stats_net_eip6 *st_net_eip6) +{ + FILE *fp; + char line[128]; + + if ((fp = fopen(NET_SNMP6, "r")) == NULL) + return; + + while (fgets(line, 128, fp) != NULL) { + + if (!strncmp(line, "Ip6InHdrErrors ", 15)) { + sscanf(line + 15, "%lu", &st_net_eip6->InHdrErrors6); + } + else if (!strncmp(line, "Ip6InAddrErrors ", 16)) { + sscanf(line + 16, "%lu", &st_net_eip6->InAddrErrors6); + } + else if (!strncmp(line, "Ip6InUnknownProtos ", 19)) { + sscanf(line + 19, "%lu", &st_net_eip6->InUnknownProtos6); + } + else if (!strncmp(line, "Ip6InTooBigErrors ", 18)) { + sscanf(line + 18, "%lu", &st_net_eip6->InTooBigErrors6); + } + else if (!strncmp(line, "Ip6InDiscards ", 14)) { + sscanf(line + 14, "%lu", &st_net_eip6->InDiscards6); + } + else if (!strncmp(line, "Ip6OutDiscards ", 15)) { + sscanf(line + 15, "%lu", &st_net_eip6->OutDiscards6); + } + else if (!strncmp(line, "Ip6InNoRoutes ", 14)) { + sscanf(line + 14, "%lu", &st_net_eip6->InNoRoutes6); + } + else if (!strncmp(line, "Ip6OutNoRoutes ", 15)) { + sscanf(line + 15, "%lu", &st_net_eip6->OutNoRoutes6); + } + else if (!strncmp(line, "Ip6ReasmFails ", 14)) { + sscanf(line + 14, "%lu", &st_net_eip6->ReasmFails6); + } + else if (!strncmp(line, "Ip6FragFails ", 13)) { + sscanf(line + 13, "%lu", &st_net_eip6->FragFails6); + } + else if (!strncmp(line, "Ip6InTruncatedPkts ", 19)) { + sscanf(line + 19, "%lu", &st_net_eip6->InTruncatedPkts6); + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read ICMPv6 network traffic statistics from /proc/net/snmp6. + * + * IN: + * @st_net_icmp6 Structure where stats will be saved. + * + * OUT: + * @st_net_icmp6 Structure with statistics. + *************************************************************************** + */ +void read_net_icmp6(struct stats_net_icmp6 *st_net_icmp6) +{ + FILE *fp; + char line[128]; + + if ((fp = fopen(NET_SNMP6, "r")) == NULL) + return; + + while (fgets(line, 128, fp) != NULL) { + + if (!strncmp(line, "Icmp6InMsgs ", 12)) { + sscanf(line + 12, "%lu", &st_net_icmp6->InMsgs6); + } + else if (!strncmp(line, "Icmp6OutMsgs ", 13)) { + sscanf(line + 13, "%lu", &st_net_icmp6->OutMsgs6); + } + else if (!strncmp(line, "Icmp6InEchos ", 13)) { + sscanf(line + 13, "%lu", &st_net_icmp6->InEchos6); + } + else if (!strncmp(line, "Icmp6InEchoReplies ", 19)) { + sscanf(line + 19, "%lu", &st_net_icmp6->InEchoReplies6); + } + else if (!strncmp(line, "Icmp6OutEchoReplies ", 20)) { + sscanf(line + 20, "%lu", &st_net_icmp6->OutEchoReplies6); + } + else if (!strncmp(line, "Icmp6InGroupMembQueries ", 24)) { + sscanf(line + 24, "%lu", &st_net_icmp6->InGroupMembQueries6); + } + else if (!strncmp(line, "Icmp6InGroupMembResponses ", 26)) { + sscanf(line + 26, "%lu", &st_net_icmp6->InGroupMembResponses6); + } + else if (!strncmp(line, "Icmp6OutGroupMembResponses ", 27)) { + sscanf(line + 27, "%lu", &st_net_icmp6->OutGroupMembResponses6); + } + else if (!strncmp(line, "Icmp6InGroupMembReductions ", 27)) { + sscanf(line + 27, "%lu", &st_net_icmp6->InGroupMembReductions6); + } + else if (!strncmp(line, "Icmp6OutGroupMembReductions ", 28)) { + sscanf(line + 28, "%lu", &st_net_icmp6->OutGroupMembReductions6); + } + else if (!strncmp(line, "Icmp6InRouterSolicits ", 22)) { + sscanf(line + 22, "%lu", &st_net_icmp6->InRouterSolicits6); + } + else if (!strncmp(line, "Icmp6OutRouterSolicits ", 23)) { + sscanf(line + 23, "%lu", &st_net_icmp6->OutRouterSolicits6); + } + else if (!strncmp(line, "Icmp6InRouterAdvertisements ", 28)) { + sscanf(line + 28, "%lu", &st_net_icmp6->InRouterAdvertisements6); + } + else if (!strncmp(line, "Icmp6InNeighborSolicits ", 24)) { + sscanf(line + 24, "%lu", &st_net_icmp6->InNeighborSolicits6); + } + else if (!strncmp(line, "Icmp6OutNeighborSolicits ", 25)) { + sscanf(line + 25, "%lu", &st_net_icmp6->OutNeighborSolicits6); + } + else if (!strncmp(line, "Icmp6InNeighborAdvertisements ", 30)) { + sscanf(line + 30, "%lu", &st_net_icmp6->InNeighborAdvertisements6); + } + else if (!strncmp(line, "Icmp6OutNeighborAdvertisements ", 31)) { + sscanf(line + 31, "%lu", &st_net_icmp6->OutNeighborAdvertisements6); + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read ICMPv6 network error statistics from /proc/net/snmp6. + * + * IN: + * @st_net_eicmp6 Structure where stats will be saved. + * + * OUT: + * @st_net_eicmp6 Structure with statistics. + *************************************************************************** + */ +void read_net_eicmp6(struct stats_net_eicmp6 *st_net_eicmp6) +{ + FILE *fp; + char line[128]; + + if ((fp = fopen(NET_SNMP6, "r")) == NULL) + return; + + while (fgets(line, 128, fp) != NULL) { + + if (!strncmp(line, "Icmp6InErrors ", 14)) { + sscanf(line + 14, "%lu", &st_net_eicmp6->InErrors6); + } + else if (!strncmp(line, "Icmp6InDestUnreachs ", 20)) { + sscanf(line + 20, "%lu", &st_net_eicmp6->InDestUnreachs6); + } + else if (!strncmp(line, "Icmp6OutDestUnreachs ", 21)) { + sscanf(line + 21, "%lu", &st_net_eicmp6->OutDestUnreachs6); + } + else if (!strncmp(line, "Icmp6InTimeExcds ", 17)) { + sscanf(line + 17, "%lu", &st_net_eicmp6->InTimeExcds6); + } + else if (!strncmp(line, "Icmp6OutTimeExcds ", 18)) { + sscanf(line + 18, "%lu", &st_net_eicmp6->OutTimeExcds6); + } + else if (!strncmp(line, "Icmp6InParmProblems ", 20)) { + sscanf(line + 20, "%lu", &st_net_eicmp6->InParmProblems6); + } + else if (!strncmp(line, "Icmp6OutParmProblems ", 21)) { + sscanf(line + 21, "%lu", &st_net_eicmp6->OutParmProblems6); + } + else if (!strncmp(line, "Icmp6InRedirects ", 17)) { + sscanf(line + 17, "%lu", &st_net_eicmp6->InRedirects6); + } + else if (!strncmp(line, "Icmp6OutRedirects ", 18)) { + sscanf(line + 18, "%lu", &st_net_eicmp6->OutRedirects6); + } + else if (!strncmp(line, "Icmp6InPktTooBigs ", 18)) { + sscanf(line + 18, "%lu", &st_net_eicmp6->InPktTooBigs6); + } + else if (!strncmp(line, "Icmp6OutPktTooBigs ", 19)) { + sscanf(line + 19, "%lu", &st_net_eicmp6->OutPktTooBigs6); + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read UDPv6 network traffic statistics from /proc/net/snmp6. + * + * IN: + * @st_net_udp6 Structure where stats will be saved. + * + * OUT: + * @st_net_udp6 Structure with statistics. + *************************************************************************** + */ +void read_net_udp6(struct stats_net_udp6 *st_net_udp6) +{ + FILE *fp; + char line[128]; + + if ((fp = fopen(NET_SNMP6, "r")) == NULL) + return; + + while (fgets(line, 128, fp) != NULL) { + + if (!strncmp(line, "Udp6InDatagrams ", 16)) { + sscanf(line + 16, "%lu", &st_net_udp6->InDatagrams6); + } + else if (!strncmp(line, "Udp6OutDatagrams ", 17)) { + sscanf(line + 17, "%lu", &st_net_udp6->OutDatagrams6); + } + else if (!strncmp(line, "Udp6NoPorts ", 12)) { + sscanf(line + 12, "%lu", &st_net_udp6->NoPorts6); + } + else if (!strncmp(line, "Udp6InErrors ", 13)) { + sscanf(line + 13, "%lu", &st_net_udp6->InErrors6); + } + } + + fclose(fp); +} + +/* + *************************************************************************** + * Read machine uptime, independently of the number of processors. + * + * OUT: + * @uptime Uptime value in jiffies. + *************************************************************************** + */ +void read_uptime(unsigned long long *uptime) +{ + FILE *fp; + char line[128]; + unsigned long up_sec, up_cent; + + if ((fp = fopen(UPTIME, "r")) == NULL) + return; + + if (fgets(line, 128, fp) == NULL) + return; + + sscanf(line, "%lu.%lu", &up_sec, &up_cent); + *uptime = (unsigned long long) up_sec * HZ + (unsigned long long) up_cent * HZ / 100; + + fclose(fp); + +} + +/* + *************************************************************************** + * Count number of interrupts that are in /proc/stat file. + * + * RETURNS: + * Number of interrupts, including total number of interrupts. + *************************************************************************** + */ +int get_irq_nr(void) +{ + FILE *fp; + char line[8192]; + int in = 0; + int pos = 4; + + if ((fp = fopen(STAT, "r")) == NULL) + return 0; + + while (fgets(line, 8192, fp) != NULL) { + + if (!strncmp(line, "intr ", 5)) { + + while (pos < strlen(line)) { + in++; + pos += strcspn(line + pos + 1, " ") + 1; + } + } + } + + fclose(fp); + + return in; +} + +/* + *************************************************************************** + * Find number of serial lines that support tx/rx accounting + * in /proc/tty/driver/serial file. + * + * RETURNS: + * Number of serial lines supporting tx/rx accouting. + *************************************************************************** + */ +int get_serial_nr(void) +{ + FILE *fp; + char line[256]; + int sl = 0; + + if ((fp = fopen(SERIAL, "r")) == NULL) + return 0; /* No SERIAL file */ + + while (fgets(line, 256, fp) != NULL) { + /* + * tx/rx statistics are always present, + * except when serial line is unknown. + */ + if (strstr(line, "tx:") != NULL) { + sl++; + } + } + + fclose(fp); + + return sl; +} + +/* + *************************************************************************** + * Find number of interfaces (network devices) that are in /proc/net/dev + * file. + * + * RETURNS: + * Number of network interfaces. + *************************************************************************** + */ +int get_iface_nr(void) +{ + FILE *fp; + char line[128]; + int iface = 0; + + if ((fp = fopen(NET_DEV, "r")) == NULL) + return 0; /* No network device file */ + + while (fgets(line, 128, fp) != NULL) { + if (strchr(line, ':')) { + iface++; + } + } + + fclose(fp); + + return iface; +} + +/* + *************************************************************************** + * Find number of devices and partitions available in /proc/diskstats. + * + * IN: + * @count_part Set to TRUE if devices _and_ partitions are to be + * counted. + * @only_used_dev When counting devices, set to TRUE if only devices + * with non zero stats must be counted. + * + * RETURNS: + * Number of devices (and partitions). + *************************************************************************** + */ +int get_diskstats_dev_nr(int count_part, int only_used_dev) +{ + FILE *fp; + char line[256]; + char dev_name[MAX_NAME_LEN]; + int dev = 0, i; + unsigned long rd_ios, wr_ios; + + if ((fp = fopen(DISKSTATS, "r")) == NULL) + /* File non-existent */ + return 0; + + /* + * Counting devices and partitions is simply a matter of counting + * the number of lines... + */ + while (fgets(line, 256, fp) != NULL) { + if (!count_part) { + i = sscanf(line, "%*d %*d %s %lu %*u %*u %*u %lu", + dev_name, &rd_ios, &wr_ios); + if ((i == 2) || !is_device(dev_name)) + /* It was a partition and not a device */ + continue; + if (only_used_dev && !rd_ios && !wr_ios) + /* Unused device */ + continue; + } + dev++; + } + + fclose(fp); + + return dev; +} + +/* + *************************************************************************** + * Get number of devices in /proc/diskstats. + * + * IN: + * @f Non zero (true) if disks *and* partitions should be counted, and + * zero (false) if only disks must be counted. + * + * RETURNS: + * Number of devices. + *************************************************************************** + */ +int get_disk_nr(unsigned int f) +{ + int disk_nr; + + /* + * Partitions are taken into account by sar -d only with + * kernels 2.6.25 and later. + */ + disk_nr = get_diskstats_dev_nr(f, CNT_USED_DEV); + + return disk_nr; +} + +/* + *************************************************************************** + * Count number of processors in /sys. + * + * RETURNS: + * Number of processors (online and offline). + * A value of 0 means that /sys was not mounted. + * A value of N (!=0) means N processor(s) (0 .. N-1). + *************************************************************************** + */ +int get_sys_cpu_nr(void) +{ + DIR *dir; + struct dirent *drd; + struct stat buf; + char line[MAX_PF_NAME]; + int proc_nr = 0; + + /* Open relevant /sys directory */ + if ((dir = opendir(SYSFS_DEVCPU)) == NULL) + return 0; + + /* Get current file entry */ + while ((drd = readdir(dir)) != NULL) { + + if (!strncmp(drd->d_name, "cpu", 3) && isdigit(drd->d_name[3])) { + snprintf(line, MAX_PF_NAME, "%s/%s", SYSFS_DEVCPU, drd->d_name); + line[MAX_PF_NAME - 1] = '\0'; + if (stat(line, &buf) < 0) + continue; + if (S_ISDIR(buf.st_mode)) { + proc_nr++; + } + } + } + + /* Close directory */ + closedir(dir); + + return proc_nr; +} + +/* + *************************************************************************** + * Count number of processors in /proc/stat. + * + * RETURNS: + * Number of processors. The returned value is greater than or equal to the + * number of online processors. + * A value of 0 means one processor and non SMP kernel. + * A value of N (!=0) means N processor(s) (0 .. N-1) with SMP kernel. + *************************************************************************** + */ +int get_proc_cpu_nr(void) +{ + FILE *fp; + char line[16]; + int num_proc, proc_nr = -1; + + if ((fp = fopen(STAT, "r")) == NULL) { + fprintf(stderr, _("Cannot open %s: %s\n"), STAT, strerror(errno)); + exit(1); + } + + while (fgets(line, 16, fp) != NULL) { + + if (strncmp(line, "cpu ", 4) && !strncmp(line, "cpu", 3)) { + sscanf(line + 3, "%d", &num_proc); + if (num_proc > proc_nr) { + proc_nr = num_proc; + } + } + } + + fclose(fp); + + return (proc_nr + 1); +} + +/* + *************************************************************************** + * Count the number of processors on the machine. + * Try to use /sys for that, or /proc/stat if /sys doesn't exist. + * + * IN: + * @max_nr_cpus Maximum number of proc that sysstat can handle. + * + * RETURNS: + * Number of processors. + * 0: one proc and non SMP kernel. + * 1: one proc and SMP kernel (NB: On SMP machines where all the CPUs but + * one have been disabled, we get the total number of proc since we use + * /sys to count them). + * 2: two proc... + *************************************************************************** + */ +int get_cpu_nr(unsigned int max_nr_cpus) +{ + int cpu_nr; + + if ((cpu_nr = get_sys_cpu_nr()) == 0) { + /* /sys may be not mounted. Use /proc/stat instead */ + cpu_nr = get_proc_cpu_nr(); + } + + if (cpu_nr > max_nr_cpus) { + fprintf(stderr, _("Cannot handle so many processors!\n")); + exit(1); + } + + return cpu_nr; +} + +/* + *************************************************************************** + * Find number of interrupts available per processor (use + * /proc/interrupts file or /proc/softirqs). + * + * IN: + * @file /proc file to read (interrupts or softirqs). + * @max_nr_irqcpu Maximum number of interrupts per processor that + * sadc can handle. + * @cpu_nr Number of processors. + * + * RETURNS: + * Number of interrupts per processor + a pre-allocation constant. + *************************************************************************** + */ +int get_irqcpu_nr(char *file, int max_nr_irqcpu, int cpu_nr) +{ + FILE *fp; + char *line = NULL; + unsigned int irq = 0; + int p; + + if ((fp = fopen(file, "r")) == NULL) + return 0; /* No interrupts file */ + + SREALLOC(line, char, INTERRUPTS_LINE + 11 * cpu_nr); + + while ((fgets(line, INTERRUPTS_LINE + 11 * cpu_nr , fp) != NULL) && + (irq < max_nr_irqcpu)) { + p = strcspn(line, ":"); + if ((p > 0) && (p < 16)) { + irq++; + } + } + + fclose(fp); + + if (line) { + free(line); + } + + return irq; +} + +/* + *************************************************************************** + * Read CPU frequency statistics. + * + * IN: + * @st_pwr_cpufreq Structure where stats will be saved. + * @nbr Total number of CPU (including cpu "all"). + * + * OUT: + * @st_pwr_cpufreq Structure with statistics. + *************************************************************************** + */ +void read_cpuinfo(struct stats_pwr_cpufreq *st_pwr_cpufreq, int nbr) +{ + FILE *fp; + struct stats_pwr_cpufreq *st_pwr_cpufreq_i; + char line[1024]; + int proc_nb = 0, nr = 0; + unsigned int ifreq, dfreq; + + if ((fp = fopen(CPUINFO, "r")) == NULL) + return; + + st_pwr_cpufreq->cpufreq = 0; + + while (fgets(line, 1024, fp) != NULL) { + + if (!strncmp(line, "processor\t", 10)) { + sscanf(strchr(line, ':') + 1, "%d", &proc_nb); + } + + else if (!strncmp(line, "cpu MHz\t", 8)) { + sscanf(strchr(line, ':') + 1, "%u.%u", &ifreq, &dfreq); + + if (proc_nb < (nbr - 1)) { + /* Save current CPU frequency */ + st_pwr_cpufreq_i = st_pwr_cpufreq + proc_nb + 1; + st_pwr_cpufreq_i->cpufreq = ifreq * 100 + dfreq / 10; + + /* Also save it to compute an average CPU frequency */ + st_pwr_cpufreq->cpufreq += st_pwr_cpufreq_i->cpufreq; + nr++; + } + } + } + + fclose(fp); + + if (nr) { + /* Compute average CPU frequency for this machine */ + st_pwr_cpufreq->cpufreq /= nr; + } +} + +#ifdef HAVE_SENSORS +/* + *************************************************************************** + * Count the number of sensors of given type on the machine. + * + * IN: + * @type Type of sensors. + * + * RETURNS: + * Number of sensors. + *************************************************************************** + */ +int get_sensors_nr(sensors_feature_type type) { + int count = 0; + const sensors_chip_name *chip; + const sensors_feature *feature; + int chip_nr = 0; + int i; + + while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) { + i = 0; + while ((feature = sensors_get_features(chip, &i))) { + if (feature->type == type) { + count++; + } + } + } + + return count; +} +#endif /* HAVE_SENSORS */ + +/* + *************************************************************************** + * Count the number of fans on the machine. + * + * RETURNS: + * Number of fans. + *************************************************************************** + */ +int get_fan_nr(void) +{ +#ifdef HAVE_SENSORS + return get_sensors_nr(SENSORS_FEATURE_FAN); +#else + return 0; +#endif /* HAVE_SENSORS */ +} + +/* + *************************************************************************** + * Read fan statistics. + * + * IN: + * @st_pwr_fan Structure where stats will be saved. + * @nbr Total number of fans. + * + * OUT: + * @st_pwr_fan Structure with statistics. + *************************************************************************** + */ +void read_fan(struct stats_pwr_fan *st_pwr_fan, int nbr) +{ +#ifdef HAVE_SENSORS + int count = 0; + const sensors_chip_name *chip; + const sensors_feature *feature; + const sensors_subfeature *sub; + struct stats_pwr_fan *st_pwr_fan_i; + int chip_nr = 0; + int i, j; + + memset(st_pwr_fan, 0, STATS_PWR_FAN_SIZE); + int err = 0; + + while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) { + i = 0; + while ((feature = sensors_get_features(chip, &i))) { + if ((feature->type == SENSORS_FEATURE_FAN) && (count < nbr)) { + j = 0; + st_pwr_fan_i = st_pwr_fan + count; + sensors_snprintf_chip_name(st_pwr_fan_i->device, MAX_SENSORS_DEV_LEN, chip); + + while ((sub = sensors_get_all_subfeatures(chip, feature, &j))) { + if ((sub->type == SENSORS_SUBFEATURE_FAN_INPUT) && + (sub->flags & SENSORS_MODE_R)) { + if ((err = sensors_get_value(chip, sub->number, &st_pwr_fan_i->rpm))) { + st_pwr_fan_i->rpm = 0; + } + } + else if ((sub->type == SENSORS_SUBFEATURE_FAN_MIN)) { + if ((err = sensors_get_value(chip, sub->number, &st_pwr_fan_i->rpm_min))) { + st_pwr_fan_i->rpm_min = 0; + } + } + } + count++; + } + } + } +#endif /* HAVE_SENSORS */ +} + +/* + *************************************************************************** + * Count the number of temperature sensors on the machine. + * + * RETURNS: + * Number of temperature sensors. + *************************************************************************** + */ +int get_temp_nr(void) +{ +#ifdef HAVE_SENSORS + return get_sensors_nr(SENSORS_FEATURE_TEMP); +#else + return 0; +#endif /* HAVE_SENSORS */ + +} + +/* + *************************************************************************** + * Read device temperature statistics. + * + * IN: + * @st_pwr_temp Structure where stats will be saved. + * @nbr Total number of fans. + * + * OUT: + * @st_pwr_temp Structure with statistics. + *************************************************************************** + */ +void read_temp(struct stats_pwr_temp *st_pwr_temp, int nbr) +{ +#ifdef HAVE_SENSORS + int count = 0; + const sensors_chip_name *chip; + const sensors_feature *feature; + const sensors_subfeature *sub; + struct stats_pwr_temp *st_pwr_temp_i; + int chip_nr = 0; + int i, j; + + memset(st_pwr_temp, 0, STATS_PWR_TEMP_SIZE); + int err = 0; + + while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) { + i = 0; + while ((feature = sensors_get_features(chip, &i))) { + if ((feature->type == SENSORS_FEATURE_TEMP) && (count < nbr)) { + j = 0; + st_pwr_temp_i = st_pwr_temp + count; + sensors_snprintf_chip_name(st_pwr_temp_i->device, MAX_SENSORS_DEV_LEN, chip); + + while ((sub = sensors_get_all_subfeatures(chip, feature, &j))) { + if ((sub->type == SENSORS_SUBFEATURE_TEMP_INPUT) && + (sub->flags & SENSORS_MODE_R)) { + if ((err = sensors_get_value(chip, sub->number, &st_pwr_temp_i->temp))) { + st_pwr_temp_i->temp = 0; + } + } + else if ((sub->type == SENSORS_SUBFEATURE_TEMP_MIN)) { + if ((err = sensors_get_value(chip, sub->number, &st_pwr_temp_i->temp_min))) { + st_pwr_temp_i->temp_min = 0; + } + } + else if ((sub->type == SENSORS_SUBFEATURE_TEMP_MAX)) { + if ((err = sensors_get_value(chip, sub->number, &st_pwr_temp_i->temp_max))) { + st_pwr_temp_i->temp_max = 0; + } + } + } + count++; + } + } + } +#endif /* HAVE_SENSORS */ +} + +/* + *************************************************************************** + * Count the number of voltage inputs on the machine. + * + * RETURNS: + * Number of voltage inputs. + *************************************************************************** + */ +int get_in_nr(void) +{ +#ifdef HAVE_SENSORS + return get_sensors_nr(SENSORS_FEATURE_IN); +#else + return 0; +#endif /* HAVE_SENSORS */ + +} + +/* + *************************************************************************** + * Read voltage inputs statistics. + * + * IN: + * @st_pwr_in Structure where stats will be saved. + * @nbr Total number of voltage inputs. + * + * OUT: + * @st_pwr_in Structure with statistics. + *************************************************************************** + */ +void read_in(struct stats_pwr_in *st_pwr_in, int nbr) +{ +#ifdef HAVE_SENSORS + int count = 0; + const sensors_chip_name *chip; + const sensors_feature *feature; + const sensors_subfeature *sub; + struct stats_pwr_in *st_pwr_in_i; + int chip_nr = 0; + int i, j; + + memset(st_pwr_in, 0, STATS_PWR_IN_SIZE); + int err = 0; + + while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) { + i = 0; + while ((feature = sensors_get_features(chip, &i))) { + if ((feature->type == SENSORS_FEATURE_IN) && (count < nbr)) { + j = 0; + st_pwr_in_i = st_pwr_in + count; + sensors_snprintf_chip_name(st_pwr_in_i->device, MAX_SENSORS_DEV_LEN, chip); + + while ((sub = sensors_get_all_subfeatures(chip, feature, &j))) { + if ((sub->type == SENSORS_SUBFEATURE_IN_INPUT) && + (sub->flags & SENSORS_MODE_R)) { + if ((err = sensors_get_value(chip, sub->number, &st_pwr_in_i->in))) { + st_pwr_in_i->in = 0; + } + } + else if ((sub->type == SENSORS_SUBFEATURE_IN_MIN)) { + if ((err = sensors_get_value(chip, sub->number, &st_pwr_in_i->in_min))) { + st_pwr_in_i->in_min = 0; + } + } + else if ((sub->type == SENSORS_SUBFEATURE_IN_MAX)) { + if ((err = sensors_get_value(chip, sub->number, &st_pwr_in_i->in_max))) { + st_pwr_in_i->in_max = 0; + } + } + } + count++; + } + } + } +#endif /* HAVE_SENSORS */ +} diff --git a/rd_stats.h b/rd_stats.h new file mode 100644 index 00000000..bbb11246 --- /dev/null +++ b/rd_stats.h @@ -0,0 +1,622 @@ +/* + * rd_stats.h: Include file used to read system statistics + * (C) 1999-2010 by Sebastien Godard (sysstat orange.fr) + */ + +#ifndef _RD_STATS_H +#define _RD_STATS_H + +#include "common.h" + + +/* + *************************************************************************** + * Miscellaneous constants + *************************************************************************** + */ + +/* Get IFNAMSIZ */ +#include +#ifndef IFNAMSIZ +#define IFNAMSIZ 16 +#endif + +/* Maximum length of network interface name */ +#define MAX_IFACE_LEN IFNAMSIZ + +#define CNT_DEV 0 +#define CNT_PART 1 +#define CNT_ALL_DEV 0 +#define CNT_USED_DEV 1 + +#define READ_PROC_STAT 0 +#define READ_DISKSTATS 1 +#define READ_PPARTITIONS 2 + +/* + *************************************************************************** + * System files containing statistics + *************************************************************************** + */ + +/* Files */ +#define PROC "/proc" +#define SERIAL "/proc/tty/driver/serial" +#define FDENTRY_STATE "/proc/sys/fs/dentry-state" +#define FFILE_NR "/proc/sys/fs/file-nr" +#define FINODE_STATE "/proc/sys/fs/inode-state" +#define PTY_NR "/proc/sys/kernel/pty/nr" +#define NET_DEV "/proc/net/dev" +#define NET_SOCKSTAT "/proc/net/sockstat" +#define NET_SOCKSTAT6 "/proc/net/sockstat6" +#define NET_RPC_NFS "/proc/net/rpc/nfs" +#define NET_RPC_NFSD "/proc/net/rpc/nfsd" +#define LOADAVG "/proc/loadavg" +#define VMSTAT "/proc/vmstat" +#define NET_SNMP "/proc/net/snmp" +#define NET_SNMP6 "/proc/net/snmp6" +#define CPUINFO "/proc/cpuinfo" + + +/* + *************************************************************************** + * Definitions of structures for system statistics + *************************************************************************** + */ + +/* + * Structure for CPU statistics. + * In activity buffer: First structure is for global CPU utilisation ("all"). + * Following structures are for each individual CPU (0, 1, etc.) + */ +struct stats_cpu { + unsigned long long cpu_user __attribute__ ((aligned (16))); + unsigned long long cpu_nice __attribute__ ((aligned (16))); + unsigned long long cpu_sys __attribute__ ((aligned (16))); + unsigned long long cpu_idle __attribute__ ((aligned (16))); + unsigned long long cpu_iowait __attribute__ ((aligned (16))); + unsigned long long cpu_steal __attribute__ ((aligned (16))); + unsigned long long cpu_hardirq __attribute__ ((aligned (16))); + unsigned long long cpu_softirq __attribute__ ((aligned (16))); + unsigned long long cpu_guest __attribute__ ((aligned (16))); +}; + +#define STATS_CPU_SIZE (sizeof(struct stats_cpu)) + +/* + * Structure for task creation and context switch statistics. + * The attribute (aligned(16)) is necessary so that sizeof(structure) has + * the same value on 32 and 64-bit architectures. + */ +struct stats_pcsw { + unsigned long long context_switch __attribute__ ((aligned (16))); + unsigned long processes __attribute__ ((aligned (16))); +}; + +#define STATS_PCSW_SIZE (sizeof(struct stats_pcsw)) + +/* + * Structure for interrupts statistics. + * In activity buffer: First structure is for total number of interrupts ("SUM"). + * Following structures are for each individual interrupt (0, 1, etc.) + * + * NOTE: The total number of interrupts is saved as a %llu by the kernel, + * whereas individual interrupts are saved as %u. + */ +struct stats_irq { + unsigned long long irq_nr __attribute__ ((aligned (16))); +}; + +#define STATS_IRQ_SIZE (sizeof(struct stats_irq)) + +/* Structure for swapping statistics */ +struct stats_swap { + unsigned long pswpin __attribute__ ((aligned (8))); + unsigned long pswpout __attribute__ ((aligned (8))); +}; + +#define STATS_SWAP_SIZE (sizeof(struct stats_swap)) + +/* Structure for paging statistics */ +struct stats_paging { + unsigned long pgpgin __attribute__ ((aligned (8))); + unsigned long pgpgout __attribute__ ((aligned (8))); + unsigned long pgfault __attribute__ ((aligned (8))); + unsigned long pgmajfault __attribute__ ((aligned (8))); + unsigned long pgfree __attribute__ ((aligned (8))); + unsigned long pgscan_kswapd __attribute__ ((aligned (8))); + unsigned long pgscan_direct __attribute__ ((aligned (8))); + unsigned long pgsteal __attribute__ ((aligned (8))); +}; + +#define STATS_PAGING_SIZE (sizeof(struct stats_paging)) + +/* Structure for I/O and transfer rate statistics */ +struct stats_io { + unsigned int dk_drive __attribute__ ((aligned (4))); + unsigned int dk_drive_rio __attribute__ ((packed)); + unsigned int dk_drive_wio __attribute__ ((packed)); + unsigned int dk_drive_rblk __attribute__ ((packed)); + unsigned int dk_drive_wblk __attribute__ ((packed)); +}; + +#define STATS_IO_SIZE (sizeof(struct stats_io)) + +/* Structure for memory and swap space utilization statistics */ +struct stats_memory { + unsigned long frmkb __attribute__ ((aligned (8))); + unsigned long bufkb __attribute__ ((aligned (8))); + unsigned long camkb __attribute__ ((aligned (8))); + unsigned long tlmkb __attribute__ ((aligned (8))); + unsigned long frskb __attribute__ ((aligned (8))); + unsigned long tlskb __attribute__ ((aligned (8))); + unsigned long caskb __attribute__ ((aligned (8))); + unsigned long comkb __attribute__ ((aligned (8))); +}; + +#define STATS_MEMORY_SIZE (sizeof(struct stats_memory)) + +/* Structure for kernel tables statistics */ +struct stats_ktables { + unsigned int file_used __attribute__ ((aligned (4))); + unsigned int inode_used __attribute__ ((packed)); + unsigned int dentry_stat __attribute__ ((packed)); + unsigned int pty_nr __attribute__ ((packed)); +}; + +#define STATS_KTABLES_SIZE (sizeof(struct stats_ktables)) + +/* Structure for queue and load statistics */ +struct stats_queue { + unsigned long nr_running __attribute__ ((aligned (8))); + unsigned int load_avg_1 __attribute__ ((aligned (8))); + unsigned int load_avg_5 __attribute__ ((packed)); + unsigned int load_avg_15 __attribute__ ((packed)); + unsigned int nr_threads __attribute__ ((packed)); +}; + +#define STATS_QUEUE_SIZE (sizeof(struct stats_queue)) + +/* Structure for serial statistics */ +struct stats_serial { + unsigned int rx __attribute__ ((aligned (4))); + unsigned int tx __attribute__ ((packed)); + unsigned int frame __attribute__ ((packed)); + unsigned int parity __attribute__ ((packed)); + unsigned int brk __attribute__ ((packed)); + unsigned int overrun __attribute__ ((packed)); + /* + * A value of 0 means that the structure is unused. + * To avoid the confusion, the line number is saved as (line# + 1) + */ + unsigned int line __attribute__ ((packed)); +}; + +#define STATS_SERIAL_SIZE (sizeof(struct stats_serial)) + +/* Structure for block devices statistics */ +struct stats_disk { + unsigned long long rd_sect __attribute__ ((aligned (16))); + unsigned long long wr_sect __attribute__ ((aligned (16))); + unsigned long rd_ticks __attribute__ ((aligned (16))); + unsigned long wr_ticks __attribute__ ((aligned (8))); + unsigned long tot_ticks __attribute__ ((aligned (8))); + unsigned long rq_ticks __attribute__ ((aligned (8))); + unsigned long nr_ios __attribute__ ((aligned (8))); + unsigned int major __attribute__ ((aligned (8))); + unsigned int minor __attribute__ ((packed)); +}; + +#define STATS_DISK_SIZE (sizeof(struct stats_disk)) + +/* Structure for network interfaces statistics */ +struct stats_net_dev { + unsigned long rx_packets __attribute__ ((aligned (8))); + unsigned long tx_packets __attribute__ ((aligned (8))); + unsigned long rx_bytes __attribute__ ((aligned (8))); + unsigned long tx_bytes __attribute__ ((aligned (8))); + unsigned long rx_compressed __attribute__ ((aligned (8))); + unsigned long tx_compressed __attribute__ ((aligned (8))); + unsigned long multicast __attribute__ ((aligned (8))); + char interface[MAX_IFACE_LEN] __attribute__ ((aligned (8))); +}; + +#define STATS_NET_DEV_SIZE (sizeof(struct stats_net_dev)) + +/* Structure for network interface errors statistics */ +struct stats_net_edev { + unsigned long collisions __attribute__ ((aligned (8))); + unsigned long rx_errors __attribute__ ((aligned (8))); + unsigned long tx_errors __attribute__ ((aligned (8))); + unsigned long rx_dropped __attribute__ ((aligned (8))); + unsigned long tx_dropped __attribute__ ((aligned (8))); + unsigned long rx_fifo_errors __attribute__ ((aligned (8))); + unsigned long tx_fifo_errors __attribute__ ((aligned (8))); + unsigned long rx_frame_errors __attribute__ ((aligned (8))); + unsigned long tx_carrier_errors __attribute__ ((aligned (8))); + char interface[MAX_IFACE_LEN] __attribute__ ((aligned (8))); +}; + +#define STATS_NET_EDEV_SIZE (sizeof(struct stats_net_edev)) + +/* Structure for NFS client statistics */ +struct stats_net_nfs { + unsigned int nfs_rpccnt __attribute__ ((aligned (4))); + unsigned int nfs_rpcretrans __attribute__ ((packed)); + unsigned int nfs_readcnt __attribute__ ((packed)); + unsigned int nfs_writecnt __attribute__ ((packed)); + unsigned int nfs_accesscnt __attribute__ ((packed)); + unsigned int nfs_getattcnt __attribute__ ((packed)); +}; + +#define STATS_NET_NFS_SIZE (sizeof(struct stats_net_nfs)) + +/* Structure for NFS server statistics */ +struct stats_net_nfsd { + unsigned int nfsd_rpccnt __attribute__ ((aligned (4))); + unsigned int nfsd_rpcbad __attribute__ ((packed)); + unsigned int nfsd_netcnt __attribute__ ((packed)); + unsigned int nfsd_netudpcnt __attribute__ ((packed)); + unsigned int nfsd_nettcpcnt __attribute__ ((packed)); + unsigned int nfsd_rchits __attribute__ ((packed)); + unsigned int nfsd_rcmisses __attribute__ ((packed)); + unsigned int nfsd_readcnt __attribute__ ((packed)); + unsigned int nfsd_writecnt __attribute__ ((packed)); + unsigned int nfsd_accesscnt __attribute__ ((packed)); + unsigned int nfsd_getattcnt __attribute__ ((packed)); +}; + +#define STATS_NET_NFSD_SIZE (sizeof(struct stats_net_nfsd)) + +/* Structure for IPv4 sockets statistics */ +struct stats_net_sock { + unsigned int sock_inuse __attribute__ ((aligned (4))); + unsigned int tcp_inuse __attribute__ ((packed)); + unsigned int tcp_tw __attribute__ ((packed)); + unsigned int udp_inuse __attribute__ ((packed)); + unsigned int raw_inuse __attribute__ ((packed)); + unsigned int frag_inuse __attribute__ ((packed)); +}; + +#define STATS_NET_SOCK_SIZE (sizeof(struct stats_net_sock)) + +/* Structure for IP statistics */ +struct stats_net_ip { + unsigned long InReceives __attribute__ ((aligned (8))); + unsigned long ForwDatagrams __attribute__ ((aligned (8))); + unsigned long InDelivers __attribute__ ((aligned (8))); + unsigned long OutRequests __attribute__ ((aligned (8))); + unsigned long ReasmReqds __attribute__ ((aligned (8))); + unsigned long ReasmOKs __attribute__ ((aligned (8))); + unsigned long FragOKs __attribute__ ((aligned (8))); + unsigned long FragCreates __attribute__ ((aligned (8))); +}; + +#define STATS_NET_IP_SIZE (sizeof(struct stats_net_ip)) + +/* Structure for IP errors statistics */ +struct stats_net_eip { + unsigned long InHdrErrors __attribute__ ((aligned (8))); + unsigned long InAddrErrors __attribute__ ((aligned (8))); + unsigned long InUnknownProtos __attribute__ ((aligned (8))); + unsigned long InDiscards __attribute__ ((aligned (8))); + unsigned long OutDiscards __attribute__ ((aligned (8))); + unsigned long OutNoRoutes __attribute__ ((aligned (8))); + unsigned long ReasmFails __attribute__ ((aligned (8))); + unsigned long FragFails __attribute__ ((aligned (8))); +}; + +#define STATS_NET_EIP_SIZE (sizeof(struct stats_net_eip)) + +/* Structure for ICMP statistics */ +struct stats_net_icmp { + unsigned long InMsgs __attribute__ ((aligned (8))); + unsigned long OutMsgs __attribute__ ((aligned (8))); + unsigned long InEchos __attribute__ ((aligned (8))); + unsigned long InEchoReps __attribute__ ((aligned (8))); + unsigned long OutEchos __attribute__ ((aligned (8))); + unsigned long OutEchoReps __attribute__ ((aligned (8))); + unsigned long InTimestamps __attribute__ ((aligned (8))); + unsigned long InTimestampReps __attribute__ ((aligned (8))); + unsigned long OutTimestamps __attribute__ ((aligned (8))); + unsigned long OutTimestampReps __attribute__ ((aligned (8))); + unsigned long InAddrMasks __attribute__ ((aligned (8))); + unsigned long InAddrMaskReps __attribute__ ((aligned (8))); + unsigned long OutAddrMasks __attribute__ ((aligned (8))); + unsigned long OutAddrMaskReps __attribute__ ((aligned (8))); +}; + +#define STATS_NET_ICMP_SIZE (sizeof(struct stats_net_icmp)) + +/* Structure for ICMP error message statistics */ +struct stats_net_eicmp { + unsigned long InErrors __attribute__ ((aligned (8))); + unsigned long OutErrors __attribute__ ((aligned (8))); + unsigned long InDestUnreachs __attribute__ ((aligned (8))); + unsigned long OutDestUnreachs __attribute__ ((aligned (8))); + unsigned long InTimeExcds __attribute__ ((aligned (8))); + unsigned long OutTimeExcds __attribute__ ((aligned (8))); + unsigned long InParmProbs __attribute__ ((aligned (8))); + unsigned long OutParmProbs __attribute__ ((aligned (8))); + unsigned long InSrcQuenchs __attribute__ ((aligned (8))); + unsigned long OutSrcQuenchs __attribute__ ((aligned (8))); + unsigned long InRedirects __attribute__ ((aligned (8))); + unsigned long OutRedirects __attribute__ ((aligned (8))); +}; + +#define STATS_NET_EICMP_SIZE (sizeof(struct stats_net_eicmp)) + +/* Structure for TCP statistics */ +struct stats_net_tcp { + unsigned long ActiveOpens __attribute__ ((aligned (8))); + unsigned long PassiveOpens __attribute__ ((aligned (8))); + unsigned long InSegs __attribute__ ((aligned (8))); + unsigned long OutSegs __attribute__ ((aligned (8))); +}; + +#define STATS_NET_TCP_SIZE (sizeof(struct stats_net_tcp)) + +/* Structure for TCP errors statistics */ +struct stats_net_etcp { + unsigned long AttemptFails __attribute__ ((aligned (8))); + unsigned long EstabResets __attribute__ ((aligned (8))); + unsigned long RetransSegs __attribute__ ((aligned (8))); + unsigned long InErrs __attribute__ ((aligned (8))); + unsigned long OutRsts __attribute__ ((aligned (8))); +}; + +#define STATS_NET_ETCP_SIZE (sizeof(struct stats_net_etcp)) + +/* Structure for UDP statistics */ +struct stats_net_udp { + unsigned long InDatagrams __attribute__ ((aligned (8))); + unsigned long OutDatagrams __attribute__ ((aligned (8))); + unsigned long NoPorts __attribute__ ((aligned (8))); + unsigned long InErrors __attribute__ ((aligned (8))); +}; + +#define STATS_NET_UDP_SIZE (sizeof(struct stats_net_udp)) + +/* Structure for IPv6 statistics */ +struct stats_net_ip6 { + unsigned long InReceives6 __attribute__ ((aligned (8))); + unsigned long OutForwDatagrams6 __attribute__ ((aligned (8))); + unsigned long InDelivers6 __attribute__ ((aligned (8))); + unsigned long OutRequests6 __attribute__ ((aligned (8))); + unsigned long ReasmReqds6 __attribute__ ((aligned (8))); + unsigned long ReasmOKs6 __attribute__ ((aligned (8))); + unsigned long InMcastPkts6 __attribute__ ((aligned (8))); + unsigned long OutMcastPkts6 __attribute__ ((aligned (8))); + unsigned long FragOKs6 __attribute__ ((aligned (8))); + unsigned long FragCreates6 __attribute__ ((aligned (8))); +}; + +#define STATS_NET_IP6_SIZE (sizeof(struct stats_net_ip6)) + +/* Structure for IPv6 errors statistics */ +struct stats_net_eip6 { + unsigned long InHdrErrors6 __attribute__ ((aligned (8))); + unsigned long InAddrErrors6 __attribute__ ((aligned (8))); + unsigned long InUnknownProtos6 __attribute__ ((aligned (8))); + unsigned long InTooBigErrors6 __attribute__ ((aligned (8))); + unsigned long InDiscards6 __attribute__ ((aligned (8))); + unsigned long OutDiscards6 __attribute__ ((aligned (8))); + unsigned long InNoRoutes6 __attribute__ ((aligned (8))); + unsigned long OutNoRoutes6 __attribute__ ((aligned (8))); + unsigned long ReasmFails6 __attribute__ ((aligned (8))); + unsigned long FragFails6 __attribute__ ((aligned (8))); + unsigned long InTruncatedPkts6 __attribute__ ((aligned (8))); +}; + +#define STATS_NET_EIP6_SIZE (sizeof(struct stats_net_eip6)) + +/* Structure for ICMPv6 statistics */ +struct stats_net_icmp6 { + unsigned long InMsgs6 __attribute__ ((aligned (8))); + unsigned long OutMsgs6 __attribute__ ((aligned (8))); + unsigned long InEchos6 __attribute__ ((aligned (8))); + unsigned long InEchoReplies6 __attribute__ ((aligned (8))); + unsigned long OutEchoReplies6 __attribute__ ((aligned (8))); + unsigned long InGroupMembQueries6 __attribute__ ((aligned (8))); + unsigned long InGroupMembResponses6 __attribute__ ((aligned (8))); + unsigned long OutGroupMembResponses6 __attribute__ ((aligned (8))); + unsigned long InGroupMembReductions6 __attribute__ ((aligned (8))); + unsigned long OutGroupMembReductions6 __attribute__ ((aligned (8))); + unsigned long InRouterSolicits6 __attribute__ ((aligned (8))); + unsigned long OutRouterSolicits6 __attribute__ ((aligned (8))); + unsigned long InRouterAdvertisements6 __attribute__ ((aligned (8))); + unsigned long InNeighborSolicits6 __attribute__ ((aligned (8))); + unsigned long OutNeighborSolicits6 __attribute__ ((aligned (8))); + unsigned long InNeighborAdvertisements6 __attribute__ ((aligned (8))); + unsigned long OutNeighborAdvertisements6 __attribute__ ((aligned (8))); +}; + +#define STATS_NET_ICMP6_SIZE (sizeof(struct stats_net_icmp6)) + +/* Structure for ICMPv6 error message statistics */ +struct stats_net_eicmp6 { + unsigned long InErrors6 __attribute__ ((aligned (8))); + unsigned long InDestUnreachs6 __attribute__ ((aligned (8))); + unsigned long OutDestUnreachs6 __attribute__ ((aligned (8))); + unsigned long InTimeExcds6 __attribute__ ((aligned (8))); + unsigned long OutTimeExcds6 __attribute__ ((aligned (8))); + unsigned long InParmProblems6 __attribute__ ((aligned (8))); + unsigned long OutParmProblems6 __attribute__ ((aligned (8))); + unsigned long InRedirects6 __attribute__ ((aligned (8))); + unsigned long OutRedirects6 __attribute__ ((aligned (8))); + unsigned long InPktTooBigs6 __attribute__ ((aligned (8))); + unsigned long OutPktTooBigs6 __attribute__ ((aligned (8))); +}; + +#define STATS_NET_EICMP6_SIZE (sizeof(struct stats_net_eicmp6)) + +/* Structure for UDPv6 statistics */ +struct stats_net_udp6 { + unsigned long InDatagrams6 __attribute__ ((aligned (8))); + unsigned long OutDatagrams6 __attribute__ ((aligned (8))); + unsigned long NoPorts6 __attribute__ ((aligned (8))); + unsigned long InErrors6 __attribute__ ((aligned (8))); +}; + +#define STATS_NET_UDP6_SIZE (sizeof(struct stats_net_udp6)) + +/* Structure for IPv6 sockets statistics */ +struct stats_net_sock6 { + unsigned int tcp6_inuse __attribute__ ((aligned (4))); + unsigned int udp6_inuse __attribute__ ((packed)); + unsigned int raw6_inuse __attribute__ ((packed)); + unsigned int frag6_inuse __attribute__ ((packed)); +}; + +#define STATS_NET_SOCK6_SIZE (sizeof(struct stats_net_sock6)) + +/* + * Structure for CPU frequency statistics. + * In activity buffer: First structure is for global CPU utilisation ("all"). + * Following structures are for each individual CPU (0, 1, etc.) + */ +struct stats_pwr_cpufreq { + unsigned long cpufreq __attribute__ ((aligned (8))); +}; + +#define STATS_PWR_CPUFREQ_SIZE (sizeof(struct stats_pwr_cpufreq)) + +/* + * Structure for fan statistics. + */ +struct stats_pwr_fan { + double rpm __attribute__ ((aligned (8))); + double rpm_min __attribute__ ((aligned (8))); + char device[MAX_SENSORS_DEV_LEN] __attribute__ ((aligned (8))); +}; + +#define STATS_PWR_FAN_SIZE (sizeof(struct stats_pwr_fan)) + +/* + * Structure for device temperature statistics. + */ +struct stats_pwr_temp { + double temp __attribute__ ((aligned (8))); + double temp_min __attribute__ ((aligned (8))); + double temp_max __attribute__ ((aligned (8))); + char device[MAX_SENSORS_DEV_LEN] __attribute__ ((aligned (8))); +}; + +#define STATS_PWR_TEMP_SIZE (sizeof(struct stats_pwr_temp)) + +/* + * Structure for voltage inputs statistics. + */ +struct stats_pwr_in { + double in __attribute__ ((aligned (8))); + double in_min __attribute__ ((aligned (8))); + double in_max __attribute__ ((aligned (8))); + char device[MAX_SENSORS_DEV_LEN] __attribute__ ((aligned (8))); +}; + +#define STATS_PWR_IN_SIZE (sizeof(struct stats_pwr_in)) + +/* + *************************************************************************** + * Prototypes for functions used to read system statistics + *************************************************************************** + */ + +extern void + read_stat_cpu(struct stats_cpu *, int, + unsigned long long *, unsigned long long *); +extern void + read_stat_pcsw(struct stats_pcsw *); +extern void + read_stat_irq(struct stats_irq *, int); +extern void + read_loadavg(struct stats_queue *); +extern void + read_meminfo(struct stats_memory *); +extern void + read_vmstat_swap(struct stats_swap *); +extern void + read_vmstat_paging(struct stats_paging *); +extern void + read_diskstats_io(struct stats_io *); +extern void + read_diskstats_disk(struct stats_disk *, int, int); +extern void + read_tty_driver_serial(struct stats_serial *, int); +extern void + read_kernel_tables(struct stats_ktables *); +extern void + read_net_dev(struct stats_net_dev *, int); +extern void + read_net_edev(struct stats_net_edev *, int); +extern void + read_net_nfs(struct stats_net_nfs *); +extern void + read_net_nfsd(struct stats_net_nfsd *); +extern void + read_net_sock(struct stats_net_sock *); +extern void + read_net_ip(struct stats_net_ip *); +extern void + read_net_eip(struct stats_net_eip *); +extern void + read_net_icmp(struct stats_net_icmp *); +extern void + read_net_eicmp(struct stats_net_eicmp *); +extern void + read_net_tcp(struct stats_net_tcp *); +extern void + read_net_etcp(struct stats_net_etcp *); +extern void + read_net_udp(struct stats_net_udp *); +extern void + read_uptime(unsigned long long *); +extern void + read_net_sock6(struct stats_net_sock6 *); +extern void + read_net_ip6(struct stats_net_ip6 *); +extern void + read_net_eip6(struct stats_net_eip6 *); +extern void + read_net_icmp6(struct stats_net_icmp6 *); +extern void + read_net_eicmp6(struct stats_net_eicmp6 *); +extern void + read_net_udp6(struct stats_net_udp6 *); +extern void + read_cpuinfo(struct stats_pwr_cpufreq *, int); +extern void + read_fan(struct stats_pwr_fan *, int); +extern void + read_temp(struct stats_pwr_temp *, int); +extern void + read_in(struct stats_pwr_in *, int); + +/* + *************************************************************************** + * Prototypes for functions used to count number of items + *************************************************************************** + */ + +extern int + get_irq_nr(void); +extern int + get_serial_nr(void); +extern int + get_iface_nr(void); +extern int + get_diskstats_dev_nr(int, int); +extern int + get_disk_nr(unsigned int); +extern int + get_cpu_nr(unsigned int); +extern int + get_irqcpu_nr(char *, int, int); +extern int + get_fan_nr(void); +extern int + get_temp_nr(void); +extern int + get_in_nr(void); + +#endif /* _RD_STATS_H */ diff --git a/sa.h b/sa.h new file mode 100644 index 00000000..ac5cc40a --- /dev/null +++ b/sa.h @@ -0,0 +1,755 @@ +/* + * sar/sadc: Report system activity + * (C) 1999-2010 by Sebastien Godard (sysstat orange.fr) + */ + +#ifndef _SA_H +#define _SA_H + +#include "common.h" +#include "rd_stats.h" + + +/* + *************************************************************************** + * Activity identification values. + *************************************************************************** + */ + +/* Number of activities */ +#define NR_ACT 33 + +/* Activities */ +#define A_CPU 1 +#define A_PCSW 2 +#define A_IRQ 3 +#define A_SWAP 4 +#define A_PAGE 5 +#define A_IO 6 +#define A_MEMORY 7 +#define A_KTABLES 8 +#define A_QUEUE 9 +#define A_SERIAL 10 +#define A_DISK 11 +#define A_NET_DEV 12 +#define A_NET_EDEV 13 +#define A_NET_NFS 14 +#define A_NET_NFSD 15 +#define A_NET_SOCK 16 +#define A_NET_IP 17 +#define A_NET_EIP 18 +#define A_NET_ICMP 19 +#define A_NET_EICMP 20 +#define A_NET_TCP 21 +#define A_NET_ETCP 22 +#define A_NET_UDP 23 +#define A_NET_SOCK6 24 +#define A_NET_IP6 25 +#define A_NET_EIP6 26 +#define A_NET_ICMP6 27 +#define A_NET_EICMP6 28 +#define A_NET_UDP6 29 +#define A_PWR_CPUFREQ 30 +#define A_PWR_FAN 31 +#define A_PWR_TEMP 32 +#define A_PWR_IN 33 + + +/* Macro used to flag an activity that should be collected */ +#define COLLECT_ACTIVITY(m) act[get_activity_position(act, m)]->options |= AO_COLLECTED + +/* Macro used to flag an activity that should be selected */ +#define SELECT_ACTIVITY(m) act[get_activity_position(act, m)]->options |= AO_SELECTED + + +/* + *************************************************************************** + * Flags. + *************************************************************************** + */ + +#define S_F_SINCE_BOOT 0x00000001 +#define S_F_SA_ROTAT 0x00000002 +#define S_F_DEV_PRETTY 0x00000004 +#define S_F_FORCE_FILE 0x00000008 +#define S_F_INTERVAL_SET 0x00000010 +#define S_F_TRUE_TIME 0x00000020 +#define S_F_LOCK_FILE 0x00000040 +/* Unused 0x00000080 */ +/* Unused 0x00000100 */ +#define S_F_FILE_LOCKED 0x00000200 +#define S_F_PER_PROC 0x00000400 +#define S_F_HORIZONTALLY 0x00000800 +#define S_F_COMMENT 0x00001000 + +#define WANT_SINCE_BOOT(m) (((m) & S_F_SINCE_BOOT) == S_F_SINCE_BOOT) +#define WANT_SA_ROTAT(m) (((m) & S_F_SA_ROTAT) == S_F_SA_ROTAT) +#define USE_PRETTY_OPTION(m) (((m) & S_F_DEV_PRETTY) == S_F_DEV_PRETTY) +#define FORCE_FILE(m) (((m) & S_F_FORCE_FILE) == S_F_FORCE_FILE) +#define INTERVAL_SET(m) (((m) & S_F_INTERVAL_SET) == S_F_INTERVAL_SET) +#define PRINT_TRUE_TIME(m) (((m) & S_F_TRUE_TIME) == S_F_TRUE_TIME) +#define LOCK_FILE(m) (((m) & S_F_LOCK_FILE) == S_F_LOCK_FILE) +#define FILE_LOCKED(m) (((m) & S_F_FILE_LOCKED) == S_F_FILE_LOCKED) +#define WANT_PER_PROC(m) (((m) & S_F_PER_PROC) == S_F_PER_PROC) +#define DISPLAY_HORIZONTALLY(m) (((m) & S_F_HORIZONTALLY) == S_F_HORIZONTALLY) +#define DISPLAY_COMMENT(m) (((m) & S_F_COMMENT) == S_F_COMMENT) + +/* Output flags for options -R / -r / -S */ +#define AO_F_MEM_DIA 0x00000001 +#define AO_F_MEM_AMT 0x00000002 +#define AO_F_MEM_SWAP 0x00000004 + +#define DISPLAY_MEMORY(m) (((m) & AO_F_MEM_DIA) == AO_F_MEM_DIA) +#define DISPLAY_MEM_AMT(m) (((m) & AO_F_MEM_AMT) == AO_F_MEM_AMT) +#define DISPLAY_SWAP(m) (((m) & AO_F_MEM_SWAP) == AO_F_MEM_SWAP) + +/* Output flags for option -u [ ALL ] */ +#define AO_F_CPU_DEF 0x00000001 +#define AO_F_CPU_ALL 0x00000002 + +#define DISPLAY_CPU_DEF(m) (((m) & AO_F_CPU_DEF) == AO_F_CPU_DEF) +#define DISPLAY_CPU_ALL(m) (((m) & AO_F_CPU_ALL) == AO_F_CPU_ALL) + +/* Output flags for option -d */ +#define AO_F_DISK_PART 0x00000001 + +#define COLLECT_PARTITIONS(m) (((m) & AO_F_DISK_PART) == AO_F_DISK_PART) + +/* + *************************************************************************** + * Various keywords and constants. + *************************************************************************** + */ + +/* Keywords */ +#define K_XALL "XALL" +#define K_SUM "SUM" +#define K_DEV "DEV" +#define K_EDEV "EDEV" +#define K_NFS "NFS" +#define K_NFSD "NFSD" +#define K_SOCK "SOCK" +#define K_IP "IP" +#define K_EIP "EIP" +#define K_ICMP "ICMP" +#define K_EICMP "EICMP" +#define K_TCP "TCP" +#define K_ETCP "ETCP" +#define K_UDP "UDP" +#define K_DISK "DISK" +#define K_INT "INT" +#define K_SNMP "SNMP" +#define K_SOCK6 "SOCK6" +#define K_IP6 "IP6" +#define K_EIP6 "EIP6" +#define K_ICMP6 "ICMP6" +#define K_EICMP6 "EICMP6" +#define K_UDP6 "UDP6" +#define K_IPV6 "IPV6" +#define K_POWER "POWER" +#define K_XDISK "XDISK" +#define K_CPU "CPU" +#define K_FAN "FAN" +#define K_TEMP "TEMP" +#define K_IN "IN" + +/* sadc program */ +#define SADC "sadc" + +/* Time must have the format HH:MM:SS with HH in 24-hour format */ +#define DEF_TMSTART "08:00:00" +#define DEF_TMEND "18:00:00" + +/* + * Macro used to define activity bitmap size. + * All those bitmaps have an additional bit used for global activity + * (eg. CPU "all" or total number of interrupts). That's why we do "(m) + 1". + */ +#define BITMAP_SIZE(m) ((((m) + 1) / 8) + 1) + +/* Pre-allocation constants */ +#define NR_IFACE_PREALLOC 2 +#define NR_SERIAL_PREALLOC 2 +#define NR_DISK_PREALLOC 3 + +#define UTSNAME_LEN 65 +#define TIMESTAMP_LEN 16 +#define XML_TIMESTAMP_LEN 64 +#define HEADER_LINE_LEN 512 + +/* Maximum number of args that can be passed to sadc */ +#define MAX_ARGV_NR 32 + +/* Miscellaneous constants */ +#define USE_SADC 0 +#define USE_SA_FILE 1 +#define NO_TM_START 0 +#define NO_TM_END 0 +#define NO_RESET 0 +#define NON_FATAL 0 +#define FATAL 1 +#define C_SAR 0 +#define C_SADF 1 +#define ALL_ACTIVITIES ~0U + +#define SOFT_SIZE 0 +#define HARD_SIZE 1 + +#define CLOSE_XML_MARKUP 0 +#define OPEN_XML_MARKUP 1 + +#define COUNT_ACTIVITIES 0 +#define COUNT_OUTPUTS 1 + + +/* + *************************************************************************** + * Generic description of an activity. + *************************************************************************** + */ + +/* Activity options */ +#define AO_NULL 0x00 +/* + * Indicate that corresponding activity should be collected by sadc. + */ +#define AO_COLLECTED 0x01 +/* + * Indicate that corresponding activity should be displayed by sar. + */ +#define AO_SELECTED 0x02 +/* + * Indicate that, when registered again, activity counters will get back + * the values they had when they were unregistered (eg. CPUs, which can + * be disabled/enabled on the fly). + */ +#define AO_REMANENT 0x04 +/* + * Indicate that the interval of time, given to f_print() function + * displaying statistics, should be the interval of time in jiffies + * multiplied by the number of processors. + */ +#define AO_GLOBAL_ITV 0x08 +/* + * This flag should be set for every activity closing a markup used + * by several activities. Used by sadf f_xml_print() functions to + * display XML output. + */ +#define AO_CLOSE_MARKUP 0x10 +/* + * Indicate that corresponding activity has multiple different + * output formats. This is the case for example for memory activity + * with options -r and -R. + */ +#define AO_MULTIPLE_OUTPUTS 0x20 + +#define IS_COLLECTED(m) (((m) & AO_COLLECTED) == AO_COLLECTED) +#define IS_SELECTED(m) (((m) & AO_SELECTED) == AO_SELECTED) +#define IS_REMANENT(m) (((m) & AO_REMANENT) == AO_REMANENT) +#define NEEDS_GLOBAL_ITV(m) (((m) & AO_GLOBAL_ITV) == AO_GLOBAL_ITV) +#define CLOSE_MARKUP(m) (((m) & AO_CLOSE_MARKUP) == AO_CLOSE_MARKUP) +#define HAS_MULTIPLE_OUTPUTS(m) (((m) & AO_MULTIPLE_OUTPUTS) == AO_MULTIPLE_OUTPUTS) + + +/* Type for all functions counting items */ +#define __nr_t int +/* Type for all functions reading statistics */ +#define __read_funct_t void +/* Type for all functions displaying statistics */ +#define __print_funct_t void + +#define _buf0 buf[0] + +/* Structure used to define a bitmap needed by an activity */ +struct act_bitmap { + /* + * Bitmap for activities that need one. Remember to allocate it + * before use! + */ + unsigned char *b_array; + /* + * Size of the bitmap in bits. In fact, bitmap is sized to bitmap_size + 1 + * to take into account CPU "all" + */ + int b_size; +}; + +/* Structure used to define an activity */ +struct activity { + /* + * This variable contains the identification value (A_...) for this activity. + */ + unsigned int id; + /* + * Activity options (AO_SELECTED, ...) + */ + unsigned int options; + /* + * The f_count() function is used to count the number of + * items (serial lines, network interfaces, etc.). + * Such a function should _always_ return a value greater than + * or equal to 0. + * + * A NULL value for this function pointer indicates that the number of items + * is a constant (and @nr is set to this value). + * + * This function is called even if activity has not been selected, to make + * sure that all items have been calculated (including #CPU, etc.) + */ + __nr_t (*f_count) (struct activity *); + /* + * This function reads the relevant file and fill the buffer + * with statistics corresponding to given activity. + */ + __read_funct_t (*f_read) (struct activity *); + /* + * This function displays activity statistics onto the screen. + */ + __print_funct_t (*f_print) (struct activity *, int, int, unsigned long long); + /* + * This function displays average activity statistics onto the screen. + */ + __print_funct_t (*f_print_avg) (struct activity *, int, int, unsigned long long); + /* + * This function is used by sadf to display activity in a format that can + * easily be ingested by a relational database, or a format that can be + * handled by pattern processing commands like "awk". + */ + __print_funct_t (*f_render) (struct activity *, int, char *, int, unsigned long long); + /* + * This function is used by sadf to display activity statistics in XML. + */ + __print_funct_t (*f_xml_print) (struct activity *, int, int, unsigned long long); + /* + * Header string displayed by sadf -d/-D. + */ + char *hdr_line; + /* + * Name of activity. + */ + char *name; + /* + * Number of items on the system. + * A negative value (-1) is the default value and indicates that this number + * has still not been calculated by the f_count() function. + * A value of 0 means that this number has been calculated, but no items have + * been found. + */ + __nr_t nr; + /* + * Size of an item. + * This is the size of the corresponding structure, as read from or written + * to a file, or read from or written by the data collector. + */ + int fsize; + /* + * Size of an item. + * This is the size of the corresponding structure as mapped into memory. + * @msize can be different from @fsize when data are read from or written to + * a data file from a different sysstat version. + */ + int msize; + /* + * Optional flags for activity. This is eg. used when AO_MULTIPLE_OUTPUTS + * option is set. + */ + unsigned int opt_flags; + /* + * Buffers that will contain the statistics read. Its size is @nr * @size each. + * [0]: used by sadc. Used by sar to save first collected stats (used later to + * compute average). + * [1] and [2]: current/previous statistics values (used by sar). + */ + void *buf[3]; + /* + * Bitmap for activities that need one. Such a bitmap is needed by activity + * if @bitmap is not NULL. + */ + struct act_bitmap *bitmap; +}; + + +/* + *************************************************************************** + * Definitions of header structures. + * + * Format of system activity data files: + * __ + * | + * | file_magic structure + * | + * |-- + * | + * | file_header structure + * | + * |-- --| + * | | + * | file_activity structure | * sa_nr_act + * | | + * |-- --| + * | | + * | record_header structure | + * | | + * |-- | * + * | | + * | Statistics structures...(*) | + * | | + * |-- --| + * + * (*)Note: If it's a special record, we may find a comment instead of + * statistics (R_COMMENT record type) or even nothing at all (R_RESTART + * record type). + *************************************************************************** + */ + +/* + * Sysstat magic number. Should never be modified. + * Indicate that the file was created by sysstat. + */ +#define SYSSTAT_MAGIC 0xd596 + +/* + * Datafile format magic number. + * Modified to indicate that the format of the file is + * no longer compatible with that of previous sysstat versions. + */ +#define FORMAT_MAGIC 0x2170 + +/* Structure for file magic header data */ +struct file_magic { + /* + * This field identifies the file as a file created by sysstat. + */ + unsigned short sysstat_magic; + /* + * The value of this field varies whenever datafile format changes. + */ + unsigned short format_magic; + /* + * Sysstat version used to create the file. + */ + unsigned char sysstat_version; + unsigned char sysstat_patchlevel; + unsigned char sysstat_sublevel; + unsigned char sysstat_extraversion; +}; + +#define FILE_MAGIC_SIZE (sizeof(struct file_magic)) + + +/* Header structure for system activity data file */ +struct file_header { + /* + * Timestamp in seconds since the epoch. + */ + unsigned long sa_ust_time __attribute__ ((aligned (8))); + /* + * Number of activities saved in the file + */ + unsigned int sa_nr_act __attribute__ ((aligned (8))); + /* + * Current day, month and year. + * No need to save DST (Daylight Saving Time) flag, since it is not taken + * into account by the strftime() function used to print the timestamp. + */ + unsigned char sa_day; + unsigned char sa_month; + unsigned char sa_year; + /* + * Size of a long integer. Useful to know the architecture on which + * the datafile was created. + */ + char sa_sizeof_long; + /* + * Operating system name. + */ + char sa_sysname[UTSNAME_LEN]; + /* + * Machine hostname. + */ + char sa_nodename[UTSNAME_LEN]; + /* + * Operating system release number. + */ + char sa_release[UTSNAME_LEN]; + /* + * Machine architecture. + */ + char sa_machine[UTSNAME_LEN]; +}; + +#define FILE_HEADER_SIZE (sizeof(struct file_header)) + + +/* List of activities saved in file */ +struct file_activity { + /* + * Identification value of activity. + */ + unsigned int id __attribute__ ((aligned (4))); + /* + * Number of items for this activity. + */ + __nr_t nr __attribute__ ((packed)); + /* + * Size of an item structure. + */ + int size __attribute__ ((packed)); +}; + +#define FILE_ACTIVITY_SIZE (sizeof(struct file_activity)) + + +/* Record type */ +/* + * R_STATS means that this is a record of statistics. + */ +#define R_STATS 1 +/* + * R_RESTART means that this is a special record containing + * a LINUX RESTART message. + */ +#define R_RESTART 2 +/* + * R_LAST_STATS warns sar that this is the last record to be written + * to file before a file rotation, and that the next data to come will + * be a header file. + * Such a record is tagged R_STATS anyway before being written to file. + */ +#define R_LAST_STATS 3 +/* + * R_COMMENT means that this is a special record containing + * a comment. + */ +#define R_COMMENT 4 + +/* Maximum length of a comment */ +#define MAX_COMMENT_LEN 64 + +/* Header structure for every record */ +struct record_header { + /* + * Machine uptime (multiplied by the # of proc). + */ + unsigned long long uptime __attribute__ ((aligned (16))); + /* + * Uptime reduced to one processor. Always set, even on UP machines. + */ + unsigned long long uptime0 __attribute__ ((aligned (16))); + /* + * Timestamp (number of seconds since the epoch). + */ + unsigned long ust_time __attribute__ ((aligned (16))); + /* + * Record type: R_STATS, R_RESTART,... + */ + unsigned char record_type __attribute__ ((aligned (8))); + /* + * Timestamp: Hour (0-23), minute (0-59) and second (0-59). + * Used to determine TRUE time (immutable, non locale dependent time). + */ + unsigned char hour; + unsigned char minute; + unsigned char second; +}; + +#define RECORD_HEADER_SIZE (sizeof(struct record_header)) + + +/* + *************************************************************************** + * Macro functions definitions. + * + * Note: Using 'do ... while' makes the macros safer to use + * (remember that macro use are followed by a semicolon). + *************************************************************************** + */ + +/* Close file descriptors */ +#define CLOSE_ALL(_fd_) do { \ + close(_fd_[0]); \ + close(_fd_[1]); \ + } while (0) + +#define CLOSE(_fd_) if (_fd_ >= 0) \ + close(_fd_) + + +/* + *************************************************************************** + * Various structure definitions. + *************************************************************************** + */ + +/* Structure for timestamps */ +struct tstamp { + int tm_sec; + int tm_min; + int tm_hour; + int use; +}; + + +/* + *************************************************************************** + * Functions prototypes. + *************************************************************************** + */ + +/* Functions used to count number of items */ +extern __nr_t + wrap_get_cpu_nr(struct activity *); +extern __nr_t + wrap_get_irq_nr(struct activity *); +extern __nr_t + wrap_get_serial_nr(struct activity *); +extern __nr_t + wrap_get_disk_nr(struct activity *); +extern __nr_t + wrap_get_iface_nr(struct activity *); +extern __nr_t + wrap_get_fan_nr(struct activity *); +extern __nr_t + wrap_get_temp_nr(struct activity *); +extern __nr_t + wrap_get_in_nr(struct activity *); + +/* Functions used to read activities statistics */ +extern __read_funct_t + wrap_read_stat_cpu(struct activity *); +extern __read_funct_t + wrap_read_stat_pcsw(struct activity *); +extern __read_funct_t + wrap_read_stat_irq(struct activity *); +extern __read_funct_t + wrap_read_swap(struct activity *); +extern __read_funct_t + wrap_read_paging(struct activity *); +extern __read_funct_t + wrap_read_io(struct activity *); +extern __read_funct_t + wrap_read_meminfo(struct activity *); +extern __read_funct_t + wrap_read_kernel_tables(struct activity *); +extern __read_funct_t + wrap_read_loadavg(struct activity *); +extern __read_funct_t + wrap_read_tty_driver_serial(struct activity *); +extern __read_funct_t + wrap_read_disk(struct activity *); +extern __read_funct_t + wrap_read_net_dev(struct activity *); +extern __read_funct_t + wrap_read_net_edev(struct activity *); +extern __read_funct_t + wrap_read_net_nfs(struct activity *); +extern __read_funct_t + wrap_read_net_nfsd(struct activity *); +extern __read_funct_t + wrap_read_net_sock(struct activity *); +extern __read_funct_t + wrap_read_net_ip(struct activity *); +extern __read_funct_t + wrap_read_net_eip(struct activity *); +extern __read_funct_t + wrap_read_net_icmp(struct activity *); +extern __read_funct_t + wrap_read_net_eicmp(struct activity *); +extern __read_funct_t + wrap_read_net_tcp(struct activity *); +extern __read_funct_t + wrap_read_net_etcp(struct activity *); +extern __read_funct_t + wrap_read_net_udp(struct activity *); +extern __read_funct_t + wrap_read_net_sock6(struct activity *); +extern __read_funct_t + wrap_read_net_ip6(struct activity *); +extern __read_funct_t + wrap_read_net_eip6(struct activity *); +extern __read_funct_t + wrap_read_net_icmp6(struct activity *); +extern __read_funct_t + wrap_read_net_eicmp6(struct activity *); +extern __read_funct_t + wrap_read_net_udp6(struct activity *); +extern __read_funct_t + wrap_read_cpuinfo(struct activity *); +extern __read_funct_t + wrap_read_fan(struct activity *); +extern __read_funct_t + wrap_read_temp(struct activity *); +extern __read_funct_t + wrap_read_in(struct activity *); + +/* Other functions */ +extern void + allocate_bitmaps(struct activity * []); +extern void + allocate_structures(struct activity * []); +extern int + check_disk_reg(struct activity *, int, int, int); +extern void + check_file_actlst(int *, char *, struct activity * [], struct file_magic *, + struct file_header *, struct file_activity **, + unsigned int [], int); +extern unsigned int + check_net_dev_reg(struct activity *, int, int, unsigned int); +extern unsigned int + check_net_edev_reg(struct activity *, int, int, unsigned int); +extern void + copy_structures(struct activity * [], unsigned int [], + struct record_header [], int, int); +extern int + datecmp(struct tm *, struct tstamp *); +extern void + display_sa_file_version(struct file_magic *); +extern void + free_bitmaps(struct activity * []); +extern void + free_structures(struct activity * []); +extern int + get_activity_nr(struct activity * [], unsigned int, int); +extern int + get_activity_position(struct activity * [], unsigned int); +extern char * + get_devname(unsigned int, unsigned int, int); +extern void + get_file_timestamp_struct(unsigned int, struct tm *, struct file_header *); +extern void + get_itv_value(struct record_header *, struct record_header *, + unsigned int, unsigned long long *, unsigned long long *); +extern void + handle_invalid_sa_file(int *, struct file_magic *, char *, int); +extern int + next_slice(unsigned long long, unsigned long long, int, long); +extern int + parse_sar_opt(char * [], int *, struct activity * [], unsigned int *, int); +extern int + parse_sar_I_opt(char * [], int *, struct activity * []); +extern int + parse_sa_P_opt(char * [], int *, unsigned int *, struct activity * []); +extern int + parse_sar_m_opt(char * [], int *, struct activity * []); +extern int + parse_sar_n_opt(char * [], int *, struct activity * []); +extern int + parse_timestamp(char * [], int *, struct tstamp *, const char *); +extern void + print_report_hdr(unsigned int, struct tm *, struct file_header *, int); +extern void + read_file_stat_bunch(struct activity * [], int, int, int, struct file_activity *); +extern int + sa_fread(int, void *, int, int); +extern void + select_all_activities(struct activity * []); +extern void + select_default_activity(struct activity * []); +extern void + set_bitmap(unsigned char [], unsigned char, unsigned int); +extern void + set_default_file(struct tm *, char *); +extern void + set_hdr_rectime(unsigned int, struct tm *, struct file_header *); + +#endif /* _SA_H */ diff --git a/sa1.in b/sa1.in new file mode 100644 index 00000000..dbaa3226 --- /dev/null +++ b/sa1.in @@ -0,0 +1,45 @@ +#!/bin/sh +# @SA_LIB_DIR@/sa1 +# (C) 1999-2009 Sebastien Godard (sysstat orange.fr) +# +#@(#) @PACKAGE_NAME@-@PACKAGE_VERSION@ +#@(#) sa1: Collect and store binary data in system activity data file. +# +HISTORY=0 +SYSCONFIG_DIR=@SYSCONFIG_DIR@ +[ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat +if [ ${HISTORY} -gt 28 ] +then + CURRENTDIR=`date +%Y%m` + DATE=`date +%d` + CURRENTFILE=sa${DATE} + DDIR=@SA_DIR@ + cd ${DDIR} || exit 1 + [ -d ${CURRENTDIR} ] || mkdir -p ${CURRENTDIR} + # If ${CURRENTFILE} exists and is a regular file, then make sure + # the file was modified this day (and not e.g. month ago) + # and move it to ${CURRENTDIR} + [ ! -L ${CURRENTFILE} ] && + [ -f ${CURRENTFILE} ] && + [ "`date +%Y%m%d -r ${CURRENTFILE}`" = "${CURRENTDIR}${DATE}" ] && + mv -f ${CURRENTFILE} ${CURRENTDIR}/${CURRENTFILE} + touch ${CURRENTDIR}/${CURRENTFILE} + # Remove the "compatibility" link and recreate it to point to + # the (new) current file + rm -f ${CURRENTFILE} + ln -s ${CURRENTDIR}/${CURRENTFILE} ${CURRENTFILE} +fi +umask 0022 +ENDIR=@SA_LIB_DIR@ +cd ${ENDIR} +[ "$1" = "--boot" ] && shift && BOOT=y || BOOT=n +if [ $# = 0 ] && [ "${BOOT}" = "n" ] +then +# Note: Stats are written at the end of previous file *and* at the +# beginning of the new one (when there is a file rotation) only if +# outfile has been specified as '-' on the command line... + exec ${ENDIR}/sadc -F -L 1 1 - +else + exec ${ENDIR}/sadc -F -L $* - +fi + diff --git a/sa2.in b/sa2.in new file mode 100644 index 00000000..c6ff59d4 --- /dev/null +++ b/sa2.in @@ -0,0 +1,63 @@ +#!/bin/sh +# @SA_LIB_DIR@/sa2 +# (C) 1999-2009 Sebastien Godard (sysstat orange.fr) +# +#@(#) @PACKAGE_NAME@-@PACKAGE_VERSION@ +#@(#) sa2: Write a daily report +# +S_TIME_FORMAT=ISO ; export S_TIME_FORMAT +umask 0022 +prefix=@prefix@ +exec_prefix=@exec_prefix@ +# Add a trailing slash so that 'find' can go through this directory if it's a symlink +DDIR=@SA_DIR@/ +SYSCONFIG_DIR=@SYSCONFIG_DIR@ +YESTERDAY=@YESTERDAY@ +DATE=`date ${YESTERDAY} +%d` +CURRENTFILE=sa${DATE} +CURRENTRPT=sar${DATE} +HISTORY=@HISTORY@ +COMPRESSAFTER=@COMPRESSAFTER@ +ZIP="@ZIP@" +[ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat +if [ ${HISTORY} -gt 28 ] +then + CURRENTDIR=`date ${YESTERDAY} +%Y%m` + cd ${DDIR} || exit 1 + [ -d ${CURRENTDIR} ] || mkdir -p ${CURRENTDIR} + # Check if ${CURRENTFILE} is the correct file created at ${DATE} + # Note: using `-ge' instead of `=' since the file could have + # the next day time stamp because of the file rotating feature of sadc + [ -f ${CURRENTFILE} ] && + [ "`date +%Y%m%d -r ${CURRENTFILE}`" -ge "${CURRENTDIR}${DATE}" ] || exit 0 + # If the file is a regular file, then move it to ${CURRENTDIR} + [ ! -L ${CURRENTFILE} ] && + mv -f ${CURRENTFILE} ${CURRENTDIR}/${CURRENTFILE} && + ln -s ${CURRENTDIR}/${CURRENTFILE} ${CURRENTFILE} + touch ${CURRENTDIR}/${CURRENTRPT} + # Remove the "compatibility" link and recreate it to point to + # the (new) current file + rm -f ${CURRENTRPT} + ln -s ${CURRENTDIR}/${CURRENTRPT} ${CURRENTRPT} + CURRENTDIR=${DDIR}/${CURRENTDIR} +else + CURRENTDIR=${DDIR} +fi +RPT=${CURRENTDIR}/${CURRENTRPT} +ENDIR=@bindir@ +DFILE=${CURRENTDIR}/${CURRENTFILE} +[ -f "$DFILE" ] || exit 0 +cd ${ENDIR} +[ -L ${RPT} ] && rm -f ${RPT} +${ENDIR}/sar $* -f ${DFILE} > ${RPT} +find ${DDIR} \( -name 'sar??' -o -name 'sa??' -o -name 'sar??.gz' -o -name 'sa??.gz' -o -name 'sar??.bz2' -o -name 'sa??.bz2' \) \ + -mtime +"${HISTORY}" -exec rm -f {} \; +find ${DDIR} \( -name 'sar??' -o -name 'sa??' \) -type f -mtime +"${COMPRESSAFTER}" \ + -exec ${ZIP} {} \; > /dev/null 2>&1 +# Remove broken links +for f in `find ${DDIR} \( -name 'sar??' -o -name 'sa??' \) -type l`; do + [ -e $f ] || rm -f $f +done +cd ${DDIR} +rmdir [0-9]????? > /dev/null 2>&1 + diff --git a/sa_common.c b/sa_common.c new file mode 100644 index 00000000..7d1bea6d --- /dev/null +++ b/sa_common.c @@ -0,0 +1,1538 @@ +/* + * sar and sadf common routines. + * (C) 1999-2010 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include /* For STDOUT_FILENO, among others */ +#include +#include +#include +#include + +#include "sa.h" +#include "common.h" +#include "ioconf.h" +#include "rd_stats.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +extern struct act_bitmap cpu_bitmap; + +/* + *************************************************************************** + * Init a bitmap (CPU, IRQ, etc.). + * + * IN: + * @value Value used to init bitmap. + * @sz Size of the bitmap in bytes. + * + * OUT: + * @bitmap Bitmap initialized. + *************************************************************************** + */ +void set_bitmap(unsigned char bitmap[], unsigned char value, unsigned int sz) +{ + register int i; + + for (i = 0; i < sz; i++) { + bitmap[i] = value; + } +} + +/* + *************************************************************************** + * Allocate structures. + * + * IN: + * @act Array of activities. + *************************************************************************** + */ +void allocate_structures(struct activity *act[]) +{ + int i, j; + + for (i = 0; i < NR_ACT; i++) { + if (act[i]->nr > 0) { + for (j = 0; j < 3; j++) { + SREALLOC(act[i]->buf[j], void, act[i]->msize * act[i]->nr); + } + } + } +} + +/* + *************************************************************************** + * Free structures. + * + * IN: + * @act Array of activities. + *************************************************************************** + */ +void free_structures(struct activity *act[]) +{ + int i, j; + + for (i = 0; i < NR_ACT; i++) { + if (act[i]->nr > 0) { + for (j = 0; j < 3; j++) { + if (act[i]->buf[j]) { + free(act[i]->buf[j]); + act[i]->buf[j] = NULL; + } + } + } + } +} + +/* + *************************************************************************** + * Get device real name if possible. + * Warning: This routine may return a bad name on 2.4 kernels where + * disk activities are read from /proc/stat. + * + * IN: + * @major Major number of the device. + * @minor Minor number of the device. + * @pretty TRUE if the real name of the device (as it appears in /dev) + * should be returned. + * + * RETURNS: + * The name of the device, which may be the real name (as it appears in /dev) + * or a string with the following format devM-n. + *************************************************************************** + */ +char *get_devname(unsigned int major, unsigned int minor, int pretty) +{ + static char buf[32]; + char *name; + + snprintf(buf, 32, "dev%d-%d", major, minor); + + if (!pretty) + return (buf); + + name = ioc_name(major, minor); + if ((name == NULL) || !strcmp(name, K_NODEV)) + return (buf); + + return (name); +} + +/* + *************************************************************************** + * Check if we are close enough to desired interval. + * + * IN: + * @uptime_ref Uptime used as reference. This is the system uptime for the + * first sample statistics, or the first system uptime after a + * LINUX RESTART. + * @uptime Current system uptime. + * @reset TRUE if @last_uptime should be reset with @uptime_ref. + * @interval Interval of time. + * + * RETURNS: + * 1 if we are actually close enough to desired interval, 0 otherwise. + *************************************************************************** +*/ +int next_slice(unsigned long long uptime_ref, unsigned long long uptime, + int reset, long interval) +{ + unsigned long file_interval, entry; + static unsigned long long last_uptime = 0; + int min, max, pt1, pt2; + double f; + + /* uptime is expressed in jiffies (basis of 1 processor) */ + if (!last_uptime || reset) { + last_uptime = uptime_ref; + } + + /* Interval cannot be greater than 0xffffffff here */ + f = ((double) ((uptime - last_uptime) & 0xffffffff)) / HZ; + file_interval = (unsigned long) f; + if ((f * 10) - (file_interval * 10) >= 5) { + file_interval++; /* Rounding to correct value */ + } + + last_uptime = uptime; + + /* + * A few notes about the "algorithm" used here to display selected entries + * from the system activity file (option -f with -i flag): + * Let 'Iu' be the interval value given by the user on the command line, + * 'If' the interval between current and previous line in the system + * activity file, + * and 'En' the nth entry (identified by its time stamp) of the file. + * We choose In = [ En - If/2, En + If/2 [ if If is even, + * or In = [ En - If/2, En + If/2 ] if not. + * En will be displayed if + * (Pn * Iu) or (P'n * Iu) belongs to In + * with Pn = En / Iu and P'n = En / Iu + 1 + */ + f = ((double) ((uptime - uptime_ref) & 0xffffffff)) / HZ; + entry = (unsigned long) f; + if ((f * 10) - (entry * 10) >= 5) { + entry++; + } + + min = entry - (file_interval / 2); + max = entry + (file_interval / 2) + (file_interval & 0x1); + pt1 = (entry / interval) * interval; + pt2 = ((entry / interval) + 1) * interval; + + return (((pt1 >= min) && (pt1 < max)) || ((pt2 >= min) && (pt2 < max))); +} + +/* + *************************************************************************** + * Use time stamp to fill tstamp structure. + * + * IN: + * @timestamp Timestamp to decode (format: HH:MM:SS). + * + * OUT: + * @tse Structure containing the decoded timestamp. + * + * RETURNS: + * 0 if the timestamp has been successfully decoded, 1 otherwise. + *************************************************************************** + */ +int decode_timestamp(char timestamp[], struct tstamp *tse) +{ + timestamp[2] = timestamp[5] = '\0'; + tse->tm_sec = atoi(×tamp[6]); + tse->tm_min = atoi(×tamp[3]); + tse->tm_hour = atoi(timestamp); + + if ((tse->tm_sec < 0) || (tse->tm_sec > 59) || + (tse->tm_min < 0) || (tse->tm_min > 59) || + (tse->tm_hour < 0) || (tse->tm_hour > 23)) + return 1; + + tse->use = TRUE; + + return 0; +} + +/* + *************************************************************************** + * Compare two timestamps. + * + * IN: + * @rectime Date and time for current sample. + * @tse Timestamp used as reference. + * + * RETURNS: + * A positive value if @rectime is greater than @tse, + * a negative one otherwise. + *************************************************************************** + */ +int datecmp(struct tm *rectime, struct tstamp *tse) +{ + if (rectime->tm_hour == tse->tm_hour) { + if (rectime->tm_min == tse->tm_min) + return (rectime->tm_sec - tse->tm_sec); + else + return (rectime->tm_min - tse->tm_min); + } + else + return (rectime->tm_hour - tse->tm_hour); +} + +/* + *************************************************************************** + * Parse a time stamp entered on the command line (hh:mm:ss) and decode it. + * + * IN: + * @argv Arguments list. + * @opt Index in the arguments list. + * @def_timestamp Default timestamp to use. + * + * OUT: + * @tse Structure containing the decoded timestamp. + * + * RETURNS: + * 0 if the timestamp has been successfully decoded, 1 otherwise. + *************************************************************************** + */ +int parse_timestamp(char *argv[], int *opt, struct tstamp *tse, + const char *def_timestamp) +{ + char timestamp[9]; + + if ((argv[++(*opt)]) && (strlen(argv[*opt]) == 8)) { + strcpy(timestamp, argv[(*opt)++]); + } + else { + strcpy(timestamp, def_timestamp); + } + + return decode_timestamp(timestamp, tse); +} + +/* + *************************************************************************** + * Set current daily data file name. + * + * OUT: + * @rectime Current date and time. + * @datafile Name of daily data file. + *************************************************************************** + */ +void set_default_file(struct tm *rectime, char *datafile) +{ + get_time(rectime); + snprintf(datafile, MAX_FILE_LEN, + "%s/sa%02d", SA_DIR, rectime->tm_mday); + datafile[MAX_FILE_LEN - 1] = '\0'; +} + +/* + *************************************************************************** + * Set interval value. + * + * IN: + * @record_hdr_curr Record with current sample statistics. + * @record_hdr_prev Record with previous sample statistics. + * @nr_proc Number of CPU, including CPU "all". + * + * OUT: + * @itv Interval in jiffies. + * @g_itv Interval in jiffies multiplied by the # of proc. + *************************************************************************** + */ +void get_itv_value(struct record_header *record_hdr_curr, + struct record_header *record_hdr_prev, + unsigned int nr_proc, + unsigned long long *itv, unsigned long long *g_itv) +{ + /* Interval value in jiffies */ + *g_itv = get_interval(record_hdr_prev->uptime, + record_hdr_curr->uptime); + + if (nr_proc > 2) { + *itv = get_interval(record_hdr_prev->uptime0, + record_hdr_curr->uptime0); + } + else { + *itv = *g_itv; + } +} + +/* + *************************************************************************** + * Fill the rectime structure with the file's creation date, based on file's + * time data saved in file header. + * The resulting timestamp is expressed in the locale of the file creator or + * in the user's own locale, depending on whether option -t has been used + * or not. + * + * IN: + * @flags Flags for common options and system state. + * @file_hdr System activity file standard header. + * + * OUT: + * @rectime Date and time from file header. + *************************************************************************** + */ +void get_file_timestamp_struct(unsigned int flags, struct tm *rectime, + struct file_header *file_hdr) +{ + struct tm *loc_t; + + if (PRINT_TRUE_TIME(flags)) { + /* Get local time. This is just to fill HH:MM:SS fields */ + get_time(rectime); + + rectime->tm_mday = file_hdr->sa_day; + rectime->tm_mon = file_hdr->sa_month; + rectime->tm_year = file_hdr->sa_year; + /* + * Call mktime() to set DST (Daylight Saving Time) flag. + * Has anyone a better way to do it? + */ + rectime->tm_hour = rectime->tm_min = rectime->tm_sec = 0; + mktime(rectime); + } + else { + loc_t = localtime((const time_t *) &file_hdr->sa_ust_time); + *rectime = *loc_t; + } +} + +/* + *************************************************************************** + * Print report header. + * + * IN: + * @flags Flags for common options and system state. + * @file_hdr System activity file standard header. + * @cpu_nr Number of CPU (value in [1, NR_CPUS + 1]). + * 1 means that there is only one proc and non SMP kernel. + * 2 means one proc and SMP kernel. + * Etc. + * + * OUT: + * @rectime Date and time from file header. + *************************************************************************** + */ +void print_report_hdr(unsigned int flags, struct tm *rectime, + struct file_header *file_hdr, int cpu_nr) +{ + + /* Get date of file creation */ + get_file_timestamp_struct(flags, rectime, file_hdr); + + /* Display the header */ + print_gal_header(rectime, file_hdr->sa_sysname, file_hdr->sa_release, + file_hdr->sa_nodename, file_hdr->sa_machine, + cpu_nr > 1 ? cpu_nr - 1 : 1); +} + +/* + *************************************************************************** + * Network interfaces may now be registered (and unregistered) dynamically. + * This is what we try to guess here. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @ref Index in array for sample statistics used as reference. + * @pos Index on current network interface. + * + * RETURNS: + * Position of current network interface in array of sample statistics used + * as reference. + *************************************************************************** + */ +unsigned int check_net_dev_reg(struct activity *a, int curr, int ref, + unsigned int pos) +{ + struct stats_net_dev *sndc, *sndp; + unsigned int index = 0; + + sndc = (struct stats_net_dev *) a->buf[curr] + pos; + + while (index < a->nr) { + sndp = (struct stats_net_dev *) a->buf[ref] + index; + if (!strcmp(sndc->interface, sndp->interface)) { + /* + * Network interface found. + * If a counter has decreased, then we may assume that the + * corresponding interface was unregistered, then registered again. + */ + if ((sndc->rx_packets < sndp->rx_packets) || + (sndc->tx_packets < sndp->tx_packets) || + (sndc->rx_bytes < sndp->rx_bytes) || + (sndc->tx_bytes < sndp->tx_bytes) || + (sndc->rx_compressed < sndp->rx_compressed) || + (sndc->tx_compressed < sndp->tx_compressed) || + (sndc->multicast < sndp->multicast)) { + + /* + * Special processing for rx_bytes (_packets) and + * tx_bytes (_packets) counters: If the number of + * bytes (packets) has decreased, whereas the number of + * packets (bytes) has increased, then assume that the + * relevant counter has met an overflow condition, and that + * the interface was not unregistered, which is all the + * more plausible that the previous value for the counter + * was > ULONG_MAX/2. + * NB: the average value displayed will be wrong in this case... + * + * If such an overflow is detected, just set the flag. There is no + * need to handle this in a special way: the difference is still + * properly calculated if the result is of the same type (i.e. + * unsigned long) as the two values. + */ + int ovfw = FALSE; + + if ((sndc->rx_bytes < sndp->rx_bytes) && + (sndc->rx_packets > sndp->rx_packets) && + (sndp->rx_bytes > (~0UL >> 1))) { + ovfw = TRUE; + } + if ((sndc->tx_bytes < sndp->tx_bytes) && + (sndc->tx_packets > sndp->tx_packets) && + (sndp->tx_bytes > (~0UL >> 1))) { + ovfw = TRUE; + } + if ((sndc->rx_packets < sndp->rx_packets) && + (sndc->rx_bytes > sndp->rx_bytes) && + (sndp->rx_packets > (~0UL >> 1))) { + ovfw = TRUE; + } + if ((sndc->tx_packets < sndp->tx_packets) && + (sndc->tx_bytes > sndp->tx_bytes) && + (sndp->tx_packets > (~0UL >> 1))) { + ovfw = TRUE; + } + + if (!ovfw) { + /* + * OK: assume here that the device was + * actually unregistered. + */ + memset(sndp, 0, STATS_NET_DEV_SIZE); + strcpy(sndp->interface, sndc->interface); + } + } + return index; + } + index++; + } + + /* Network interface not found: Look for the first free structure */ + for (index = 0; index < a->nr; index++) { + sndp = (struct stats_net_dev *) a->buf[ref] + index; + if (!strcmp(sndp->interface, "?")) { + memset(sndp, 0, STATS_NET_DEV_SIZE); + strcpy(sndp->interface, sndc->interface); + break; + } + } + if (index >= a->nr) { + /* No free structure: Default is structure of same rank */ + index = pos; + } + + sndp = (struct stats_net_dev *) a->buf[ref] + index; + /* Since the name is not the same, reset all the structure */ + memset(sndp, 0, STATS_NET_DEV_SIZE); + strcpy(sndp->interface, sndc->interface); + + return index; +} + +/* + *************************************************************************** + * Network interfaces may now be registered (and unregistered) dynamically. + * This is what we try to guess here. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @ref Index in array for sample statistics used as reference. + * @pos Index on current network interface. + * + * RETURNS: + * Position of current network interface in array of sample statistics used + * as reference. + *************************************************************************** + */ +unsigned int check_net_edev_reg(struct activity *a, int curr, int ref, + unsigned int pos) +{ + struct stats_net_edev *snedc, *snedp; + unsigned int index = 0; + + snedc = (struct stats_net_edev *) a->buf[curr] + pos; + + while (index < a->nr) { + snedp = (struct stats_net_edev *) a->buf[ref] + index; + if (!strcmp(snedc->interface, snedp->interface)) { + /* + * Network interface found. + * If a counter has decreased, then we may assume that the + * corresponding interface was unregistered, then registered again. + */ + if ((snedc->tx_errors < snedp->tx_errors) || + (snedc->collisions < snedp->collisions) || + (snedc->rx_dropped < snedp->rx_dropped) || + (snedc->tx_dropped < snedp->tx_dropped) || + (snedc->tx_carrier_errors < snedp->tx_carrier_errors) || + (snedc->rx_frame_errors < snedp->rx_frame_errors) || + (snedc->rx_fifo_errors < snedp->rx_fifo_errors) || + (snedc->tx_fifo_errors < snedp->tx_fifo_errors)) { + + /* + * OK: assume here that the device was + * actually unregistered. + */ + memset(snedp, 0, STATS_NET_EDEV_SIZE); + strcpy(snedp->interface, snedc->interface); + } + return index; + } + index++; + } + + /* Network interface not found: Look for the first free structure */ + for (index = 0; index < a->nr; index++) { + snedp = (struct stats_net_edev *) a->buf[ref] + index; + if (!strcmp(snedp->interface, "?")) { + memset(snedp, 0, STATS_NET_EDEV_SIZE); + strcpy(snedp->interface, snedc->interface); + break; + } + } + if (index >= a->nr) { + /* No free structure: Default is structure of same rank */ + index = pos; + } + + snedp = (struct stats_net_edev *) a->buf[ref] + index; + /* Since the name is not the same, reset all the structure */ + memset(snedp, 0, STATS_NET_EDEV_SIZE); + strcpy(snedp->interface, snedc->interface); + + return index; +} + +/* + *************************************************************************** + * Disks may be registered dynamically (true in /proc/stat file). + * This is what we try to guess here. + * + * IN: + * @a Activity structure with statistics. + * @curr Index in array for current sample statistics. + * @ref Index in array for sample statistics used as reference. + * @pos Index on current disk. + * + * RETURNS: + * Position of current disk in array of sample statistics used as reference. + *************************************************************************** + */ +int check_disk_reg(struct activity *a, int curr, int ref, int pos) +{ + struct stats_disk *sdc, *sdp; + int index = 0; + + sdc = (struct stats_disk *) a->buf[curr] + pos; + + while (index < a->nr) { + sdp = (struct stats_disk *) a->buf[ref] + index; + if ((sdc->major == sdp->major) && + (sdc->minor == sdp->minor)) { + /* + * Disk found. + * If all the counters have decreased then the likelyhood + * is that the disk has been unregistered and a new disk inserted. + * If only one or two have decreased then the likelyhood + * is that the counter has simply wrapped. + */ + if ((sdc->nr_ios < sdp->nr_ios) && + (sdc->rd_sect < sdp->rd_sect) && + (sdc->wr_sect < sdp->wr_sect)) { + + memset(sdp, 0, STATS_DISK_SIZE); + sdp->major = sdc->major; + sdp->minor = sdc->minor; + } + return index; + } + index++; + } + + /* Disk not found: Look for the first free structure */ + for (index = 0; index < a->nr; index++) { + sdp = (struct stats_disk *) a->buf[ref] + index; + if (!(sdp->major + sdp->minor)) { + memset(sdp, 0, STATS_DISK_SIZE); + sdp->major = sdc->major; + sdp->minor = sdc->minor; + break; + } + } + if (index >= a->nr) { + /* No free structure found: Default is structure of same rank */ + index = pos; + } + + sdp = (struct stats_disk *) a->buf[ref] + index; + /* Since the device is not the same, reset all the structure */ + memset(sdp, 0, STATS_DISK_SIZE); + sdp->major = sdc->major; + sdp->minor = sdc->minor; + + return index; +} + +/* + *************************************************************************** + * Allocate bitmaps for activities that have one. + * + * IN: + * @act Array of activities. + *************************************************************************** + */ +void allocate_bitmaps(struct activity *act[]) +{ + int i; + + for (i = 0; i < NR_ACT; i++) { + /* + * If current activity has a bitmap which has not already + * been allocated, then allocate it. + * Note that a same bitmap may be used by several activities. + */ + if (act[i]->bitmap && !act[i]->bitmap->b_array) { + SREALLOC(act[i]->bitmap->b_array, unsigned char, + BITMAP_SIZE(act[i]->bitmap->b_size)); + } + } +} + +/* + *************************************************************************** + * Free bitmaps for activities that have one. + * + * IN: + * @act Array of activities. + *************************************************************************** + */ +void free_bitmaps(struct activity *act[]) +{ + int i; + + for (i = 0; i < NR_ACT; i++) { + if (act[i]->bitmap && act[i]->bitmap->b_array) { + free(act[i]->bitmap->b_array); + /* Set pointer to NULL to prevent it from being freed again */ + act[i]->bitmap->b_array = NULL; + } + } +} + +/* + *************************************************************************** + * Look for activity in array. + * + * IN: + * @act Array of activities. + * @act_flag Activity flag to look for. + * + * RETURNS: + * Position of activity in array, or -1 if not found (this may happen when + * reading data from a system activity file created by another version of + * sysstat). + *************************************************************************** + */ +int get_activity_position(struct activity *act[], unsigned int act_flag) +{ + int i; + + for (i = 0; i < NR_ACT; i++) { + if (act[i]->id == act_flag) + break; + } + + if (i == NR_ACT) + return -1; + + return i; +} + +/* + *************************************************************************** + * Count number of activities with given option. + * + * IN: + * @act Array of activities. + * @option Option that activities should have to be counted + * (eg. AO_COLLECTED...) + * @count_outputs TRUE if each output should be counted for activities with + * multiple outputs. + * + * RETURNS: + * Number of selected activities + *************************************************************************** + */ +int get_activity_nr(struct activity *act[], unsigned int option, int count_outputs) +{ + int i, n = 0; + unsigned int msk; + + for (i = 0; i < NR_ACT; i++) { + if ((act[i]->options & option) == option) { + + if (HAS_MULTIPLE_OUTPUTS(act[i]->options) && count_outputs) { + for (msk = 1; msk < 0x10; msk <<= 1) { + if (act[i]->opt_flags & msk) { + n++; + } + } + } + else { + n++; + } + } + } + + return n; +} + +/* + *************************************************************************** + * Select all activities, even if they have no associated items. + * + * IN: + * @act Array of activities. + *************************************************************************** + */ +void select_all_activities(struct activity *act[]) +{ + int i; + + for (i = 0; i < NR_ACT; i++) { + act[i]->options |= AO_SELECTED; + } +} + +/* + *************************************************************************** + * Select CPU activity if no other activities have been explicitly selected. + * Also select CPU "all" if no other CPU has been selected. + * + * IN: + * @act Array of activities. + * + * OUT: + * @act Array of activities with CPU activity selected if needed. + *************************************************************************** + */ +void select_default_activity(struct activity *act[]) +{ + int p; + + p = get_activity_position(act, A_CPU); + + /* Default is CPU activity... */ + if (!get_activity_nr(act, AO_SELECTED, COUNT_ACTIVITIES)) { + /* + * Still OK even when reading stats from a file + * since A_CPU activity is always recorded. + */ + act[p]->options |= AO_SELECTED; + } + + /* + * If no CPU's have been selected then select CPU "all". + * cpu_bitmap bitmap may be used by several activities (A_CPU, A_PWR_CPUFREQ...) + */ + if (!count_bits(cpu_bitmap.b_array, BITMAP_SIZE(cpu_bitmap.b_size))) { + cpu_bitmap.b_array[0] |= 0x01; + } +} + +/* + *************************************************************************** + * Read data from a system activity data file. + * + * IN: + * @ifd Input file descriptor. + * @buffer Buffer where data are read. + * @size Number of bytes to read. + * @mode If set to HARD_SIZE, indicate that an EOF should be considered + * as an error. + * + * RETURNS: + * 1 if EOF has been reached, 0 otherwise. + *************************************************************************** + */ +int sa_fread(int ifd, void *buffer, int size, int mode) +{ + int n; + + if ((n = read(ifd, buffer, size)) < 0) { + fprintf(stderr, _("Error while reading system activity file: %s\n"), + strerror(errno)); + close(ifd); + exit(2); + } + + if (!n && (mode == SOFT_SIZE)) + return 1; /* EOF */ + + if (n < size) { + fprintf(stderr, _("End of system activity file unexpected\n")); + close(ifd); + exit(2); + } + + return 0; +} + +/* + *************************************************************************** + * Display sysstat version used to create system activity data file. + * + * IN: + * @file_magic File magic header + *************************************************************************** + */ +void display_sa_file_version(struct file_magic *file_magic) +{ + fprintf(stderr, _("File created using sar/sadc from sysstat version %d.%d.%d"), + file_magic->sysstat_version, + file_magic->sysstat_patchlevel, + file_magic->sysstat_sublevel); + + if (file_magic->sysstat_extraversion) { + fprintf(stderr, ".%d", file_magic->sysstat_extraversion); + } + fprintf(stderr, "\n"); +} + +/* + *************************************************************************** + * An invalid system activity file has been opened for reading. + * If this file was created by an old version of sysstat, tell it to the + * user... + * + * IN: + * @fd Descriptor of the file that has been opened. + * @file_magic file_magic structure filled with file magic header data. + * May contain invalid data. + * @file Name of the file being read. + * @n Number of bytes read while reading file magic header. + * This function may also be called after failing to read file + * standard header, or if CPU activity has not been found in + * file. In this case, n is set to 0. + *************************************************************************** + */ +void handle_invalid_sa_file(int *fd, struct file_magic *file_magic, char *file, + int n) +{ + fprintf(stderr, _("Invalid system activity file: %s\n"), file); + + if ((n == FILE_MAGIC_SIZE) && (file_magic->sysstat_magic == SYSSTAT_MAGIC)) { + /* This is a sysstat file, but this file has an old format */ + display_sa_file_version(file_magic); + + fprintf(stderr, + _("Current sysstat version can no longer read the format of this file (%#x)\n"), + file_magic->format_magic); + } + + close (*fd); + exit(3); +} + +/* + *************************************************************************** + * Move structures data. + * + * IN: + * @act Array of activities. + * @id_seq Activity sequence in file. + * @record_hdr Current record header. + * @dest Index in array where stats have to be copied to. + * @src Index in array where stats to copy are. + *************************************************************************** + */ +void copy_structures(struct activity *act[], unsigned int id_seq[], + struct record_header record_hdr[], int dest, int src) +{ + int i, p; + + memcpy(&record_hdr[dest], &record_hdr[src], RECORD_HEADER_SIZE); + + for (i = 0; i < NR_ACT; i++) { + + if (!id_seq[i]) + continue; + + if (((p = get_activity_position(act, id_seq[i])) < 0) || + (act[p]->nr < 1)) { + PANIC(1); + } + + memcpy(act[p]->buf[dest], act[p]->buf[src], act[p]->msize * act[p]->nr); + + } +} + +/* + *************************************************************************** + * Read varying part of the statistics from a daily data file. + * + * IN: + * @act Array of activities. + * @curr Index in array for current sample statistics. + * @ifd Input file descriptor. + * @act_nr Number of activities in file. + * @file_actlst Activity list in file. + *************************************************************************** + */ +void read_file_stat_bunch(struct activity *act[], int curr, int ifd, int act_nr, + struct file_activity *file_actlst) +{ + int i, j, p; + struct file_activity *fal = file_actlst; + + for (i = 0; i < act_nr; i++, fal++) { + + if ((p = get_activity_position(act, fal->id)) < 0) { + /* + * Ignore current activity in file, which is unknown to + * current sysstat version. + */ + if (lseek(ifd, fal->size * fal->nr, SEEK_CUR) < (fal->size * fal->nr)) { + close(ifd); + perror("lseek"); + exit(2); + } + } + else if ((act[p]->nr > 1) && (act[p]->msize > act[p]->fsize)) { + for (j = 0; j < act[p]->nr; j++) { + sa_fread(ifd, (char *) act[p]->buf[curr] + j * act[p]->msize, + act[p]->fsize, HARD_SIZE); + } + } + else if (act[p]->nr > 0) { + sa_fread(ifd, act[p]->buf[curr], act[p]->fsize * act[p]->nr, HARD_SIZE); + } + else { + PANIC(act[p]->nr); + } + } +} + +/* + *************************************************************************** + * Open a data file, and perform various checks before reading. + * + * IN: + * @dfile Name of system activity data file + * @act Array of activities. + * @ignore Set to 1 if a true sysstat activity file but with a bad + * format should not yield an error message. Useful with + * sadf -H. + * + * OUT: + * @ifd System activity data file descriptor + * @file_magic file_magic structure containing data read from file magic + * header + * @file_hdr file_hdr structure containing data read from file standard + * header + * @file_actlst Acvtivity list in file. + * @id_seq Activity sequence. + *************************************************************************** + */ +void check_file_actlst(int *ifd, char *dfile, struct activity *act[], + struct file_magic *file_magic, struct file_header *file_hdr, + struct file_activity **file_actlst, unsigned int id_seq[], + int ignore) +{ + int i, j, n, p; + unsigned int a_cpu = FALSE; + struct file_activity *fal; + + /* Open sa data file */ + if ((*ifd = open(dfile, O_RDONLY)) < 0) { + fprintf(stderr, _("Cannot open %s: %s\n"), dfile, strerror(errno)); + exit(2); + } + + /* Read file magic data */ + n = read(*ifd, file_magic, FILE_MAGIC_SIZE); + + if ((n != FILE_MAGIC_SIZE) || + (file_magic->sysstat_magic != SYSSTAT_MAGIC) || + (file_magic->format_magic != FORMAT_MAGIC)) { + + if (ignore && + (n == FILE_MAGIC_SIZE) && + (file_magic->sysstat_magic == SYSSTAT_MAGIC)) + /* Don't display error message. This is for sadf -H */ + return; + else { + /* Display error message and exit */ + handle_invalid_sa_file(ifd, file_magic, dfile, n); + } + } + + /* Read sa data file standard header and allocate activity list */ + sa_fread(*ifd, file_hdr, FILE_HEADER_SIZE, HARD_SIZE); + + SREALLOC(*file_actlst, struct file_activity, FILE_ACTIVITY_SIZE * file_hdr->sa_nr_act); + fal = *file_actlst; + + /* Read activity list */ + j = 0; + for (i = 0; i < file_hdr->sa_nr_act; i++, fal++) { + + sa_fread(*ifd, fal, FILE_ACTIVITY_SIZE, HARD_SIZE); + + if (fal->nr < 1) { + /* + * Every activity, known or unknown, + * should have at least one item. + */ + handle_invalid_sa_file(ifd, file_magic, dfile, 0); + } + + if (fal->id == A_CPU) { + a_cpu = TRUE; + } + + if ((p = get_activity_position(act, fal->id)) >= 0) { + if (fal->size > act[p]->msize) { + act[p]->msize = fal->size; + } + act[p]->fsize = fal->size; + act[p]->nr = fal->nr; + id_seq[j++] = fal->id; + } + } + + if (!a_cpu) { + /* CPU activity should always be in file */ + handle_invalid_sa_file(ifd, file_magic, dfile, 0); + } + + while (j < NR_ACT) { + id_seq[j++] = 0; + } + + /* Check that at least one selected activity is available in file */ + for (i = 0; i < NR_ACT; i++) { + + if (!IS_SELECTED(act[i]->options)) + continue; + + /* Here is a selected activity: Does it exist in file? */ + fal = *file_actlst; + for (j = 0; j < file_hdr->sa_nr_act; j++, fal++) { + if (act[i]->id == fal->id) + break; + } + if (j == file_hdr->sa_nr_act) { + /* No: Unselect it */ + act[i]->options &= ~AO_SELECTED; + } + } + if (!get_activity_nr(act, AO_SELECTED, COUNT_ACTIVITIES)) { + fprintf(stderr, _("Requested activities not available in file %s\n"), + dfile); + close(*ifd); + exit(1); + } +} + +/* + *************************************************************************** + * Parse sar activities options (also used by sadf). + * + * IN: + * @argv Arguments list. + * @opt Index in list of arguments. + * @caller Indicate whether it's sar or sadf that called this function. + * + * OUT: + * @act Array of selected activities. + * @flags Common flags and system state. + * + * RETURNS: + * 0 on success, 1 otherwise. + *************************************************************************** + */ +int parse_sar_opt(char *argv[], int *opt, struct activity *act[], + unsigned int *flags, int caller) +{ + int i, p; + + for (i = 1; *(argv[*opt] + i); i++) { + + switch (*(argv[*opt] + i)) { + + case 'A': + select_all_activities(act); + + /* Force '-P ALL -I XALL' */ + *flags |= S_F_PER_PROC; + + p = get_activity_position(act, A_MEMORY); + act[p]->opt_flags |= AO_F_MEM_AMT + AO_F_MEM_DIA + AO_F_MEM_SWAP; + + p = get_activity_position(act, A_IRQ); + set_bitmap(act[p]->bitmap->b_array, ~0, + BITMAP_SIZE(act[p]->bitmap->b_size)); + + p = get_activity_position(act, A_CPU); + set_bitmap(act[p]->bitmap->b_array, ~0, + BITMAP_SIZE(act[p]->bitmap->b_size)); + act[p]->opt_flags = AO_F_CPU_ALL; + break; + + case 'B': + SELECT_ACTIVITY(A_PAGE); + break; + + case 'b': + SELECT_ACTIVITY(A_IO); + break; + + case 'C': + *flags |= S_F_COMMENT; + break; + + case 'd': + SELECT_ACTIVITY(A_DISK); + break; + + case 'p': + *flags |= S_F_DEV_PRETTY; + break; + + case 'q': + SELECT_ACTIVITY(A_QUEUE); + break; + + case 'r': + p = get_activity_position(act, A_MEMORY); + act[p]->options |= AO_SELECTED; + act[p]->opt_flags |= AO_F_MEM_AMT; + break; + + case 'R': + p = get_activity_position(act, A_MEMORY); + act[p]->options |= AO_SELECTED; + act[p]->opt_flags |= AO_F_MEM_DIA; + break; + + case 'S': + p = get_activity_position(act, A_MEMORY); + act[p]->options |= AO_SELECTED; + act[p]->opt_flags |= AO_F_MEM_SWAP; + break; + + case 't': + if (caller == C_SAR) { + *flags |= S_F_TRUE_TIME; + } + else + return 1; + break; + + case 'u': + p = get_activity_position(act, A_CPU); + act[p]->options |= AO_SELECTED; + if (!*(argv[*opt] + i + 1) && argv[*opt + 1] && !strcmp(argv[*opt + 1], K_ALL)) { + (*opt)++; + act[p]->opt_flags = AO_F_CPU_ALL; + return 0; + } + else { + act[p]->opt_flags = AO_F_CPU_DEF; + } + break; + + case 'v': + SELECT_ACTIVITY(A_KTABLES); + break; + + case 'w': + SELECT_ACTIVITY(A_PCSW); + break; + + case 'W': + SELECT_ACTIVITY(A_SWAP); + break; + + case 'y': + SELECT_ACTIVITY(A_SERIAL); + break; + + case 'V': + print_version(); + break; + + default: + return 1; + } + } + return 0; +} + +/* + *************************************************************************** + * Parse sar "-m" option. + * + * IN: + * @argv Arguments list. + * @opt Index in list of arguments. + * + * OUT: + * @act Array of selected activities. + * + * RETURNS: + * 0 on success, 1 otherwise. + *************************************************************************** + */ +int parse_sar_m_opt(char *argv[], int *opt, struct activity *act[]) +{ + char *t; + + for (t = strtok(argv[*opt], ","); t; t = strtok(NULL, ",")) { + if (!strcmp(t, K_CPU)) { + SELECT_ACTIVITY(A_PWR_CPUFREQ); + } + else if (!strcmp(t, K_FAN)) { + SELECT_ACTIVITY(A_PWR_FAN); + } + else if (!strcmp(t, K_IN)) { + SELECT_ACTIVITY(A_PWR_IN); + } + else if (!strcmp(t, K_TEMP)) { + SELECT_ACTIVITY(A_PWR_TEMP); + } + else if (!strcmp(t, K_ALL)) { + SELECT_ACTIVITY(A_PWR_CPUFREQ); + SELECT_ACTIVITY(A_PWR_FAN); + SELECT_ACTIVITY(A_PWR_IN); + SELECT_ACTIVITY(A_PWR_TEMP); + } + else + return 1; + } + + (*opt)++; + return 0; +} + +/* + *************************************************************************** + * Parse sar "-n" option. + * + * IN: + * @argv Arguments list. + * @opt Index in list of arguments. + * + * OUT: + * @act Array of selected activities. + * + * RETURNS: + * 0 on success, 1 otherwise. + *************************************************************************** + */ +int parse_sar_n_opt(char *argv[], int *opt, struct activity *act[]) +{ + char *t; + + for (t = strtok(argv[*opt], ","); t; t = strtok(NULL, ",")) { + if (!strcmp(t, K_DEV)) { + SELECT_ACTIVITY(A_NET_DEV); + } + else if (!strcmp(t, K_EDEV)) { + SELECT_ACTIVITY(A_NET_EDEV); + } + else if (!strcmp(t, K_SOCK)) { + SELECT_ACTIVITY(A_NET_SOCK); + } + else if (!strcmp(t, K_NFS)) { + SELECT_ACTIVITY(A_NET_NFS); + } + else if (!strcmp(t, K_NFSD)) { + SELECT_ACTIVITY(A_NET_NFSD); + } + else if (!strcmp(t, K_IP)) { + SELECT_ACTIVITY(A_NET_IP); + } + else if (!strcmp(t, K_EIP)) { + SELECT_ACTIVITY(A_NET_EIP); + } + else if (!strcmp(t, K_ICMP)) { + SELECT_ACTIVITY(A_NET_ICMP); + } + else if (!strcmp(t, K_EICMP)) { + SELECT_ACTIVITY(A_NET_EICMP); + } + else if (!strcmp(t, K_TCP)) { + SELECT_ACTIVITY(A_NET_TCP); + } + else if (!strcmp(t, K_ETCP)) { + SELECT_ACTIVITY(A_NET_ETCP); + } + else if (!strcmp(t, K_UDP)) { + SELECT_ACTIVITY(A_NET_UDP); + } + else if (!strcmp(t, K_SOCK6)) { + SELECT_ACTIVITY(A_NET_SOCK6); + } + else if (!strcmp(t, K_IP6)) { + SELECT_ACTIVITY(A_NET_IP6); + } + else if (!strcmp(t, K_EIP6)) { + SELECT_ACTIVITY(A_NET_EIP6); + } + else if (!strcmp(t, K_ICMP6)) { + SELECT_ACTIVITY(A_NET_ICMP6); + } + else if (!strcmp(t, K_EICMP6)) { + SELECT_ACTIVITY(A_NET_EICMP6); + } + else if (!strcmp(t, K_UDP6)) { + SELECT_ACTIVITY(A_NET_UDP6); + } + else if (!strcmp(t, K_ALL)) { + SELECT_ACTIVITY(A_NET_DEV); + SELECT_ACTIVITY(A_NET_EDEV); + SELECT_ACTIVITY(A_NET_SOCK); + SELECT_ACTIVITY(A_NET_NFS); + SELECT_ACTIVITY(A_NET_NFSD); + SELECT_ACTIVITY(A_NET_IP); + SELECT_ACTIVITY(A_NET_EIP); + SELECT_ACTIVITY(A_NET_ICMP); + SELECT_ACTIVITY(A_NET_EICMP); + SELECT_ACTIVITY(A_NET_TCP); + SELECT_ACTIVITY(A_NET_ETCP); + SELECT_ACTIVITY(A_NET_UDP); + SELECT_ACTIVITY(A_NET_SOCK6); + SELECT_ACTIVITY(A_NET_IP6); + SELECT_ACTIVITY(A_NET_EIP6); + SELECT_ACTIVITY(A_NET_ICMP6); + SELECT_ACTIVITY(A_NET_EICMP6); + SELECT_ACTIVITY(A_NET_UDP6); + } + else + return 1; + } + + (*opt)++; + return 0; +} + +/* + *************************************************************************** + * Parse sar "-I" option. + * + * IN: + * @argv Arguments list. + * @opt Index in list of arguments. + * @act Array of activities. + * + * OUT: + * @act Array of activities, with interrupts activity selected. + * + * RETURNS: + * 0 on success, 1 otherwise. + *************************************************************************** + */ +int parse_sar_I_opt(char *argv[], int *opt, struct activity *act[]) +{ + int i, p; + unsigned char c; + char *t; + + /* Select interrupt activity */ + p = get_activity_position(act, A_IRQ); + act[p]->options |= AO_SELECTED; + + for (t = strtok(argv[*opt], ","); t; t = strtok(NULL, ",")) { + if (!strcmp(t, K_SUM)) { + /* Select total number of interrupts */ + act[p]->bitmap->b_array[0] |= 0x01; + } + else if (!strcmp(t, K_ALL)) { + /* Set bit for the first 16 individual interrupts */ + act[p]->bitmap->b_array[0] |= 0xfe; + act[p]->bitmap->b_array[1] |= 0xff; + act[p]->bitmap->b_array[2] |= 0x01; + } + else if (!strcmp(t, K_XALL)) { + /* Set every bit except for total number of interrupts */ + c = act[p]->bitmap->b_array[0]; + set_bitmap(act[p]->bitmap->b_array, ~0, + BITMAP_SIZE(act[p]->bitmap->b_size)); + act[p]->bitmap->b_array[0] = 0xfe | c; + } + else { + /* Get irq number */ + if (strspn(t, DIGITS) != strlen(t)) + return 1; + i = atoi(t); + if ((i < 0) || (i >= act[p]->bitmap->b_size)) + return 1; + act[p]->bitmap->b_array[(i + 1) >> 3] |= 1 << ((i + 1) & 0x07); + } + } + + (*opt)++; + return 0; +} + +/* + *************************************************************************** + * Parse sar and sadf "-P" option. + * + * IN: + * @argv Arguments list. + * @opt Index in list of arguments. + * @act Array of activities. + * + * OUT: + * @flags Common flags and system state. + * @act Array of activities, with CPUs selected. + * + * RETURNS: + * 0 on success, 1 otherwise. + *************************************************************************** + */ +int parse_sa_P_opt(char *argv[], int *opt, unsigned int *flags, struct activity *act[]) +{ + int i, p; + char *t; + + p = get_activity_position(act, A_CPU); + + if (argv[++(*opt)]) { + *flags |= S_F_PER_PROC; + + for (t = strtok(argv[*opt], ","); t; t = strtok(NULL, ",")) { + if (!strcmp(t, K_ALL)) { + /* + * Set bit for every processor. + * We still don't know if we are going to read stats + * from a file or not... + */ + set_bitmap(act[p]->bitmap->b_array, ~0, + BITMAP_SIZE(act[p]->bitmap->b_size)); + } + else { + /* Get cpu number */ + if (strspn(t, DIGITS) != strlen(t)) + return 1; + i = atoi(t); + if ((i < 0) || (i >= act[p]->bitmap->b_size)) + return 1; + act[p]->bitmap->b_array[(i + 1) >> 3] |= 1 << ((i + 1) & 0x07); + } + } + (*opt)++; + } + else + return 1; + + return 0; +} + diff --git a/sa_wrap.c b/sa_wrap.c new file mode 100644 index 00000000..2c0daaff --- /dev/null +++ b/sa_wrap.c @@ -0,0 +1,912 @@ +/* + * sysstat - sa_wrap.c: Functions used in activity.c + * (C) 1999-2010 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include "sa.h" +#include "rd_stats.h" + +extern unsigned int flags; +extern struct record_header record_hdr; + +/* + *************************************************************************** + * Count number of interrupts that are in /proc/stat file. + * Truncate the number of different individual interrupts to NR_IRQS. + * + * IN: + * @a Activity structure. + * + * RETURNS: + * Number of interrupts, including total number of interrupts. + * Value in [0, NR_IRQS + 1]. + *************************************************************************** + */ +__nr_t wrap_get_irq_nr(struct activity *a) +{ + __nr_t n; + + if ((n = get_irq_nr()) > (a->bitmap->b_size + 1)) { + n = a->bitmap->b_size + 1; + } + + return n; +} + +/* + *************************************************************************** + * Find number of serial lines that support tx/rx accounting + * in /proc/tty/driver/serial file. + * + * IN: + * @a Activity structure. + * + * RETURNS: + * Number of serial lines supporting tx/rx accouting + a pre-allocation + * constant. + *************************************************************************** + */ +__nr_t wrap_get_serial_nr(struct activity *a) +{ + __nr_t n = 0; + + if ((n = get_serial_nr()) > 0) + return n + NR_SERIAL_PREALLOC; + + return 0; +} + +/* + *************************************************************************** + * Find number of interfaces (network devices) that are in /proc/net/dev + * file. + * + * IN: + * @a Activity structure. + * + * RETURNS: + * Number of network interfaces + a pre-allocation constant. + *************************************************************************** + */ +__nr_t wrap_get_iface_nr(struct activity *a) +{ + __nr_t n = 0; + + if ((n = get_iface_nr()) > 0) + return n + NR_IFACE_PREALLOC; + + return 0; +} + +/* + *************************************************************************** + * Compute number of CPU structures to allocate. + * + * IN: + * @a Activity structure. + * + * RETURNS: + * Number of structures (value in [1, NR_CPUS + 1]). + * 1 means that there is only one proc and non SMP kernel. + * 2 means one proc and SMP kernel. + * Etc. + *************************************************************************** + */ +__nr_t wrap_get_cpu_nr(struct activity *a) +{ + return (get_cpu_nr(a->bitmap->b_size) + 1); +} + +/* + *************************************************************************** + * Get number of devices in /proc/diskstats. + * Always done, since disk stats must be read at least for sar -b + * if not for sar -d. + * + * IN: + * @a Activity structure. + * + * RETURNS: + * Number of devices + a pre-allocation constant. + *************************************************************************** + */ +__nr_t wrap_get_disk_nr(struct activity *a) +{ + __nr_t n = 0; + unsigned int f = COLLECT_PARTITIONS(a->opt_flags); + + if ((n = get_disk_nr(f)) > 0) + return n + NR_DISK_PREALLOC; + + return 0; +} + +/* + *************************************************************************** + * Read CPU statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_stat_cpu(struct activity *a) +{ + struct stats_cpu *st_cpu + = (struct stats_cpu *) a->_buf0; + + /* Read CPU statistics */ + read_stat_cpu(st_cpu, a->nr, &record_hdr.uptime, &record_hdr.uptime0); + + return; +} + +/* + *************************************************************************** + * Read process (task) creation and context switch statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_stat_pcsw(struct activity *a) +{ + struct stats_pcsw *st_pcsw + = (struct stats_pcsw *) a->_buf0; + + /* Read process and context switch stats */ + read_stat_pcsw(st_pcsw); + + return; +} + +/* + *************************************************************************** + * Read interrupt statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_stat_irq(struct activity *a) +{ + struct stats_irq *st_irq + = (struct stats_irq *) a->_buf0; + + /* Read interrupts stats */ + read_stat_irq(st_irq, a->nr); + + return; +} + +/* + *************************************************************************** + * Read queue and load statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_loadavg(struct activity *a) +{ + struct stats_queue *st_queue + = (struct stats_queue *) a->_buf0; + + /* Read queue and load stats */ + read_loadavg(st_queue); + + return; +} + +/* + *************************************************************************** + * Read memory statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_meminfo(struct activity *a) +{ + struct stats_memory *st_memory + = (struct stats_memory *) a->_buf0; + + /* Read memory stats */ + read_meminfo(st_memory); + + return; +} + +/* + *************************************************************************** + * Read swapping statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_swap(struct activity *a) +{ + struct stats_swap *st_swap + = (struct stats_swap *) a->_buf0; + + /* Read stats from /proc/vmstat */ + read_vmstat_swap(st_swap); + + return; +} + +/* + *************************************************************************** + * Read paging statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_paging(struct activity *a) +{ + struct stats_paging *st_paging + = (struct stats_paging *) a->_buf0; + + /* Read stats from /proc/vmstat */ + read_vmstat_paging(st_paging); + + return; +} + +/* + *************************************************************************** + * Read I/O and transfer rates statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_io(struct activity *a) +{ + struct stats_io *st_io + = (struct stats_io *) a->_buf0; + + /* Read stats from /proc/diskstats */ + read_diskstats_io(st_io); + + return; +} + +/* + *************************************************************************** + * Read block devices statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_disk(struct activity *a) +{ + struct stats_disk *st_disk + = (struct stats_disk *) a->_buf0; + + /* Read stats from /proc/diskstats */ + read_diskstats_disk(st_disk, a->nr, COLLECT_PARTITIONS(a->opt_flags)); + + return; +} + +/* + *************************************************************************** + * Read serial lines statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_tty_driver_serial(struct activity *a) +{ + struct stats_serial *st_serial + = (struct stats_serial *) a->_buf0; + + /* Read serial lines stats */ + read_tty_driver_serial(st_serial, a->nr); + + return; +} + +/* + *************************************************************************** + * Read kernel tables statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_kernel_tables(struct activity *a) +{ + struct stats_ktables *st_ktables + = (struct stats_ktables *) a->_buf0; + + /* Read kernel tables stats */ + read_kernel_tables(st_ktables); + + return; +} + +/* + *************************************************************************** + * Read network interfaces statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_dev(struct activity *a) +{ + struct stats_net_dev *st_net_dev + = (struct stats_net_dev *) a->_buf0; + + /* Read network interfaces stats */ + read_net_dev(st_net_dev, a->nr); + + return; +} + +/* + *************************************************************************** + * Read network interfaces errors statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_edev(struct activity *a) +{ + struct stats_net_edev *st_net_edev + = (struct stats_net_edev *) a->_buf0; + + /* Read network interfaces errors stats */ + read_net_edev(st_net_edev, a->nr); + + return; +} + +/* + *************************************************************************** + * Read NFS client statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_nfs(struct activity *a) +{ + struct stats_net_nfs *st_net_nfs + = (struct stats_net_nfs *) a->_buf0; + + /* Read NFS client stats */ + read_net_nfs(st_net_nfs); + + return; +} + +/* + *************************************************************************** + * Read NFS server statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_nfsd(struct activity *a) +{ + struct stats_net_nfsd *st_net_nfsd + = (struct stats_net_nfsd *) a->_buf0; + + /* Read NFS server stats */ + read_net_nfsd(st_net_nfsd); + + return; +} + +/* + *************************************************************************** + * Read network sockets statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_sock(struct activity *a) +{ + struct stats_net_sock *st_net_sock + = (struct stats_net_sock *) a->_buf0; + + /* Read network sockets stats */ + read_net_sock(st_net_sock); + + return; +} + +/* + *************************************************************************** + * Read IP statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_ip(struct activity *a) +{ + struct stats_net_ip *st_net_ip + = (struct stats_net_ip *) a->_buf0; + + /* Read IP stats */ + read_net_ip(st_net_ip); + + return; +} + +/* + *************************************************************************** + * Read IP error statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_eip(struct activity *a) +{ + struct stats_net_eip *st_net_eip + = (struct stats_net_eip *) a->_buf0; + + /* Read IP error stats */ + read_net_eip(st_net_eip); + + return; +} + +/* + *************************************************************************** + * Read ICMP statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_icmp(struct activity *a) +{ + struct stats_net_icmp *st_net_icmp + = (struct stats_net_icmp *) a->_buf0; + + /* Read ICMP stats */ + read_net_icmp(st_net_icmp); + + return; +} + +/* + *************************************************************************** + * Read ICMP error statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_eicmp(struct activity *a) +{ + struct stats_net_eicmp *st_net_eicmp + = (struct stats_net_eicmp *) a->_buf0; + + /* Read ICMP error stats */ + read_net_eicmp(st_net_eicmp); + + return; +} + +/* + *************************************************************************** + * Read TCP statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_tcp(struct activity *a) +{ + struct stats_net_tcp *st_net_tcp + = (struct stats_net_tcp *) a->_buf0; + + /* Read TCP stats */ + read_net_tcp(st_net_tcp); + + return; +} + +/* + *************************************************************************** + * Read TCP error statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_etcp(struct activity *a) +{ + struct stats_net_etcp *st_net_etcp + = (struct stats_net_etcp *) a->_buf0; + + /* Read TCP error stats */ + read_net_etcp(st_net_etcp); + + return; +} + +/* + *************************************************************************** + * Read UDP statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_udp(struct activity *a) +{ + struct stats_net_udp *st_net_udp + = (struct stats_net_udp *) a->_buf0; + + /* Read UDP stats */ + read_net_udp(st_net_udp); + + return; +} + +/* + *************************************************************************** + * Read IPv6 network sockets statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_sock6(struct activity *a) +{ + struct stats_net_sock6 *st_net_sock6 + = (struct stats_net_sock6 *) a->_buf0; + + /* Read IPv6 network sockets stats */ + read_net_sock6(st_net_sock6); + + return; +} + +/* + *************************************************************************** + * Read IPv6 statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_ip6(struct activity *a) +{ + struct stats_net_ip6 *st_net_ip6 + = (struct stats_net_ip6 *) a->_buf0; + + /* Read IPv6 stats */ + read_net_ip6(st_net_ip6); + + return; +} + +/* + *************************************************************************** + * Read IPv6 error statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_eip6(struct activity *a) +{ + struct stats_net_eip6 *st_net_eip6 + = (struct stats_net_eip6 *) a->_buf0; + + /* Read IPv6 error stats */ + read_net_eip6(st_net_eip6); + + return; +} + +/* + *************************************************************************** + * Read ICMPv6 statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_icmp6(struct activity *a) +{ + struct stats_net_icmp6 *st_net_icmp6 + = (struct stats_net_icmp6 *) a->_buf0; + + /* Read ICMPv6 stats */ + read_net_icmp6(st_net_icmp6); + + return; +} + +/* + *************************************************************************** + * Read ICMPv6 error statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_eicmp6(struct activity *a) +{ + struct stats_net_eicmp6 *st_net_eicmp6 + = (struct stats_net_eicmp6 *) a->_buf0; + + /* Read ICMPv6 error stats */ + read_net_eicmp6(st_net_eicmp6); + + return; +} + +/* + *************************************************************************** + * Read UDPv6 statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_net_udp6(struct activity *a) +{ + struct stats_net_udp6 *st_net_udp6 + = (struct stats_net_udp6 *) a->_buf0; + + /* Read UDPv6 stats */ + read_net_udp6(st_net_udp6); + + return; +} + +/* + *************************************************************************** + * Read CPU frequency statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_cpuinfo(struct activity *a) +{ + struct stats_pwr_cpufreq *st_pwr_cpufreq + = (struct stats_pwr_cpufreq *) a->_buf0; + + /* Read CPU frequency stats */ + read_cpuinfo(st_pwr_cpufreq, a->nr); + + return; +} + +/* + *************************************************************************** + * Get number of fan structures to allocate. + * + * IN: + * @a Activity structure. + * + * RETURNS: + * Number of structures. + *************************************************************************** + */ +__nr_t wrap_get_fan_nr(struct activity *a) +{ + return (get_fan_nr()); +} + +/* + *************************************************************************** + * Read fan statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_fan(struct activity *a) +{ + struct stats_pwr_fan *st_pwr_fan + = (struct stats_pwr_fan *) a->_buf0; + + /* Read fan stats */ + read_fan(st_pwr_fan, a->nr); + + return; +} + +/* + *************************************************************************** + * Get number of temp structures to allocate. + * + * IN: + * @a Activity structure. + * + * RETURNS: + * Number of structures. + *************************************************************************** + */ +__nr_t wrap_get_temp_nr(struct activity *a) +{ + return (get_temp_nr()); +} + +/* + *************************************************************************** + * Read temperature statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_temp(struct activity *a) +{ + struct stats_pwr_temp *st_pwr_temp + = (struct stats_pwr_temp *) a->_buf0; + + /* Read temperature stats */ + read_temp(st_pwr_temp, a->nr); + + return; +} + +/* + *************************************************************************** + * Get number of voltage input structures to allocate. + * + * IN: + * @a Activity structure. + * + * RETURNS: + * Number of structures. + *************************************************************************** + */ +__nr_t wrap_get_in_nr(struct activity *a) +{ + return (get_in_nr()); +} + +/* + *************************************************************************** + * Read voltage input statistics. + * + * IN: + * @a Activity structure. + * + * OUT: + * @a Activity structure with statistics. + *************************************************************************** + */ +__read_funct_t wrap_read_in(struct activity *a) +{ + struct stats_pwr_in *st_pwr_in + = (struct stats_pwr_in *) a->_buf0; + + /* Read voltage input stats */ + read_in(st_pwr_in, a->nr); + + return; +} diff --git a/sadc.c b/sadc.c new file mode 100644 index 00000000..f16f0ac8 --- /dev/null +++ b/sadc.c @@ -0,0 +1,1115 @@ +/* + * sadc: system activity data collector + * (C) 1999-2010 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "version.h" +#include "sa.h" +#include "rd_stats.h" +#include "common.h" +#include "ioconf.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +#ifdef HAVE_SENSORS +#include "sensors/sensors.h" +#include "sensors/error.h" +#endif + +#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__ +char *sccsid(void) { return (SCCSID); } + +long interval = 0; +unsigned int flags = 0; + +int dis; +char timestamp[2][TIMESTAMP_LEN]; + +struct file_header file_hdr; +struct record_header record_hdr; +char comment[MAX_COMMENT_LEN]; +unsigned int id_seq[NR_ACT]; + +extern struct activity *act[]; + +/* + *************************************************************************** + * Print usage and exit. + * + * IN: + * @progname Name of sysstat command + *************************************************************************** + */ +void usage(char *progname) +{ + fprintf(stderr, _("Usage: %s [ options ] [ [ ] ] [ ]\n"), + progname); + + fprintf(stderr, _("Options are:\n" + "[ -C ] [ -F ] [ -L ] [ -V ]\n" + "[ -S { INT | DISK | IPV6 | POWER | SNMP | XDISK | ALL | XALL } ]\n")); + exit(1); +} + +/* + *************************************************************************** + * Parse option -S, indicating which activities are to be collected. + * + * IN: + * @argv Arguments list. + * @opt Index in list of arguments. + *************************************************************************** + */ +void parse_sadc_S_option(char *argv[], int opt) +{ + char *p; + int i; + + for (p = strtok(argv[opt], ","); p; p = strtok(NULL, ",")) { + if (!strcmp(p, K_INT)) { + /* Select interrupt activity */ + COLLECT_ACTIVITY(A_IRQ); + } + else if (!strcmp(p, K_DISK)) { + /* Select disk activity */ + COLLECT_ACTIVITY(A_DISK); + } + else if (!strcmp(p, K_XDISK)) { + /* Select disk and partition activity */ + i = get_activity_position(act, A_DISK); + act[i]->options |= AO_COLLECTED; + act[i]->opt_flags |= AO_F_DISK_PART; + } + else if (!strcmp(p, K_SNMP)) { + /* Select SNMP activities */ + COLLECT_ACTIVITY(A_NET_IP); + COLLECT_ACTIVITY(A_NET_EIP); + COLLECT_ACTIVITY(A_NET_ICMP); + COLLECT_ACTIVITY(A_NET_EICMP); + COLLECT_ACTIVITY(A_NET_TCP); + COLLECT_ACTIVITY(A_NET_ETCP); + COLLECT_ACTIVITY(A_NET_UDP); + } + else if (!strcmp(p, K_IPV6)) { + /* Select IPv6 activities */ + COLLECT_ACTIVITY(A_NET_IP6); + COLLECT_ACTIVITY(A_NET_EIP6); + COLLECT_ACTIVITY(A_NET_ICMP6); + COLLECT_ACTIVITY(A_NET_EICMP6); + COLLECT_ACTIVITY(A_NET_UDP6); + COLLECT_ACTIVITY(A_NET_SOCK6); + } + else if (!strcmp(p, K_POWER)) { + /* Select activities related to power management */ + COLLECT_ACTIVITY(A_PWR_CPUFREQ); + COLLECT_ACTIVITY(A_PWR_FAN); + COLLECT_ACTIVITY(A_PWR_TEMP); + } + else if (!strcmp(p, K_ALL) || !strcmp(p, K_XALL)) { + /* Select all activities */ + for (i = 0; i < NR_ACT; i++) { + act[i]->options |= AO_COLLECTED; + } + if (!strcmp(p, K_XALL)) { + /* Tell sadc to also collect partition statistics */ + i = get_activity_position(act, A_DISK); + act[i]->opt_flags |= AO_F_DISK_PART; + } + } + else if (strspn(argv[opt], DIGITS) == strlen(argv[opt])) { + /* + * Although undocumented, option -S followed by a numerical value + * enables the user to select each activity that should be + * collected. "-S 0" unselects all activities but CPU. + */ + int act_id; + + act_id = atoi(argv[opt]); + if ((act_id < 0) || (act_id > NR_ACT)) { + usage(argv[0]); + } + if (!act_id) { + /* Unselect all activities but CPU */ + for (i = 0; i < NR_ACT; i++) { + act[i]->options &= ~AO_COLLECTED; + } + COLLECT_ACTIVITY(A_CPU); + } + else { + /* Select chosen activity */ + COLLECT_ACTIVITY(act_id); + } + } + else { + usage(argv[0]); + } + } +} + +/* + *************************************************************************** + * SIGALRM signal handler. + * + * IN: + * @sig Signal number. Set to 0 for the first time, then to SIGALRM. + *************************************************************************** + */ +void alarm_handler(int sig) +{ + signal(SIGALRM, alarm_handler); + alarm(interval); +} + +/* + *************************************************************************** + * Display an error message. + *************************************************************************** + */ +void p_write_error(void) +{ + fprintf(stderr, _("Cannot write data to system activity file: %s\n"), + strerror(errno)); + exit(2); +} + +/* + *************************************************************************** + * Init structures. All of them are init'ed first when they are allocated + * (done by SREALLOC() macro in sa_sys_init() function). + * Then, they are init'ed again each time before reading the various system + * stats to make sure that no stats from a previous reading will remain (eg. + * if some network interfaces or block devices have been unregistered). + *************************************************************************** + */ +void reset_stats(void) +{ + int i; + + for (i = 0; i < NR_ACT; i++) { + if ((act[i]->nr > 0) && act[i]->_buf0) { + memset(act[i]->_buf0, 0, act[i]->msize * act[i]->nr); + } + } +} + +/* + *************************************************************************** + * Allocate and init structures, according to system state. + *************************************************************************** + */ +void sa_sys_init(void) +{ + int i; + + for (i = 0; i < NR_ACT; i++) { + + if (act[i]->f_count) { + /* Number of items is not a constant and should be calculated */ + act[i]->nr = (*act[i]->f_count)(act[i]); + } + + if (act[i]->nr > 0) { + /* Allocate structures for current activity */ + SREALLOC(act[i]->_buf0, void, act[i]->msize * act[i]->nr); + } + else { + /* No items found: Invalidate current activity */ + act[i]->options &= ~AO_COLLECTED; + } + + /* Set default activity list */ + id_seq[i] = act[i]->id; + } +} + +/* + *************************************************************************** + * Free structures. + *************************************************************************** + */ +void sa_sys_free(void) +{ + int i; + + for (i = 0; i < NR_ACT; i++) { + + if (act[i]->nr > 0) { + if (act[i]->_buf0) { + free(act[i]->_buf0); + act[i]->_buf0 = NULL; + } + } + } +} + +/* + *************************************************************************** + * Write data to file. If the write() call was interrupted by a signal, try + * again so that the whole buffer can be written. + * + * IN: + * @fd Output file descriptor. + * @buf Data buffer. + * @nr_bytes Number of bytes to write. + * + * RETURNS: + * Number of bytes written to file, or -1 on error. + *************************************************************************** + */ +int write_all(int fd, const void *buf, int nr_bytes) +{ + int block, offset = 0; + char *buffer = (char *) buf; + + while (nr_bytes > 0) { + block = write(fd, &buffer[offset], nr_bytes); + + if (block < 0) { + if (errno == EINTR) + continue; + return block; + } + if (block == 0) + return offset; + + offset += block; + nr_bytes -= block; + } + + return offset; +} + +/* + *************************************************************************** + * If -L option used, request a non-blocking, exclusive lock on the file. + * If lock would block, then another process (possibly sadc) has already + * opened that file => exit. + * + * IN: + * @fd Output file descriptor. + * @fatal Indicate if failing to lock file should be fatal or not. + * If it's not fatal then we'll wait for next iteration and + * try again. + * + * RETURNS: + * 0 on success, or 1 if file couldn't be locked. + *************************************************************************** + */ +int ask_for_flock(int fd, int fatal) +{ + /* Option -L may be used only if an outfile was specified on the command line */ + if (LOCK_FILE(flags)) { + /* + * Yes: Try to lock file. To make code portable, check for both EWOULDBLOCK + * and EAGAIN return codes, and treat them the same (glibc documentation). + * Indeed, some Linux ports (e.g. hppa-linux) do not equate EWOULDBLOCK and + * EAGAIN like every other Linux port. + */ + if (flock(fd, LOCK_EX | LOCK_NB) < 0) { + if ((((errno == EWOULDBLOCK) || (errno == EAGAIN)) && (fatal == FATAL)) || + ((errno != EWOULDBLOCK) && (errno != EAGAIN))) { + perror("flock"); + exit(1); + } + /* Was unable to lock file: Lock would have blocked... */ + return 1; + } + else { + /* File successfully locked */ + flags |= S_F_FILE_LOCKED; + } + } + return 0; +} + +/* + *************************************************************************** + * Fill system activity file magic header. + * + * IN: + * @file_magic System activity file magic header. + *************************************************************************** + */ +void fill_magic_header(struct file_magic *file_magic) +{ + char *v; + char version[16]; + + memset(file_magic, 0, FILE_MAGIC_SIZE); + + file_magic->sysstat_magic = SYSSTAT_MAGIC; + file_magic->format_magic = FORMAT_MAGIC; + file_magic->sysstat_extraversion = 0; + + strcpy(version, VERSION); + + /* Get version number */ + if ((v = strtok(version, ".")) == NULL) + return; + file_magic->sysstat_version = atoi(v) & 0xff; + + /* Get patchlevel number */ + if ((v = strtok(NULL, ".")) == NULL) + return; + file_magic->sysstat_patchlevel = atoi(v) & 0xff; + + /* Get sublevel number */ + if ((v = strtok(NULL, ".")) == NULL) + return; + file_magic->sysstat_sublevel = atoi(v) & 0xff; + + /* Get extraversion number. Don't necessarily exist */ + if ((v = strtok(NULL, ".")) == NULL) + return; + file_magic->sysstat_extraversion = atoi(v) & 0xff; +} + +/* + *************************************************************************** + * Fill system activity file header, then write it (or print it if stdout). + * + * IN: + * @fd Output file descriptor. May be stdout. + *************************************************************************** + */ +void setup_file_hdr(int fd) +{ + int n, i, p; + struct tm rectime; + struct utsname header; + struct file_magic file_magic; + struct file_activity file_act; + + /* Fill then write file magic header */ + fill_magic_header(&file_magic); + + if ((n = write_all(fd, &file_magic, FILE_MAGIC_SIZE)) != FILE_MAGIC_SIZE) + goto write_error; + + /* First reset the structure */ + memset(&file_hdr, 0, FILE_HEADER_SIZE); + + /* Then get current date */ + file_hdr.sa_ust_time = get_time(&rectime); + + /* OK, now fill the header */ + file_hdr.sa_nr_act = get_activity_nr(act, AO_COLLECTED, COUNT_ACTIVITIES); + file_hdr.sa_day = rectime.tm_mday; + file_hdr.sa_month = rectime.tm_mon; + file_hdr.sa_year = rectime.tm_year; + file_hdr.sa_sizeof_long = sizeof(long); + + /* Get system name, release number, hostname and machine architecture */ + uname(&header); + strncpy(file_hdr.sa_sysname, header.sysname, UTSNAME_LEN); + file_hdr.sa_sysname[UTSNAME_LEN - 1] = '\0'; + strncpy(file_hdr.sa_nodename, header.nodename, UTSNAME_LEN); + file_hdr.sa_nodename[UTSNAME_LEN - 1] = '\0'; + strncpy(file_hdr.sa_release, header.release, UTSNAME_LEN); + file_hdr.sa_release[UTSNAME_LEN - 1] = '\0'; + strncpy(file_hdr.sa_machine, header.machine, UTSNAME_LEN); + file_hdr.sa_machine[UTSNAME_LEN - 1] = '\0'; + + /* Write file header */ + if ((n = write_all(fd, &file_hdr, FILE_HEADER_SIZE)) != FILE_HEADER_SIZE) + goto write_error; + + /* Write activity list */ + for (i = 0; i < NR_ACT; i++) { + + /* + * Activity sequence given by id_seq array. + * Sequence must be the same for stdout as for output file. + */ + if (!id_seq[i]) + continue; + if ((p = get_activity_position(act, id_seq[i])) < 0) + continue; + + if (IS_COLLECTED(act[p]->options)) { + file_act.id = act[p]->id; + file_act.nr = act[p]->nr; + file_act.size = act[p]->fsize; + + if ((n = write_all(fd, &file_act, FILE_ACTIVITY_SIZE)) + != FILE_ACTIVITY_SIZE) + goto write_error; + } + } + + return; + +write_error: + + fprintf(stderr, _("Cannot write system activity file header: %s\n"), + strerror(errno)); + exit(2); +} + +/* + *************************************************************************** + * sadc called with interval and count parameters not set: + * Write a dummy record notifying a system restart, or insert a comment in + * binary data file if option -C has been used. + * Writing a dummy record should typically be done at boot time, + * before the cron daemon is started to avoid conflict with sa1/sa2 scripts. + * + * IN: + * @ofd Output file descriptor. + * @rtype Record type to write (dummy or comment). + *************************************************************************** + */ +void write_special_record(int ofd, int rtype) +{ + int n; + struct tm rectime; + + /* Check if file is locked */ + if (!FILE_LOCKED(flags)) { + ask_for_flock(ofd, FATAL); + } + + /* Reset the structure (not compulsory, but a bit cleaner) */ + memset(&record_hdr, 0, RECORD_HEADER_SIZE); + + /* Set record type */ + record_hdr.record_type = rtype; + + /* Save time */ + record_hdr.ust_time = get_time(&rectime); + + record_hdr.hour = rectime.tm_hour; + record_hdr.minute = rectime.tm_min; + record_hdr.second = rectime.tm_sec; + + /* Write record now */ + if ((n = write_all(ofd, &record_hdr, RECORD_HEADER_SIZE)) != RECORD_HEADER_SIZE) { + p_write_error(); + } + + if (rtype == R_COMMENT) { + /* Also write the comment */ + if ((n = write_all(ofd, comment, MAX_COMMENT_LEN)) != MAX_COMMENT_LEN) { + p_write_error(); + } + } +} + +/* + *************************************************************************** + * Write stats (or print them if stdout). + * + * IN: + * @ofd Output file descriptor. May be stdout. + *************************************************************************** + */ +void write_stats(int ofd) +{ + int i, n, p; + + /* Try to lock file */ + if (!FILE_LOCKED(flags)) { + if (ask_for_flock(ofd, NON_FATAL)) + /* + * Unable to lock file: + * Wait for next iteration to try again to save data. + */ + return; + } + + /* Write record header */ + if ((n = write_all(ofd, &record_hdr, RECORD_HEADER_SIZE)) != RECORD_HEADER_SIZE) { + p_write_error(); + } + + /* Then write all statistics */ + for (i = 0; i < NR_ACT; i++) { + + if (!id_seq[i]) + continue; + if ((p = get_activity_position(act, id_seq[i])) < 0) + continue; + + if (IS_COLLECTED(act[p]->options)) { + if ((n = write_all(ofd, act[p]->_buf0, act[p]->fsize * act[p]->nr)) != + (act[p]->fsize * act[p]->nr)) { + p_write_error(); + } + } + } +} + +/* + *************************************************************************** + * Create a system activity daily data file. + * + * IN: + * @ofile Name of output file. + * + * OUT: + * @ofd Output file descriptor. + *************************************************************************** + */ +void create_sa_file(int *ofd, char *ofile) +{ + if ((*ofd = open(ofile, O_CREAT | O_WRONLY, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) < 0) { + fprintf(stderr, _("Cannot open %s: %s\n"), ofile, strerror(errno)); + exit(2); + } + + /* Try to lock file */ + ask_for_flock(*ofd, FATAL); + + /* Truncate file */ + if (ftruncate(*ofd, 0) < 0) { + fprintf(stderr, _("Cannot open %s: %s\n"), ofile, strerror(errno)); + exit(2); + } + + /* Write file header */ + setup_file_hdr(*ofd); +} + +/* + *************************************************************************** + * Get descriptor for stdout. + * + * IN: + * @stdfd A value >= 0 indicates that stats data should also + * be written to stdout. + * + * OUT: + * @stdfd Stdout file descriptor. + *************************************************************************** + */ +void open_stdout(int *stdfd) +{ + if (*stdfd >= 0) { + if ((*stdfd = dup(STDOUT_FILENO)) < 0) { + perror("dup"); + exit(4); + } + /* Write file header on STDOUT */ + setup_file_hdr(*stdfd); + } +} + +/* + *************************************************************************** + * Get descriptor for output file and write its header. + * We may enter this function several times (when we rotate a file). + * + * IN: + * @ofile Name of output file. + * + * OUT: + * @ofd Output file descriptor. + *************************************************************************** + */ +void open_ofile(int *ofd, char ofile[]) +{ + struct file_magic file_magic; + struct file_activity file_act; + ssize_t sz; + int i, p; + + if (ofile[0]) { + /* Does file exist? */ + if (access(ofile, F_OK) < 0) { + /* NO: Create it */ + create_sa_file(ofd, ofile); + } + else { + /* YES: Append data to it if possible */ + if ((*ofd = open(ofile, O_APPEND | O_RDWR)) < 0) { + fprintf(stderr, _("Cannot open %s: %s\n"), ofile, strerror(errno)); + exit(2); + } + + /* Read file magic header */ + sz = read(*ofd, &file_magic, FILE_MAGIC_SIZE); + if (!sz) { + close(*ofd); + /* This is an empty file: Create it again */ + create_sa_file(ofd, ofile); + return; + } + if ((sz != FILE_MAGIC_SIZE) || + (file_magic.sysstat_magic != SYSSTAT_MAGIC) || + (file_magic.format_magic != FORMAT_MAGIC)) { + if (FORCE_FILE(flags)) { + close(*ofd); + /* -F option used: Truncate file */ + create_sa_file(ofd, ofile); + return; + } + /* Display error message and exit */ + handle_invalid_sa_file(ofd, &file_magic, ofile, sz); + } + + /* Read file standard header */ + if (read(*ofd, &file_hdr, FILE_HEADER_SIZE) != FILE_HEADER_SIZE) { + /* Display error message and exit */ + handle_invalid_sa_file(ofd, &file_magic, ofile, 0); + } + + /* + * OK: It's a true system activity file. + * List of activities from the file prevails over that of the user. + * So unselect all of them. And reset activity sequence. + */ + for (i = 0; i < NR_ACT; i++) { + act[i]->options &= ~AO_COLLECTED; + id_seq[i] = 0; + } + + if (!file_hdr.sa_nr_act || (file_hdr.sa_nr_act > NR_ACT)) + /* + * No activities at all or at least one unknown activity: + * Cannot append data to such a file. + */ + goto append_error; + + for (i = 0; i < file_hdr.sa_nr_act; i++) { + + /* Read current activity in list */ + if (read(*ofd, &file_act, FILE_ACTIVITY_SIZE) != FILE_ACTIVITY_SIZE) { + handle_invalid_sa_file(ofd, &file_magic, ofile, 0); + } + + p = get_activity_position(act, file_act.id); + + if ((p < 0) || (act[p]->fsize != file_act.size)) + /* Unknown activity in list or item size has changed */ + goto append_error; + + if (act[p]->nr != file_act.nr) { + if (IS_REMANENT(act[p]->options) || !file_act.nr) + /* + * Remanent structures cannot have a different number of items. + * Also number of items should never be null. + */ + goto append_error; + else { + /* + * Force number of items (serial lines, network interfaces...) + * to that of the file, and reallocate structures. + */ + act[p]->nr = file_act.nr; + SREALLOC(act[p]->_buf0, void, act[p]->msize * act[p]->nr); + } + } + /* Save activity sequence */ + id_seq[i] = file_act.id; + act[p]->options |= AO_COLLECTED; + } + } + } + + return; + +append_error: + + close(*ofd); + if (FORCE_FILE(flags)) { + /* Truncate file */ + create_sa_file(ofd, ofile); + } + else { + fprintf(stderr, _("Cannot append data to that file (%s)\n"), ofile); + exit(1); + } +} + +/* + *************************************************************************** + * Read statistics from various system files. + *************************************************************************** + */ +void read_stats(void) +{ + int i; + __nr_t cpu_nr = act[get_activity_position(act, A_CPU)]->nr; + + /* + * Init uptime0. So if /proc/uptime cannot fill it, + * this will be done by /proc/stat. + * If cpu_nr = 2, force /proc/stat to fill it. + * If cpu_nr = 1, uptime0 and uptime are equal. + * NB: uptime0 is always filled. + * Remember that cpu_nr = 1 means one CPU and no SMP kernel + * (one structure for CPU "all") and cpu_nr = 2 means one CPU + * and an SMP kernel (two structures for CPUs "all" and "0"). + */ + record_hdr.uptime0 = 0; + if (cpu_nr > 2) { + read_uptime(&(record_hdr.uptime0)); + } + + for (i = 0; i < NR_ACT; i++) { + if (IS_COLLECTED(act[i]->options)) { + /* Read statistics for current activity */ + (*act[i]->f_read)(act[i]); + } + } + + if (cpu_nr == 1) { + /* + * uptime has been filled by read_uptime() + * or when reading CPU stats from /proc/stat. + */ + record_hdr.uptime0 = record_hdr.uptime; + } +} + +/* + *************************************************************************** + * Main loop: Read stats from the relevant sources and display them. + * + * IN: + * @count Number of lines of stats to display. + * @rectime Current date and time. + * @stdfd Stdout file descriptor. + * @ofd Output file descriptor. + * @ofile Name of output file. + *************************************************************************** + */ +void rw_sa_stat_loop(long count, struct tm *rectime, int stdfd, int ofd, + char ofile[]) +{ + int do_sa_rotat = 0; + unsigned int save_flags; + char new_ofile[MAX_FILE_LEN]; + + new_ofile[0] = '\0'; + + /* Main loop */ + do { + + /* + * Init all structures. + * Exception for individual CPUs structures which must not be + * init'ed to keep values for CPU before they were disabled. + */ + reset_stats(); + + /* Save time */ + record_hdr.ust_time = get_time(rectime); + record_hdr.hour = rectime->tm_hour; + record_hdr.minute = rectime->tm_min; + record_hdr.second = rectime->tm_sec; + + /* Set record type */ + if (do_sa_rotat) { + record_hdr.record_type = R_LAST_STATS; + } + else { + record_hdr.record_type = R_STATS; + } + + /* Read then write stats */ + read_stats(); + + if (stdfd >= 0) { + save_flags = flags; + flags &= ~S_F_LOCK_FILE; + write_stats(stdfd); + flags = save_flags; + } + + /* If the record type was R_LAST_STATS, tag it R_STATS before writing it */ + record_hdr.record_type = R_STATS; + if (ofile[0]) { + write_stats(ofd); + } + + if (do_sa_rotat) { + /* + * Stats are written at the end of previous file *and* at the + * beginning of the new one (outfile must have been specified + * as '-' on the command line). + */ + do_sa_rotat = FALSE; + + if (fdatasync(ofd) < 0) { + /* Flush previous file */ + perror("fdatasync"); + exit(4); + } + close(ofd); + strcpy(ofile, new_ofile); + + /* Recalculate number of system items and reallocate structures */ + sa_sys_init(); + + /* + * Open and init new file. + * This is also used to set activity sequence to that of the file + * if the file already exists. + */ + open_ofile(&ofd, ofile); + + /* + * Rewrite header and activity sequence to stdout since + * number of items may have changed. + */ + if (stdfd >= 0) { + setup_file_hdr(stdfd); + } + + /* Write stats to file again */ + write_stats(ofd); + } + + /* Flush data */ + fflush(stdout); + + if (count > 0) { + count--; + } + + if (count) { + pause(); + } + + /* Rotate activity file if necessary */ + if (WANT_SA_ROTAT(flags)) { + /* The user specified '-' as the filename to use */ + set_default_file(rectime, new_ofile); + + if (strcmp(ofile, new_ofile)) { + do_sa_rotat = TRUE; + } + } + } + while (count); + + /* Close file descriptors if they have actually been used */ + CLOSE(stdfd); + CLOSE(ofd); +} + +/* + *************************************************************************** + * Main entry to the program. + *************************************************************************** + */ +int main(int argc, char **argv) +{ + int opt = 0, optz = 0; + char ofile[MAX_FILE_LEN]; + struct tm rectime; + int stdfd = 0, ofd = -1; + long count = 0; + + /* Get HZ */ + get_HZ(); + + /* Compute page shift in kB */ + get_kb_shift(); + + ofile[0] = comment[0] = '\0'; + +#ifdef HAVE_SENSORS + /* Initialize sensors, let it use the default cfg file */ + int err = sensors_init(NULL); + if (err) { + fprintf(stderr, "sensors_init: %s\n", sensors_strerror(err)); + } +#endif /* HAVE_SENSORS */ + +#ifdef USE_NLS + /* Init National Language Support */ + init_nls(); +#endif + + while (++opt < argc) { + + if (!strcmp(argv[opt], "-S")) { + if (argv[++opt]) { + parse_sadc_S_option(argv, opt); + } + else { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-F")) { + flags |= S_F_FORCE_FILE; + } + + else if (!strcmp(argv[opt], "-L")) { + flags |= S_F_LOCK_FILE; + } + + else if (!strcmp(argv[opt], "-V")) { + print_version(); + } + + else if (!strcmp(argv[opt], "-z")) { + /* Set by sar command */ + optz = 1; + } + + else if (!strcmp(argv[opt], "-C")) { + if (argv[++opt]) { + strncpy(comment, argv[opt], MAX_COMMENT_LEN); + comment[MAX_COMMENT_LEN - 1] = '\0'; + if (!strlen(comment)) { + usage(argv[0]); + } + } + else { + usage(argv[0]); + } + } + + else if (strspn(argv[opt], DIGITS) != strlen(argv[opt])) { + if (!ofile[0]) { + stdfd = -1; /* Don't write to STDOUT */ + if (!strcmp(argv[opt], "-")) { + /* File name set to '-' */ + set_default_file(&rectime, ofile); + flags |= S_F_SA_ROTAT; + } + else if (!strncmp(argv[opt], "-", 1)) { + /* Bad option */ + usage(argv[0]); + } + else { + /* Write data to file */ + strncpy(ofile, argv[opt], MAX_FILE_LEN); + ofile[MAX_FILE_LEN - 1] = '\0'; + } + } + else { + /* Outfile already specified */ + usage(argv[0]); + } + } + + else if (!interval) { + /* Get interval */ + interval = atol(argv[opt]); + if (interval < 1) { + usage(argv[0]); + } + count = -1; + } + + else if (count <= 0) { + /* Get count value */ + count = atol(argv[opt]); + if (count < 1) { + usage(argv[0]); + } + } + + else { + usage(argv[0]); + } + } + + /* + * If option -z used, write to STDOUT even if a filename + * has been entered on the command line. + */ + if (optz) { + stdfd = 0; + } + + if (!ofile[0]) { + /* -L option ignored when writing to STDOUT */ + flags &= ~S_F_LOCK_FILE; + } + + /* Init structures according to machine architecture */ + sa_sys_init(); + + /* + * Open output file then STDOUT. Write header for each of them. + * NB: Output file must be opened first, because we may change + * the activities collected AND the activity sequence to that + * of the file, and the activities collected and activity sequence + * written on STDOUT must be consistent to those of the file. + */ + open_ofile(&ofd, ofile); + open_stdout(&stdfd); + + if (!interval) { + if (ofd >= 0) { + /* + * Interval (and count) not set: + * Write a dummy record, or insert a comment, then exit. + * NB: Never write such a dummy record on stdout since + * sar never expects it. + */ + if (comment[0]) { + write_special_record(ofd, R_COMMENT); + } + else { + write_special_record(ofd, R_RESTART); + } + + /* Close file descriptor */ + CLOSE(ofd); + } + + /* Free structures */ + sa_sys_free(); + exit(0); + } + + /* Set a handler for SIGALRM */ + alarm_handler(0); + + /* Main loop */ + rw_sa_stat_loop(count, &rectime, stdfd, ofd, ofile); + +#ifdef HAVE_SENSORS + /* Cleanup sensors */ + sensors_cleanup(); +#endif /* HAVE_SENSORS */ + + /* Free structures */ + sa_sys_free(); + + return 0; +} diff --git a/sadf.c b/sadf.c new file mode 100644 index 00000000..7219ef12 --- /dev/null +++ b/sadf.c @@ -0,0 +1,1391 @@ +/* + * sadf: system activity data formatter + * (C) 1999-2009 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "version.h" +#include "sadf.h" +#include "sa.h" +#include "common.h" +#include "ioconf.h" +#include "prf_stats.h" + +#ifdef USE_NLS +# include +# include +# define _(string) gettext(string) +#else +# define _(string) (string) +#endif + +#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__ +char *sccsid(void) { return (SCCSID); } + +long interval = -1, count = 0; + +unsigned int flags = 0; +unsigned int format = 0; /* Output format */ + +/* File header */ +struct file_header file_hdr; + +static char *seps[] = {"\t", ";"}; + +/* + * Activity sequence. + * This array must always be entirely filled (even with trailing zeros). + */ +unsigned int id_seq[NR_ACT]; + +/* Current record header */ +struct record_header record_hdr[3]; + +struct tm rectime, loctime; +/* Contain the date specified by -s and -e options */ +struct tstamp tm_start, tm_end; +char *args[MAX_ARGV_NR]; + +extern struct activity *act[]; + +/* + *************************************************************************** + * Print usage and exit. + * + * IN: + * @progname Name of sysstat command. + *************************************************************************** + */ +void usage(char *progname) +{ + fprintf(stderr, + _("Usage: %s [ options ] [ [ ] ] [ ]\n"), + progname); + + fprintf(stderr, _("Options are:\n" + "[ -d | -D | -H | -p | -x ] [ -C ] [ -h ] [ -t ] [ -V ]\n" + "[ -P { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" + "[ -- ]\n")); + exit(1); +} + +/* + *************************************************************************** + * Init structures. + *************************************************************************** + */ +void init_structures(void) +{ + int i; + + for (i = 0; i < 3; i++) { + memset(&record_hdr[i], 0, RECORD_HEADER_SIZE); + } +} + +/* + *************************************************************************** + * Fill the rectime structure with current record's date and time, based on + * current record's "number of seconds since the epoch" saved in file. + * The resulting timestamp is expressed in UTC or in local time, depending + * on whether option -t has been used or not. + * NB: Option -t is ignored when option -p is used, since option -p + * displays its timestamp as a long integer. This is type 'time_t', + * which is the number of seconds since 1970 _always_ expressed in UTC. + * + * IN: + * @curr Index in array for current sample statistics. + *************************************************************************** +*/ +void sadf_get_record_timestamp_struct(int curr) +{ + struct tm *ltm; + + ltm = localtime((const time_t *) &record_hdr[curr].ust_time); + loctime = *ltm; + + if (!PRINT_TRUE_TIME(flags) || + ((format != S_O_DB_OPTION) && (format != S_O_XML_OPTION))) { + /* Option -t is valid only with options -d and -x */ + ltm = gmtime((const time_t *) &record_hdr[curr].ust_time); + } + + rectime = *ltm; +} + +/* + *************************************************************************** + * Set current record's timestamp string. This timestamp is expressed in + * UTC or in local time, depending on whether option -t has been used or + * not. + * NB: If options -D or -p have been used, the timestamp in expressed in + * seconds since 1970. + * + * IN: + * @curr Index in array for current sample statistics. + * @len Maximum length of timestamp string. + * + * OUT: + * @cur_time Timestamp string. + *************************************************************************** +*/ +void set_record_timestamp_string(int curr, char *cur_time, int len) +{ + /* Fill timestamp structure */ + sadf_get_record_timestamp_struct(curr); + + /* Set cur_time date value */ + if (format == S_O_DB_OPTION) { + if (PRINT_TRUE_TIME(flags)) { + strftime(cur_time, len, "%Y-%m-%d %H:%M:%S", &rectime); + } + else { + strftime(cur_time, len, "%Y-%m-%d %H:%M:%S UTC", &rectime); + } + } + else if ((format == S_O_PPC_OPTION) || (format == S_O_DBD_OPTION)) { + sprintf(cur_time, "%ld", record_hdr[curr].ust_time); + } +} + +/* + *************************************************************************** + * Display the field list (when displaying stats in DB format) + * + * IN: + * @act_d Activity to display, or ~0 for all. + *************************************************************************** + */ +void list_fields(unsigned int act_id) +{ + int i; + unsigned int msk; + char *hl; + char hline[HEADER_LINE_LEN]; + + printf("# hostname;interval;timestamp"); + + for (i = 0; i < NR_ACT; i++) { + + if ((act_id != ALL_ACTIVITIES) && (act[i]->id != act_id)) + continue; + + if (IS_SELECTED(act[i]->options) && (act[i]->nr > 0)) { + if (!HAS_MULTIPLE_OUTPUTS(act[i]->options)) { + printf(";%s", act[i]->hdr_line); + if ((act[i]->nr > 1) && DISPLAY_HORIZONTALLY(flags)) { + printf("[...]"); + } + } + else { + msk = 1; + strcpy(hline, act[i]->hdr_line); + for (hl = strtok(hline, "|"); hl; hl = strtok(NULL, "|"), msk <<= 1) { + if ((hl != NULL) && (act[i]->opt_flags & msk)) { + printf(";%s", hl); + if ((act[i]->nr > 1) && DISPLAY_HORIZONTALLY(flags)) { + printf("[...]"); + } + } + } + } + } + } + + printf("\n"); +} + +/* + *************************************************************************** + * write_mech_stats() - + * Replace the old write_stats_for_ppc() and write_stats_for_db(), + * making it easier for them to remain in sync and print the same data. + * + * IN: + * @curr Index in array for current sample statistics. + * @dt Interval of time in seconds. + * @itv Interval of time in jiffies. + * @g_itv Interval of time in jiffies multiplied by the number of + * processors. + * @cur_time Current timestamp. + * @act_id Activity to display, or ~0 for all. + *************************************************************************** + */ +void write_mech_stats(int curr, unsigned long dt, unsigned long long itv, + unsigned long long g_itv, char *cur_time, unsigned int act_id) +{ + int i; + char pre[80]; /* Text at beginning of each line */ + int isdb = ((format == S_O_DB_OPTION) || (format == S_O_DBD_OPTION)); + + /* This substring appears on every output line, preformat it here */ + snprintf(pre, 80, "%s%s%ld%s%s", + file_hdr.sa_nodename, seps[isdb], dt, seps[isdb], cur_time); + pre[79] = '\0'; + + if (DISPLAY_HORIZONTALLY(flags)) { + printf("%s", pre); + } + + for (i = 0; i < NR_ACT; i++) { + + if ((act_id != ALL_ACTIVITIES) && (act[i]->id != act_id)) + continue; + + if (IS_SELECTED(act[i]->options) && (act[i]->nr > 0)) { + + if (NEEDS_GLOBAL_ITV(act[i]->options)) { + (*act[i]->f_render)(act[i], isdb, pre, curr, g_itv); + } + else { + (*act[i]->f_render)(act[i], isdb, pre, curr, itv); + } + } + } + + if (DISPLAY_HORIZONTALLY(flags)) { + printf("\n"); + } +} + +/* + *************************************************************************** + * Write system statistics. + * + * IN: + * @curr Index in array for current sample statistics. + * @reset Set to TRUE if last_uptime variable should be + * reinitialized (used in next_slice() function). + * @use_tm_start Set to TRUE if option -s has been used. + * @use_tm_end Set to TRUE if option -e has been used. + * @act_id Activities to display. + * + * OUT: + * @cnt Set to 0 to indicate that no other lines of stats + * should be displayed. + * + * RETURNS: + * 1 if a line of stats has been displayed, and 0 otherwise. + *************************************************************************** + */ +int write_parsable_stats(int curr, int reset, long *cnt, int use_tm_start, + int use_tm_end, unsigned int act_id) +{ + unsigned long long dt, itv, g_itv; + char cur_time[26]; + static int cross_day = FALSE; + static __nr_t cpu_nr = -1; + + if (cpu_nr < 0) { + cpu_nr = act[get_activity_position(act, A_CPU)]->nr; + } + + /* + * Check time (1). + * For this first check, we use the time interval entered on + * the command line. This is equivalent to sar's option -i which + * selects records at seconds as close as possible to the number + * specified by the interval parameter. + */ + if (!next_slice(record_hdr[2].uptime0, record_hdr[curr].uptime0, + reset, interval)) + /* Not close enough to desired interval */ + return 0; + + /* Set current timestamp */ + set_record_timestamp_string(curr, cur_time, 26); + + /* Check if we are beginning a new day */ + if (use_tm_start && record_hdr[!curr].ust_time && + (record_hdr[curr].ust_time > record_hdr[!curr].ust_time) && + (record_hdr[curr].hour < record_hdr[!curr].hour)) { + cross_day = TRUE; + } + + if (cross_day) { + /* + * This is necessary if we want to properly handle something like: + * sar -s time_start -e time_end with + * time_start(day D) > time_end(day D+1) + */ + loctime.tm_hour += 24; + } + + /* Check time (2) */ + if (use_tm_start && (datecmp(&loctime, &tm_start) < 0)) + /* it's too soon... */ + return 0; + + /* Get interval values */ + get_itv_value(&record_hdr[curr], &record_hdr[!curr], + cpu_nr, &itv, &g_itv); + + /* Check time (3) */ + if (use_tm_end && (datecmp(&loctime, &tm_end) > 0)) { + /* It's too late... */ + *cnt = 0; + return 0; + } + + dt = itv / HZ; + /* Correct rounding error for dt */ + if ((itv % HZ) >= (HZ / 2)) { + dt++; + } + + write_mech_stats(curr, dt, itv, g_itv, cur_time, act_id); + + return 1; +} + +/* + *************************************************************************** + * Display XML activity records + * + * IN: + * @curr Index in array for current sample statistics. + * @use_tm_start Set to TRUE if option -s has been used. + * @use_tm_end Set to TRUE if option -e has been used. + * @reset Set to TRUE if last_uptime should be reinitialized + * (used in next_slice() function). + * @tab Number of tabulations to print. + * @cpu_nr Number of processors. + * + * OUT: + * @cnt Set to 0 to indicate that no other lines of stats + * should be displayed. + * + * RETURNS: + * 1 if stats have been successfully displayed. + *************************************************************************** + */ +int write_xml_stats(int curr, int use_tm_start, int use_tm_end, int reset, + long *cnt, int tab, __nr_t cpu_nr) +{ + int i; + unsigned long long dt, itv, g_itv; + char cur_time[XML_TIMESTAMP_LEN]; + static int cross_day = FALSE; + + /* Fill timestamp structure (rectime) for current record */ + sadf_get_record_timestamp_struct(curr); + + /* + * Check time (1). + * For this first check, we use the time interval entered on + * the command line. This is equivalent to sar's option -i which + * selects records at seconds as close as possible to the number + * specified by the interval parameter. + */ + if (!next_slice(record_hdr[2].uptime0, record_hdr[curr].uptime0, + reset, interval)) + /* Not close enough to desired interval */ + return 0; + + /* Check if we are beginning a new day */ + if (use_tm_start && record_hdr[!curr].ust_time && + (record_hdr[curr].ust_time > record_hdr[!curr].ust_time) && + (record_hdr[curr].hour < record_hdr[!curr].hour)) { + cross_day = TRUE; + } + + if (cross_day) { + /* + * This is necessary if we want to properly handle something like: + * sar -s time_start -e time_end with + * time_start(day D) > time_end(day D+1) + */ + loctime.tm_hour += 24; + } + + /* Check time (2) */ + if (use_tm_start && (datecmp(&loctime, &tm_start) < 0)) + /* it's too soon... */ + return 0; + + /* Get interval values */ + get_itv_value(&record_hdr[curr], &record_hdr[!curr], + cpu_nr, &itv, &g_itv); + + /* Check time (3) */ + if (use_tm_end && (datecmp(&loctime, &tm_end) > 0)) { + /* It's too late... */ + *cnt = 0; + return 0; + } + + dt = itv / HZ; + /* Correct rounding error for dt */ + if ((itv % HZ) >= (HZ / 2)) { + dt++; + } + + strftime(cur_time, XML_TIMESTAMP_LEN, + "date=\"%Y-%m-%d\" time=\"%H:%M:%S\"", &rectime); + + xprintf(tab, "", cur_time, dt); + tab++; + + /* Display XML statistics */ + for (i = 0; i < NR_ACT; i++) { + + if (CLOSE_MARKUP(act[i]->options) || + (IS_SELECTED(act[i]->options) && (act[i]->nr > 0))) { + + if (NEEDS_GLOBAL_ITV(act[i]->options)) { + (*act[i]->f_xml_print)(act[i], curr, tab, g_itv); + } + else { + (*act[i]->f_xml_print)(act[i], curr, tab, itv); + } + } + } + + xprintf(--tab, ""); + + return 1; +} + +/* + *************************************************************************** + * Display XML restart records + * + * IN: + * @curr Index in array for current sample statistics. + * @use_tm_start Set to TRUE if option -s has been used. + * @use_tm_end Set to TRUE if option -e has been used. + * @tab Number of tabulations to print. + *************************************************************************** + */ +void write_xml_restarts(int curr, int use_tm_start, int use_tm_end, int tab) +{ + char cur_time[64]; + + /* Fill timestamp structure for current record */ + sadf_get_record_timestamp_struct(curr); + + /* The record must be in the interval specified by -s/-e options */ + if ((use_tm_start && (datecmp(&loctime, &tm_start) < 0)) || + (use_tm_end && (datecmp(&loctime, &tm_end) > 0))) + return; + + strftime(cur_time, 64, "date=\"%Y-%m-%d\" time=\"%H:%M:%S\"", &rectime); + xprintf(tab, "", cur_time); +} + +/* + *************************************************************************** + * Display XML COMMENT records + * + * IN: + * @curr Index in array for current sample statistics. + * @use_tm_start Set to TRUE if option -s has been used. + * @use_tm_end Set to TRUE if option -e has been used. + * @tab Number of tabulations to print. + * @ifd Input file descriptor. + *************************************************************************** + */ +void write_xml_comments(int curr, int use_tm_start, int use_tm_end, int tab, int ifd) +{ + char cur_time[64]; + char file_comment[MAX_COMMENT_LEN]; + + sa_fread(ifd, file_comment, MAX_COMMENT_LEN, HARD_SIZE); + file_comment[MAX_COMMENT_LEN - 1] = '\0'; + + /* Fill timestamp structure for current record */ + sadf_get_record_timestamp_struct(curr); + + /* The record must be in the interval specified by -s/-e options */ + if ((use_tm_start && (datecmp(&loctime, &tm_start) < 0)) || + (use_tm_end && (datecmp(&loctime, &tm_end) > 0))) + return; + + strftime(cur_time, 64, "date=\"%Y-%m-%d\" time=\"%H:%M:%S\"", &rectime); + xprintf(tab, "", cur_time, file_comment); +} + +/* + *************************************************************************** + * Print contents of a special (RESTART or COMMENT) record + * + * IN: + * @curr Index in array for current sample statistics. + * @use_tm_start Set to TRUE if option -s has been used. + * @use_tm_end Set to TRUE if option -e has been used. + * @rtype Record type (RESTART or COMMENT). + * @ifd Input file descriptor. + *************************************************************************** + */ +void sadf_print_special(int curr, int use_tm_start, int use_tm_end, int rtype, int ifd) +{ + char cur_time[26]; + int dp = 1; + + set_record_timestamp_string(curr, cur_time, 26); + + /* The record must be in the interval specified by -s/-e options */ + if ((use_tm_start && (datecmp(&loctime, &tm_start) < 0)) || + (use_tm_end && (datecmp(&loctime, &tm_end) > 0))) { + dp = 0; + } + + if (rtype == R_RESTART) { + if (!dp) + return; + if (format == S_O_PPC_OPTION) { + printf("%s\t-1\t%ld\tLINUX-RESTART\n", + file_hdr.sa_nodename, record_hdr[curr].ust_time); + } + else if ((format == S_O_DB_OPTION) || (format == S_O_DBD_OPTION)) { + printf("%s;-1;%s;LINUX-RESTART\n", + file_hdr.sa_nodename, cur_time); + } + } + else if (rtype == R_COMMENT) { + char file_comment[MAX_COMMENT_LEN]; + + sa_fread(ifd, file_comment, MAX_COMMENT_LEN, HARD_SIZE); + file_comment[MAX_COMMENT_LEN - 1] = '\0'; + + if (!dp || !DISPLAY_COMMENT(flags)) + return; + + if (format == S_O_PPC_OPTION) { + printf("%s\t-1\t%ld\tCOM %s\n", + file_hdr.sa_nodename, record_hdr[curr].ust_time, + file_comment); + } + else if ((format == S_O_DB_OPTION) || (format == S_O_DBD_OPTION)) { + printf("%s;-1;%s;COM %s\n", + file_hdr.sa_nodename, cur_time, file_comment); + } + } +} + +/* + *************************************************************************** + * Display data file header. + * + * IN: + * @dfile Name of system activity data file + * @file_magic System activity file magic header + * @file_hdr System activity file standard header + *************************************************************************** + */ +void display_file_header(char *dfile, struct file_magic *file_magic, + struct file_header *file_hdr) +{ + int i, p; + static __nr_t cpu_nr = -1; + + if (cpu_nr < 0) { + cpu_nr = act[get_activity_position(act, A_CPU)]->nr; + } + + printf(_("System activity data file: %s (%#x)\n"), + dfile, file_magic->format_magic); + + display_sa_file_version(file_magic); + + if (file_magic->format_magic != FORMAT_MAGIC) { + exit(0); + } + + printf(_("Host: ")); + print_gal_header(localtime((const time_t *) &(file_hdr->sa_ust_time)), + file_hdr->sa_sysname, file_hdr->sa_release, + file_hdr->sa_nodename, file_hdr->sa_machine, + cpu_nr > 1 ? cpu_nr - 1 : 1); + + printf(_("Size of a long int: %d\n"), file_hdr->sa_sizeof_long); + + printf(_("List of activities:\n")); + for (i = 0; i < NR_ACT; i++) { + if (!id_seq[i]) + continue; + if ((p = get_activity_position(act, id_seq[i])) < 0) { + PANIC(id_seq[i]); + } + printf("%02d: %s\t(x%d)\n", act[p]->id, act[p]->name, act[p]->nr); + } + + exit(0); +} + +/* + *************************************************************************** + * Display XML header and host data + * + * IN: + * @tab Number of tabulations to print. + * @cpu_nr Number of processors. + * + * OUT: + * @tab Number of tabulations to print. + *************************************************************************** + */ +void display_xml_header(int *tab, __nr_t cpu_nr) +{ + char cur_time[XML_TIMESTAMP_LEN]; + + printf("\n"); + printf("\n"); + + xprintf(*tab, ""); + xprintf(++(*tab), "%s", XML_DTD_VERSION); + + xprintf(*tab, "", file_hdr.sa_nodename); + xprintf(++(*tab), "%s", file_hdr.sa_sysname); + xprintf(*tab, "%s", file_hdr.sa_release); + + xprintf(*tab, "%s", file_hdr.sa_machine); + xprintf(*tab, "%d", cpu_nr > 1 ? cpu_nr - 1 : 1); + + /* Fill file timestmap structure (rectime) */ + get_file_timestamp_struct(flags, &rectime, &file_hdr); + strftime(cur_time, XML_TIMESTAMP_LEN, "%Y-%m-%d", &rectime); + xprintf(*tab, "%s", cur_time); +} + +/* + *************************************************************************** + * Read stats for current activity from file and write them. + * + * IN: + * @ifd File descriptor of input file. + * @fpos Position in file where reading must start. + * @curr Index in array for current sample statistics. + * @file_actlst List of (known or unknown) activities in file. + * + * OUT: + * @curr Index in array for next sample statistics. + * @cnt Number of lines of stats remaining to write. + * @eosaf Set to TRUE if EOF (end of file) has been reached. + * @act_id Activity to display, or ~0 for all. + * @reset Set to TRUE if last_uptime variable should be + * reinitialized (used in next_slice() function). + *************************************************************************** + */ +void rw_curr_act_stats(int ifd, off_t fpos, int *curr, long *cnt, int *eosaf, + unsigned int act_id, int *reset, struct file_activity *file_actlst) +{ + unsigned char rtype; + int next; + + if (lseek(ifd, fpos, SEEK_SET) < fpos) { + perror("lseek"); + exit(2); + } + + if ((format == S_O_DB_OPTION) || (format == S_O_DBD_OPTION)) { + /* Print field list */ + list_fields(act_id); + } + + /* + * Restore the first stats collected. + * Used to compute the rate displayed on the first line. + */ + copy_structures(act, id_seq, record_hdr, !*curr, 2); + + *cnt = count; + + do { + /* Display lines of stats */ + *eosaf = sa_fread(ifd, &record_hdr[*curr], RECORD_HEADER_SIZE, + SOFT_SIZE); + rtype = record_hdr[*curr].record_type; + + if (!*eosaf && (rtype != R_RESTART) && (rtype != R_COMMENT)) { + /* Read the extra fields since it's not a RESTART record */ + read_file_stat_bunch(act, *curr, ifd, file_hdr.sa_nr_act, + file_actlst); + } + + if (!*eosaf && (rtype != R_RESTART)) { + + if (rtype == R_COMMENT) { + sadf_print_special(*curr, tm_start.use, tm_end.use, + R_COMMENT, ifd); + continue; + } + + next = write_parsable_stats(*curr, *reset, cnt, + tm_start.use, tm_end.use, act_id); + + if (next) { + /* + * next is set to 1 when we were close enough to desired interval. + * In this case, the call to write_parsable_stats() has actually + * displayed a line of stats. + */ + *curr ^=1; + if (*cnt > 0) { + (*cnt)--; + } + } + *reset = FALSE; + } + } + while (*cnt && !*eosaf && (rtype != R_RESTART)); + + *reset = TRUE; +} + +/* + *************************************************************************** + * Display activities for -x option. + * + * IN: + * @ifd File descriptor of input file. + * @file_actlst List of (known or unknown) activities in file. + *************************************************************************** + */ +void xml_display_loop(int ifd, struct file_activity *file_actlst) +{ + int curr, tab = 0, rtype; + int eosaf = TRUE, next, reset = FALSE; + long cnt = 1; + off_t fpos; + static __nr_t cpu_nr = -1; + + if (cpu_nr < 0) { + cpu_nr = act[get_activity_position(act, A_CPU)]->nr; + } + + /* Save current file position */ + if ((fpos = lseek(ifd, 0, SEEK_CUR)) < 0) { + perror("lseek"); + exit(2); + } + + /* Print XML header */ + display_xml_header(&tab, cpu_nr); + + /* Process activities */ + xprintf(tab++, ""); + do { + /* + * If this record is a special (RESTART or COMMENT) one, + * skip it and try to read the next record in file. + */ + do { + eosaf = sa_fread(ifd, &record_hdr[0], RECORD_HEADER_SIZE, SOFT_SIZE); + rtype = record_hdr[0].record_type; + + if (!eosaf && (rtype != R_RESTART) && (rtype != R_COMMENT)) { + /* + * OK: Previous record was not a special one. + * So read now the extra fields. + */ + read_file_stat_bunch(act, 0, ifd, file_hdr.sa_nr_act, + file_actlst); + sadf_get_record_timestamp_struct(0); + } + + if (!eosaf && (rtype == R_COMMENT)) { + /* + * Ignore COMMENT record. + * (Unlike RESTART records, COMMENT records have an additional + * comment field). + */ + if (lseek(ifd, MAX_COMMENT_LEN, SEEK_CUR) < MAX_COMMENT_LEN) { + perror("lseek"); + } + } + } + while (!eosaf && ((rtype == R_RESTART) || (rtype == R_COMMENT) || + (tm_start.use && (datecmp(&loctime, &tm_start) < 0)) || + (tm_end.use && (datecmp(&loctime, &tm_end) >=0)))); + + /* Save the first stats collected. Used for example in next_slice() function */ + copy_structures(act, id_seq, record_hdr, 2, 0); + + curr = 1; + cnt = count; + reset = TRUE; + + if (!eosaf) { + do { + eosaf = sa_fread(ifd, &record_hdr[curr], RECORD_HEADER_SIZE, + SOFT_SIZE); + rtype = record_hdr[curr].record_type; + + if (!eosaf && (rtype != R_RESTART) && (rtype != R_COMMENT)) { + /* Read the extra fields since it's not a special record */ + read_file_stat_bunch(act, curr, ifd, file_hdr.sa_nr_act, + file_actlst); + + /* next is set to 1 when we were close enough to desired interval */ + next = write_xml_stats(curr, tm_start.use, tm_end.use, reset, + &cnt, tab, cpu_nr); + + if (next) { + curr ^= 1; + if (cnt > 0) { + cnt--; + } + } + reset = FALSE; + } + + if (!eosaf && (rtype == R_COMMENT)) { + /* Ignore COMMENT record */ + if (lseek(ifd, MAX_COMMENT_LEN, SEEK_CUR) < MAX_COMMENT_LEN) { + perror("lseek"); + } + } + } + while (cnt && !eosaf && (rtype != R_RESTART)); + + if (!cnt) { + /* Go to next Linux restart, if possible */ + do { + eosaf = sa_fread(ifd, &record_hdr[curr], RECORD_HEADER_SIZE, + SOFT_SIZE); + rtype = record_hdr[curr].record_type; + if (!eosaf && (rtype != R_RESTART) && (rtype != R_COMMENT)) { + read_file_stat_bunch(act, curr, ifd, file_hdr.sa_nr_act, + file_actlst); + } + else if (!eosaf && (rtype == R_COMMENT)) { + /* Ignore COMMENT record */ + if (lseek(ifd, MAX_COMMENT_LEN, SEEK_CUR) < MAX_COMMENT_LEN) { + perror("lseek"); + } + } + } + while (!eosaf && (rtype != R_RESTART)); + } + reset = TRUE; + } + } + while (!eosaf); + xprintf(--tab, ""); + + /* Rewind file */ + if (lseek(ifd, fpos, SEEK_SET) < fpos) { + perror("lseek"); + exit(2); + } + + /* Process now RESTART entries to display restart messages */ + xprintf(tab++, ""); + do { + if ((eosaf = sa_fread(ifd, &record_hdr[0], RECORD_HEADER_SIZE, + SOFT_SIZE)) == 0) { + + rtype = record_hdr[0].record_type; + if ((rtype != R_RESTART) && (rtype != R_COMMENT)) { + read_file_stat_bunch(act, 0, ifd, file_hdr.sa_nr_act, + file_actlst); + } + if (rtype == R_RESTART) { + write_xml_restarts(0, tm_start.use, tm_end.use, tab); + } + else if (rtype == R_COMMENT) { + /* Ignore COMMENT record */ + if (lseek(ifd, MAX_COMMENT_LEN, SEEK_CUR) < MAX_COMMENT_LEN) { + perror("lseek"); + } + } + } + } + while (!eosaf); + xprintf(--tab, ""); + + /* Rewind file */ + if (lseek(ifd, fpos, SEEK_SET) < fpos) { + perror("lseek"); + exit(2); + } + + /* Last, process COMMENT entries to display comments */ + if (DISPLAY_COMMENT(flags)) { + xprintf(tab++, ""); + do { + if ((eosaf = sa_fread(ifd, &record_hdr[0], RECORD_HEADER_SIZE, + SOFT_SIZE)) == 0) { + + rtype = record_hdr[0].record_type; + if ((rtype != R_RESTART) && (rtype != R_COMMENT)) { + read_file_stat_bunch(act, 0, ifd, file_hdr.sa_nr_act, + file_actlst); + } + if (rtype == R_COMMENT) { + write_xml_comments(0, tm_start.use, tm_end.use, + tab, ifd); + } + } + } + while (!eosaf); + xprintf(--tab, ""); + } + + xprintf(--tab, ""); + xprintf(--tab, ""); +} + +/* + *************************************************************************** + * Display activities for -p and -d options. + * + * IN: + * @ifd File descriptor of input file. + * @file_actlst List of (known or unknown) activities in file. + *************************************************************************** + */ +void main_display_loop(int ifd, struct file_activity *file_actlst) +{ + int i, p; + int curr = 1, rtype; + int eosaf = TRUE, reset = FALSE; + long cnt = 1; + off_t fpos; + + /* Read system statistics from file */ + do { + /* + * If this record is a special (RESTART or COMMENT) one, print it and + * (try to) get another one. + */ + do { + if (sa_fread(ifd, &record_hdr[0], RECORD_HEADER_SIZE, SOFT_SIZE)) + /* End of sa data file */ + return; + + rtype = record_hdr[0].record_type; + if ((rtype == R_RESTART) || (rtype == R_COMMENT)) { + sadf_print_special(0, tm_start.use, tm_end.use, rtype, ifd); + } + else { + /* + * OK: Previous record was not a special one. + * So read now the extra fields. + */ + read_file_stat_bunch(act, 0, ifd, file_hdr.sa_nr_act, + file_actlst); + sadf_get_record_timestamp_struct(0); + } + } + while ((rtype == R_RESTART) || (rtype == R_COMMENT) || + (tm_start.use && (datecmp(&loctime, &tm_start) < 0)) || + (tm_end.use && (datecmp(&loctime, &tm_end) >=0))); + + /* Save the first stats collected. Will be used to compute the average */ + copy_structures(act, id_seq, record_hdr, 2, 0); + + /* Set flag to reset last_uptime variable. Should be done after a LINUX RESTART record */ + reset = TRUE; + + /* Save current file position */ + if ((fpos = lseek(ifd, 0, SEEK_CUR)) < 0) { + perror("lseek"); + exit(2); + } + + /* Read and write stats located between two possible Linux restarts */ + + if (DISPLAY_HORIZONTALLY(flags)) { + /* + * If stats are displayed horizontally, then all activities + * are printed on the same line. + */ + rw_curr_act_stats(ifd, fpos, &curr, &cnt, &eosaf, + ALL_ACTIVITIES, &reset, file_actlst); + } + else { + /* For each requested activity... */ + for (i = 0; i < NR_ACT; i++) { + + if (!id_seq[i]) + continue; + + if ((p = get_activity_position(act, id_seq[i])) < 0) { + /* Should never happen */ + PANIC(1); + } + if (!IS_SELECTED(act[p]->options)) + continue; + + if (!HAS_MULTIPLE_OUTPUTS(act[p]->options)) { + rw_curr_act_stats(ifd, fpos, &curr, &cnt, &eosaf, + act[p]->id, &reset, file_actlst); + } + else { + unsigned int optf, msk; + + optf = act[p]->opt_flags; + + for (msk = 1; msk < 0x10; msk <<= 1) { + if (act[p]->opt_flags & msk) { + act[p]->opt_flags &= msk; + + rw_curr_act_stats(ifd, fpos, &curr, &cnt, &eosaf, + act[p]->id, &reset, file_actlst); + act[p]->opt_flags = optf; + } + } + } + } + } + + if (!cnt) { + /* Go to next Linux restart, if possible */ + do { + eosaf = sa_fread(ifd, &record_hdr[curr], RECORD_HEADER_SIZE, + SOFT_SIZE); + rtype = record_hdr[curr].record_type; + if (!eosaf && (rtype != R_RESTART) && (rtype != R_COMMENT)) { + read_file_stat_bunch(act, curr, ifd, file_hdr.sa_nr_act, + file_actlst); + } + else if (!eosaf && (rtype == R_COMMENT)) { + /* This was a COMMENT record: print it */ + sadf_print_special(curr, tm_start.use, tm_end.use, R_COMMENT, ifd); + } + } + while (!eosaf && (rtype != R_RESTART)); + } + + /* The last record we read was a RESTART one: Print it */ + if (!eosaf && (record_hdr[curr].record_type == R_RESTART)) { + sadf_print_special(curr, tm_start.use, tm_end.use, R_RESTART, ifd); + } + } + while (!eosaf); +} + +/* + *************************************************************************** + * Read statistics from a system activity data file. + * + * IN: + * @dfile System activity data file name. + *************************************************************************** + */ +void read_stats_from_file(char dfile[]) +{ + struct file_magic file_magic; + struct file_activity *file_actlst = NULL; + int ifd, ignore; + + /* Prepare file for reading */ + ignore = (format == S_O_HDR_OPTION); + check_file_actlst(&ifd, dfile, act, &file_magic, &file_hdr, + &file_actlst, id_seq, ignore); + + if (format == S_O_HDR_OPTION) { + /* Display data file header then exit */ + display_file_header(dfile, &file_magic, &file_hdr); + } + + /* Perform required allocations */ + allocate_structures(act); + + if (format == S_O_XML_OPTION) { + xml_display_loop(ifd, file_actlst); + } + else { + main_display_loop(ifd, file_actlst); + } + + close(ifd); + + if (file_actlst) { + free(file_actlst); + } + free_structures(act); +} + +/* + *************************************************************************** + * Main entry to the sadf program + *************************************************************************** + */ +int main(int argc, char **argv) +{ + int opt = 1, sar_options = 0; + int i; + char dfile[MAX_FILE_LEN]; + + /* Get HZ */ + get_HZ(); + + /* Compute page shift in kB */ + get_kb_shift(); + + dfile[0] = '\0'; + +#ifdef USE_NLS + /* Init National Language Support */ + init_nls(); +#endif + + tm_start.use = tm_end.use = FALSE; + + /* Allocate and init activity bitmaps */ + allocate_bitmaps(act); + + /* Init some structures */ + init_structures(); + + /* Process options */ + while (opt < argc) { + + if (!strcmp(argv[opt], "-I")) { + if (argv[++opt] && sar_options) { + if (parse_sar_I_opt(argv, &opt, act)) { + usage(argv[0]); + } + } + else { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-P")) { + if (parse_sa_P_opt(argv, &opt, &flags, act)) { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-s")) { + /* Get time start */ + if (parse_timestamp(argv, &opt, &tm_start, DEF_TMSTART)) { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-e")) { + /* Get time end */ + if (parse_timestamp(argv, &opt, &tm_end, DEF_TMEND)) { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "--")) { + sar_options = 1; + opt++; + } + + else if (!strcmp(argv[opt], "-m")) { + if (argv[++opt] && sar_options) { + /* Parse sar's option -m */ + if (parse_sar_m_opt(argv, &opt, act)) { + usage(argv[0]); + } + } + else { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-n")) { + if (argv[++opt] && sar_options) { + /* Parse sar's option -n */ + if (parse_sar_n_opt(argv, &opt, act)) { + usage(argv[0]); + } + } + else { + usage(argv[0]); + } + } + + else if (!strncmp(argv[opt], "-", 1)) { + /* Other options not previously tested */ + if (sar_options) { + if (parse_sar_opt(argv, &opt, act, &flags, C_SADF)) { + usage(argv[0]); + } + } + else { + + for (i = 1; *(argv[opt] + i); i++) { + + switch (*(argv[opt] + i)) { + + case 'C': + flags |= S_F_COMMENT; + break; + + case 'd': + if (format && (format != S_O_DB_OPTION)) { + usage(argv[0]); + } + format = S_O_DB_OPTION; + break; + + case 'D': + if (format && (format != S_O_DBD_OPTION)) { + usage(argv[0]); + } + format = S_O_DBD_OPTION; + break; + + case 'h': + flags |= S_F_HORIZONTALLY; + break; + + case 'H': + if (format && (format != S_O_HDR_OPTION)) { + usage(argv[0]); + } + format = S_O_HDR_OPTION; + break; + + case 'p': + if (format && (format != S_O_PPC_OPTION)) { + usage(argv[0]); + } + format = S_O_PPC_OPTION; + break; + + case 't': + flags |= S_F_TRUE_TIME; + break; + + case 'x': + if (format && (format != S_O_XML_OPTION)) { + usage(argv[0]); + } + format = S_O_XML_OPTION; + break; + + case 'V': + print_version(); + break; + + default: + usage(argv[0]); + } + } + } + opt++; + } + + /* Get data file name */ + else if (strspn(argv[opt], DIGITS) != strlen(argv[opt])) { + if (!dfile[0]) { + if (!strcmp(argv[opt], "-")) { + /* File name set to '-' */ + set_default_file(&rectime, dfile); + opt++; + } + else if (!strncmp(argv[opt], "-", 1)) { + /* Bad option */ + usage(argv[0]); + } + else { + /* Write data to file */ + strncpy(dfile, argv[opt++], MAX_FILE_LEN); + dfile[MAX_FILE_LEN - 1] = '\0'; + } + } + else { + /* File already specified */ + usage(argv[0]); + } + } + + else if (interval < 0) { + /* Get interval */ + if (strspn(argv[opt], DIGITS) != strlen(argv[opt])) { + usage(argv[0]); + } + interval = atol(argv[opt++]); + if (interval <= 0) { + usage(argv[0]); + } + } + + else { + /* Get count value */ + if (strspn(argv[opt], DIGITS) != strlen(argv[opt])) { + usage(argv[0]); + } + if (count) { + /* Count parameter already set */ + usage(argv[0]); + } + count = atol(argv[opt++]); + if (count < 0) { + usage(argv[0]); + } + else if (!count) { + count = -1; /* To generate a report continuously */ + } + } + } + + /* sadf reads current daily data file by default */ + if (!dfile[0]) { + set_default_file(&rectime, dfile); + } + + if (tm_start.use && tm_end.use && (tm_end.tm_hour < tm_start.tm_hour)) { + tm_end.tm_hour += 24; + } + + /* + * Display all the contents of the daily data file if the count parameter + * was not set on the command line. + */ + if (!count) { + count = -1; + } + + /* Default is CPU activity and PPC display */ + select_default_activity(act); + + if (!format) { + if (DISPLAY_HORIZONTALLY(flags)) { + format = S_O_DB_OPTION; + } + else { + format = S_O_PPC_OPTION; + } + } + if (DISPLAY_HORIZONTALLY(flags) && (format != S_O_DB_OPTION)) { + /* Remove option -h if not used with option -d */ + flags &= ~S_F_HORIZONTALLY; + } + + if (interval < 0) { + interval = 1; + } + + /* Read stats from file */ + read_stats_from_file(dfile); + + /* Free bitmaps */ + free_bitmaps(act); + + return 0; +} diff --git a/sadf.h b/sadf.h new file mode 100644 index 00000000..3b6cc0bd --- /dev/null +++ b/sadf.h @@ -0,0 +1,19 @@ +/* + * sadf: System activity data formatter + * (C) 1999-2010 by Sebastien Godard (sysstat orange.fr) + */ + +#ifndef _SADF_H +#define _SADF_H + +/* Output formats (O_= Output) */ +#define S_O_HDR_OPTION 1 +#define S_O_PPC_OPTION 2 +#define S_O_DB_OPTION 3 +#define S_O_XML_OPTION 4 +#define S_O_DBD_OPTION 5 + +/* DTD version for XML output */ +#define XML_DTD_VERSION "2.8" + +#endif /* _SADF_H */ diff --git a/sar.c b/sar.c new file mode 100644 index 00000000..a48bb7ff --- /dev/null +++ b/sar.c @@ -0,0 +1,1355 @@ +/* + * sar: report system activity + * (C) 1999-2010 by Sebastien GODARD (sysstat orange.fr) + * + *************************************************************************** + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include + +#include "version.h" +#include "sa.h" +#include "common.h" +#include "ioconf.h" +#include "pr_stats.h" + +#ifdef USE_NLS +#include +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + +#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__ +char *sccsid(void) { return (SCCSID); } + +/* Interval and count parameters */ +long interval = -1, count = 0; + +/* TRUE if a header line must be printed */ +int dis = TRUE; + +unsigned int flags = 0; +char timestamp[2][TIMESTAMP_LEN]; + +unsigned long avg_count = 0; + +/* File header */ +struct file_header file_hdr; + +/* Current record header */ +struct record_header record_hdr[3]; + +/* + * Activity sequence. + * This array must always be entirely filled (even with trailing zeros). + */ +unsigned int id_seq[NR_ACT]; + +struct tm rectime; + +/* Contain the date specified by -s and -e options */ +struct tstamp tm_start, tm_end; + +char *args[MAX_ARGV_NR]; + +extern struct activity *act[]; + +/* + *************************************************************************** + * Print usage title message. + * + * IN: + * @progname Name of sysstat command + *************************************************************************** + */ +void print_usage_title(char *progname) +{ + fprintf(stderr, _("Usage: %s [ options ] [ [ ] ]\n"), + progname); +} + +/* + *************************************************************************** + * Print usage and exit. + * + * IN: + * @progname Name of sysstat command + *************************************************************************** + */ +void usage(char *progname) +{ + + print_usage_title(progname); + fprintf(stderr, _("Options are:\n" + "[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n" + "[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n" + "[ -I { [,...] | SUM | ALL | XALL } ] [ -P { [,...] | ALL } ]\n" + "[ -m { [,...] | ALL } ] [ -n { [,...] | ALL } ]\n" + "[ -o [ ] | -f [ ] ]\n" + "[ -i ] [ -s [ ] ] [ -e [ ] ]\n")); + exit(1); +} + +/* + *************************************************************************** + * Display a short help message and exit. + * + * IN: + * @progname Name of sysstat command + *************************************************************************** + */ +void display_help(char *progname) +{ + + print_usage_title(progname); + fprintf(stderr, _("Main options and reports:\n")); + fprintf(stderr, _("\t-b\tI/O and transfer rate statistics\n")); + fprintf(stderr, _("\t-B\tPaging statistics\n")); + fprintf(stderr, _("\t-d\tBlock device statistics\n")); + fprintf(stderr, _("\t-I { | SUM | ALL | XALL }\n" + "\t\tInterrupts statistics\n")); + fprintf(stderr, _("\t-m { [,...] | ALL }\n" + "\t\tPower management statistics\n" + "\t\tKeywords are:\n" + "\t\tCPU\tCPU clock frequency\n" + "\t\tFAN\tFans speed\n" + "\t\tIN\tVoltage inputs\n" + "\t\tTEMP\tDevices temperature\n")); + fprintf(stderr, _("\t-n { [,...] | ALL }\n" + "\t\tNetwork statistics\n" + "\t\tKeywords are:\n" + "\t\tDEV\tNetwork interfaces\n" + "\t\tEDEV\tNetwork interfaces (errors)\n" + "\t\tNFS\tNFS client\n" + "\t\tNFSD\tNFS server\n" + "\t\tSOCK\tSockets\t(v4)\n" + "\t\tIP\tIP traffic\t(v4)\n" + "\t\tEIP\tIP traffic\t(v4) (errors)\n" + "\t\tICMP\tICMP traffic\t(v4)\n" + "\t\tEICMP\tICMP traffic\t(v4) (errors)\n" + "\t\tTCP\tTCP traffic\t(v4)\n" + "\t\tETCP\tTCP traffic\t(v4) (errors)\n" + "\t\tUDP\tUDP traffic\t(v4)\n" + "\t\tSOCK6\tSockets\t(v6)\n" + "\t\tIP6\tIP traffic\t(v6)\n" + "\t\tEIP6\tIP traffic\t(v6) (errors)\n" + "\t\tICMP6\tICMP traffic\t(v6)\n" + "\t\tEICMP6\tICMP traffic\t(v6) (errors)\n" + "\t\tUDP6\tUDP traffic\t(v6)\n")); + fprintf(stderr, _("\t-q\tQueue length and load average statistics\n")); + fprintf(stderr, _("\t-r\tMemory utilization statistics\n")); + fprintf(stderr, _("\t-R\tMemory statistics\n")); + fprintf(stderr, _("\t-S\tSwap space utilization statistics\n")); + fprintf(stderr, _("\t-u [ ALL ]\n" + "\t\tCPU utilization statistics\n")); + fprintf(stderr, _("\t-v\tKernel table statistics\n")); + fprintf(stderr, _("\t-w\tTask creation and system switching statistics\n")); + fprintf(stderr, _("\t-W\tSwapping statistics\n")); + fprintf(stderr, _("\t-y\tTTY device statistics\n")); + exit(1); +} + +/* + *************************************************************************** + * Init some structures. + *************************************************************************** + */ +void init_structures(void) +{ + int i; + + for (i = 0; i < 3; i++) + memset(&record_hdr[i], 0, RECORD_HEADER_SIZE); +} + +/* + *************************************************************************** + * Allocate memory for sadc args. + * + * IN: + * @i Argument number. + * @ltemp Argument value. + *************************************************************************** + */ +void salloc(int i, char *ltemp) +{ + if ((args[i] = (char *) malloc(strlen(ltemp) + 1)) == NULL) { + perror("malloc"); + exit(4); + } + strcpy(args[i], ltemp); +} + +/* + *************************************************************************** + * Display an error message. Happens when the data collector doesn't send + * enough data. + *************************************************************************** + */ +void print_read_error(void) +{ + fprintf(stderr, _("End of data collecting unexpected\n")); + exit(3); +} + +/* + *************************************************************************** + * Check that every selected activity actually belongs to the sequence list. + * If not, then the activity should be unselected since it will not be sent + * by sadc. An activity can be unsent if its number of items is null. + * + * IN: + * @act_nr Size of sequence list. + *************************************************************************** + */ +void reverse_check_act(unsigned int act_nr) +{ + int i, j; + + for (i = 0; i < NR_ACT; i++) { + + if (IS_SELECTED(act[i]->options)) { + + for (j = 0; j < act_nr; j++) { + if (id_seq[j] == act[i]->id) + break; + } + if (j == act_nr) + act[i]->options &= ~AO_SELECTED; + } + } +} + +/* + *************************************************************************** + * Fill the rectime structure with current record's time, based on current + * record's time data saved in file. + * The resulting timestamp is expressed in the locale of the file creator + * or in the user's own locale depending on whether option -t has been used + * or not. + * + * IN: + * @curr Index in array for current sample statistics. + *************************************************************************** +*/ +void sar_get_record_timestamp_struct(int curr) +{ + struct tm *ltm; + + /* Check if option -t was specified on the command line */ + if (PRINT_TRUE_TIME(flags)) { + /* -t */ + rectime.tm_hour = record_hdr[curr].hour; + rectime.tm_min = record_hdr[curr].minute; + rectime.tm_sec = record_hdr[curr].second; + } + else { + ltm = localtime((const time_t *) &record_hdr[curr].ust_time); + rectime = *ltm; + } +} + +/* + *************************************************************************** + * Determine if a stat header line has to be displayed. + * + * RETURNS: + * TRUE if a header line has to be displayed. + *************************************************************************** +*/ +int check_line_hdr(void) +{ + int i, rc = FALSE; + + /* Get number of options entered on the command line */ + if (get_activity_nr(act, AO_SELECTED, COUNT_OUTPUTS) > 1) + return TRUE; + + for (i = 0; i < NR_ACT; i++) { + if (IS_SELECTED(act[i]->options)) { + /* Special processing for activities using a bitmap */ + if (act[i]->bitmap) { + if (count_bits(act[i]->bitmap->b_array, + BITMAP_SIZE(act[i]->bitmap->b_size)) > 1) { + rc = TRUE; + } + } + else if (act[i]->nr > 1) { + rc = TRUE; + } + /* Stop now since we have only one selected activity */ + break; + } + } + + return rc; +} + +/* + *************************************************************************** + * Set current record's timestamp string. + * + * IN: + * @curr Index in array for current sample statistics. + * @len Maximum length of timestamp string. + * + * OUT: + * @cur_time Timestamp string. + *************************************************************************** +*/ +void set_record_timestamp_string(int curr, char *cur_time, int len) +{ + /* Fill timestamp structure */ + sar_get_record_timestamp_struct(curr); + + /* Set cur_time date value */ + strftime(cur_time, len, "%X", &rectime); +} + +/* + *************************************************************************** + * Print statistics average. + * + * IN: + * @curr Index in array for current sample statistics. + * @read_from_file Set to TRUE if stats are read from a system activity + * data file. + * @act_id Activity that can be displayed, or ~0 for all. + * Remember that when reading stats from a file, only + * one activity can be displayed at a time. + *************************************************************************** + */ +void write_stats_avg(int curr, int read_from_file, unsigned int act_id) +{ + int i; + unsigned long long itv, g_itv; + static __nr_t cpu_nr = -1; + + if (cpu_nr < 0) + cpu_nr = act[get_activity_position(act, A_CPU)]->nr; + + /* Interval value in jiffies */ + g_itv = get_interval(record_hdr[2].uptime, record_hdr[curr].uptime); + + if (cpu_nr > 1) + itv = get_interval(record_hdr[2].uptime0, record_hdr[curr].uptime0); + else + itv = g_itv; + + strcpy(timestamp[curr], _("Average:")); + strcpy(timestamp[!curr], timestamp[curr]); + + /* Test stdout */ + TEST_STDOUT(STDOUT_FILENO); + + for (i = 0; i < NR_ACT; i++) { + + if ((act_id != ALL_ACTIVITIES) && (act[i]->id != act_id)) + continue; + + if (IS_SELECTED(act[i]->options) && (act[i]->nr > 0)) { + /* Display current average activity statistics */ + if (NEEDS_GLOBAL_ITV(act[i]->options)) + (*act[i]->f_print_avg)(act[i], 2, curr, g_itv); + else + (*act[i]->f_print_avg)(act[i], 2, curr, itv); + } + } + + if (read_from_file) { + /* + * Reset number of lines printed only if we read stats + * from a system activity file. + */ + avg_count = 0; + } +} + +/* + *************************************************************************** + * Print system statistics. + * + * IN: + * @curr Index in array for current sample statistics. + * @read_from_file Set to TRUE if stats are read from a system activity + * data file. + * @use_tm_start Set to TRUE if option -s has been used. + * @use_tm_end Set to TRUE if option -e has been used. + * @reset Set to TRUE if last_uptime variable should be + * reinitialized (used in next_slice() function). + * @act_id Activity that can be displayed or ~0 for all. + * Remember that when reading stats from a file, only + * one activity can be displayed at a time. + * + * OUT: + * @cnt Number of remaining lines to display. + * + * RETURNS: + * 1 if stats have been successfully displayed. + *************************************************************************** + */ +int write_stats(int curr, int read_from_file, long *cnt, int use_tm_start, + int use_tm_end, int reset, unsigned int act_id) +{ + int i; + unsigned long long itv, g_itv; + static int cross_day = 0; + static __nr_t cpu_nr = -1; + + if (cpu_nr < 0) + cpu_nr = act[get_activity_position(act, A_CPU)]->nr; + + /* Check time (1) */ + if (read_from_file) { + if (!next_slice(record_hdr[2].uptime0, record_hdr[curr].uptime0, + reset, interval)) + /* Not close enough to desired interval */ + return 0; + } + + /* Set previous timestamp */ + set_record_timestamp_string(!curr, timestamp[!curr], 16); + /* Set current timestamp */ + set_record_timestamp_string(curr, timestamp[curr], 16); + + /* Check if we are beginning a new day */ + if (use_tm_start && record_hdr[!curr].ust_time && + (record_hdr[curr].ust_time > record_hdr[!curr].ust_time) && + (record_hdr[curr].hour < record_hdr[!curr].hour)) { + cross_day = 1; + } + + if (cross_day) { + /* + * This is necessary if we want to properly handle something like: + * sar -s time_start -e time_end with + * time_start(day D) > time_end(day D+1) + */ + rectime.tm_hour +=24; + } + + /* Check time (2) */ + if (use_tm_start && (datecmp(&rectime, &tm_start) < 0)) + /* it's too soon... */ + return 0; + + /* Get interval values */ + get_itv_value(&record_hdr[curr], &record_hdr[!curr], + cpu_nr, &itv, &g_itv); + + /* Check time (3) */ + if (use_tm_end && (datecmp(&rectime, &tm_end) > 0)) { + /* It's too late... */ + *cnt = 0; + return 0; + } + + avg_count++; + + /* Test stdout */ + TEST_STDOUT(STDOUT_FILENO); + + for (i = 0; i < NR_ACT; i++) { + + if ((act_id != ALL_ACTIVITIES) && (act[i]->id != act_id)) + continue; + + if (IS_SELECTED(act[i]->options) && (act[i]->nr > 0)) { + /* Display current activity statistics */ + if (NEEDS_GLOBAL_ITV(act[i]->options)) + (*act[i]->f_print)(act[i], !curr, curr, g_itv); + else + (*act[i]->f_print)(act[i], !curr, curr, itv); + } + } + + return 1; +} + +/* + *************************************************************************** + * Display stats since system startup. + * + * IN: + * @curr Index in array for current sample statistics. + *************************************************************************** + */ +void write_stats_startup(int curr) +{ + int i; + + /* Set to 0 previous structures corresponding to boot time */ + memset(&record_hdr[!curr], 0, RECORD_HEADER_SIZE); + record_hdr[!curr].record_type = R_STATS; + record_hdr[!curr].hour = record_hdr[curr].hour; + record_hdr[!curr].minute = record_hdr[curr].minute; + record_hdr[!curr].second = record_hdr[curr].second; + record_hdr[!curr].ust_time = record_hdr[curr].ust_time; + + for (i = 0; i < NR_ACT; i++) { + if (IS_SELECTED(act[i]->options) && (act[i]->nr > 0)) + memset(act[i]->buf[!curr], 0, act[i]->msize * act[i]->nr); + } + + flags |= S_F_SINCE_BOOT; + dis = TRUE; + + write_stats(curr, USE_SADC, &count, NO_TM_START, NO_TM_END, NO_RESET, ALL_ACTIVITIES); + + exit(0); +} + +/* + *************************************************************************** + * Read data sent by the data collector. + * + * IN: + * @size Number of bytes of data to read. + * + * OUT: + * @buffer Buffer where data will be saved. + * + * RETURNS: + * 1 if end of file has been reached, 0 otherwise. + *************************************************************************** + */ +int sa_read(void *buffer, int size) +{ + int n; + + while (size) { + + if ((n = read(STDIN_FILENO, buffer, size)) < 0) { + perror("read"); + exit(2); + } + + if (!n) + return 1; /* EOF */ + + size -= n; + buffer = (char *) buffer + n; + } + + return 0; +} + +/* + *************************************************************************** + * Print a Linux restart message (contents of a RESTART record) or a + * comment (contents of a COMMENT record). + * + * IN: + * @curr Index in array for current sample statistics. + * @use_tm_start Set to TRUE if option -s has been used. + * @use_tm_end Set to TRUE if option -e has been used. + * @rtype Record type to display. + * @ifd Input file descriptor. + * + * RETURNS: + * 1 if the record has been successfully displayed. + *************************************************************************** + */ +int sar_print_special(int curr, int use_tm_start, int use_tm_end, int rtype, int ifd) +{ + char cur_time[26]; + int dp = 1; + + set_record_timestamp_string(curr, cur_time, 26); + + /* The record must be in the interval specified by -s/-e options */ + if ((use_tm_start && (datecmp(&rectime, &tm_start) < 0)) || + (use_tm_end && (datecmp(&rectime, &tm_end) > 0))) { + dp = 0; + } + + if (rtype == R_RESTART) { + if (dp) { + printf("\n%-11s LINUX RESTART\n", cur_time); + return 1; + } + } + else if (rtype == R_COMMENT) { + char file_comment[MAX_COMMENT_LEN]; + + /* Don't forget to read comment record even if it won't be displayed... */ + sa_fread(ifd, file_comment, MAX_COMMENT_LEN, HARD_SIZE); + file_comment[MAX_COMMENT_LEN - 1] = '\0'; + + if (dp && DISPLAY_COMMENT(flags)) { + printf("%-11s COM %s\n", cur_time, file_comment); + return 1; + } + } + + return 0; +} + +/* + *************************************************************************** + * Read the various statistics sent by the data collector (sadc). + * + * IN: + * @curr Index in array for current sample statistics. + *************************************************************************** + */ +void read_sadc_stat_bunch(int curr) +{ + int i, p; + + /* Read record header (type is always R_STATS since it is read from sadc) */ + if (sa_read(&record_hdr[curr], RECORD_HEADER_SIZE)) { + print_read_error(); + } + + for (i = 0; i < NR_ACT; i++) { + + if (!id_seq[i]) + continue; + if ((p = get_activity_position(act, id_seq[i])) < 0) { + PANIC(1); + } + + if (sa_read(act[p]->buf[curr], act[p]->fsize * act[p]->nr)) { + print_read_error(); + } + } +} + +/* + *************************************************************************** + * Read stats for current activity from file and display them. + * + * IN: + * @ifd Input file descriptor. + * @fpos Position in file where reading must start. + * @curr Index in array for current sample statistics. + * @rows Number of rows of screen. + * @act_id Activity to display. + * @file_actlst List of activities in file. + * + * OUT: + * @curr Index in array for next sample statistics. + * @cnt Number of remaining lines of stats to write. + * @eosaf Set to TRUE if EOF (end of file) has been reached. + * @reset Set to TRUE if last_uptime variable should be + * reinitialized (used in next_slice() function). + *************************************************************************** + */ +void handle_curr_act_stats(int ifd, off_t fpos, int *curr, long *cnt, int *eosaf, + int rows, unsigned int act_id, int *reset, + struct file_activity *file_actlst) +{ + int p; + unsigned long lines = 0; + unsigned char rtype; + int davg = 0, next, inc = -2; + + if (lseek(ifd, fpos, SEEK_SET) < fpos) { + perror("lseek"); + exit(2); + } + + /* + * Restore the first stats collected. + * Used to compute the rate displayed on the first line. + */ + copy_structures(act, id_seq, record_hdr, !*curr, 2); + + *cnt = count; + + /* Assess number of lines printed */ + if ((p = get_activity_position(act, act_id)) >= 0) { + if (act[p]->bitmap) { + inc = count_bits(act[p]->bitmap->b_array, + BITMAP_SIZE(act[p]->bitmap->b_size)); + } + else { + inc = act[p]->nr; + } + } + if (inc < 0) { + /* Should never happen */ + PANIC(inc); + } + + do { + /* Display count lines of stats */ + *eosaf = sa_fread(ifd, &record_hdr[*curr], + RECORD_HEADER_SIZE, SOFT_SIZE); + rtype = record_hdr[*curr].record_type; + + if (!*eosaf && (rtype != R_RESTART) && (rtype != R_COMMENT)) { + /* Read the extra fields since it's not a special record */ + read_file_stat_bunch(act, *curr, ifd, file_hdr.sa_nr_act, file_actlst); + } + + if ((lines >= rows) || !lines) { + lines = 0; + dis = 1; + } + else + dis = 0; + + if (!*eosaf && (rtype != R_RESTART)) { + + if (rtype == R_COMMENT) { + /* Display comment */ + next = sar_print_special(*curr, tm_start.use, tm_end.use, + R_COMMENT, ifd); + if (next) { + /* A line of comment was actually displayed */ + lines++; + } + continue; + } + + /* next is set to 1 when we were close enough to desired interval */ + next = write_stats(*curr, USE_SA_FILE, cnt, tm_start.use, tm_end.use, + *reset, act_id); + if (next && (*cnt > 0)) { + (*cnt)--; + } + if (next) { + davg++; + *curr ^=1; + lines += inc; + } + *reset = FALSE; + } + } + while (*cnt && !*eosaf && (rtype != R_RESTART)); + + if (davg) { + write_stats_avg(!*curr, USE_SA_FILE, act_id); + } + + *reset = TRUE; +} + +/* + *************************************************************************** + * Read header data sent by sadc. + *************************************************************************** + */ +void read_header_data(void) +{ + struct file_magic file_magic; + struct file_activity file_act; + int rc, i, p; + char version[16]; + + /* Read magic header */ + rc = sa_read(&file_magic, FILE_MAGIC_SIZE); + + sprintf(version, "%d.%d.%d.%d", + file_magic.sysstat_version, + file_magic.sysstat_patchlevel, + file_magic.sysstat_sublevel, + file_magic.sysstat_extraversion); + if (!file_magic.sysstat_extraversion) { + version[strlen(version) - 2] = '\0'; + } + + if (rc || (file_magic.sysstat_magic != SYSSTAT_MAGIC) || + (file_magic.format_magic != FORMAT_MAGIC) || + strcmp(version, VERSION)) { + + /* sar and sadc commands are not consistent */ + fprintf(stderr, _("Invalid data format\n")); + + if (!rc && (file_magic.sysstat_magic == SYSSTAT_MAGIC)) { + fprintf(stderr, + _("Using a wrong data collector from a different sysstat version\n")); + } + exit(3); + } + + /* Read header data */ + if (sa_read(&file_hdr, FILE_HEADER_SIZE)) { + print_read_error(); + } + + /* Read activity list */ + for (i = 0; i < file_hdr.sa_nr_act; i++) { + + if (sa_read(&file_act, FILE_ACTIVITY_SIZE)) { + print_read_error(); + } + + p = get_activity_position(act, file_act.id); + + if ((p < 0) || (act[p]->fsize != file_act.size) || !file_act.nr) { + fprintf(stderr, _("Inconsistent input data\n")); + exit(3); + } + + id_seq[i] = file_act.id; /* We necessarily have "i < NR_ACT" */ + act[p]->nr = file_act.nr; + } + + while (i < NR_ACT) { + id_seq[i++] = 0; + } + + /* Check that all selected activties are actually sent by sadc */ + reverse_check_act(file_hdr.sa_nr_act); +} + +/* + *************************************************************************** + * Read statistics from a system activity data file. + * + * IN: + * @from_file Input file name. + *************************************************************************** + */ +void read_stats_from_file(char from_file[]) +{ + struct file_magic file_magic; + struct file_activity *file_actlst = NULL; + int curr = 1, i, p; + int ifd, rtype; + int rows, eosaf = TRUE, reset = FALSE; + long cnt = 1; + off_t fpos; + + /* Get window size */ + rows = get_win_height(); + + /* Read file headers and activity list */ + check_file_actlst(&ifd, from_file, act, &file_magic, &file_hdr, + &file_actlst, id_seq, FALSE); + + /* Perform required allocations */ + allocate_structures(act); + + /* Print report header */ + print_report_hdr(flags, &rectime, &file_hdr, + act[get_activity_position(act, A_CPU)]->nr); + + /* Read system statistics from file */ + do { + /* + * If this record is a special (RESTART or COMMENT) one, print it and + * (try to) get another one. + */ + do { + if (sa_fread(ifd, &record_hdr[0], RECORD_HEADER_SIZE, SOFT_SIZE)) + /* End of sa data file */ + return; + + rtype = record_hdr[0].record_type; + if ((rtype == R_RESTART) || (rtype == R_COMMENT)) { + sar_print_special(0, tm_start.use, tm_end.use, rtype, ifd); + } + else { + /* + * OK: Previous record was not a special one. + * So read now the extra fields. + */ + read_file_stat_bunch(act, 0, ifd, file_hdr.sa_nr_act, + file_actlst); + sar_get_record_timestamp_struct(0); + } + } + while ((rtype == R_RESTART) || (rtype == R_COMMENT) || + (tm_start.use && (datecmp(&rectime, &tm_start) < 0)) || + (tm_end.use && (datecmp(&rectime, &tm_end) >=0))); + + /* Save the first stats collected. Will be used to compute the average */ + copy_structures(act, id_seq, record_hdr, 2, 0); + + reset = TRUE; /* Set flag to reset last_uptime variable */ + + /* Save current file position */ + if ((fpos = lseek(ifd, 0, SEEK_CUR)) < 0) { + perror("lseek"); + exit(2); + } + + /* Read and write stats located between two possible Linux restarts */ + for (i = 0; i < NR_ACT; i++) { + + if (!id_seq[i]) + continue; + + if ((p = get_activity_position(act, id_seq[i])) < 0) { + /* Should never happen */ + PANIC(1); + } + if (!IS_SELECTED(act[p]->options)) + continue; + + if (!HAS_MULTIPLE_OUTPUTS(act[p]->options)) { + handle_curr_act_stats(ifd, fpos, &curr, &cnt, &eosaf, rows, + act[p]->id, &reset, file_actlst); + } + else { + unsigned int optf, msk; + + optf = act[p]->opt_flags; + + for (msk = 1; msk < 0x10; msk <<= 1) { + if (act[p]->opt_flags & msk) { + act[p]->opt_flags &= msk; + + handle_curr_act_stats(ifd, fpos, &curr, &cnt, + &eosaf, rows, act[p]->id, + &reset, file_actlst); + act[p]->opt_flags = optf; + } + } + } + } + + if (!cnt) { + /* Go to next Linux restart, if possible */ + do { + eosaf = sa_fread(ifd, &record_hdr[curr], RECORD_HEADER_SIZE, + SOFT_SIZE); + rtype = record_hdr[curr].record_type; + if (!eosaf && (rtype != R_RESTART) && (rtype != R_COMMENT)) { + read_file_stat_bunch(act, curr, ifd, file_hdr.sa_nr_act, + file_actlst); + } + else if (!eosaf && (rtype == R_COMMENT)) { + /* This was a COMMENT record: print it */ + sar_print_special(curr, tm_start.use, tm_end.use, R_COMMENT, ifd); + } + } + while (!eosaf && (rtype != R_RESTART)); + } + + /* The last record we read was a RESTART one: Print it */ + if (!eosaf && (record_hdr[curr].record_type == R_RESTART)) { + sar_print_special(curr, tm_start.use, tm_end.use, R_RESTART, ifd); + } + } + while (!eosaf); + + close(ifd); + + if (file_actlst) { + free(file_actlst); + } +} + +/* + *************************************************************************** + * Read statistics sent by sadc, the data collector. + *************************************************************************** + */ +void read_stats(void) +{ + int curr = 1; + unsigned long lines; + unsigned int rows = 23; + int dis_hdr = 0; + + /* Don't buffer data if redirected to a pipe... */ + setbuf(stdout, NULL); + + /* Read stats header */ + read_header_data(); + + if (!get_activity_nr(act, AO_SELECTED, COUNT_ACTIVITIES)) { + fprintf(stderr, _("Requested activities not available\n")); + exit(1); + } + + /* Determine if a stat line header has to be displayed */ + dis_hdr = check_line_hdr(); + + lines = rows = get_win_height(); + + /* Perform required allocations */ + allocate_structures(act); + + /* Print report header */ + print_report_hdr(flags, &rectime, &file_hdr, + act[get_activity_position(act, A_CPU)]->nr); + + /* Read system statistics sent by the data collector */ + read_sadc_stat_bunch(0); + + if (!interval) { + /* Display stats since boot time and exit */ + write_stats_startup(0); + } + + /* Save the first stats collected. Will be used to compute the average */ + copy_structures(act, id_seq, record_hdr, 2, 0); + + /* Main loop */ + do { + + /* Get stats */ + read_sadc_stat_bunch(curr); + + /* Print results */ + if (!dis_hdr) { + dis = lines / rows; + if (dis) { + lines %= rows; + } + lines++; + } + write_stats(curr, USE_SADC, &count, NO_TM_START, tm_end.use, + NO_RESET, ALL_ACTIVITIES); + + if (record_hdr[curr].record_type == R_LAST_STATS) { + /* File rotation is happening: Re-read header data sent by sadc */ + read_header_data(); + allocate_structures(act); + } + + if (count > 0) { + count--; + } + if (count) { + curr ^= 1; + } + } + while (count); + + /* Print statistics average */ + dis = dis_hdr; + write_stats_avg(curr, USE_SADC, ALL_ACTIVITIES); +} + +/* + *************************************************************************** + * Main entry to the sar program. + *************************************************************************** + */ +int main(int argc, char **argv) +{ + int opt = 1, args_idx = 2; + int fd[2]; + char from_file[MAX_FILE_LEN], to_file[MAX_FILE_LEN]; + char ltemp[20]; + + /* Get HZ */ + get_HZ(); + + /* Compute page shift in kB */ + get_kb_shift(); + + from_file[0] = to_file[0] = '\0'; + +#ifdef USE_NLS + /* Init National Language Support */ + init_nls(); +#endif + + tm_start.use = tm_end.use = FALSE; + + /* Allocate and init activity bitmaps */ + allocate_bitmaps(act); + + init_structures(); + + /* Process options */ + while (opt < argc) { + + if (!strcmp(argv[opt], "-I")) { + if (argv[++opt]) { + /* Parse -I option */ + if (parse_sar_I_opt(argv, &opt, act)) { + usage(argv[0]); + } + } + else { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-P")) { + /* Parse -P option */ + if (parse_sa_P_opt(argv, &opt, &flags, act)) { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-o")) { + /* Save stats to a file */ + if ((argv[++opt]) && strncmp(argv[opt], "-", 1) && + (strspn(argv[opt], DIGITS) != strlen(argv[opt]))) { + strncpy(to_file, argv[opt++], MAX_FILE_LEN); + to_file[MAX_FILE_LEN - 1] = '\0'; + } + else { + strcpy(to_file, "-"); + } + } + + else if (!strcmp(argv[opt], "-f")) { + /* Read stats from a file */ + if ((argv[++opt]) && strncmp(argv[opt], "-", 1) && + (strspn(argv[opt], DIGITS) != strlen(argv[opt]))) { + strncpy(from_file, argv[opt++], MAX_FILE_LEN); + from_file[MAX_FILE_LEN - 1] = '\0'; + } + else { + set_default_file(&rectime, from_file); + } + } + + else if (!strcmp(argv[opt], "-s")) { + /* Get time start */ + if (parse_timestamp(argv, &opt, &tm_start, DEF_TMSTART)) { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-e")) { + /* Get time end */ + if (parse_timestamp(argv, &opt, &tm_end, DEF_TMEND)) { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-h")) { + /* Display help message */ + display_help(argv[0]); + } + + else if (!strcmp(argv[opt], "-i")) { + if (!argv[++opt] || (strspn(argv[opt], DIGITS) != strlen(argv[opt]))) { + usage(argv[0]); + } + interval = atol(argv[opt++]); + if (interval < 1) { + usage(argv[0]); + } + flags |= S_F_INTERVAL_SET; + } + + else if (!strcmp(argv[opt], "-m")) { + if (argv[++opt]) { + /* Parse option -m */ + if (parse_sar_m_opt(argv, &opt, act)) { + usage(argv[0]); + } + } + else { + usage(argv[0]); + } + } + + else if (!strcmp(argv[opt], "-n")) { + if (argv[++opt]) { + /* Parse option -n */ + if (parse_sar_n_opt(argv, &opt, act)) { + usage(argv[0]); + } + } + else { + usage(argv[0]); + } + } + + else if (!strncmp(argv[opt], "-", 1)) { + /* Other options not previously tested */ + if (parse_sar_opt(argv, &opt, act, &flags, C_SAR)) { + usage(argv[0]); + } + opt++; + } + + else if (interval < 0) { + /* Get interval */ + if (strspn(argv[opt], DIGITS) != strlen(argv[opt])) { + usage(argv[0]); + } + interval = atol(argv[opt++]); + if (interval < 0) { + usage(argv[0]); + } + } + + else { + /* Get count value */ + if ((strspn(argv[opt], DIGITS) != strlen(argv[opt])) || + !interval) { + usage(argv[0]); + } + if (count) { + /* Count parameter already set */ + usage(argv[0]); + } + count = atol(argv[opt++]); + if (count < 1) { + usage(argv[0]); + } + } + } + + /* 'sar' is equivalent to 'sar -f' */ + if ((argc == 1) || + ((interval < 0) && !from_file[0] && !to_file[0])) { + set_default_file(&rectime, from_file); + } + + if (tm_start.use && tm_end.use && (tm_end.tm_hour < tm_start.tm_hour)) { + tm_end.tm_hour += 24; + } + + /* + * Check option dependencies. + */ + /* You read from a file OR you write to it... */ + if (from_file[0] && to_file[0]) { + fprintf(stderr, _("-f and -o options are mutually exclusive\n")); + exit(1); + } + /* Use time start or option -i only when reading stats from a file */ + if ((tm_start.use || INTERVAL_SET(flags)) && !from_file[0]) { + fprintf(stderr, + _("Not reading from a system activity file (use -f option)\n")); + exit(1); + } + /* Don't print stats since boot time if -o or -f options are used */ + if (!interval && (from_file[0] || to_file[0])) { + usage(argv[0]); + } + + if (!count) { + /* + * count parameter not set: Display all the contents of the file + * or generate a report continuously. + */ + count = -1; + } + + /* Default is CPU activity... */ + select_default_activity(act); + + /* Reading stats from file: */ + if (from_file[0]) { + if (interval < 0) { + interval = 1; + } + + /* Read stats from file */ + read_stats_from_file(from_file); + + /* Free stuctures and activity bitmaps */ + free_bitmaps(act); + free_structures(act); + + return 0; + } + + /* Reading stats from sadc: */ + + /* Create anonymous pipe */ + if (pipe(fd) == -1) { + perror("pipe"); + exit(4); + } + + switch (fork()) { + + case -1: + perror("fork"); + exit(4); + break; + + case 0: /* Child */ + if (dup2(fd[1], STDOUT_FILENO) < 0) { + perror("dup2"); + exit(4); + } + CLOSE_ALL(fd); + + /* + * Prepare options for sadc. + */ + /* Program name */ + salloc(0, SADC); + + /* Interval value */ + if (interval < 0) { + usage(argv[0]); + } + else if (!interval) { + strcpy(ltemp, "1"); + } + else { + sprintf(ltemp, "%ld", interval); + } + salloc(1, ltemp); + + /* Count number */ + if (count >= 0) { + sprintf(ltemp, "%ld", count + 1); + salloc(args_idx++, ltemp); + } + + /* Flags to be passed to sadc */ + salloc(args_idx++, "-z"); + salloc(args_idx++, "-S"); + salloc(args_idx++, K_ALL); + + /* Outfile arg */ + if (to_file[0]) { + salloc(args_idx++, to_file); + } + + /* Last arg is NULL */ + args[args_idx] = NULL; + + /* Call now the data collector */ + execv(SADC_PATH, args); + execvp(SADC, args); + /* + * Note: Don't use execl/execlp since we don't have a fixed number of + * args to give to sadc. + */ + fprintf(stderr, _("Cannot find the data collector (%s)\n"), SADC); + perror("exec"); + exit(4); + break; + + default: /* Parent */ + if (dup2(fd[0], STDIN_FILENO) < 0) { + perror("dup2"); + exit(4); + } + CLOSE_ALL(fd); + + /* Get now the statistics */ + read_stats(); + + break; + } + + /* Free structures and activity bitmaps */ + free_bitmaps(act); + free_structures(act); + + return 0; +} diff --git a/sysconfig.in b/sysconfig.in new file mode 100644 index 00000000..6d94b56c --- /dev/null +++ b/sysconfig.in @@ -0,0 +1,13 @@ +/* + * sysstat: System performance tools for Linux + * (C) 1999-2009 by Sebastien Godard (sysstat orange.fr) + */ + +#ifndef _SYSCONFIG_H +#define _SYSCONFIG_H + +/* sysstat configuration directory */ +#define IOCONF "@SYSCONFIG_DIR@/sysstat.ioconf" +#define LOCAL_IOCONF "./sysstat.ioconf" + +#endif /* _SYSCONFIG_H */ diff --git a/sysstat-9.1.5.lsm b/sysstat-9.1.5.lsm new file mode 100644 index 00000000..3fb87bac --- /dev/null +++ b/sysstat-9.1.5.lsm @@ -0,0 +1,37 @@ +Begin4 +Title: sysstat - the sar, sadf, mpstat, iostat, nfsiostat, cifsiostat and pidstat commands for Linux +Version: 9.1.5 +Entered-date: 2010-09-12 +Description: The sysstat package contains the sar, sadf, mpstat, iostat, + pidstat, nfsiostat, cifsiostat and sa tools for Linux. + The sar command collects and reports system activity + information. + The information collected by sar can be saved in a file + in a binary format for future inspection. + The statistics reported by sar concern I/O transfer rates, + paging activity, process-related activities, interrupts, + network activity, memory and swap space utilization, CPU + utilization, kernel activities and TTY statistics, among + others. Both UP and SMP machines are fully supported. + The iostat command reports CPU utilization + and I/O statistics for disks. The mpstat command reports + global and per-processor statistics. The sadf command + is used to display data collected by sar in various + formats (XML, database-friendly, etc.). + The pidstat command reports statistics for Linux tasks (processes). + The nfsiostat command reports I/O statistics for network filesystems. + The cifsiostat command reports I/O statistics for CIFS filesystems. + NB: Send bugs, patches, suggestions and/or questions to + (sysstat [at] orange.fr) and not to the address below! + URL: http://pagesperso-orange.fr/sebastien.godard/ +Keywords: system administration, sar, sadf, iostat, mpstat, pidstat, nfsiostat, cifsiostat, system accounting, performance, tuning +Author: sebastien.godard@orange.fr (Sebastien Godard) +Maintained-by: sebastien.godard@orange.fr (Sebastien Godard) +Primary-site: http://pagesperso-orange.fr/sebastien.godard/ + 309kB sysstat-9.1.5.tar.gz + 248kB sysstat-9.1.5.tar.bz2 + 312kB sysstat-9.1.5-1.src.rpm + 311kB sysstat-9.1.5-1.i586.rpm +Alternate-site: ibiblio.org /pub/linux/system/status +Copying-policy: GPL +End diff --git a/sysstat-9.1.5.spec b/sysstat-9.1.5.spec new file mode 100644 index 00000000..870d3088 --- /dev/null +++ b/sysstat-9.1.5.spec @@ -0,0 +1,79 @@ +Summary: SAR, SADF, MPSTAT, IOSTAT, NFSIOSTAT, CIFSIOSTAT and PIDSTAT for Linux +Name: sysstat +Version: 9.1.5 +Release: 1 +License: GPL +Group: Applications/System +Source0: %{name}-%{version}.tar.gz +URL: http://pagesperso-orange.fr/sebastien.godard/ +Packager: Damien Faure +BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(id -u -n) +Requires: gettext + +%description +The sysstat package contains the sar, sadf, mpstat, iostat, pidstat, +nfsiostat, cifsiostat and sa tools for Linux. +The sar command collects and reports system activity information. +The information collected by sar can be saved in a file in a binary +format for future inspection. The statistics reported by sar concern +I/O transfer rates, paging activity, process-related activities, +interrupts, network activity, memory and swap space utilization, CPU +utilization, kernel activities and TTY statistics, among others. Both +UP and SMP machines are fully supported. +The sadf command may be used to display data collected by sar in +various formats (CSV, XML, etc.). +The iostat command reports CPU utilization and I/O statistics for disks. +The mpstat command reports global and per-processor statistics. +The pidstat command reports statistics for Linux tasks (processes). +The nfsiostat command reports I/O statistics for network filesystems. +The cifsiostat command reports I/O statistics for CIFS filesystems. + +%prep +%setup + +%build +./configure --prefix=%{_prefix} \ + sa_lib_dir=%{_libdir}/sa \ + --mandir=%{_mandir} \ + DESTDIR=$RPM_BUILD_ROOT +make + +%install +rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT/var/log/sa + +make install + +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +install -m 755 sysstat $RPM_BUILD_ROOT/etc/rc.d/init.d/sysstat +mkdir -p $RPM_BUILD_ROOT/etc/sysconfig +install -m 644 sysstat.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/sysstat +install -m 644 sysstat.ioconf $RPM_BUILD_ROOT/etc/sysconfig/sysstat.ioconf +mkdir -p $RPM_BUILD_ROOT/etc/cron.d +install -m 644 sysstat.crond.sample $RPM_BUILD_ROOT/etc/cron.d/sysstat +mkdir -p $RPM_BUILD_ROOT/etc/rc2.d +cd $RPM_BUILD_ROOT/etc/rc2.d && ln -sf ../init.d/sysstat S01sysstat +mkdir -p $RPM_BUILD_ROOT/etc/rc3.d +cd $RPM_BUILD_ROOT/etc/rc3.d && ln -sf ../init.d/sysstat S01sysstat +mkdir -p $RPM_BUILD_ROOT/etc/rc5.d +cd $RPM_BUILD_ROOT/etc/rc5.d && ln -sf ../init.d/sysstat S01sysstat + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(644,root,root,755) +%doc %{_datadir}/doc/sysstat-%{version}/* +%attr(755,root,root) %{_bindir}/* +%attr(755,root,root) %{_libdir}/sa/* +%attr(644,root,root) %{_mandir}/man*/* +%attr(644,root,root) %{_datadir}/locale/*/LC_MESSAGES/sysstat.mo +%attr(755,root,root) %dir /var/log/sa +%attr(755,root,root) /etc/rc.d/init.d/sysstat +%attr(644,root,root) /etc/sysconfig/sysstat +%attr(644,root,root) /etc/sysconfig/sysstat.ioconf +%attr(755,root,root) /etc/rc2.d/S01sysstat +%attr(755,root,root) /etc/rc3.d/S01sysstat +%attr(755,root,root) /etc/rc5.d/S01sysstat +%config(noreplace) %attr(0644,root,root) /etc/cron.d/sysstat + diff --git a/sysstat.cron.daily.in b/sysstat.cron.daily.in new file mode 100644 index 00000000..943e9fe3 --- /dev/null +++ b/sysstat.cron.daily.in @@ -0,0 +1,5 @@ +#!/bin/sh +# Generate a daily summary of process accounting. Since this will probably +# get kicked off in the morning, it would probably be better to run against +# the previous days data. +@SA_LIB_DIR@/sa2 -A & diff --git a/sysstat.cron.hourly.in b/sysstat.cron.hourly.in new file mode 100644 index 00000000..61c9cf23 --- /dev/null +++ b/sysstat.cron.hourly.in @@ -0,0 +1,3 @@ +#!/bin/sh +# Run system activity accounting tool every @CRON_INTERVAL@ minutes +@SA_LIB_DIR@/sa1 @CRON_INTERVAL_SEC@ @CRON_COUNT@ & diff --git a/sysstat.crond.in b/sysstat.crond.in new file mode 100644 index 00000000..bfe87222 --- /dev/null +++ b/sysstat.crond.in @@ -0,0 +1,6 @@ +# Run system activity accounting tool every @CRON_INTERVAL@ minutes +*/@CRON_INTERVAL@ * * * * @CRON_OWNER@ @SA_LIB_DIR@/sa1 1 1 +# 0 * * * * @CRON_OWNER@ @SA_LIB_DIR@/sa1 @CRON_INTERVAL_SEC@ @CRON_COUNT@ & +# Generate a daily summary of process accounting at 23:53 +53 23 * * * @CRON_OWNER@ @SA_LIB_DIR@/sa2 -A + diff --git a/sysstat.in b/sysstat.in new file mode 100644 index 00000000..8cb41d95 --- /dev/null +++ b/sysstat.in @@ -0,0 +1,48 @@ +#!/bin/sh +# +# chkconfig: 12345 01 99 +# @INIT_DIR@/sysstat +# (C) 2000-2010 Sebastien Godard (sysstat orange.fr) +# +### BEGIN INIT INFO +# Provides: sysstat +# Required-Start: +# Required-Stop: +# Default-Stop: +# Description: Reset the system activity logs +# Short-Description: Reset the system activity logs +### END INIT INFO +#@(#) @PACKAGE_NAME@-@PACKAGE_VERSION@ startup script: +#@(#) Insert a dummy record in current daily data file. +#@(#) This indicates that the counters have restarted from 0. + +RETVAL=0 +SYSCONFIG_DIR=@SYSCONFIG_DIR@ +#SADC_OPTIONS="-S DISK" +SADC_OPTIONS="" + +# See how we were called. +case "$1" in + start) + exitCodeIndicator="$(mktemp /tmp/sysstat-XXXXXX)" || exit 1 + echo -n "Calling the system activity data collector (sadc): " + @SU_C_OWNER@ @QUOTE@ @SA_LIB_DIR@/sa1 --boot ${SADC_OPTIONS} || rm -f ${exitCodeIndicator} @QUOTE@ + + # Try to guess if sadc was successfully launched. The difficulty + # here is that the exit code is lost when the above command is + # run via "su foo -c ..." + if [ -f "${exitCodeIndicator}" ]; then + rm -f ${exitCodeIndicator} + else + RETVAL=2 + fi + echo + ;; + stop|status|restart|reload|force-reload|condrestart|try-restart) + ;; + *) + echo "Usage: sysstat {start|stop|status|restart|reload|force-reload|condrestart|try-restart}" + exit 2 +esac +exit ${RETVAL} + diff --git a/sysstat.ioconf b/sysstat.ioconf new file mode 100644 index 00000000..ab34ba3d --- /dev/null +++ b/sysstat.ioconf @@ -0,0 +1,268 @@ +# +# sysstat.ioconf +# +# Copyright (C) 2004, Red Hat, Inc. +# +# Maintained by Sebastien Godard (sysstat [at] orange.fr) +# +# This file gives iostat and sadc a clue about how to find whole +# disk devices in /proc/partitions and /proc/diskstats +# Authoritative source is: linux/Documentation/devices.txt +# +# line format, general record: +# major:name:ctrlpre:ctrlno:devfmt:devcnt:partpre:partcnt:description +# +# major: major # for device +# name: base of device name +# ctrlpre: string to use in generating controller designators +# eg: the c in c0d2p6, decimal formatting implied +# '*' means none or irrelevant +# 'x': exception... record contains a specific name +# for a specific minor #, stored in the ctrlno field +# ctrlno: which controller of this type is this +# devfmt: type of device naming convention +# a: alpha: xxa, xxb, ... xxaa, xxab, ... xxzz +# %string: string to use in generating drive designators, +# eg: the 'd' in c0d2p6 , decimal formatting implied +# d: no special translations (decimal formatting) +# devcnt: how many whole devs per major number +# partpre: appended to whole dev before part designator +# eg. the p in c0d2p6, decimal formatting implied +# '*' means none +# partcnt: number of partitions per volume +# or minor # for exception records +# description: informative text +# +# line format, indirect record: +# major:base_major:ctrlno[:[desc]] +# +# major: major number of the device +# base_major: major number of the template for this type, +# 0 for not supported +# ctrlno: controller number of this type +# desc: controller-specific description +# if absent the desc from base_major will be +# used in sprintf( buf, desc, ctrlno ) + + +1:ram:*:0:d:256:*:1:RAM disks (ram0..ram255) +1:initrd:x:250:d:256:*:1:Initial RAM Disk (initrd) + +#2:0:0:Floppy Devices +2:fd:*:0:d:4:*:1:Floppy Devices fd0,fd1,fd2,fd3 + +3:hd:*:0:a:2:*:64:IDE - Controller %d +22:3:1: +33:3:2: +34:3:3: +56:3:4: +57:3:5: +88:3:6: +89:3:7: +90:3:8: +91:3:9: + +#4:0:0:NODEV +#5:0:0:NODEV +#6:0:0:NODEV +7:loop:*:0:d:256:*:1:Loop Devices + +8:sd:*:0:a:16:*:16:SCSI - Controller %d +65:8:1: +66:8:2: +67:8:3: +68:8:4: +69:8:5: +70:8:6: +71:8:7: +128:8:8: +129:8:9: +130:8:10: +131:8:11: +132:8:12: +133:8:13: +134:8:14: +135:8:15: + +9:md:*:0:d:256:*:1:Metadisk (Software RAID) devices (md0..md255) + +#10:0:0:NODEV + +#11:sr:*:0:d:256:*:1:CDROM - CDROM (sr0..sr255) (deprecated) +11:scd:*:0:d:256:*:1:CDROM - CDROM (scd0..scd255) + +#12:0:0:MSCDEX CD-ROM Callback + +13:xd:*:0:a:2:*:64:8-bit MFM/RLL/IDE controller (xda, xdb) + +#14:0:0:BIOS Hard Drive Callback +#15:0:0:CDROM - Sony CDU-31A/CDU-33A +#16:0:0:CDROM - Goldstar +#17:0:0:CDROM - Optics Storage +#18:0:0:CDROM - Sanyo + +19:double:*:0:d:256:*:1:Compressed Disk (double0..double255) + +#20:0:0:CDROM - Hitachi + +21:mfm:*:0:a:2:*:64:Acorn MFM Hard Drive (mfma, mfmb) + +# 22: see IDE, dev 3 + +#23:0:0:CDROM - Mistumi Proprietary +#24:0:0:CDROM - Sony CDU-535 +#25:0:0:CDROM - Matsushita (Panasonic/Soundblaster) #1 +#26:0:1:CDROM - Matsushita (Panasonic/Soundblaster) #2 +#27:0:2:CDROM - Matsushita (Panasonic/Soundblaster) #3 +#28:0:3:CDROM - Matsushita (Panasonic/Soundblaster) #4 +# 28:0:0:! ACSI (Atari) Disk Not Supported +#29:0:0:CDROM - Aztech/Orchid/Okano/Wearnes +#30:0:0:CDROM - Philips LMS CM-205 +#31:0:0:ROM/flash Memory Card +#32:0:0:CDROM - Phillips LMS CM-206 + +# 33: See IDE, dev 3 +# 34: See IDE, dev 3 + +#35:0:0:Slow Memory RAM Disk + +36:ed:*:0:a:2:*:64:MCA ESDI Hard Disk (eda, edb) + +#37:0:0:Zorro II Ram Disk +#38:0:0:Reserved For Linux/AP+ +#39:0:0:Reserved For Linux/AP+ +#40:0:0:Syquest EZ135 Parallel Port Drive +#41:0:0:CDROM - MicroSolutions Parallel Port BackPack +#42:0:0:For DEMO Use Only + +43:nb:*:0:d:256:*:1:Network Block devices (nb0..nb255) +44:ftl:*:0:a:16:*:16:Flash Translation Layer (ftla..ftlp) +45:pd:*:0:a:4:*:16:Parallel Port IDE (pda..pdd) + +#46:0:0:CDROM - Parallel Port ATAPI + +47:pf:*:0:d:256:*:1:Parallel Port ATAPI Disk Devices (pf0..pf255) + +48:rd:/c:0:%d:32:p:8:Mylex DAC960 RAID, Controller %d +49:48:1: +50:48:2: +51:48:3: +52:48:4: +53:48:5: +54:48:6: +55:48:7: +136:48:8: +137:48:9: +138:48:10: +139:48:11: +140:48:12: +141:48:13: +142:48:14: +143:48:15: + +# 56, 57: see IDE, dev 3: + +58:lvm:*:0:d:256:*:1:Logical Volume Manager (lvm0..lvm255) + +#59:0:0:PDA Filesystem Device +#60:0:0:Local/Experimental Use +#61:0:0:Local/Experimental Use +#62:0:0:Local/Experimental Use +#63:0:0:Local/Experimental Use +#64:0:0:NODEV + +# 65..71: See SCSI, dev 8: + +72:ida/:c:0:%d:16:p:16:Compaq Intelligent Drive Array - Controller %d +73:72:1: +74:72:2: +75:72:3: +76:72:4: +77:72:5: +78:72:6: +79:72:7: + +80:i2o/hd:*:0:a:16:*:16:I2O Disk - Controller %d +81:80:1: +82:80:2: +83:80:3: +84:80:4: +85:80:5: +86:80:6: +87:80:7: + +# 88..91: see IDE, dev 3: + +#92:0:0:PPDD Encrypted Disk +#93:0:0:NAND Flash Translation Layer not supported + +94:dasd:*:0:a:64:*:4:IBM S/390 DASD Block Storage (dasda, dasdb, ...) + +#95:0:0:IBM S/390 VM/ESA Minidisk +#96:0:0:NODEV +#97:0:0:CD/DVD packed writing devices not supported + +98:ubd:*:0:d:256:*:1:User-mode Virtual Block Devices (ubd0..ubd256) + +#99:0:0:JavaStation Flash Disk +#100:0:0:NODEV + +101:amiraid/ar:*:0:d:16:p:16:AMI HyperDisk RAID (amiraid/ar0 - amiraid/ar15) + +#102:0:0:Compressed Block Device +#103:0:0:Audit Block Device + +104:cciss:/c:0:%d:16:p:16:HP SA 5xxx/6xxx (cciss) Controller %d +105:104:1: +106:104:2: +107:104:3: +108:104:4: +109:104:5: +110:104:6: +111:104:7: + +112:iseries/vd:*:0:a:32:*:8:IBM iSeries Virtual Disk (.../vda - .../vdaf) + +#113:0:0:CDROM - IBM iSeries Virtual + +# 114..159 NODEV + +120:emcpower:*:0:a:16:*:16:EMC PowerPath Unit %d + +#160:sx8/:*:0:d:8:p:32:Promise SATA SX8 Unit %d +#161:160:1: +160:carmel/:*:0:d:8:p:32:Carmel 8-port SATA Disks (carmel/0 - carmel/7) +161:160:1: + +# 162..198 UNUSED + +180:ub:*:0:a:32:p:8:USB block devices + +#199:0:0:Veritas Volume Manager (VxVM) Volumes +#200:0:0:NODEV +#201:0:0:Veritas VxVM Dynamic Multipathing Driver + +202:xvd:*:0:a:16:p:16:Xen Virtual Block Device + +# 203..230: UNUSED + +232:emcpower:*:0:a:16:*:16:EMC PowerPath Unit %d +233:232:1: +234:232:2: +235:232:3: +236:232:4: +237:232:5: +238:232:6: +239:232:7: +240:232:8: +241:232:9: +242:232:10: +243:232:11: +244:232:12: +245:232:13: +246:232:14: +247:232:15: + +# 240..254: LOCAL/Experimental +# 255: reserved for big dev_t expansion + diff --git a/sysstat.sysconfig.in b/sysstat.sysconfig.in new file mode 100644 index 00000000..b06b6337 --- /dev/null +++ b/sysstat.sysconfig.in @@ -0,0 +1,10 @@ +# @PACKAGE_NAME@-@PACKAGE_VERSION@ configuration file. + +# How long to keep log files (in days). +# If value is greater than 28, then log files are kept in +# multiple directories, one for each month. +HISTORY=@HISTORY@ + +# Compress (using gzip or bzip2) sa and sar files older than (in days): +COMPRESSAFTER=@COMPRESSAFTER@ + diff --git a/version.in b/version.in new file mode 100644 index 00000000..38caba48 --- /dev/null +++ b/version.in @@ -0,0 +1,12 @@ +/* + * sysstat: System performance tools for Linux + * (C) 1999-2009 by Sebastien Godard (sysstat orange.fr) + */ + +#ifndef _VERSION_H +#define _VERSION_H + +/* sysstat version number */ +#define VERSION "@PACKAGE_VERSION@" + +#endif /* _VERSION_H */ diff --git a/xml/sysstat.dtd b/xml/sysstat.dtd new file mode 100644 index 00000000..16849ec2 --- /dev/null +++ b/xml/sysstat.dtd @@ -0,0 +1,432 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml/sysstat.xsd b/xml/sysstat.xsd new file mode 100644 index 00000000..9ac00fae --- /dev/null +++ b/xml/sysstat.xsd @@ -0,0 +1,745 @@ + + +-- XML Schema v2.8 for sysstat. See sadf.h -- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +