From e63bca11f5438db25629b8dfd3ed5c9edfd2e469 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sat, 21 Oct 2017 16:13:35 +0200 Subject: [PATCH] Use a time interval expressed in seconds, not in jiffies Now use a time interval expressed in 1/100th of a second instead of jiffies to calculate statistics. This is independent of the machine. Signed-off-by: Sebastien GODARD --- cifsiostat.c | 13 +++---- common.c | 12 +++--- common.h | 10 +++-- iostat.c | 8 ++-- json_stats.c | 80 +++++++++++++++++++------------------- mpstat.c | 52 ++++++++++++------------- pidstat.c | 48 +++++++++++------------ pr_stats.c | 108 +++++++++++++++++++++++++-------------------------- rd_stats.c | 31 ++++++++------- rndr_stats.c | 80 +++++++++++++++++++------------------- sa.h | 4 +- sa_common.c | 16 ++++---- sadc.c | 4 +- sadf.c | 8 ++-- sar.c | 8 ++-- svg_stats.c | 72 +++++++++++++++++----------------- xml_stats.c | 80 +++++++++++++++++++------------------- 17 files changed, 319 insertions(+), 315 deletions(-) diff --git a/cifsiostat.c b/cifsiostat.c index 3bbad25..7d2a5cc 100644 --- a/cifsiostat.c +++ b/cifsiostat.c @@ -46,7 +46,7 @@ char *sccsid(void) { return (SCCSID); } #endif -unsigned long long uptime0[2] = {0, 0}; +unsigned long long uptime_cs[2] = {0, 0}; struct cifs_stats *st_cifs[2]; struct io_hdr_stats *st_hdr_cifs; @@ -420,7 +420,7 @@ void write_cifs_stat_header(int *fctr) * * IN: * @curr Index in array for current sample statistics. - * @itv Interval of time. + * @itv Interval of time (in 1/100th of a second). * @fctr Conversion factor. * @shi Structures describing the CIFS filesystems. * @ioi Current sample statistics. @@ -496,7 +496,7 @@ void write_stats(int curr, struct tm *rectime) } /* Interval of time, reduced to one processor */ - itv = get_interval(uptime0[!curr], uptime0[curr]); + itv = get_interval(uptime_cs[!curr], uptime_cs[curr]); shi = st_hdr_cifs; @@ -543,11 +543,8 @@ void rw_io_stat_loop(long int count, struct tm *rectime) setbuf(stdout, NULL); do { - /* Read system uptime (reduced to one processor) */ - read_uptime(&(uptime0[curr])); - if (!uptime0[curr]) - /* Cannot read system uptime */ - exit(2); + /* Read system uptime in 1/100th of a second */ + read_uptime(&(uptime_cs[curr])); /* Read CIFS stats */ read_cifs_stat(curr); diff --git a/common.c b/common.c index 262611b..8b170ba 100644 --- a/common.c +++ b/common.c @@ -666,11 +666,11 @@ double ll_sp_value(unsigned long long value1, unsigned long long value2, * Compute time interval. * * IN: - * @prev_uptime Previous uptime value in jiffies. - * @curr_uptime Current uptime value in jiffies. + * @prev_uptime Previous uptime value (in jiffies or 1/100th of a second). + * @curr_uptime Current uptime value (in jiffies or 1/100th of a second). * * RETURNS: - * Interval of time in jiffies. + * Interval of time in jiffies or 1/100th of a second. *************************************************************************** */ unsigned long long get_interval(unsigned long long prev_uptime, @@ -701,7 +701,7 @@ unsigned long long get_interval(unsigned long long prev_uptime, * @scp Previous sample statistics for current CPU. * * RETURNS: - * Interval of time based on current CPU. + * Interval of time based on current CPU, expressed in jiffies. *************************************************************************** */ unsigned long long get_per_cpu_interval(struct stats_cpu *scc, @@ -794,7 +794,7 @@ int count_bits(void *ptr, int size) * IN: * @sdc Structure with current device statistics. * @sdp Structure with previous device statistics. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. * * OUT: * @xds Structure with extended statistics. @@ -804,7 +804,7 @@ 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; + = ((double) (sdc->nr_ios - sdp->nr_ios)) * 100 / itv; xds->util = S_VALUE(sdp->tot_ticks, sdc->tot_ticks, itv); xds->svctm = tput ? xds->util / tput : 0.0; diff --git a/common.h b/common.h index bcda7a1..02fafd2 100644 --- a/common.h +++ b/common.h @@ -143,13 +143,15 @@ /* * Macros used to display statistics values. * - * NB: Define SP_VALUE() to normalize to %; - * HZ is 1024 on IA64 and % should be normalized to 100. + */ +/* With S_VALUE macro, the interval of time (@p) is given in 1/100th of a second */ +#define S_VALUE(m,n,p) (((double) ((n) - (m))) / (p) * 100) +/* Define SP_VALUE() to normalize to % */ +#define SP_VALUE(m,n,p) (((double) ((n) - (m))) / (p) * 100) +/* * SP_VALUE_100() will not output value bigger than 100; this is needed for some * corner cases, should be used with care. */ -#define S_VALUE(m,n,p) (((double) ((n) - (m))) / (p) * HZ) -#define SP_VALUE(m,n,p) (((double) ((n) - (m))) / (p) * 100) #define SP_VALUE_100(m,n,p) MINIMUM((((double) ((n) - (m))) / (p) * 100), 100.0) /* diff --git a/iostat.c b/iostat.c index 742c39a..36e93b5 100644 --- a/iostat.c +++ b/iostat.c @@ -54,7 +54,7 @@ char *sccsid(void) { return (SCCSID); } #endif struct stats_cpu *st_cpu[2]; -unsigned long long uptime0[2] = {0, 0}; +unsigned long long uptime_cs[2] = {0, 0}; unsigned long long tot_jiffies[2] = {0, 0}; struct io_stats *st_iodev[2]; struct io_hdr_stats *st_hdr_iodev; @@ -1505,8 +1505,8 @@ void write_stats(int curr, struct tm *rectime) } } - /* Calculate time interval in jiffies */ - itv = get_interval(uptime0[!curr], uptime0[curr]); + /* Calculate time interval in 1/100th of a second */ + itv = get_interval(uptime_cs[!curr], uptime_cs[curr]); if (DISPLAY_DISK(flags)) { struct io_stats *ioi, *ioj; @@ -1631,7 +1631,7 @@ void rw_io_stat_loop(long int count, struct tm *rectime) do { /* Read system uptime (only for SMP machines) */ - read_uptime(&(uptime0[curr])); + read_uptime(&(uptime_cs[curr])); /* Read stats for CPU "all" */ read_stat_cpu(st_cpu[curr], 1); diff --git a/json_stats.c b/json_stats.c index f023873..8027491 100644 --- a/json_stats.c +++ b/json_stats.c @@ -103,8 +103,8 @@ void json_markup_power_management(int tab, int action) * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies (independent of the number of - * processors). Unused here. + * @itv Interval of time in 1/100th of a second (independent of the + * number of processors). Unused here. *************************************************************************** */ __print_funct_t json_print_cpu_stats(struct activity *a, int curr, int tab, @@ -283,7 +283,7 @@ __print_funct_t json_print_cpu_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_pcsw_stats(struct activity *a, int curr, int tab, @@ -309,7 +309,7 @@ __print_funct_t json_print_pcsw_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_irq_stats(struct activity *a, int curr, int tab, @@ -364,7 +364,7 @@ __print_funct_t json_print_irq_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_swap_stats(struct activity *a, int curr, int tab, @@ -389,7 +389,7 @@ __print_funct_t json_print_swap_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_paging_stats(struct activity *a, int curr, int tab, @@ -432,7 +432,7 @@ __print_funct_t json_print_paging_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_io_stats(struct activity *a, int curr, int tab, @@ -476,7 +476,7 @@ __print_funct_t json_print_io_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_memory_stats(struct activity *a, int curr, int tab, @@ -568,7 +568,7 @@ __print_funct_t json_print_memory_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_ktables_stats(struct activity *a, int curr, int tab, @@ -596,7 +596,7 @@ __print_funct_t json_print_ktables_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_queue_stats(struct activity *a, int curr, int tab, @@ -628,7 +628,7 @@ __print_funct_t json_print_queue_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_serial_stats(struct activity *a, int curr, int tab, @@ -684,7 +684,7 @@ __print_funct_t json_print_serial_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_disk_stats(struct activity *a, int curr, int tab, @@ -787,7 +787,7 @@ __print_funct_t json_print_disk_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_dev_stats(struct activity *a, int curr, int tab, @@ -872,7 +872,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_edev_stats(struct activity *a, int curr, int tab, @@ -954,7 +954,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_nfs_stats(struct activity *a, int curr, int tab, @@ -999,7 +999,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_nfsd_stats(struct activity *a, int curr, int tab, @@ -1054,7 +1054,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_sock_stats(struct activity *a, int curr, int tab, @@ -1098,7 +1098,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_ip_stats(struct activity *a, int curr, int tab, @@ -1147,7 +1147,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_eip_stats(struct activity *a, int curr, int tab, @@ -1196,7 +1196,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_icmp_stats(struct activity *a, int curr, int tab, @@ -1257,7 +1257,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_eicmp_stats(struct activity *a, int curr, int tab, @@ -1314,7 +1314,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_tcp_stats(struct activity *a, int curr, int tab, @@ -1355,7 +1355,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_etcp_stats(struct activity *a, int curr, int tab, @@ -1398,7 +1398,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_udp_stats(struct activity *a, int curr, int tab, @@ -1439,7 +1439,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_sock6_stats(struct activity *a, int curr, int tab, @@ -1479,7 +1479,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_ip6_stats(struct activity *a, int curr, int tab, @@ -1532,7 +1532,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_eip6_stats(struct activity *a, int curr, int tab, @@ -1587,7 +1587,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_icmp6_stats(struct activity *a, int curr, int tab, @@ -1654,7 +1654,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_eicmp6_stats(struct activity *a, int curr, int tab, @@ -1709,7 +1709,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_net_udp6_stats(struct activity *a, int curr, int tab, @@ -1750,7 +1750,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_pwr_cpufreq_stats(struct activity *a, int curr, int tab, @@ -1815,7 +1815,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_pwr_fan_stats(struct activity *a, int curr, int tab, @@ -1869,7 +1869,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_pwr_temp_stats(struct activity *a, int curr, int tab, @@ -1925,7 +1925,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_pwr_in_stats(struct activity *a, int curr, int tab, @@ -1981,7 +1981,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_huge_stats(struct activity *a, int curr, int tab, @@ -2009,7 +2009,7 @@ __print_funct_t json_print_huge_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_pwr_wghfreq_stats(struct activity *a, int curr, int tab, @@ -2091,7 +2091,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_pwr_usb_stats(struct activity *a, int curr, int tab, @@ -2153,7 +2153,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_filesystem_stats(struct activity *a, int curr, int tab, @@ -2211,7 +2211,7 @@ __print_funct_t json_print_filesystem_stats(struct activity *a, int curr, int ta * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_fchost_stats(struct activity *a, int curr, int tab, @@ -2273,7 +2273,7 @@ close_json_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t json_print_softnet_stats(struct activity *a, int curr, int tab, diff --git a/mpstat.c b/mpstat.c index 7481d4d..cd5df95 100644 --- a/mpstat.c +++ b/mpstat.c @@ -49,7 +49,7 @@ char *sccsid(void) { return (SCCSID); } #endif unsigned long long tot_jiffies[3] = {0, 0, 0}; -unsigned long long uptime0[3] = {0, 0, 0}; +unsigned long long uptime_cs[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. */ @@ -735,7 +735,7 @@ void write_cpu_stats(int dis, unsigned long long deltot_jiffies, int prev, int c * @dis TRUE if a header line must be printed. * @deltot_jiffies * Number of jiffies spent on the interval by all processors. - * @itv Interval value. + * @itv Interval value in 1/100th of a second. * @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. @@ -832,38 +832,38 @@ void write_plain_node_stats(int dis, unsigned long long deltot_jiffies, unsigned 0.0 : ll_sp_value(snp->cpu_user - snp->cpu_guest, snc->cpu_user - snc->cpu_guest, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), (snc->cpu_nice - snc->cpu_guest_nice) < (snp->cpu_nice - snp->cpu_guest_nice) ? 0.0 : ll_sp_value(snp->cpu_nice - snp->cpu_guest_nice, snc->cpu_nice - snc->cpu_guest_nice, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_sys, snc->cpu_sys, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_iowait, snc->cpu_iowait, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_hardirq, snc->cpu_hardirq, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_softirq, snc->cpu_softirq, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_steal, snc->cpu_steal, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_guest, snc->cpu_guest, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_guest_nice, snc->cpu_guest_nice, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), (snc->cpu_idle < snp->cpu_idle) ? 0.0 : ll_sp_value(snp->cpu_idle, snc->cpu_idle, - itv * cpu_per_node[node])); + itv * HZ / 100 * cpu_per_node[node])); printf("\n"); } } @@ -963,38 +963,38 @@ void write_json_node_stats(int tab, unsigned long long deltot_jiffies, unsigned 0.0 : ll_sp_value(snp->cpu_user - snp->cpu_guest, snc->cpu_user - snc->cpu_guest, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), (snc->cpu_nice - snc->cpu_guest_nice) < (snp->cpu_nice - snp->cpu_guest_nice) ? 0.0 : ll_sp_value(snp->cpu_nice - snp->cpu_guest_nice, snc->cpu_nice - snc->cpu_guest_nice, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_sys, snc->cpu_sys, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_iowait, snc->cpu_iowait, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_hardirq, snc->cpu_hardirq, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_softirq, snc->cpu_softirq, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_steal, snc->cpu_steal, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_guest, snc->cpu_guest, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), ll_sp_value(snp->cpu_guest_nice, snc->cpu_guest_nice, - itv * cpu_per_node[node]), + itv * HZ / 100 * cpu_per_node[node]), (snc->cpu_idle < snp->cpu_idle) ? 0.0 : ll_sp_value(snp->cpu_idle, snc->cpu_idle, - itv * cpu_per_node[node])); + itv * HZ / 100 * cpu_per_node[node])); } printf("\n"); xprintf0(--tab, "]"); @@ -1614,7 +1614,7 @@ void write_stats_core(int prev, int curr, int dis, deltot_jiffies = get_interval(tot_jiffies[prev], tot_jiffies[curr]); /* Get time interval */ - itv = get_interval(uptime0[prev], uptime0[curr]); + itv = get_interval(uptime_cs[prev], uptime_cs[curr]); /* Print CPU stats */ if (DISPLAY_CPU(actflags)) { @@ -1842,7 +1842,7 @@ void rw_mpstat_loop(int dis_hdr, int rows) setbuf(stdout, NULL); /* Read system uptime and CPU stats */ - read_uptime(&(uptime0[0])); + read_uptime(&(uptime_cs[0])); read_stat_cpu(st_cpu[0], cpu_nr + 1); tot_jiffies[0] = st_cpu[0]->cpu_user + st_cpu[0]->cpu_nice + st_cpu[0]->cpu_sys + st_cpu[0]->cpu_idle + @@ -1898,7 +1898,7 @@ void rw_mpstat_loop(int dis_hdr, int rows) /* Save the first stats collected. Will be used to compute the average */ mp_tstamp[2] = mp_tstamp[0]; tot_jiffies[2] = tot_jiffies[0]; - uptime0[2] = uptime0[0]; + uptime_cs[2] = uptime_cs[0]; memcpy(st_cpu[2], st_cpu[0], STATS_CPU_SIZE * (cpu_nr + 1)); memcpy(st_node[2], st_node[0], STATS_CPU_SIZE * (cpu_nr + 1)); memcpy(st_irq[2], st_irq[0], STATS_IRQ_SIZE * (cpu_nr + 1)); @@ -1939,7 +1939,7 @@ void rw_mpstat_loop(int dis_hdr, int rows) get_localtime(&(mp_tstamp[curr]), 0); /* Read uptime and CPU stats */ - read_uptime(&(uptime0[curr])); + read_uptime(&(uptime_cs[curr])); read_stat_cpu(st_cpu[curr], cpu_nr + 1); if (DISPLAY_NODE(actflags)) { set_node_cpu_stats(st_node[curr], st_cpu[curr]); diff --git a/pidstat.c b/pidstat.c index 5b628ff..5be7a43 100644 --- a/pidstat.c +++ b/pidstat.c @@ -53,7 +53,7 @@ char *sccsid(void) { return (SCCSID); } #endif unsigned long long tot_jiffies[3] = {0, 0, 0}; -unsigned long long uptime0[3] = {0, 0, 0}; +unsigned long long uptime_cs[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; @@ -1456,16 +1456,16 @@ int write_pid_task_all_stats(int prev, int curr, int dis, (pstc->utime - pstc->gtime) < (pstp->utime - pstp->gtime) ? 0.0 : SP_VALUE_100(pstp->utime - pstp->gtime, - pstc->utime - pstc->gtime, itv), - SP_VALUE_100(pstp->stime, pstc->stime, itv), - SP_VALUE_100(pstp->gtime, pstc->gtime, itv), - SP_VALUE_100(pstp->wtime, pstc->wtime, itv), + pstc->utime - pstc->gtime, itv * HZ / 100), + SP_VALUE_100(pstp->stime, pstc->stime, itv * HZ / 100), + SP_VALUE_100(pstp->gtime, pstc->gtime, itv * HZ / 100), + SP_VALUE_100(pstp->wtime, pstc->wtime, itv * HZ / 100), /* User time already includes guest time */ IRIX_MODE_OFF(pidflag) ? SP_VALUE_100(pstp->utime + pstp->stime, pstc->utime + pstc->stime, deltot_jiffies) : SP_VALUE_100(pstp->utime + pstp->stime, - pstc->utime + pstc->stime, itv)); + pstc->utime + pstc->stime, itv * HZ / 100)); cprintf_in(IS_INT, " %3d", "", pstc->processor); } @@ -1561,7 +1561,7 @@ int write_pid_task_all_stats(int prev, int curr, int dis, * the timestamp of the previous sample. * @curr_string String displayed at the beginning of current sample stats. * This is the timestamp of the current sample. - * @itv Interval of time in jiffies. + * @itv Interval of time. * * RETURNS: * 0 if all the processes to display have terminated. @@ -1635,7 +1635,7 @@ int write_pid_child_all_stats(int prev, int curr, int dis, * @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. + * @itv Interval of time in 1/100th of a second. * @deltot_jiffies * Number of jiffies spent on the interval by all processors. * @@ -1669,16 +1669,16 @@ int write_pid_task_cpu_stats(int prev, int curr, int dis, int disp_avg, (pstc->utime - pstc->gtime) < (pstp->utime - pstp->gtime) ? 0.0 : SP_VALUE_100(pstp->utime - pstp->gtime, - pstc->utime - pstc->gtime, itv), - SP_VALUE_100(pstp->stime, pstc->stime, itv), - SP_VALUE_100(pstp->gtime, pstc->gtime, itv), - SP_VALUE_100(pstp->wtime, pstc->wtime, itv), + pstc->utime - pstc->gtime, itv * HZ / 100), + SP_VALUE_100(pstp->stime, pstc->stime, itv * HZ / 100), + SP_VALUE_100(pstp->gtime, pstc->gtime, itv * HZ / 100), + SP_VALUE_100(pstp->wtime, pstc->wtime, itv * HZ / 100), /* User time already includes guest time */ IRIX_MODE_OFF(pidflag) ? SP_VALUE_100(pstp->utime + pstp->stime, pstc->utime + pstc->stime, deltot_jiffies) : SP_VALUE_100(pstp->utime + pstp->stime, - pstc->utime + pstc->stime, itv)); + pstc->utime + pstc->stime, itv * HZ / 100)); if (!disp_avg) { cprintf_in(IS_INT, " %3d", "", pstc->processor); @@ -1793,7 +1793,7 @@ int write_pid_child_cpu_stats(int prev, int curr, int dis, int disp_avg, * @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. + * @itv Interval of time in 1/100th of a second. * * RETURNS: * 0 if all the processes to display have terminated. @@ -1947,7 +1947,7 @@ int write_pid_child_memory_stats(int prev, int curr, int dis, int disp_avg, * @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. + * @itv Interval of time. * * RETURNS: * 0 if all the processes to display have terminated. @@ -2020,7 +2020,7 @@ int write_pid_stack_stats(int prev, int curr, int dis, int disp_avg, * @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. + * @itv Interval of time in 1/100th of a second. * * RETURNS: * 0 if all the processes to display have terminated. @@ -2109,7 +2109,7 @@ int write_pid_io_stats(int prev, int curr, int dis, int disp_avg, * @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. + * @itv Interval of time in 1/100th of a second. * * RETURNS: * 0 if all the processes to display have terminated. @@ -2160,7 +2160,7 @@ int write_pid_ctxswitch_stats(int prev, int curr, int dis, * @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. + * @itv Interval of time. * * RETURNS: * 0 if all the processes to display have terminated. @@ -2212,7 +2212,7 @@ int write_pid_rt_stats(int prev, int curr, int dis, * @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. + * @itv Interval of time. * * RETURNS: * 0 if all the processes to display have terminated. @@ -2312,7 +2312,7 @@ int write_stats_core(int prev, int curr, int dis, int disp_avg, /* Total number of jiffies spent on the interval */ deltot_jiffies = get_interval(tot_jiffies[prev], tot_jiffies[curr]); - itv = get_interval(uptime0[prev], uptime0[curr]); + itv = get_interval(uptime_cs[prev], uptime_cs[curr]); if (PROCESS_STRING(pidflag)) { /* Reset "show threads" flag */ @@ -2480,7 +2480,7 @@ void rw_pidstat_loop(int dis_hdr, int rows) setbuf(stdout, NULL); /* Read system uptime */ - read_uptime(&uptime0[0]); + read_uptime(&uptime_cs[0]); read_stats(0); if (DISPLAY_MEM(actflag)) { @@ -2505,7 +2505,7 @@ void rw_pidstat_loop(int dis_hdr, int rows) /* Save the first stats collected. Will be used to compute the average */ ps_tstamp[2] = ps_tstamp[0]; tot_jiffies[2] = tot_jiffies[0]; - uptime0[2] = uptime0[0]; + uptime_cs[2] = uptime_cs[0]; memcpy(st_pid_list[2], st_pid_list[0], PID_STATS_SIZE * pid_nr); /* Set a handler for SIGINT */ @@ -2524,8 +2524,8 @@ void rw_pidstat_loop(int dis_hdr, int rows) /* Get time */ get_localtime(&ps_tstamp[curr], 0); - /* Read system uptime */ - read_uptime(&(uptime0[curr])); + /* Read system uptime (in 1/100th of a second) */ + read_uptime(&(uptime_cs[curr])); /* Read stats */ read_stats(curr); diff --git a/pr_stats.c b/pr_stats.c index cb64fb3..c8a229f 100644 --- a/pr_stats.c +++ b/pr_stats.c @@ -118,8 +118,8 @@ void print_hdr_line(char *timestamp, struct activity *a, int pos, int iwidth, 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 (independent of the number of - * processors). Unused here. + * @itv Interval of time in 1/100th of a second (independent of the + * number of processors). Unused here. *************************************************************************** */ __print_funct_t print_cpu_stats(struct activity *a, int prev, int curr, @@ -290,7 +290,7 @@ __print_funct_t print_cpu_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_pcsw_stats(struct activity *a, int prev, int curr, @@ -319,7 +319,7 @@ __print_funct_t print_pcsw_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_irq_stats(struct activity *a, int prev, int curr, @@ -372,7 +372,7 @@ __print_funct_t print_irq_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_swap_stats(struct activity *a, int prev, int curr, @@ -401,7 +401,7 @@ __print_funct_t print_swap_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_paging_stats(struct activity *a, int prev, int curr, @@ -443,7 +443,7 @@ __print_funct_t print_paging_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_io_stats(struct activity *a, int prev, int curr, @@ -487,7 +487,7 @@ __print_funct_t print_io_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. * @dispavg TRUE if displaying average statistics. *************************************************************************** */ @@ -693,7 +693,7 @@ void stub_print_memory_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_memory_stats(struct activity *a, int prev, int curr, @@ -710,7 +710,7 @@ __print_funct_t print_memory_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_avg_memory_stats(struct activity *a, int prev, int curr, @@ -787,7 +787,7 @@ void stub_print_ktables_stats(struct activity *a, int curr, int dispavg) * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_ktables_stats(struct activity *a, int prev, int curr, @@ -804,7 +804,7 @@ __print_funct_t print_ktables_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_avg_ktables_stats(struct activity *a, int prev, int curr, @@ -891,7 +891,7 @@ void stub_print_queue_stats(struct activity *a, int curr, int dispavg) * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_queue_stats(struct activity *a, int prev, int curr, @@ -908,7 +908,7 @@ __print_funct_t print_queue_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_avg_queue_stats(struct activity *a, int prev, int curr, @@ -925,7 +925,7 @@ __print_funct_t print_avg_queue_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_serial_stats(struct activity *a, int prev, int curr, @@ -974,7 +974,7 @@ __print_funct_t print_serial_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_disk_stats(struct activity *a, int prev, int curr, @@ -1066,7 +1066,7 @@ __print_funct_t print_disk_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_dev_stats(struct activity *a, int prev, int curr, @@ -1134,7 +1134,7 @@ __print_funct_t print_net_dev_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_edev_stats(struct activity *a, int prev, int curr, @@ -1190,7 +1190,7 @@ __print_funct_t print_net_edev_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_nfs_stats(struct activity *a, int prev, int curr, @@ -1223,7 +1223,7 @@ __print_funct_t print_net_nfs_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_nfsd_stats(struct activity *a, int prev, int curr, @@ -1326,7 +1326,7 @@ void stub_print_net_sock_stats(struct activity *a, int curr, int dispavg) * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_sock_stats(struct activity *a, int prev, int curr, @@ -1343,7 +1343,7 @@ __print_funct_t print_net_sock_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_avg_net_sock_stats(struct activity *a, int prev, int curr, @@ -1360,7 +1360,7 @@ __print_funct_t print_avg_net_sock_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_ip_stats(struct activity *a, int prev, int curr, @@ -1395,7 +1395,7 @@ __print_funct_t print_net_ip_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_eip_stats(struct activity *a, int prev, int curr, @@ -1430,7 +1430,7 @@ __print_funct_t print_net_eip_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_icmp_stats(struct activity *a, int prev, int curr, @@ -1471,7 +1471,7 @@ __print_funct_t print_net_icmp_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_eicmp_stats(struct activity *a, int prev, int curr, @@ -1510,7 +1510,7 @@ __print_funct_t print_net_eicmp_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_tcp_stats(struct activity *a, int prev, int curr, @@ -1541,7 +1541,7 @@ __print_funct_t print_net_tcp_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_etcp_stats(struct activity *a, int prev, int curr, @@ -1573,7 +1573,7 @@ __print_funct_t print_net_etcp_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_udp_stats(struct activity *a, int prev, int curr, @@ -1660,7 +1660,7 @@ void stub_print_net_sock6_stats(struct activity *a, int curr, int dispavg) * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_sock6_stats(struct activity *a, int prev, int curr, @@ -1677,7 +1677,7 @@ __print_funct_t print_net_sock6_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_avg_net_sock6_stats(struct activity *a, int prev, int curr, @@ -1694,7 +1694,7 @@ __print_funct_t print_avg_net_sock6_stats(struct activity *a, int prev, int curr * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_ip6_stats(struct activity *a, int prev, int curr, @@ -1731,7 +1731,7 @@ __print_funct_t print_net_ip6_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_eip6_stats(struct activity *a, int prev, int curr, @@ -1769,7 +1769,7 @@ __print_funct_t print_net_eip6_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_icmp6_stats(struct activity *a, int prev, int curr, @@ -1813,7 +1813,7 @@ __print_funct_t print_net_icmp6_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_eicmp6_stats(struct activity *a, int prev, int curr, @@ -1851,7 +1851,7 @@ __print_funct_t print_net_eicmp6_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_net_udp6_stats(struct activity *a, int prev, int curr, @@ -1975,7 +1975,7 @@ void stub_print_pwr_cpufreq_stats(struct activity *a, int curr, int dispavg) * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_pwr_cpufreq_stats(struct activity *a, int prev, int curr, @@ -1992,7 +1992,7 @@ __print_funct_t print_pwr_cpufreq_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_avg_pwr_cpufreq_stats(struct activity *a, int prev, int curr, @@ -2083,7 +2083,7 @@ void stub_print_pwr_fan_stats(struct activity *a, int curr, int dispavg) * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_pwr_fan_stats(struct activity *a, int prev, int curr, @@ -2100,7 +2100,7 @@ __print_funct_t print_pwr_fan_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_avg_pwr_fan_stats(struct activity *a, int prev, int curr, @@ -2208,7 +2208,7 @@ void stub_print_pwr_temp_stats(struct activity *a, int curr, int dispavg) * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_pwr_temp_stats(struct activity *a, int prev, int curr, @@ -2225,7 +2225,7 @@ __print_funct_t print_pwr_temp_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_avg_pwr_temp_stats(struct activity *a, int prev, int curr, @@ -2333,7 +2333,7 @@ void stub_print_pwr_in_stats(struct activity *a, int curr, int dispavg) * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_pwr_in_stats(struct activity *a, int prev, int curr, @@ -2350,7 +2350,7 @@ __print_funct_t print_pwr_in_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_avg_pwr_in_stats(struct activity *a, int prev, int curr, @@ -2430,7 +2430,7 @@ void stub_print_huge_stats(struct activity *a, int curr, int dispavg) * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_huge_stats(struct activity *a, int prev, int curr, @@ -2447,7 +2447,7 @@ __print_funct_t print_huge_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_avg_huge_stats(struct activity *a, int prev, int curr, @@ -2465,7 +2465,7 @@ __print_funct_t print_avg_huge_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ void print_pwr_wghfreq_stats(struct activity *a, int prev, int curr, @@ -2543,7 +2543,7 @@ void print_pwr_wghfreq_stats(struct activity *a, int prev, int curr, * IN: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. * @dispavg TRUE if displaying average statistics. *************************************************************************** */ @@ -2624,7 +2624,7 @@ void stub_print_pwr_usb_stats(struct activity *a, int curr, int dispavg) * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_pwr_usb_stats(struct activity *a, int prev, int curr, @@ -2641,7 +2641,7 @@ __print_funct_t print_pwr_usb_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_avg_pwr_usb_stats(struct activity *a, int prev, int curr, @@ -2731,7 +2731,7 @@ __print_funct_t stub_print_filesystem_stats(struct activity *a, int curr, int di * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_filesystem_stats(struct activity *a, int prev, int curr, @@ -2748,7 +2748,7 @@ __print_funct_t print_filesystem_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_avg_filesystem_stats(struct activity *a, int prev, int curr, @@ -2765,7 +2765,7 @@ __print_funct_t print_avg_filesystem_stats(struct activity *a, int prev, int cur * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_fchost_stats(struct activity *a, int prev, int curr, @@ -2805,7 +2805,7 @@ __print_funct_t print_fchost_stats(struct activity *a, int prev, int curr, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t print_softnet_stats(struct activity *a, int prev, int curr, diff --git a/rd_stats.c b/rd_stats.c index bae0213..a62d65e 100644 --- a/rd_stats.c +++ b/rd_stats.c @@ -272,32 +272,37 @@ void read_meminfo(struct stats_memory *st_memory) * Read machine uptime, independently of the number of processors. * * OUT: - * @uptime Uptime value in jiffies. + * @uptime Uptime value in hundredths of a second. *************************************************************************** */ void read_uptime(unsigned long long *uptime) { - FILE *fp; + FILE *fp = NULL; char line[128]; unsigned long up_sec, up_cent; + int err = FALSE; if ((fp = fopen(UPTIME, "r")) == NULL) { - fprintf(stderr, _("Cannot open %s: %s\n"), UPTIME, strerror(errno)); - exit(2); - return; + err = TRUE; } - - if (fgets(line, sizeof(line), fp) != NULL) { - sscanf(line, "%lu.%lu", &up_sec, &up_cent); - *uptime = (unsigned long long) up_sec * HZ + - (unsigned long long) up_cent * HZ / 100; + else if (fgets(line, sizeof(line), fp) == NULL) { + err = TRUE; + } + else if (sscanf(line, "%lu.%lu", &up_sec, &up_cent) == 2) { + *uptime = (unsigned long long) up_sec * 100 + + (unsigned long long) up_cent; } else { - /* Couldn't read system uptime */ - *uptime = 0; + err = TRUE; } - fclose(fp); + if (fp != NULL) { + fclose(fp); + } + if (err) { + fprintf(stderr, _("Cannot read %s\n"), UPTIME); + exit(2); + } } #ifdef SOURCE_SADC diff --git a/rndr_stats.c b/rndr_stats.c index bdcaef4..2a28282 100644 --- a/rndr_stats.c +++ b/rndr_stats.c @@ -163,8 +163,8 @@ static void render(int isdb, char *pre, int rflags, const char *pptxt, * @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 (independent of the number of - * processors). Unused here. + * @itv Interval of time in 1/100th of a second (independent of the + * number of processors). Unused here. *************************************************************************** */ __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre, @@ -483,7 +483,7 @@ __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_pcsw_stats(struct activity *a, int isdb, char *pre, @@ -523,7 +523,7 @@ __print_funct_t render_pcsw_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_irq_stats(struct activity *a, int isdb, char *pre, @@ -571,7 +571,7 @@ __print_funct_t render_irq_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_swap_stats(struct activity *a, int isdb, char *pre, @@ -604,7 +604,7 @@ __print_funct_t render_swap_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_paging_stats(struct activity *a, int isdb, char *pre, @@ -684,7 +684,7 @@ __print_funct_t render_paging_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_io_stats(struct activity *a, int isdb, char *pre, @@ -747,7 +747,7 @@ __print_funct_t render_io_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_memory_stats(struct activity *a, int isdb, char *pre, @@ -870,7 +870,7 @@ __print_funct_t render_memory_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_ktables_stats(struct activity *a, int isdb, char *pre, @@ -907,7 +907,7 @@ __print_funct_t render_ktables_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_queue_stats(struct activity *a, int isdb, char *pre, @@ -958,7 +958,7 @@ __print_funct_t render_queue_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_serial_stats(struct activity *a, int isdb, char *pre, @@ -1032,7 +1032,7 @@ __print_funct_t render_serial_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_disk_stats(struct activity *a, int isdb, char *pre, @@ -1154,7 +1154,7 @@ __print_funct_t render_disk_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_dev_stats(struct activity *a, int isdb, char *pre, @@ -1254,7 +1254,7 @@ __print_funct_t render_net_dev_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_edev_stats(struct activity *a, int isdb, char *pre, @@ -1357,7 +1357,7 @@ __print_funct_t render_net_edev_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_nfs_stats(struct activity *a, int isdb, char *pre, @@ -1415,7 +1415,7 @@ __print_funct_t render_net_nfs_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_nfsd_stats(struct activity *a, int isdb, char *pre, @@ -1503,7 +1503,7 @@ __print_funct_t render_net_nfsd_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_sock_stats(struct activity *a, int isdb, char *pre, @@ -1548,7 +1548,7 @@ __print_funct_t render_net_sock_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_ip_stats(struct activity *a, int isdb, char *pre, @@ -1618,7 +1618,7 @@ __print_funct_t render_net_ip_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_eip_stats(struct activity *a, int isdb, char *pre, @@ -1688,7 +1688,7 @@ __print_funct_t render_net_eip_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre, @@ -1794,7 +1794,7 @@ __print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_eicmp_stats(struct activity *a, int isdb, char *pre, @@ -1888,7 +1888,7 @@ __print_funct_t render_net_eicmp_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_tcp_stats(struct activity *a, int isdb, char *pre, @@ -1934,7 +1934,7 @@ __print_funct_t render_net_tcp_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_etcp_stats(struct activity *a, int isdb, char *pre, @@ -1986,7 +1986,7 @@ __print_funct_t render_net_etcp_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_udp_stats(struct activity *a, int isdb, char *pre, @@ -2032,7 +2032,7 @@ __print_funct_t render_net_udp_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_sock6_stats(struct activity *a, int isdb, char *pre, @@ -2069,7 +2069,7 @@ __print_funct_t render_net_sock6_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_ip6_stats(struct activity *a, int isdb, char *pre, @@ -2151,7 +2151,7 @@ __print_funct_t render_net_ip6_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_eip6_stats(struct activity *a, int isdb, char *pre, @@ -2239,7 +2239,7 @@ __print_funct_t render_net_eip6_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_icmp6_stats(struct activity *a, int isdb, char *pre, @@ -2363,7 +2363,7 @@ __print_funct_t render_net_icmp6_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_eicmp6_stats(struct activity *a, int isdb, char *pre, @@ -2451,7 +2451,7 @@ __print_funct_t render_net_eicmp6_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_net_udp6_stats(struct activity *a, int isdb, char *pre, @@ -2497,7 +2497,7 @@ __print_funct_t render_net_udp6_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_pwr_cpufreq_stats(struct activity *a, int isdb, char *pre, @@ -2545,7 +2545,7 @@ __print_funct_t render_pwr_cpufreq_stats(struct activity *a, int isdb, char *pre * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_pwr_fan_stats(struct activity *a, int isdb, char *pre, @@ -2594,7 +2594,7 @@ __print_funct_t render_pwr_fan_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_pwr_temp_stats(struct activity *a, int isdb, char *pre, @@ -2645,7 +2645,7 @@ __print_funct_t render_pwr_temp_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_pwr_in_stats(struct activity *a, int isdb, char *pre, @@ -2696,7 +2696,7 @@ __print_funct_t render_pwr_in_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_huge_stats(struct activity *a, int isdb, char *pre, @@ -2731,7 +2731,7 @@ __print_funct_t render_huge_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_pwr_wghfreq_stats(struct activity *a, int isdb, char *pre, @@ -2797,7 +2797,7 @@ __print_funct_t render_pwr_wghfreq_stats(struct activity *a, int isdb, char *pre * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_pwr_usb_stats(struct activity *a, int isdb, char *pre, @@ -2868,7 +2868,7 @@ __print_funct_t render_pwr_usb_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_filesystem_stats(struct activity *a, int isdb, char *pre, @@ -2955,7 +2955,7 @@ __print_funct_t render_filesystem_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_fchost_stats(struct activity *a, int isdb, char *pre, @@ -3010,7 +3010,7 @@ __print_funct_t render_fchost_stats(struct activity *a, int isdb, char *pre, * @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. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t render_softnet_stats(struct activity *a, int isdb, char *pre, diff --git a/sa.h b/sa.h index 0fdc7a8..a09bfd1 100644 --- a/sa.h +++ b/sa.h @@ -569,9 +569,9 @@ struct file_activity { /* Header structure for every record */ struct record_header { /* - * Machine uptime in jiffies (independent of the number of processors). + * Machine uptime in 1/100th of a second. */ - unsigned long long uptime0; + unsigned long long uptime_cs; /* * Timestamp (number of seconds since the epoch). */ diff --git a/sa_common.c b/sa_common.c index 6527f17..b5796b6 100644 --- a/sa_common.c +++ b/sa_common.c @@ -183,8 +183,8 @@ char *get_devname(unsigned int major, unsigned int minor, int pretty) * 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. + * LINUX RESTART (in 1/100th of a second). + * @uptime Current system uptime (in 1/100th of a second). * @reset TRUE if @last_uptime should be reset with @uptime_ref. * @interval Interval of time. * @@ -200,13 +200,13 @@ int next_slice(unsigned long long uptime_ref, unsigned long long uptime, int min, max, pt1, pt2; double f; - /* uptime is expressed in jiffies (basis of 1 processor) */ + /* uptime is expressed in 1/100th of a second */ if (!last_uptime || reset) { last_uptime = uptime_ref; } /* Interval cannot be greater than 0xffffffff here */ - f = ((double) ((uptime - last_uptime) & 0xffffffff)) / HZ; + f = ((double) ((uptime - last_uptime) & 0xffffffff)) / 100; file_interval = (unsigned long) f; if ((f * 10) - (file_interval * 10) >= 5) { file_interval++; /* Rounding to correct value */ @@ -227,7 +227,7 @@ int next_slice(unsigned long long uptime_ref, unsigned long long uptime, * (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; + f = ((double) ((uptime - uptime_ref) & 0xffffffff)) / 100; entry = (unsigned long) f; if ((f * 10) - (entry * 10) >= 5) { entry++; @@ -505,7 +505,7 @@ int check_alt_sa_dir(char *datafile, int d_off, int sa_name) * @nr_proc Number of CPU, including CPU "all". * * OUT: - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ void get_itv_value(struct record_header *record_hdr_curr, @@ -513,8 +513,8 @@ void get_itv_value(struct record_header *record_hdr_curr, unsigned int nr_proc, unsigned long long *itv) { /* Interval value in jiffies */ - *itv = get_interval(record_hdr_prev->uptime0, - record_hdr_curr->uptime0); + *itv = get_interval(record_hdr_prev->uptime_cs, + record_hdr_curr->uptime_cs); } /* diff --git a/sadc.c b/sadc.c index b928565..65541e5 100644 --- a/sadc.c +++ b/sadc.c @@ -1066,8 +1066,8 @@ void read_stats(void) { int i; - /* Read system uptime in jiffies */ - read_uptime(&(record_hdr.uptime0)); + /* Read system uptime in 1/100th of a second */ + read_uptime(&(record_hdr.uptime_cs)); for (i = 0; i < NR_ACT; i++) { if (IS_COLLECTED(act[i]->options)) { diff --git a/sadf.c b/sadf.c index 9c3f9f8..dde0311 100644 --- a/sadf.c +++ b/sadf.c @@ -629,7 +629,7 @@ int generic_write_stats(int curr, int use_tm_start, int use_tm_end, int reset, * 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, + if (!next_slice(record_hdr[2].uptime_cs, record_hdr[curr].uptime_cs, reset, interval)) /* Not close enough to desired interval */ return 0; @@ -655,7 +655,7 @@ int generic_write_stats(int curr, int use_tm_start, int use_tm_end, int reset, /* it's too soon... */ return 0; - /* Get interval values */ + /* Get interval values in 1/100th of a second */ get_itv_value(&record_hdr[curr], &record_hdr[!curr], cpu_nr, &itv); @@ -666,9 +666,9 @@ int generic_write_stats(int curr, int use_tm_start, int use_tm_end, int reset, return 0; } - dt = itv / HZ; + dt = itv / 100; /* Correct rounding error for dt */ - if ((itv % HZ) >= (HZ / 2)) { + if ((itv % 100) >= 50) { dt++; } diff --git a/sar.c b/sar.c index e01ad50..d1dce7f 100644 --- a/sar.c +++ b/sar.c @@ -354,8 +354,8 @@ void write_stats_avg(int curr, int read_from_file, unsigned int act_id) if (cpu_nr < 0) cpu_nr = act[get_activity_position(act, A_CPU, EXIT_IF_NOT_FOUND)]->nr; - /* Interval value in jiffies */ - itv = get_interval(record_hdr[2].uptime0, record_hdr[curr].uptime0); + /* Interval value in 1/100th of a second */ + itv = get_interval(record_hdr[2].uptime_cs, record_hdr[curr].uptime_cs); strncpy(timestamp[curr], _("Average:"), TIMESTAMP_LEN); timestamp[curr][TIMESTAMP_LEN - 1] = '\0'; @@ -436,7 +436,7 @@ int write_stats(int curr, int read_from_file, long *cnt, int use_tm_start, /* Check time (1) */ if (read_from_file) { - if (!next_slice(record_hdr[2].uptime0, record_hdr[curr].uptime0, + if (!next_slice(record_hdr[2].uptime_cs, record_hdr[curr].uptime_cs, reset, interval)) /* Not close enough to desired interval */ return 0; @@ -480,7 +480,7 @@ int write_stats(int curr, int read_from_file, long *cnt, int use_tm_start, /* it's too soon... */ return 0; - /* Get interval values */ + /* Get interval value in 1/100th of a second */ get_itv_value(&record_hdr[curr], &record_hdr[!curr], cpu_nr, &itv); diff --git a/svg_stats.c b/svg_stats.c index bc5b03c..b1d6a88 100644 --- a/svg_stats.c +++ b/svg_stats.c @@ -62,7 +62,7 @@ unsigned int svg_colors[] = {0x00cc00, 0xff00bf, 0x00ffff, 0xff0000, * composing the structure. * @cs Pointer on current sample statistics structure. * @ps Pointer on previous sample statistics structure (may be NULL). - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. * @spmin Array containing min values already found for this activity. * @spmax Array containing max values already found for this activity. * @g_fields Index in spmin/spmax arrays where extrema values for each @@ -1001,7 +1001,7 @@ void draw_activity_graphs(int g_nr, int g_type[], char *title[], char *g_title[] * flag indicating that a restart record has been previously * found (.@restart), and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * Unused here. * @record_hdr Pointer on record header of current stats sample. *************************************************************************** @@ -1282,7 +1282,7 @@ __print_funct_t svg_print_cpu_stats(struct activity *a, int curr, int action, st * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -1345,7 +1345,7 @@ __print_funct_t svg_print_pcsw_stats(struct activity *a, int curr, int action, s * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -1407,7 +1407,7 @@ __print_funct_t svg_print_swap_stats(struct activity *a, int curr, int action, s * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -1495,7 +1495,7 @@ __print_funct_t svg_print_paging_stats(struct activity *a, int curr, int action, * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -1582,7 +1582,7 @@ __print_funct_t svg_print_io_stats(struct activity *a, int curr, int action, str * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -1809,7 +1809,7 @@ __print_funct_t svg_print_memory_stats(struct activity *a, int curr, int action, * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -1879,7 +1879,7 @@ __print_funct_t svg_print_ktables_stats(struct activity *a, int curr, int action * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -1963,7 +1963,7 @@ __print_funct_t svg_print_queue_stats(struct activity *a, int curr, int action, * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -2218,7 +2218,7 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -2422,7 +2422,7 @@ __print_funct_t svg_print_net_dev_stats(struct activity *a, int curr, int action * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -2612,7 +2612,7 @@ __print_funct_t svg_print_net_edev_stats(struct activity *a, int curr, int actio * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -2694,7 +2694,7 @@ __print_funct_t svg_print_net_nfs_stats(struct activity *a, int curr, int action * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -2800,7 +2800,7 @@ __print_funct_t svg_print_net_nfsd_stats(struct activity *a, int curr, int actio * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -2878,7 +2878,7 @@ __print_funct_t svg_print_net_sock_stats(struct activity *a, int curr, int actio * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -2967,7 +2967,7 @@ __print_funct_t svg_print_net_ip_stats(struct activity *a, int curr, int action, * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -3057,7 +3057,7 @@ __print_funct_t svg_print_net_eip_stats(struct activity *a, int curr, int action * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -3173,7 +3173,7 @@ __print_funct_t svg_print_net_icmp_stats(struct activity *a, int curr, int actio * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -3284,7 +3284,7 @@ __print_funct_t svg_print_net_eicmp_stats(struct activity *a, int curr, int acti * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -3356,7 +3356,7 @@ __print_funct_t svg_print_net_tcp_stats(struct activity *a, int curr, int action * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -3432,7 +3432,7 @@ __print_funct_t svg_print_net_etcp_stats(struct activity *a, int curr, int actio * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -3504,7 +3504,7 @@ __print_funct_t svg_print_net_udp_stats(struct activity *a, int curr, int action * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -3573,7 +3573,7 @@ __print_funct_t svg_print_net_sock6_stats(struct activity *a, int curr, int acti * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -3673,7 +3673,7 @@ __print_funct_t svg_print_net_ip6_stats(struct activity *a, int curr, int action * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -3778,7 +3778,7 @@ __print_funct_t svg_print_net_eip6_stats(struct activity *a, int curr, int actio * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -3908,7 +3908,7 @@ __print_funct_t svg_print_net_icmp6_stats(struct activity *a, int curr, int acti * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -4015,7 +4015,7 @@ __print_funct_t svg_print_net_eicmp6_stats(struct activity *a, int curr, int act * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -4087,7 +4087,7 @@ __print_funct_t svg_print_net_udp6_stats(struct activity *a, int curr, int actio * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (unused here). + * @itv Interval of time in 1/100th of a second (unused here). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -4173,7 +4173,7 @@ __print_funct_t svg_print_pwr_cpufreq_stats(struct activity *a, int curr, int ac * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (unused here). + * @itv Interval of time in 1/100th of a second (unused here). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -4246,7 +4246,7 @@ __print_funct_t svg_print_pwr_fan_stats(struct activity *a, int curr, int action * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (unused here). + * @itv Interval of time in 1/100th of a second (unused here). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -4340,7 +4340,7 @@ __print_funct_t svg_print_pwr_temp_stats(struct activity *a, int curr, int actio * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -4434,7 +4434,7 @@ __print_funct_t svg_print_pwr_in_stats(struct activity *a, int curr, int action, * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -4519,7 +4519,7 @@ __print_funct_t svg_print_huge_stats(struct activity *a, int curr, int action, s * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (unused here). + * @itv Interval of time in 1/100th of a second (unused here). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -4748,7 +4748,7 @@ __print_funct_t svg_print_filesystem_stats(struct activity *a, int curr, int act * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ @@ -4852,7 +4852,7 @@ __print_funct_t svg_print_fchost_stats(struct activity *a, int curr, int action, * flag indicating that a restart record has been previously * found (.@restart) and time used for the X axis origin * (@ust_time_ref). - * @itv Interval of time in jiffies (only with F_MAIN action). + * @itv Interval of time in 1/100th of a second (only with F_MAIN action). * @record_hdr Pointer on record header of current stats sample. *************************************************************************** */ diff --git a/xml_stats.c b/xml_stats.c index b5e06c3..34be014 100644 --- a/xml_stats.c +++ b/xml_stats.c @@ -101,8 +101,8 @@ void xml_markup_power_management(int tab, int action) * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies (independent of the number of - * processors). Unused here. + * @itv Interval of time in 1/100th of a second (independent of the + * number of processors). Unused here. *************************************************************************** */ __print_funct_t xml_print_cpu_stats(struct activity *a, int curr, int tab, @@ -274,7 +274,7 @@ __print_funct_t xml_print_cpu_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_pcsw_stats(struct activity *a, int curr, int tab, @@ -300,7 +300,7 @@ __print_funct_t xml_print_pcsw_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_irq_stats(struct activity *a, int curr, int tab, @@ -347,7 +347,7 @@ __print_funct_t xml_print_irq_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_swap_stats(struct activity *a, int curr, int tab, @@ -372,7 +372,7 @@ __print_funct_t xml_print_swap_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_paging_stats(struct activity *a, int curr, int tab, @@ -415,7 +415,7 @@ __print_funct_t xml_print_paging_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_io_stats(struct activity *a, int curr, int tab, @@ -460,7 +460,7 @@ __print_funct_t xml_print_io_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_memory_stats(struct activity *a, int curr, int tab, @@ -561,7 +561,7 @@ __print_funct_t xml_print_memory_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_ktables_stats(struct activity *a, int curr, int tab, @@ -589,7 +589,7 @@ __print_funct_t xml_print_ktables_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_queue_stats(struct activity *a, int curr, int tab, @@ -621,7 +621,7 @@ __print_funct_t xml_print_queue_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_serial_stats(struct activity *a, int curr, int tab, @@ -670,7 +670,7 @@ __print_funct_t xml_print_serial_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_disk_stats(struct activity *a, int curr, int tab, @@ -766,7 +766,7 @@ __print_funct_t xml_print_disk_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_dev_stats(struct activity *a, int curr, int tab, @@ -839,7 +839,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_edev_stats(struct activity *a, int curr, int tab, @@ -909,7 +909,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_nfs_stats(struct activity *a, int curr, int tab, @@ -954,7 +954,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_nfsd_stats(struct activity *a, int curr, int tab, @@ -1009,7 +1009,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_sock_stats(struct activity *a, int curr, int tab, @@ -1053,7 +1053,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_ip_stats(struct activity *a, int curr, int tab, @@ -1102,7 +1102,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_eip_stats(struct activity *a, int curr, int tab, @@ -1151,7 +1151,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_icmp_stats(struct activity *a, int curr, int tab, @@ -1212,7 +1212,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_eicmp_stats(struct activity *a, int curr, int tab, @@ -1269,7 +1269,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_tcp_stats(struct activity *a, int curr, int tab, @@ -1310,7 +1310,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_etcp_stats(struct activity *a, int curr, int tab, @@ -1353,7 +1353,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_udp_stats(struct activity *a, int curr, int tab, @@ -1394,7 +1394,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_sock6_stats(struct activity *a, int curr, int tab, @@ -1434,7 +1434,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_ip6_stats(struct activity *a, int curr, int tab, @@ -1487,7 +1487,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_eip6_stats(struct activity *a, int curr, int tab, @@ -1542,7 +1542,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_icmp6_stats(struct activity *a, int curr, int tab, @@ -1609,7 +1609,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_eicmp6_stats(struct activity *a, int curr, int tab, @@ -1664,7 +1664,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_net_udp6_stats(struct activity *a, int curr, int tab, @@ -1705,7 +1705,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_pwr_cpufreq_stats(struct activity *a, int curr, int tab, @@ -1763,7 +1763,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_pwr_fan_stats(struct activity *a, int curr, int tab, @@ -1807,7 +1807,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_pwr_temp_stats(struct activity *a, int curr, int tab, @@ -1853,7 +1853,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_pwr_in_stats(struct activity *a, int curr, int tab, @@ -1899,7 +1899,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_huge_stats(struct activity *a, int curr, int tab, @@ -1932,7 +1932,7 @@ __print_funct_t xml_print_huge_stats(struct activity *a, int curr, int tab, * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_pwr_wghfreq_stats(struct activity *a, int curr, int tab, @@ -2007,7 +2007,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_pwr_usb_stats(struct activity *a, int curr, int tab, @@ -2058,7 +2058,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_filesystem_stats(struct activity *a, int curr, int tab, @@ -2111,7 +2111,7 @@ __print_funct_t xml_print_filesystem_stats(struct activity *a, int curr, int tab * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_fchost_stats(struct activity *a, int curr, int tab, @@ -2162,7 +2162,7 @@ close_xml_markup: * @a Activity structure with statistics. * @curr Index in array for current sample statistics. * @tab Indentation in XML output. - * @itv Interval of time in jiffies. + * @itv Interval of time in 1/100th of a second. *************************************************************************** */ __print_funct_t xml_print_softnet_stats(struct activity *a, int curr, int tab, -- 2.40.0