2 * rndr_stats.c: Functions used by sadf to display statistics in selected format.
3 * (C) 1999-2022 by Sebastien GODARD (sysstat <at> orange.fr)
5 ***************************************************************************
6 * This program is free software; you can redistribute it and/or modify it *
7 * under the terms of the GNU General Public License as published by the *
8 * Free Software Foundation; either version 2 of the License, or (at your *
9 * option) any later version. *
11 * This program is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY *
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
16 * You should have received a copy of the GNU General Public License along *
17 * with this program; if not, write to the Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA *
19 ***************************************************************************
28 #include "rndr_stats.h"
33 #define _(string) gettext(string)
35 #define _(string) (string)
38 char *seps[] = {"\t", ";"};
40 extern uint64_t flags;
43 ***************************************************************************
45 * encapsulate a pair of ints or pair of char * into a static Cons and
46 * return a pointer to it.
48 * given: t - type of Cons {iv, sv}
49 * arg1 - unsigned long int (if iv), char * (if sv) to become
51 * arg2 - unsigned long int (if iv), char * (if sv) to become
54 * does: load a static Cons with values using the t parameter to
55 * guide pulling values from the arglist
57 * return: the address of its static Cons. If you need to keep
58 * the contents of this Cons, copy it somewhere before calling
59 * cons() against to avoid overwrite.
60 * ie. don't do this: f( cons( iv, i, j ), cons( iv, a, b ) );
61 ***************************************************************************
63 static Cons *cons(tcons t, ...)
72 c.a.i = va_arg(ap, unsigned long int);
73 c.b.i = va_arg(ap, unsigned long int);
76 c.a.s = va_arg(ap, char *);
77 c.b.s = va_arg(ap, char *);
84 ***************************************************************************
87 * given: isdb - flag, true if db printing, false if ppc printing
88 * pre - prefix string for output entries
89 * rflags - PT_.... rendering flags
90 * pptxt - printf-format text required for ppc output (may be null)
91 * dbtxt - printf-format text required for db output (may be null)
92 * mid - pptxt/dbtxt format args as a Cons.
93 * lluval - %llu printable arg (PT_USEINT must be set)
94 * dval - %.2f printable arg (used unless PT_USEINT is set)
95 * sval - %s printable arg (PT_USESTR must be set)
97 * does: print [pre<sep>]([dbtxt,arg,arg<sep>]|[pptxt,arg,arg<sep>]) \
98 * (luval|dval)(<sep>|\n)
101 ***************************************************************************
103 static void render(int isdb, char *pre, int rflags, const char *pptxt,
104 const char *dbtxt, Cons *mid, unsigned long long lluval,
105 double dval, char *sval)
107 static int newline = 1;
108 const char *txt[] = {pptxt, dbtxt};
110 /* Start a new line? */
111 if (newline && !DISPLAY_HORIZONTALLY(flags)) {
115 /* Terminate this one ? ppc always gets a newline */
116 newline = ((rflags & PT_NEWLIN) || !isdb);
121 printf("%s", seps[isdb]); /* Only if something actually gets printed */
124 /* Got format args? */
127 printf(txt[isdb], mid->a.i, mid->b.i);
130 printf(txt[isdb], mid->a.s, mid->b.s);
135 printf("%s", txt[isdb]);
139 if (rflags & PT_USEINT) {
140 printf("%s%llu", seps[isdb], lluval);
142 else if (rflags & PT_USESTR) {
143 printf("%s%s", seps[isdb], sval);
145 else if (rflags & PT_USERND) {
146 printf("%s%.0f", seps[isdb], dval);
148 else if (rflags & PT_NOFLAG) {
149 printf("%s%.2f", seps[isdb], dval);
157 ***************************************************************************
158 * Display CPU statistics in selected format.
161 * @a Activity structure with statistics.
162 * @isdb Flag, true if db printing, false if ppc printing.
163 * @pre Prefix string for output entries
164 * @curr Index in array for current sample statistics.
165 * @itv Interval of time in 1/100th of a second (independent of the
166 * number of processors). Unused here.
167 ***************************************************************************
169 __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
170 int curr, unsigned long long itv)
173 unsigned long long deltot_jiffies = 1;
174 struct stats_cpu *scc, *scp;
175 unsigned char offline_cpu_bitmap[BITMAP_SIZE(NR_CPUS)] = {0};
177 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
179 /* @nr[curr] cannot normally be greater than @nr_ini */
180 if (a->nr[curr] > a->nr_ini) {
181 a->nr_ini = a->nr[curr];
185 * Compute CPU "all" as sum of all individual CPU (on SMP machines)
186 * and look for offline CPU.
189 deltot_jiffies = get_global_cpu_statistics(a, !curr, curr,
190 flags, offline_cpu_bitmap);
193 for (i = 0; (i < a->nr_ini) && (i < a->bitmap->b_size + 1); i++) {
195 /* Should current CPU (including CPU "all") be displayed? */
196 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) ||
197 offline_cpu_bitmap[i >> 3] & (1 << (i & 0x07)))
198 /* Don't display CPU */
201 scc = (struct stats_cpu *) ((char *) a->buf[curr] + i * a->msize);
202 scp = (struct stats_cpu *) ((char *) a->buf[!curr] + i * a->msize);
205 /* This is CPU "all" */
206 if (a->nr_ini == 1) {
208 * This is a UP machine. In this case
209 * interval has still not been calculated.
211 deltot_jiffies = get_per_cpu_interval(scc, scp);
213 if (!deltot_jiffies) {
214 /* CPU "all" cannot be tickless */
218 if (DISPLAY_CPU_DEF(a->opt_flags)) {
220 PT_NOFLAG, /* that's zero but you know what it means */
221 "all\t%user", /* ppctext */
222 "-1", /* look! dbtext */
224 NOVAL, /* another 0, named for readability */
225 ll_sp_value(scp->cpu_user, scc->cpu_user, deltot_jiffies),
226 NULL); /* No string arg */
228 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
229 render(isdb, pre, PT_NOFLAG,
230 "all\t%usr", "-1", NULL,
232 (scc->cpu_user - scc->cpu_guest) < (scp->cpu_user - scp->cpu_guest) ?
234 ll_sp_value(scp->cpu_user - scp->cpu_guest,
235 scc->cpu_user - scc->cpu_guest,
240 if (DISPLAY_CPU_DEF(a->opt_flags)) {
241 render(isdb, pre, PT_NOFLAG,
242 "all\t%nice", NULL, NULL,
244 ll_sp_value(scp->cpu_nice, scc->cpu_nice, deltot_jiffies),
247 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
248 render(isdb, pre, PT_NOFLAG,
249 "all\t%nice", NULL, NULL,
251 (scc->cpu_nice - scc->cpu_guest_nice) < (scp->cpu_nice - scp->cpu_guest_nice) ?
253 ll_sp_value(scp->cpu_nice - scp->cpu_guest_nice,
254 scc->cpu_nice - scc->cpu_guest_nice,
259 if (DISPLAY_CPU_DEF(a->opt_flags)) {
260 render(isdb, pre, PT_NOFLAG,
261 "all\t%system", NULL, NULL,
263 ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq,
264 scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq,
268 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
269 render(isdb, pre, PT_NOFLAG,
270 "all\t%sys", NULL, NULL,
272 ll_sp_value(scp->cpu_sys, scc->cpu_sys, deltot_jiffies),
276 render(isdb, pre, PT_NOFLAG,
277 "all\t%iowait", NULL, NULL,
279 ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, deltot_jiffies),
282 render(isdb, pre, PT_NOFLAG,
283 "all\t%steal", NULL, NULL,
285 ll_sp_value(scp->cpu_steal, scc->cpu_steal, deltot_jiffies),
288 if (DISPLAY_CPU_ALL(a->opt_flags)) {
289 render(isdb, pre, PT_NOFLAG,
290 "all\t%irq", NULL, NULL,
292 ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, deltot_jiffies),
295 render(isdb, pre, PT_NOFLAG,
296 "all\t%soft", NULL, NULL,
298 ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, deltot_jiffies),
301 render(isdb, pre, PT_NOFLAG,
302 "all\t%guest", NULL, NULL,
304 ll_sp_value(scp->cpu_guest, scc->cpu_guest, deltot_jiffies),
307 render(isdb, pre, PT_NOFLAG,
308 "all\t%gnice", NULL, NULL,
310 ll_sp_value(scp->cpu_guest_nice, scc->cpu_guest_nice, deltot_jiffies),
314 render(isdb, pre, pt_newlin,
315 "all\t%idle", NULL, NULL,
317 (scc->cpu_idle < scp->cpu_idle) ?
319 ll_sp_value(scp->cpu_idle, scc->cpu_idle, deltot_jiffies),
324 * Recalculate itv for current proc.
325 * If the result is 0, then current CPU is a tickless one.
327 deltot_jiffies = get_per_cpu_interval(scc, scp);
329 if (DISPLAY_CPU_DEF(a->opt_flags)) {
330 render(isdb, pre, PT_NOFLAG,
331 "cpu%d\t%%user", /* ppc text with formatting */
332 "%d", /* db text with format char */
333 cons(iv, i - 1, NOVAL), /* how we pass format args */
336 0.0 : /* CPU is tickless */
337 ll_sp_value(scp->cpu_user, scc->cpu_user, deltot_jiffies),
340 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
341 render(isdb, pre, PT_NOFLAG,
342 "cpu%d\t%%usr", "%d", cons(iv, i - 1, NOVAL),
345 ((scc->cpu_user - scc->cpu_guest) < (scp->cpu_user - scp->cpu_guest))) ?
347 ll_sp_value(scp->cpu_user - scp->cpu_guest,
348 scc->cpu_user - scc->cpu_guest, deltot_jiffies),
352 if (DISPLAY_CPU_DEF(a->opt_flags)) {
353 render(isdb, pre, PT_NOFLAG,
354 "cpu%d\t%%nice", NULL, cons(iv, i - 1, NOVAL),
358 ll_sp_value(scp->cpu_nice, scc->cpu_nice, deltot_jiffies),
361 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
362 render(isdb, pre, PT_NOFLAG,
363 "cpu%d\t%%nice", NULL, cons(iv, i - 1, NOVAL),
366 ((scc->cpu_nice - scc->cpu_guest_nice) < (scp->cpu_nice - scp->cpu_guest_nice))) ?
368 ll_sp_value(scp->cpu_nice - scp->cpu_guest_nice,
369 scc->cpu_nice - scc->cpu_guest_nice, deltot_jiffies),
373 if (DISPLAY_CPU_DEF(a->opt_flags)) {
374 render(isdb, pre, PT_NOFLAG,
375 "cpu%d\t%%system", NULL, cons(iv, i - 1, NOVAL),
379 ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq,
380 scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq,
384 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
385 render(isdb, pre, PT_NOFLAG,
386 "cpu%d\t%%sys", NULL, cons(iv, i - 1, NOVAL),
390 ll_sp_value(scp->cpu_sys, scc->cpu_sys, deltot_jiffies),
394 render(isdb, pre, PT_NOFLAG,
395 "cpu%d\t%%iowait", NULL, cons(iv, i - 1, NOVAL),
399 ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, deltot_jiffies),
402 render(isdb, pre, PT_NOFLAG,
403 "cpu%d\t%%steal", NULL, cons(iv, i - 1, NOVAL),
407 ll_sp_value(scp->cpu_steal, scc->cpu_steal, deltot_jiffies),
410 if (DISPLAY_CPU_ALL(a->opt_flags)) {
411 render(isdb, pre, PT_NOFLAG,
412 "cpu%d\t%%irq", NULL, cons(iv, i - 1, NOVAL),
416 ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, deltot_jiffies),
419 render(isdb, pre, PT_NOFLAG,
420 "cpu%d\t%%soft", NULL, cons(iv, i - 1, NOVAL),
424 ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, deltot_jiffies),
427 render(isdb, pre, PT_NOFLAG,
428 "cpu%d\t%%guest", NULL, cons(iv, i - 1, NOVAL),
432 ll_sp_value(scp->cpu_guest, scc->cpu_guest, deltot_jiffies),
435 render(isdb, pre, PT_NOFLAG,
436 "cpu%d\t%%gnice", NULL, cons(iv, i - 1, NOVAL),
440 ll_sp_value(scp->cpu_guest_nice, scc->cpu_guest_nice, deltot_jiffies),
444 if (!deltot_jiffies) {
445 /* CPU is tickless */
446 render(isdb, pre, pt_newlin,
447 "cpu%d\t%%idle", NULL, cons(iv, i - 1, NOVAL),
453 render(isdb, pre, pt_newlin,
454 "cpu%d\t%%idle", NULL, cons(iv, i - 1, NOVAL),
456 (scc->cpu_idle < scp->cpu_idle) ?
458 ll_sp_value(scp->cpu_idle, scc->cpu_idle, deltot_jiffies),
466 ***************************************************************************
467 * Display task creation and context switch statistics in selected format.
470 * @a Activity structure with statistics.
471 * @isdb Flag, true if db printing, false if ppc printing.
472 * @pre Prefix string for output entries
473 * @curr Index in array for current sample statistics.
474 * @itv Interval of time in 1/100th of a second.
475 ***************************************************************************
477 __print_funct_t render_pcsw_stats(struct activity *a, int isdb, char *pre,
478 int curr, unsigned long long itv)
481 *spc = (struct stats_pcsw *) a->buf[curr],
482 *spp = (struct stats_pcsw *) a->buf[!curr];
484 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
486 /* The first one as an example */
487 render(isdb, /* db/ppc flag */
488 pre, /* the preformatted line leader */
489 PT_NOFLAG, /* is this the end of a db line? */
490 "-\tproc/s", /* ppc text */
492 NULL, /* db/ppc text format args (Cons *) */
493 NOVAL, /* %lu value (unused unless PT_USEINT) */
494 /* and %.2f value, used unless PT_USEINT */
495 S_VALUE(spp->processes, spc->processes, itv),
496 NULL); /* %s value */
498 render(isdb, pre, pt_newlin,
499 "-\tcswch/s", NULL, NULL,
501 S_VALUE(spp->context_switch, spc->context_switch, itv),
506 ***************************************************************************
507 * Display interrupts statistics in selected format.
510 * @a Activity structure with statistics.
511 * @isdb Flag, true if db printing, false if ppc printing.
512 * @pre Prefix string for output entries
513 * @curr Index in array for current sample statistics.
514 * @itv Interval of time in 1/100th of a second.
515 ***************************************************************************
517 __print_funct_t render_irq_stats(struct activity *a, int isdb, char *pre,
518 int curr, unsigned long long itv)
521 struct stats_irq *stc_cpu_irq, *stp_cpu_irq, *stc_cpuall_irq;
522 unsigned char masked_cpu_bitmap[BITMAP_SIZE(NR_CPUS)] = {0};
523 char cpu_name[32], ppc_txt[512];
526 /* @nr[curr] cannot normally be greater than @nr_ini */
527 if (a->nr[curr] > a->nr_ini) {
528 a->nr_ini = a->nr[curr];
531 /* Identify offline and unselected CPU, and keep persistent statistics values */
532 get_global_int_statistics(a, !curr, curr, flags, masked_cpu_bitmap);
534 for (i = 0; i < a->nr2; i++) {
536 stc_cpuall_irq = (struct stats_irq *) ((char *) a->buf[curr] + i * a->msize);
538 if (a->item_list != NULL) {
539 /* A list of devices has been entered on the command line */
540 if (!search_list_item(a->item_list, stc_cpuall_irq->irq_name))
541 /* Device not found */
546 for (c = 0; (c < a->nr[curr]) && (c < a->bitmap->b_size + 1); c++) {
548 stc_cpu_irq = (struct stats_irq *) ((char *) a->buf[curr] + c * a->msize * a->nr2
550 stp_cpu_irq = (struct stats_irq *) ((char *) a->buf[!curr] + c * a->msize * a->nr2
553 /* Should current CPU (including CPU "all") be displayed? */
554 if (masked_cpu_bitmap[c >> 3] & (1 << (c & 0x07)))
558 /* Compute value to be displayed */
559 dval = S_VALUE(stp_cpu_irq->irq_nr, stc_cpu_irq->irq_nr, itv);
561 /* Yes: Display it */
563 strcpy(cpu_name, "all");
565 /* If number of int has decreased for CPU "all" then display 0.00 */
566 if (stc_cpu_irq->irq_nr < stp_cpu_irq->irq_nr) {
571 snprintf(cpu_name, sizeof(cpu_name), "cpu%d", c - 1);
572 cpu_name[sizeof(cpu_name) - 1] = '\0';
574 snprintf(ppc_txt, sizeof(ppc_txt), "%s\t%s", stc_cpuall_irq->irq_name, cpu_name);
575 ppc_txt[sizeof(ppc_txt) - 1] = '\0';
578 render(isdb, pre, PT_NOFLAG,
580 isdb ? cons(sv, stc_cpuall_irq->irq_name, NOVAL)
581 : cons(sv, ppc_txt, NOVAL),
588 render(isdb, pre, PT_NOFLAG,
590 cons(sv, ppc_txt, NOVAL),
596 if (isdb && !DISPLAY_HORIZONTALLY(flags)) {
597 /* Print a newline chr and make sure that @pre text will be printed next time */
598 render(isdb, pre, PT_NEWLIN, NULL, NULL, NULL, NOVAL, NOVAL, NULL);
604 ***************************************************************************
605 * Display swapping statistics in selected format.
608 * @a Activity structure with statistics.
609 * @isdb Flag, true if db printing, false if ppc printing.
610 * @pre Prefix string for output entries
611 * @curr Index in array for current sample statistics.
612 * @itv Interval of time in 1/100th of a second.
613 ***************************************************************************
615 __print_funct_t render_swap_stats(struct activity *a, int isdb, char *pre,
616 int curr, unsigned long long itv)
619 *ssc = (struct stats_swap *) a->buf[curr],
620 *ssp = (struct stats_swap *) a->buf[!curr];
622 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
624 render(isdb, pre, PT_NOFLAG,
625 "-\tpswpin/s", NULL, NULL,
627 S_VALUE(ssp->pswpin, ssc->pswpin, itv),
629 render(isdb, pre, pt_newlin,
630 "-\tpswpout/s", NULL, NULL,
632 S_VALUE(ssp->pswpout, ssc->pswpout, itv),
637 ***************************************************************************
638 * Display paging statistics in selected format.
641 * @a Activity structure with statistics.
642 * @isdb Flag, true if db printing, false if ppc printing.
643 * @pre Prefix string for output entries
644 * @curr Index in array for current sample statistics.
645 * @itv Interval of time in 1/100th of a second.
646 ***************************************************************************
648 __print_funct_t render_paging_stats(struct activity *a, int isdb, char *pre,
649 int curr, unsigned long long itv)
652 *spc = (struct stats_paging *) a->buf[curr],
653 *spp = (struct stats_paging *) a->buf[!curr];
655 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
657 render(isdb, pre, PT_NOFLAG,
658 "-\tpgpgin/s", NULL, NULL,
660 S_VALUE(spp->pgpgin, spc->pgpgin, itv),
663 render(isdb, pre, PT_NOFLAG,
664 "-\tpgpgout/s", NULL, NULL,
666 S_VALUE(spp->pgpgout, spc->pgpgout, itv),
669 render(isdb, pre, PT_NOFLAG,
670 "-\tfault/s", NULL, NULL,
672 S_VALUE(spp->pgfault, spc->pgfault, itv),
675 render(isdb, pre, PT_NOFLAG,
676 "-\tmajflt/s", NULL, NULL,
678 S_VALUE(spp->pgmajfault, spc->pgmajfault, itv),
681 render(isdb, pre, PT_NOFLAG,
682 "-\tpgfree/s", NULL, NULL,
684 S_VALUE(spp->pgfree, spc->pgfree, itv),
687 render(isdb, pre, PT_NOFLAG,
688 "-\tpgscank/s", NULL, NULL,
690 S_VALUE(spp->pgscan_kswapd, spc->pgscan_kswapd, itv),
693 render(isdb, pre, PT_NOFLAG,
694 "-\tpgscand/s", NULL, NULL,
696 S_VALUE(spp->pgscan_direct, spc->pgscan_direct, itv),
699 render(isdb, pre, PT_NOFLAG,
700 "-\tpgsteal/s", NULL, NULL,
702 S_VALUE(spp->pgsteal, spc->pgsteal, itv),
705 render(isdb, pre, pt_newlin,
706 "-\t%vmeff", NULL, NULL,
708 (spc->pgscan_kswapd + spc->pgscan_direct -
709 spp->pgscan_kswapd - spp->pgscan_direct) ?
710 SP_VALUE(spp->pgsteal, spc->pgsteal,
711 spc->pgscan_kswapd + spc->pgscan_direct -
712 spp->pgscan_kswapd - spp->pgscan_direct) : 0.0,
717 ***************************************************************************
718 * Display I/O and transfer rate statistics in selected format.
721 * @a Activity structure with statistics.
722 * @isdb Flag, true if db printing, false if ppc printing.
723 * @pre Prefix string for output entries
724 * @curr Index in array for current sample statistics.
725 * @itv Interval of time in 1/100th of a second.
726 ***************************************************************************
728 __print_funct_t render_io_stats(struct activity *a, int isdb, char *pre,
729 int curr, unsigned long long itv)
732 *sic = (struct stats_io *) a->buf[curr],
733 *sip = (struct stats_io *) a->buf[!curr];
735 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
738 * If we get negative values, this is probably because
739 * one or more devices/filesystems have been unmounted.
740 * We display 0.0 in this case though we should rather tell
741 * the user that the value cannot be calculated here.
743 render(isdb, pre, PT_NOFLAG,
744 "-\ttps", NULL, NULL,
746 sic->dk_drive < sip->dk_drive ? 0.0 :
747 S_VALUE(sip->dk_drive, sic->dk_drive, itv),
750 render(isdb, pre, PT_NOFLAG,
751 "-\trtps", NULL, NULL,
753 sic->dk_drive_rio < sip->dk_drive_rio ? 0.0 :
754 S_VALUE(sip->dk_drive_rio, sic->dk_drive_rio, itv),
757 render(isdb, pre, PT_NOFLAG,
758 "-\twtps", NULL, NULL,
760 sic->dk_drive_wio < sip->dk_drive_wio ? 0.0 :
761 S_VALUE(sip->dk_drive_wio, sic->dk_drive_wio, itv),
764 render(isdb, pre, PT_NOFLAG,
765 "-\tdtps", NULL, NULL,
767 sic->dk_drive_dio < sip->dk_drive_dio ? 0.0 :
768 S_VALUE(sip->dk_drive_dio, sic->dk_drive_dio, itv),
771 render(isdb, pre, PT_NOFLAG,
772 "-\tbread/s", NULL, NULL,
774 sic->dk_drive_rblk < sip->dk_drive_rblk ? 0.0 :
775 S_VALUE(sip->dk_drive_rblk, sic->dk_drive_rblk, itv),
778 render(isdb, pre, PT_NOFLAG,
779 "-\tbwrtn/s", NULL, NULL,
781 sic->dk_drive_wblk < sip->dk_drive_wblk ? 0.0 :
782 S_VALUE(sip->dk_drive_wblk, sic->dk_drive_wblk, itv),
785 render(isdb, pre, pt_newlin,
786 "-\tbdscd/s", NULL, NULL,
788 sic->dk_drive_dblk < sip->dk_drive_dblk ? 0.0 :
789 S_VALUE(sip->dk_drive_dblk, sic->dk_drive_dblk, itv),
794 ***************************************************************************
795 * Display memory and swap statistics in selected format.
798 * @a Activity structure with statistics.
799 * @isdb Flag, true if db printing, false if ppc printing.
800 * @pre Prefix string for output entries
801 * @curr Index in array for current sample statistics.
802 * @itv Interval of time in 1/100th of a second.
803 ***************************************************************************
805 __print_funct_t render_memory_stats(struct activity *a, int isdb, char *pre,
806 int curr, unsigned long long itv)
809 *smc = (struct stats_memory *) a->buf[curr];
811 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
813 unsigned long long nousedmem;
815 if (DISPLAY_MEMORY(a->opt_flags)) {
817 nousedmem = smc->frmkb + smc->bufkb + smc->camkb + smc->slabkb;
818 if (nousedmem > smc->tlmkb) {
819 nousedmem = smc->tlmkb;
822 render(isdb, pre, PT_USEINT,
823 "-\tkbmemfree", NULL, NULL,
824 smc->frmkb, DNOVAL, NULL);
826 render(isdb, pre, PT_USEINT,
827 "-\tkbavail", NULL, NULL,
828 smc->availablekb, DNOVAL, NULL);
830 render(isdb, pre, PT_USEINT,
831 "-\tkbmemused", NULL, NULL,
832 smc->tlmkb - nousedmem, DNOVAL, NULL);
834 render(isdb, pre, PT_NOFLAG,
835 "-\t%memused", NULL, NULL, NOVAL,
837 SP_VALUE(nousedmem, smc->tlmkb, smc->tlmkb) :
840 render(isdb, pre, PT_USEINT,
841 "-\tkbbuffers", NULL, NULL,
842 smc->bufkb, DNOVAL, NULL);
844 render(isdb, pre, PT_USEINT,
845 "-\tkbcached", NULL, NULL,
846 smc->camkb, DNOVAL, NULL);
848 render(isdb, pre, PT_USEINT,
849 "-\tkbcommit", NULL, NULL,
850 smc->comkb, DNOVAL, NULL);
852 render(isdb, pre, PT_NOFLAG,
853 "-\t%commit", NULL, NULL, NOVAL,
854 (smc->tlmkb + smc->tlskb) ?
855 SP_VALUE(0, smc->comkb, smc->tlmkb + smc->tlskb) :
858 render(isdb, pre, PT_USEINT,
859 "-\tkbactive", NULL, NULL,
860 smc->activekb, DNOVAL, NULL);
862 render(isdb, pre, PT_USEINT,
863 "-\tkbinact", NULL, NULL,
864 smc->inactkb, DNOVAL, NULL);
866 ptn = DISPLAY_MEM_ALL(a->opt_flags) ? 0 : pt_newlin;
867 render(isdb, pre, PT_USEINT | ptn,
868 "-\tkbdirty", NULL, NULL,
869 smc->dirtykb, DNOVAL, NULL);
871 if (DISPLAY_MEM_ALL(a->opt_flags)) {
872 render(isdb, pre, PT_USEINT,
873 "-\tkbanonpg", NULL, NULL,
874 smc->anonpgkb, DNOVAL, NULL);
876 render(isdb, pre, PT_USEINT,
877 "-\tkbslab", NULL, NULL,
878 smc->slabkb, DNOVAL, NULL);
880 render(isdb, pre, PT_USEINT,
881 "-\tkbkstack", NULL, NULL,
882 smc->kstackkb, DNOVAL, NULL);
884 render(isdb, pre, PT_USEINT,
885 "-\tkbpgtbl", NULL, NULL,
886 smc->pgtblkb, DNOVAL, NULL);
888 render(isdb, pre, PT_USEINT | pt_newlin,
889 "-\tkbvmused", NULL, NULL,
890 smc->vmusedkb, DNOVAL, NULL);
894 if (DISPLAY_SWAP(a->opt_flags)) {
896 render(isdb, pre, PT_USEINT,
897 "-\tkbswpfree", NULL, NULL,
898 smc->frskb, DNOVAL, NULL);
900 render(isdb, pre, PT_USEINT,
901 "-\tkbswpused", NULL, NULL,
902 smc->tlskb - smc->frskb, DNOVAL, NULL);
904 render(isdb, pre, PT_NOFLAG,
905 "-\t%swpused", NULL, NULL, NOVAL,
907 SP_VALUE(smc->frskb, smc->tlskb, smc->tlskb) :
910 render(isdb, pre, PT_USEINT,
911 "-\tkbswpcad", NULL, NULL,
912 smc->caskb, DNOVAL, NULL);
914 render(isdb, pre, pt_newlin,
915 "-\t%swpcad", NULL, NULL, NOVAL,
916 (smc->tlskb - smc->frskb) ?
917 SP_VALUE(0, smc->caskb, smc->tlskb - smc->frskb) :
923 ***************************************************************************
924 * Display kernel tables statistics in selected format.
927 * @a Activity structure with statistics.
928 * @isdb Flag, true if db printing, false if ppc printing.
929 * @pre Prefix string for output entries
930 * @curr Index in array for current sample statistics.
931 * @itv Interval of time in 1/100th of a second.
932 ***************************************************************************
934 __print_funct_t render_ktables_stats(struct activity *a, int isdb, char *pre,
935 int curr, unsigned long long itv)
938 *skc = (struct stats_ktables *) a->buf[curr];
940 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
942 render(isdb, pre, PT_USEINT,
943 "-\tdentunusd", NULL, NULL,
944 skc->dentry_stat, DNOVAL, NULL);
946 render(isdb, pre, PT_USEINT,
947 "-\tfile-nr", NULL, NULL,
948 skc->file_used, DNOVAL, NULL);
950 render(isdb, pre, PT_USEINT,
951 "-\tinode-nr", NULL, NULL,
952 skc->inode_used, DNOVAL, NULL);
954 render(isdb, pre, PT_USEINT | pt_newlin,
955 "-\tpty-nr", NULL, NULL,
956 skc->pty_nr, DNOVAL, NULL);
960 ***************************************************************************
961 * Display queue and load statistics in selected format.
964 * @a Activity structure with statistics.
965 * @isdb Flag, true if db printing, false if ppc printing.
966 * @pre Prefix string for output entries
967 * @curr Index in array for current sample statistics.
968 * @itv Interval of time in 1/100th of a second.
969 ***************************************************************************
971 __print_funct_t render_queue_stats(struct activity *a, int isdb, char *pre,
972 int curr, unsigned long long itv)
975 *sqc = (struct stats_queue *) a->buf[curr];
977 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
979 render(isdb, pre, PT_USEINT,
980 "-\trunq-sz", NULL, NULL,
981 sqc->nr_running, DNOVAL, NULL);
983 render(isdb, pre, PT_USEINT,
984 "-\tplist-sz", NULL, NULL,
985 sqc->nr_threads, DNOVAL, NULL);
987 render(isdb, pre, PT_NOFLAG,
988 "-\tldavg-1", NULL, NULL,
990 (double) sqc->load_avg_1 / 100,
993 render(isdb, pre, PT_NOFLAG,
994 "-\tldavg-5", NULL, NULL,
996 (double) sqc->load_avg_5 / 100,
999 render(isdb, pre, PT_NOFLAG,
1000 "-\tldavg-15", NULL, NULL,
1002 (double) sqc->load_avg_15 / 100,
1005 render(isdb, pre, PT_USEINT | pt_newlin,
1006 "-\tblocked", NULL, NULL,
1007 sqc->procs_blocked, DNOVAL, NULL);
1011 ***************************************************************************
1012 * Display serial lines statistics in selected format.
1015 * @a Activity structure with statistics.
1016 * @isdb Flag, true if db printing, false if ppc printing.
1017 * @pre Prefix string for output entries
1018 * @curr Index in array for current sample statistics.
1019 * @itv Interval of time in 1/100th of a second.
1020 ***************************************************************************
1022 __print_funct_t render_serial_stats(struct activity *a, int isdb, char *pre,
1023 int curr, unsigned long long itv)
1025 int i, j, j0, found;
1026 struct stats_serial *ssc, *ssp;
1028 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
1030 for (i = 0; i < a->nr[curr]; i++) {
1034 if (a->nr[!curr] > 0) {
1035 ssc = (struct stats_serial *) ((char *) a->buf[curr] + i * a->msize);
1037 /* Look for corresponding serial line in previous iteration */
1040 if (j >= a->nr[!curr]) {
1041 j = a->nr[!curr] - 1;
1047 ssp = (struct stats_serial *) ((char *) a->buf[!curr] + j * a->msize);
1048 if (ssc->line == ssp->line) {
1052 if (++j >= a->nr[!curr]) {
1062 render(isdb, pre, PT_NOFLAG,
1063 "ttyS%d\trcvin/s", "%d",
1064 cons(iv, ssc->line, NOVAL),
1066 S_VALUE(ssp->rx, ssc->rx, itv),
1069 render(isdb, pre, PT_NOFLAG,
1070 "ttyS%d\txmtin/s", NULL,
1071 cons(iv, ssc->line, NOVAL),
1073 S_VALUE(ssp->tx, ssc->tx, itv),
1076 render(isdb, pre, PT_NOFLAG,
1077 "ttyS%d\tframerr/s", NULL,
1078 cons(iv, ssc->line, NOVAL),
1080 S_VALUE(ssp->frame, ssc->frame, itv),
1083 render(isdb, pre, PT_NOFLAG,
1084 "ttyS%d\tprtyerr/s", NULL,
1085 cons(iv, ssc->line, NOVAL),
1087 S_VALUE(ssp->parity, ssc->parity, itv),
1090 render(isdb, pre, PT_NOFLAG,
1091 "ttyS%d\tbrk/s", NULL,
1092 cons(iv, ssc->line, NOVAL),
1094 S_VALUE(ssp->brk, ssc->brk, itv),
1097 render(isdb, pre, pt_newlin,
1098 "ttyS%d\tovrun/s", NULL,
1099 cons(iv, ssc->line, NOVAL),
1101 S_VALUE(ssp->overrun, ssc->overrun, itv),
1107 ***************************************************************************
1108 * Display disks statistics in selected format.
1111 * @a Activity structure with statistics.
1112 * @isdb Flag, true if db printing, false if ppc printing.
1113 * @pre Prefix string for output entries
1114 * @curr Index in array for current sample statistics.
1115 * @itv Interval of time in 1/100th of a second.
1116 ***************************************************************************
1118 __print_funct_t render_disk_stats(struct activity *a, int isdb, char *pre,
1119 int curr, unsigned long long itv)
1122 struct stats_disk *sdc, *sdp, sdpzero;
1123 struct ext_disk_stats xds;
1126 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
1128 memset(&sdpzero, 0, STATS_DISK_SIZE);
1130 for (i = 0; i < a->nr[curr]; i++) {
1132 sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize);
1134 j = check_disk_reg(a, curr, !curr, i);
1136 /* This is a newly registered interface. Previous stats are zero */
1140 sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
1143 /* Get device name */
1144 dev_name = get_device_name(sdc->major, sdc->minor, sdc->wwn, sdc->part_nr,
1145 DISPLAY_PRETTY(flags), DISPLAY_PERSIST_NAME_S(flags),
1146 USE_STABLE_ID(flags), NULL);
1148 if (a->item_list != NULL) {
1149 /* A list of devices has been entered on the command line */
1150 if (!search_list_item(a->item_list, dev_name))
1151 /* Device not found */
1155 /* Compute extended stats (service time, etc.) */
1156 compute_ext_disk_stats(sdc, sdp, itv, &xds);
1158 render(isdb, pre, PT_NOFLAG,
1160 cons(sv, dev_name, NOVAL),
1162 S_VALUE(sdp->nr_ios, sdc->nr_ios, itv),
1165 render(isdb, pre, PT_NOFLAG,
1167 cons(sv, dev_name, NOVAL),
1169 S_VALUE(sdp->rd_sect, sdc->rd_sect, itv) / 2,
1172 render(isdb, pre, PT_NOFLAG,
1174 cons(sv, dev_name, NOVAL),
1176 S_VALUE(sdp->wr_sect, sdc->wr_sect, itv) / 2,
1179 render(isdb, pre, PT_NOFLAG,
1181 cons(sv, dev_name, NOVAL),
1183 S_VALUE(sdp->dc_sect, sdc->dc_sect, itv) / 2,
1186 render(isdb, pre, PT_NOFLAG,
1187 "%s\tareq-sz", NULL,
1188 cons(sv, dev_name, NOVAL),
1193 render(isdb, pre, PT_NOFLAG,
1195 cons(sv, dev_name, NOVAL),
1197 S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,
1200 render(isdb, pre, PT_NOFLAG,
1202 cons(sv, dev_name, NOVAL),
1207 render(isdb, pre, pt_newlin,
1209 cons(sv, dev_name, NOVAL),
1217 ***************************************************************************
1218 * Display network interfaces statistics in selected format.
1221 * @a Activity structure with statistics.
1222 * @isdb Flag, true if db printing, false if ppc printing.
1223 * @pre Prefix string for output entries
1224 * @curr Index in array for current sample statistics.
1225 * @itv Interval of time in 1/100th of a second.
1226 ***************************************************************************
1228 __print_funct_t render_net_dev_stats(struct activity *a, int isdb, char *pre,
1229 int curr, unsigned long long itv)
1232 struct stats_net_dev *sndc, *sndp, sndzero;
1233 double rxkb, txkb, ifutil;
1235 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
1237 memset(&sndzero, 0, STATS_NET_DEV_SIZE);
1239 for (i = 0; i < a->nr[curr]; i++) {
1241 sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize);
1243 if (a->item_list != NULL) {
1244 /* A list of devices has been entered on the command line */
1245 if (!search_list_item(a->item_list, sndc->interface))
1246 /* Device not found */
1250 j = check_net_dev_reg(a, curr, !curr, i);
1252 /* This is a newly registered interface. Previous stats are zero */
1256 sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize);
1259 render(isdb, pre, PT_NOFLAG,
1260 "%s\trxpck/s", "%s",
1261 cons(sv, sndc->interface, NOVAL), /* What if the format args are strings? */
1263 S_VALUE(sndp->rx_packets, sndc->rx_packets, itv),
1266 render(isdb, pre, PT_NOFLAG,
1267 "%s\ttxpck/s", NULL,
1268 cons(sv, sndc->interface, NOVAL),
1270 S_VALUE(sndp->tx_packets, sndc->tx_packets, itv),
1273 rxkb = S_VALUE(sndp->rx_bytes, sndc->rx_bytes, itv);
1274 render(isdb, pre, PT_NOFLAG,
1276 cons(sv, sndc->interface, NOVAL),
1281 txkb = S_VALUE(sndp->tx_bytes, sndc->tx_bytes, itv);
1282 render(isdb, pre, PT_NOFLAG,
1284 cons(sv, sndc->interface, NOVAL),
1289 render(isdb, pre, PT_NOFLAG,
1290 "%s\trxcmp/s", NULL,
1291 cons(sv, sndc->interface, NOVAL),
1293 S_VALUE(sndp->rx_compressed, sndc->rx_compressed, itv),
1296 render(isdb, pre, PT_NOFLAG,
1297 "%s\ttxcmp/s", NULL,
1298 cons(sv, sndc->interface, NOVAL),
1300 S_VALUE(sndp->tx_compressed, sndc->tx_compressed, itv),
1303 render(isdb, pre, PT_NOFLAG,
1304 "%s\trxmcst/s", NULL,
1305 cons(sv, sndc->interface, NOVAL),
1307 S_VALUE(sndp->multicast, sndc->multicast, itv),
1310 ifutil = compute_ifutil(sndc, rxkb, txkb);
1311 render(isdb, pre, pt_newlin,
1312 "%s\t%%ifutil", NULL,
1313 cons(sv, sndc->interface, NOVAL),
1321 ***************************************************************************
1322 * Display network interface errors statistics in selected format.
1325 * @a Activity structure with statistics.
1326 * @isdb Flag, true if db printing, false if ppc printing.
1327 * @pre Prefix string for output entries
1328 * @curr Index in array for current sample statistics.
1329 * @itv Interval of time in 1/100th of a second.
1330 ***************************************************************************
1332 __print_funct_t render_net_edev_stats(struct activity *a, int isdb, char *pre,
1333 int curr, unsigned long long itv)
1336 struct stats_net_edev *snedc, *snedp, snedzero;
1338 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
1340 memset(&snedzero, 0, STATS_NET_EDEV_SIZE);
1342 for (i = 0; i < a->nr[curr]; i++) {
1344 snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize);
1346 if (a->item_list != NULL) {
1347 /* A list of devices has been entered on the command line */
1348 if (!search_list_item(a->item_list, snedc->interface))
1349 /* Device not found */
1353 j = check_net_edev_reg(a, curr, !curr, i);
1355 /* This is a newly registered interface. Previous stats are zero */
1359 snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize);
1362 render(isdb, pre, PT_NOFLAG,
1363 "%s\trxerr/s", "%s",
1364 cons(sv, snedc->interface, NOVAL),
1366 S_VALUE(snedp->rx_errors, snedc->rx_errors, itv),
1369 render(isdb, pre, PT_NOFLAG,
1370 "%s\ttxerr/s", NULL,
1371 cons(sv, snedc->interface, NOVAL),
1373 S_VALUE(snedp->tx_errors, snedc->tx_errors, itv),
1376 render(isdb, pre, PT_NOFLAG,
1378 cons(sv, snedc->interface, NOVAL),
1380 S_VALUE(snedp->collisions, snedc->collisions, itv),
1383 render(isdb, pre, PT_NOFLAG,
1384 "%s\trxdrop/s", NULL,
1385 cons(sv, snedc->interface, NOVAL),
1387 S_VALUE(snedp->rx_dropped, snedc->rx_dropped, itv),
1390 render(isdb, pre, PT_NOFLAG,
1391 "%s\ttxdrop/s", NULL,
1392 cons(sv, snedc->interface, NOVAL),
1394 S_VALUE(snedp->tx_dropped, snedc->tx_dropped, itv),
1397 render(isdb, pre, PT_NOFLAG,
1398 "%s\ttxcarr/s", NULL,
1399 cons(sv, snedc->interface, NOVAL),
1401 S_VALUE(snedp->tx_carrier_errors, snedc->tx_carrier_errors, itv),
1404 render(isdb, pre, PT_NOFLAG,
1405 "%s\trxfram/s", NULL,
1406 cons(sv, snedc->interface, NOVAL),
1408 S_VALUE(snedp->rx_frame_errors, snedc->rx_frame_errors, itv),
1411 render(isdb, pre, PT_NOFLAG,
1412 "%s\trxfifo/s", NULL,
1413 cons(sv, snedc->interface, NOVAL),
1415 S_VALUE(snedp->rx_fifo_errors, snedc->rx_fifo_errors, itv),
1418 render(isdb, pre, pt_newlin,
1419 "%s\ttxfifo/s", NULL,
1420 cons(sv, snedc->interface, NOVAL),
1422 S_VALUE(snedp->tx_fifo_errors, snedc->tx_fifo_errors, itv),
1428 ***************************************************************************
1429 * Display NFS client statistics in selected format.
1432 * @a Activity structure with statistics.
1433 * @isdb Flag, true if db printing, false if ppc printing.
1434 * @pre Prefix string for output entries
1435 * @curr Index in array for current sample statistics.
1436 * @itv Interval of time in 1/100th of a second.
1437 ***************************************************************************
1439 __print_funct_t render_net_nfs_stats(struct activity *a, int isdb, char *pre,
1440 int curr, unsigned long long itv)
1442 struct stats_net_nfs
1443 *snnc = (struct stats_net_nfs *) a->buf[curr],
1444 *snnp = (struct stats_net_nfs *) a->buf[!curr];
1446 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
1448 render(isdb, pre, PT_NOFLAG,
1449 "-\tcall/s", NULL, NULL,
1451 S_VALUE(snnp->nfs_rpccnt, snnc->nfs_rpccnt, itv),
1454 render(isdb, pre, PT_NOFLAG,
1455 "-\tretrans/s", NULL, NULL,
1457 S_VALUE(snnp->nfs_rpcretrans, snnc->nfs_rpcretrans, itv),
1460 render(isdb, pre, PT_NOFLAG,
1461 "-\tread/s", NULL, NULL,
1463 S_VALUE(snnp->nfs_readcnt, snnc->nfs_readcnt, itv),
1466 render(isdb, pre, PT_NOFLAG,
1467 "-\twrite/s", NULL, NULL,
1469 S_VALUE(snnp->nfs_writecnt, snnc->nfs_writecnt, itv),
1472 render(isdb, pre, PT_NOFLAG,
1473 "-\taccess/s", NULL, NULL,
1475 S_VALUE(snnp->nfs_accesscnt, snnc->nfs_accesscnt, itv),
1478 render(isdb, pre, pt_newlin,
1479 "-\tgetatt/s", NULL, NULL,
1481 S_VALUE(snnp->nfs_getattcnt, snnc->nfs_getattcnt, itv),
1486 ***************************************************************************
1487 * Display NFS server statistics in selected format.
1490 * @a Activity structure with statistics.
1491 * @isdb Flag, true if db printing, false if ppc printing.
1492 * @pre Prefix string for output entries
1493 * @curr Index in array for current sample statistics.
1494 * @itv Interval of time in 1/100th of a second.
1495 ***************************************************************************
1497 __print_funct_t render_net_nfsd_stats(struct activity *a, int isdb, char *pre,
1498 int curr, unsigned long long itv)
1500 struct stats_net_nfsd
1501 *snndc = (struct stats_net_nfsd *) a->buf[curr],
1502 *snndp = (struct stats_net_nfsd *) a->buf[!curr];
1504 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
1506 render(isdb, pre, PT_NOFLAG,
1507 "-\tscall/s", NULL, NULL,
1509 S_VALUE(snndp->nfsd_rpccnt, snndc->nfsd_rpccnt, itv),
1512 render(isdb, pre, PT_NOFLAG,
1513 "-\tbadcall/s", NULL, NULL,
1515 S_VALUE(snndp->nfsd_rpcbad, snndc->nfsd_rpcbad, itv),
1518 render(isdb, pre, PT_NOFLAG,
1519 "-\tpacket/s", NULL, NULL,
1521 S_VALUE(snndp->nfsd_netcnt, snndc->nfsd_netcnt, itv),
1524 render(isdb, pre, PT_NOFLAG,
1525 "-\tudp/s", NULL, NULL,
1527 S_VALUE(snndp->nfsd_netudpcnt, snndc->nfsd_netudpcnt, itv),
1530 render(isdb, pre, PT_NOFLAG,
1531 "-\ttcp/s", NULL, NULL,
1533 S_VALUE(snndp->nfsd_nettcpcnt, snndc->nfsd_nettcpcnt, itv),
1536 render(isdb, pre, PT_NOFLAG,
1537 "-\thit/s", NULL, NULL,
1539 S_VALUE(snndp->nfsd_rchits, snndc->nfsd_rchits, itv),
1542 render(isdb, pre, PT_NOFLAG,
1543 "-\tmiss/s", NULL, NULL,
1545 S_VALUE(snndp->nfsd_rcmisses, snndc->nfsd_rcmisses, itv),
1548 render(isdb, pre, PT_NOFLAG,
1549 "-\tsread/s", NULL, NULL,
1551 S_VALUE(snndp->nfsd_readcnt, snndc->nfsd_readcnt, itv),
1554 render(isdb, pre, PT_NOFLAG,
1555 "-\tswrite/s", NULL, NULL,
1557 S_VALUE(snndp->nfsd_writecnt, snndc->nfsd_writecnt, itv),
1560 render(isdb, pre, PT_NOFLAG,
1561 "-\tsaccess/s", NULL, NULL,
1563 S_VALUE(snndp->nfsd_accesscnt, snndc->nfsd_accesscnt, itv),
1566 render(isdb, pre, pt_newlin,
1567 "-\tsgetatt/s", NULL, NULL,
1569 S_VALUE(snndp->nfsd_getattcnt, snndc->nfsd_getattcnt, itv),
1574 ***************************************************************************
1575 * Display network sockets statistics in selected format.
1578 * @a Activity structure with statistics.
1579 * @isdb Flag, true if db printing, false if ppc printing.
1580 * @pre Prefix string for output entries
1581 * @curr Index in array for current sample statistics.
1582 * @itv Interval of time in 1/100th of a second.
1583 ***************************************************************************
1585 __print_funct_t render_net_sock_stats(struct activity *a, int isdb, char *pre,
1586 int curr, unsigned long long itv)
1588 struct stats_net_sock
1589 *snsc = (struct stats_net_sock *) a->buf[curr];
1591 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
1593 render(isdb, pre, PT_USEINT,
1594 "-\ttotsck", NULL, NULL,
1595 (unsigned long long) snsc->sock_inuse, DNOVAL, NULL);
1597 render(isdb, pre, PT_USEINT,
1598 "-\ttcpsck", NULL, NULL,
1599 (unsigned long long) snsc->tcp_inuse, DNOVAL, NULL);
1601 render(isdb, pre, PT_USEINT,
1602 "-\tudpsck", NULL, NULL,
1603 (unsigned long long) snsc->udp_inuse, DNOVAL, NULL);
1605 render(isdb, pre, PT_USEINT,
1606 "-\trawsck", NULL, NULL,
1607 (unsigned long long) snsc->raw_inuse, DNOVAL, NULL);
1609 render(isdb, pre, PT_USEINT,
1610 "-\tip-frag", NULL, NULL,
1611 (unsigned long long) snsc->frag_inuse, DNOVAL, NULL);
1613 render(isdb, pre, PT_USEINT | pt_newlin,
1614 "-\ttcp-tw", NULL, NULL,
1615 (unsigned long long) snsc->tcp_tw, DNOVAL, NULL);
1619 ***************************************************************************
1620 * Display IP network statistics in selected format.
1623 * @a Activity structure with statistics.
1624 * @isdb Flag, true if db printing, false if ppc printing.
1625 * @pre Prefix string for output entries
1626 * @curr Index in array for current sample statistics.
1627 * @itv Interval of time in 1/100th of a second.
1628 ***************************************************************************
1630 __print_funct_t render_net_ip_stats(struct activity *a, int isdb, char *pre,
1631 int curr, unsigned long long itv)
1634 *snic = (struct stats_net_ip *) a->buf[curr],
1635 *snip = (struct stats_net_ip *) a->buf[!curr];
1637 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
1639 render(isdb, pre, PT_NOFLAG,
1640 "-\tirec/s", NULL, NULL,
1642 S_VALUE(snip->InReceives, snic->InReceives, itv),
1645 render(isdb, pre, PT_NOFLAG,
1646 "-\tfwddgm/s", NULL, NULL,
1648 S_VALUE(snip->ForwDatagrams, snic->ForwDatagrams, itv),
1651 render(isdb, pre, PT_NOFLAG,
1652 "-\tidel/s", NULL, NULL,
1654 S_VALUE(snip->InDelivers, snic->InDelivers, itv),
1657 render(isdb, pre, PT_NOFLAG,
1658 "-\torq/s", NULL, NULL,
1660 S_VALUE(snip->OutRequests, snic->OutRequests, itv),
1663 render(isdb, pre, PT_NOFLAG,
1664 "-\tasmrq/s", NULL, NULL,
1666 S_VALUE(snip->ReasmReqds, snic->ReasmReqds, itv),
1669 render(isdb, pre, PT_NOFLAG,
1670 "-\tasmok/s", NULL, NULL,
1672 S_VALUE(snip->ReasmOKs, snic->ReasmOKs, itv),
1675 render(isdb, pre, PT_NOFLAG,
1676 "-\tfragok/s", NULL, NULL,
1678 S_VALUE(snip->FragOKs, snic->FragOKs, itv),
1681 render(isdb, pre, pt_newlin,
1682 "-\tfragcrt/s", NULL, NULL,
1684 S_VALUE(snip->FragCreates, snic->FragCreates, itv),
1689 ***************************************************************************
1690 * Display IP network errors statistics in selected format.
1693 * @a Activity structure with statistics.
1694 * @isdb Flag, true if db printing, false if ppc printing.
1695 * @pre Prefix string for output entries
1696 * @curr Index in array for current sample statistics.
1697 * @itv Interval of time in 1/100th of a second.
1698 ***************************************************************************
1700 __print_funct_t render_net_eip_stats(struct activity *a, int isdb, char *pre,
1701 int curr, unsigned long long itv)
1703 struct stats_net_eip
1704 *sneic = (struct stats_net_eip *) a->buf[curr],
1705 *sneip = (struct stats_net_eip *) a->buf[!curr];
1707 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
1709 render(isdb, pre, PT_NOFLAG,
1710 "-\tihdrerr/s", NULL, NULL,
1712 S_VALUE(sneip->InHdrErrors, sneic->InHdrErrors, itv),
1715 render(isdb, pre, PT_NOFLAG,
1716 "-\tiadrerr/s", NULL, NULL,
1718 S_VALUE(sneip->InAddrErrors, sneic->InAddrErrors, itv),
1721 render(isdb, pre, PT_NOFLAG,
1722 "-\tiukwnpr/s", NULL, NULL,
1724 S_VALUE(sneip->InUnknownProtos, sneic->InUnknownProtos, itv),
1727 render(isdb, pre, PT_NOFLAG,
1728 "-\tidisc/s", NULL, NULL,
1730 S_VALUE(sneip->InDiscards, sneic->InDiscards, itv),
1733 render(isdb, pre, PT_NOFLAG,
1734 "-\todisc/s", NULL, NULL,
1736 S_VALUE(sneip->OutDiscards, sneic->OutDiscards, itv),
1739 render(isdb, pre, PT_NOFLAG,
1740 "-\tonort/s", NULL, NULL,
1742 S_VALUE(sneip->OutNoRoutes, sneic->OutNoRoutes, itv),
1745 render(isdb, pre, PT_NOFLAG,
1746 "-\tasmf/s", NULL, NULL,
1748 S_VALUE(sneip->ReasmFails, sneic->ReasmFails, itv),
1751 render(isdb, pre, pt_newlin,
1752 "-\tfragf/s", NULL, NULL,
1754 S_VALUE(sneip->FragFails, sneic->FragFails, itv),
1759 ***************************************************************************
1760 * Display ICMP network statistics in selected format.
1763 * @a Activity structure with statistics.
1764 * @isdb Flag, true if db printing, false if ppc printing.
1765 * @pre Prefix string for output entries
1766 * @curr Index in array for current sample statistics.
1767 * @itv Interval of time in 1/100th of a second.
1768 ***************************************************************************
1770 __print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre,
1771 int curr, unsigned long long itv)
1773 struct stats_net_icmp
1774 *snic = (struct stats_net_icmp *) a->buf[curr],
1775 *snip = (struct stats_net_icmp *) a->buf[!curr];
1777 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
1779 render(isdb, pre, PT_NOFLAG,
1780 "-\timsg/s", NULL, NULL,
1782 S_VALUE(snip->InMsgs, snic->InMsgs, itv),
1785 render(isdb, pre, PT_NOFLAG,
1786 "-\tomsg/s", NULL, NULL,
1788 S_VALUE(snip->OutMsgs, snic->OutMsgs, itv),
1791 render(isdb, pre, PT_NOFLAG,
1792 "-\tiech/s", NULL, NULL,
1794 S_VALUE(snip->InEchos, snic->InEchos, itv),
1797 render(isdb, pre, PT_NOFLAG,
1798 "-\tiechr/s", NULL, NULL,
1800 S_VALUE(snip->InEchoReps, snic->InEchoReps, itv),
1803 render(isdb, pre, PT_NOFLAG,
1804 "-\toech/s", NULL, NULL,
1806 S_VALUE(snip->OutEchos, snic->OutEchos, itv),
1809 render(isdb, pre, PT_NOFLAG,
1810 "-\toechr/s", NULL, NULL,
1812 S_VALUE(snip->OutEchoReps, snic->OutEchoReps, itv),
1815 render(isdb, pre, PT_NOFLAG,
1816 "-\titm/s", NULL, NULL,
1818 S_VALUE(snip->InTimestamps, snic->InTimestamps, itv),
1821 render(isdb, pre, PT_NOFLAG,
1822 "-\titmr/s", NULL, NULL,
1824 S_VALUE(snip->InTimestampReps, snic->InTimestampReps, itv),
1827 render(isdb, pre, PT_NOFLAG,
1828 "-\totm/s", NULL, NULL,
1830 S_VALUE(snip->OutTimestamps, snic->OutTimestamps, itv),
1833 render(isdb, pre, PT_NOFLAG,
1834 "-\totmr/s", NULL, NULL,
1836 S_VALUE(snip->OutTimestampReps, snic->OutTimestampReps, itv),
1839 render(isdb, pre, PT_NOFLAG,
1840 "-\tiadrmk/s", NULL, NULL,
1842 S_VALUE(snip->InAddrMasks, snic->InAddrMasks, itv),
1845 render(isdb, pre, PT_NOFLAG,
1846 "-\tiadrmkr/s", NULL, NULL,
1848 S_VALUE(snip->InAddrMaskReps, snic->InAddrMaskReps, itv),
1851 render(isdb, pre, PT_NOFLAG,
1852 "-\toadrmk/s", NULL, NULL,
1854 S_VALUE(snip->OutAddrMasks, snic->OutAddrMasks, itv),
1857 render(isdb, pre, pt_newlin,
1858 "-\toadrmkr/s", NULL, NULL,
1860 S_VALUE(snip->OutAddrMaskReps, snic->OutAddrMaskReps, itv),
1865 ***************************************************************************
1866 * Display ICMP error messages statistics in selected format.
1869 * @a Activity structure with statistics.
1870 * @isdb Flag, true if db printing, false if ppc printing.
1871 * @pre Prefix string for output entries
1872 * @curr Index in array for current sample statistics.
1873 * @itv Interval of time in 1/100th of a second.
1874 ***************************************************************************
1876 __print_funct_t render_net_eicmp_stats(struct activity *a, int isdb, char *pre,
1877 int curr, unsigned long long itv)
1879 struct stats_net_eicmp
1880 *sneic = (struct stats_net_eicmp *) a->buf[curr],
1881 *sneip = (struct stats_net_eicmp *) a->buf[!curr];
1883 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
1885 render(isdb, pre, PT_NOFLAG,
1886 "-\tierr/s", NULL, NULL,
1888 S_VALUE(sneip->InErrors, sneic->InErrors, itv),
1891 render(isdb, pre, PT_NOFLAG,
1892 "-\toerr/s", NULL, NULL,
1894 S_VALUE(sneip->OutErrors, sneic->OutErrors, itv),
1897 render(isdb, pre, PT_NOFLAG,
1898 "-\tidstunr/s", NULL, NULL,
1900 S_VALUE(sneip->InDestUnreachs, sneic->InDestUnreachs, itv),
1903 render(isdb, pre, PT_NOFLAG,
1904 "-\todstunr/s", NULL, NULL,
1906 S_VALUE(sneip->OutDestUnreachs, sneic->OutDestUnreachs, itv),
1909 render(isdb, pre, PT_NOFLAG,
1910 "-\titmex/s", NULL, NULL,
1912 S_VALUE(sneip->InTimeExcds, sneic->InTimeExcds, itv),
1915 render(isdb, pre, PT_NOFLAG,
1916 "-\totmex/s", NULL, NULL,
1918 S_VALUE(sneip->OutTimeExcds, sneic->OutTimeExcds, itv),
1921 render(isdb, pre, PT_NOFLAG,
1922 "-\tiparmpb/s", NULL, NULL,
1924 S_VALUE(sneip->InParmProbs, sneic->InParmProbs, itv),
1927 render(isdb, pre, PT_NOFLAG,
1928 "-\toparmpb/s", NULL, NULL,
1930 S_VALUE(sneip->OutParmProbs, sneic->OutParmProbs, itv),
1933 render(isdb, pre, PT_NOFLAG,
1934 "-\tisrcq/s", NULL, NULL,
1936 S_VALUE(sneip->InSrcQuenchs, sneic->InSrcQuenchs, itv),
1939 render(isdb, pre, PT_NOFLAG,
1940 "-\tosrcq/s", NULL, NULL,
1942 S_VALUE(sneip->OutSrcQuenchs, sneic->OutSrcQuenchs, itv),
1945 render(isdb, pre, PT_NOFLAG,
1946 "-\tiredir/s", NULL, NULL,
1948 S_VALUE(sneip->InRedirects, sneic->InRedirects, itv),
1951 render(isdb, pre, pt_newlin,
1952 "-\toredir/s", NULL, NULL,
1954 S_VALUE(sneip->OutRedirects, sneic->OutRedirects, itv),
1959 ***************************************************************************
1960 * Display TCP network statistics in selected format.
1963 * @a Activity structure with statistics.
1964 * @isdb Flag, true if db printing, false if ppc printing.
1965 * @pre Prefix string for output entries
1966 * @curr Index in array for current sample statistics.
1967 * @itv Interval of time in 1/100th of a second.
1968 ***************************************************************************
1970 __print_funct_t render_net_tcp_stats(struct activity *a, int isdb, char *pre,
1971 int curr, unsigned long long itv)
1973 struct stats_net_tcp
1974 *sntc = (struct stats_net_tcp *) a->buf[curr],
1975 *sntp = (struct stats_net_tcp *) a->buf[!curr];
1977 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
1979 render(isdb, pre, PT_NOFLAG,
1980 "-\tactive/s", NULL, NULL,
1982 S_VALUE(sntp->ActiveOpens, sntc->ActiveOpens, itv),
1985 render(isdb, pre, PT_NOFLAG,
1986 "-\tpassive/s", NULL, NULL,
1988 S_VALUE(sntp->PassiveOpens, sntc->PassiveOpens, itv),
1991 render(isdb, pre, PT_NOFLAG,
1992 "-\tiseg/s", NULL, NULL,
1994 S_VALUE(sntp->InSegs, sntc->InSegs, itv),
1997 render(isdb, pre, pt_newlin,
1998 "-\toseg/s", NULL, NULL,
2000 S_VALUE(sntp->OutSegs, sntc->OutSegs, itv),
2005 ***************************************************************************
2006 * Display TCP network errors statistics in selected format.
2009 * @a Activity structure with statistics.
2010 * @isdb Flag, true if db printing, false if ppc printing.
2011 * @pre Prefix string for output entries
2012 * @curr Index in array for current sample statistics.
2013 * @itv Interval of time in 1/100th of a second.
2014 ***************************************************************************
2016 __print_funct_t render_net_etcp_stats(struct activity *a, int isdb, char *pre,
2017 int curr, unsigned long long itv)
2019 struct stats_net_etcp
2020 *snetc = (struct stats_net_etcp *) a->buf[curr],
2021 *snetp = (struct stats_net_etcp *) a->buf[!curr];
2023 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2025 render(isdb, pre, PT_NOFLAG,
2026 "-\tatmptf/s", NULL, NULL,
2028 S_VALUE(snetp->AttemptFails, snetc->AttemptFails, itv),
2031 render(isdb, pre, PT_NOFLAG,
2032 "-\testres/s", NULL, NULL,
2034 S_VALUE(snetp->EstabResets, snetc->EstabResets, itv),
2037 render(isdb, pre, PT_NOFLAG,
2038 "-\tretrans/s", NULL, NULL,
2040 S_VALUE(snetp->RetransSegs, snetc->RetransSegs, itv),
2043 render(isdb, pre, PT_NOFLAG,
2044 "-\tisegerr/s", NULL, NULL,
2046 S_VALUE(snetp->InErrs, snetc->InErrs, itv),
2049 render(isdb, pre, pt_newlin,
2050 "-\torsts/s", NULL, NULL,
2052 S_VALUE(snetp->OutRsts, snetc->OutRsts, itv),
2057 ***************************************************************************
2058 * Display UDP network statistics in selected format.
2061 * @a Activity structure with statistics.
2062 * @isdb Flag, true if db printing, false if ppc printing.
2063 * @pre Prefix string for output entries
2064 * @curr Index in array for current sample statistics.
2065 * @itv Interval of time in 1/100th of a second.
2066 ***************************************************************************
2068 __print_funct_t render_net_udp_stats(struct activity *a, int isdb, char *pre,
2069 int curr, unsigned long long itv)
2071 struct stats_net_udp
2072 *snuc = (struct stats_net_udp *) a->buf[curr],
2073 *snup = (struct stats_net_udp *) a->buf[!curr];
2075 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2077 render(isdb, pre, PT_NOFLAG,
2078 "-\tidgm/s", NULL, NULL,
2080 S_VALUE(snup->InDatagrams, snuc->InDatagrams, itv),
2083 render(isdb, pre, PT_NOFLAG,
2084 "-\todgm/s", NULL, NULL,
2086 S_VALUE(snup->OutDatagrams, snuc->OutDatagrams, itv),
2089 render(isdb, pre, PT_NOFLAG,
2090 "-\tnoport/s", NULL, NULL,
2092 S_VALUE(snup->NoPorts, snuc->NoPorts, itv),
2095 render(isdb, pre, pt_newlin,
2096 "-\tidgmerr/s", NULL, NULL,
2098 S_VALUE(snup->InErrors, snuc->InErrors, itv),
2103 ***************************************************************************
2104 * Display IPv6 network sockets statistics in selected format.
2107 * @a Activity structure with statistics.
2108 * @isdb Flag, true if db printing, false if ppc printing.
2109 * @pre Prefix string for output entries
2110 * @curr Index in array for current sample statistics.
2111 * @itv Interval of time in 1/100th of a second.
2112 ***************************************************************************
2114 __print_funct_t render_net_sock6_stats(struct activity *a, int isdb, char *pre,
2115 int curr, unsigned long long itv)
2117 struct stats_net_sock6
2118 *snsc = (struct stats_net_sock6 *) a->buf[curr];
2120 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2122 render(isdb, pre, PT_USEINT,
2123 "-\ttcp6sck", NULL, NULL,
2124 (unsigned long long) snsc->tcp6_inuse, DNOVAL, NULL);
2126 render(isdb, pre, PT_USEINT,
2127 "-\tudp6sck", NULL, NULL,
2128 (unsigned long long) snsc->udp6_inuse, DNOVAL, NULL);
2130 render(isdb, pre, PT_USEINT,
2131 "-\traw6sck", NULL, NULL,
2132 (unsigned long long) snsc->raw6_inuse, DNOVAL, NULL);
2134 render(isdb, pre, PT_USEINT | pt_newlin,
2135 "-\tip6-frag", NULL, NULL,
2136 (unsigned long long) snsc->frag6_inuse, DNOVAL, NULL);
2140 ***************************************************************************
2141 * Display IPv6 network statistics in selected format.
2144 * @a Activity structure with statistics.
2145 * @isdb Flag, true if db printing, false if ppc printing.
2146 * @pre Prefix string for output entries
2147 * @curr Index in array for current sample statistics.
2148 * @itv Interval of time in 1/100th of a second.
2149 ***************************************************************************
2151 __print_funct_t render_net_ip6_stats(struct activity *a, int isdb, char *pre,
2152 int curr, unsigned long long itv)
2154 struct stats_net_ip6
2155 *snic = (struct stats_net_ip6 *) a->buf[curr],
2156 *snip = (struct stats_net_ip6 *) a->buf[!curr];
2158 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2160 render(isdb, pre, PT_NOFLAG,
2161 "-\tirec6/s", NULL, NULL,
2163 S_VALUE(snip->InReceives6, snic->InReceives6, itv),
2166 render(isdb, pre, PT_NOFLAG,
2167 "-\tfwddgm6/s", NULL, NULL,
2169 S_VALUE(snip->OutForwDatagrams6, snic->OutForwDatagrams6, itv),
2172 render(isdb, pre, PT_NOFLAG,
2173 "-\tidel6/s", NULL, NULL,
2175 S_VALUE(snip->InDelivers6, snic->InDelivers6, itv),
2178 render(isdb, pre, PT_NOFLAG,
2179 "-\torq6/s", NULL, NULL,
2181 S_VALUE(snip->OutRequests6, snic->OutRequests6, itv),
2184 render(isdb, pre, PT_NOFLAG,
2185 "-\tasmrq6/s", NULL, NULL,
2187 S_VALUE(snip->ReasmReqds6, snic->ReasmReqds6, itv),
2190 render(isdb, pre, PT_NOFLAG,
2191 "-\tasmok6/s", NULL, NULL,
2193 S_VALUE(snip->ReasmOKs6, snic->ReasmOKs6, itv),
2196 render(isdb, pre, PT_NOFLAG,
2197 "-\timcpck6/s", NULL, NULL,
2199 S_VALUE(snip->InMcastPkts6, snic->InMcastPkts6, itv),
2202 render(isdb, pre, PT_NOFLAG,
2203 "-\tomcpck6/s", NULL, NULL,
2205 S_VALUE(snip->OutMcastPkts6, snic->OutMcastPkts6, itv),
2208 render(isdb, pre, PT_NOFLAG,
2209 "-\tfragok6/s", NULL, NULL,
2211 S_VALUE(snip->FragOKs6, snic->FragOKs6, itv),
2214 render(isdb, pre, pt_newlin,
2215 "-\tfragcr6/s", NULL, NULL,
2217 S_VALUE(snip->FragCreates6, snic->FragCreates6, itv),
2222 ***************************************************************************
2223 * Display IPv6 network errors statistics in selected format.
2226 * @a Activity structure with statistics.
2227 * @isdb Flag, true if db printing, false if ppc printing.
2228 * @pre Prefix string for output entries
2229 * @curr Index in array for current sample statistics.
2230 * @itv Interval of time in 1/100th of a second.
2231 ***************************************************************************
2233 __print_funct_t render_net_eip6_stats(struct activity *a, int isdb, char *pre,
2234 int curr, unsigned long long itv)
2236 struct stats_net_eip6
2237 *sneic = (struct stats_net_eip6 *) a->buf[curr],
2238 *sneip = (struct stats_net_eip6 *) a->buf[!curr];
2240 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2242 render(isdb, pre, PT_NOFLAG,
2243 "-\tihdrer6/s", NULL, NULL,
2245 S_VALUE(sneip->InHdrErrors6, sneic->InHdrErrors6, itv),
2248 render(isdb, pre, PT_NOFLAG,
2249 "-\tiadrer6/s", NULL, NULL,
2251 S_VALUE(sneip->InAddrErrors6, sneic->InAddrErrors6, itv),
2254 render(isdb, pre, PT_NOFLAG,
2255 "-\tiukwnp6/s", NULL, NULL,
2257 S_VALUE(sneip->InUnknownProtos6, sneic->InUnknownProtos6, itv),
2260 render(isdb, pre, PT_NOFLAG,
2261 "-\ti2big6/s", NULL, NULL,
2263 S_VALUE(sneip->InTooBigErrors6, sneic->InTooBigErrors6, itv),
2266 render(isdb, pre, PT_NOFLAG,
2267 "-\tidisc6/s", NULL, NULL,
2269 S_VALUE(sneip->InDiscards6, sneic->InDiscards6, itv),
2272 render(isdb, pre, PT_NOFLAG,
2273 "-\todisc6/s", NULL, NULL,
2275 S_VALUE(sneip->OutDiscards6, sneic->OutDiscards6, itv),
2278 render(isdb, pre, PT_NOFLAG,
2279 "-\tinort6/s", NULL, NULL,
2281 S_VALUE(sneip->InNoRoutes6, sneic->InNoRoutes6, itv),
2284 render(isdb, pre, PT_NOFLAG,
2285 "-\tonort6/s", NULL, NULL,
2287 S_VALUE(sneip->OutNoRoutes6, sneic->OutNoRoutes6, itv),
2290 render(isdb, pre, PT_NOFLAG,
2291 "-\tasmf6/s", NULL, NULL,
2293 S_VALUE(sneip->ReasmFails6, sneic->ReasmFails6, itv),
2296 render(isdb, pre, PT_NOFLAG,
2297 "-\tfragf6/s", NULL, NULL,
2299 S_VALUE(sneip->FragFails6, sneic->FragFails6, itv),
2302 render(isdb, pre, pt_newlin,
2303 "-\titrpck6/s", NULL, NULL,
2305 S_VALUE(sneip->InTruncatedPkts6, sneic->InTruncatedPkts6, itv),
2310 ***************************************************************************
2311 * Display ICMPv6 network statistics in selected format.
2314 * @a Activity structure with statistics.
2315 * @isdb Flag, true if db printing, false if ppc printing.
2316 * @pre Prefix string for output entries
2317 * @curr Index in array for current sample statistics.
2318 * @itv Interval of time in 1/100th of a second.
2319 ***************************************************************************
2321 __print_funct_t render_net_icmp6_stats(struct activity *a, int isdb, char *pre,
2322 int curr, unsigned long long itv)
2324 struct stats_net_icmp6
2325 *snic = (struct stats_net_icmp6 *) a->buf[curr],
2326 *snip = (struct stats_net_icmp6 *) a->buf[!curr];
2328 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2330 render(isdb, pre, PT_NOFLAG,
2331 "-\timsg6/s", NULL, NULL,
2333 S_VALUE(snip->InMsgs6, snic->InMsgs6, itv),
2336 render(isdb, pre, PT_NOFLAG,
2337 "-\tomsg6/s", NULL, NULL,
2339 S_VALUE(snip->OutMsgs6, snic->OutMsgs6, itv),
2342 render(isdb, pre, PT_NOFLAG,
2343 "-\tiech6/s", NULL, NULL,
2345 S_VALUE(snip->InEchos6, snic->InEchos6, itv),
2348 render(isdb, pre, PT_NOFLAG,
2349 "-\tiechr6/s", NULL, NULL,
2351 S_VALUE(snip->InEchoReplies6, snic->InEchoReplies6, itv),
2354 render(isdb, pre, PT_NOFLAG,
2355 "-\toechr6/s", NULL, NULL,
2357 S_VALUE(snip->OutEchoReplies6, snic->OutEchoReplies6, itv),
2360 render(isdb, pre, PT_NOFLAG,
2361 "-\tigmbq6/s", NULL, NULL,
2363 S_VALUE(snip->InGroupMembQueries6, snic->InGroupMembQueries6, itv),
2366 render(isdb, pre, PT_NOFLAG,
2367 "-\tigmbr6/s", NULL, NULL,
2369 S_VALUE(snip->InGroupMembResponses6, snic->InGroupMembResponses6, itv),
2372 render(isdb, pre, PT_NOFLAG,
2373 "-\togmbr6/s", NULL, NULL,
2375 S_VALUE(snip->OutGroupMembResponses6, snic->OutGroupMembResponses6, itv),
2378 render(isdb, pre, PT_NOFLAG,
2379 "-\tigmbrd6/s", NULL, NULL,
2381 S_VALUE(snip->InGroupMembReductions6, snic->InGroupMembReductions6, itv),
2384 render(isdb, pre, PT_NOFLAG,
2385 "-\togmbrd6/s", NULL, NULL,
2387 S_VALUE(snip->OutGroupMembReductions6, snic->OutGroupMembReductions6, itv),
2390 render(isdb, pre, PT_NOFLAG,
2391 "-\tirtsol6/s", NULL, NULL,
2393 S_VALUE(snip->InRouterSolicits6, snic->InRouterSolicits6, itv),
2396 render(isdb, pre, PT_NOFLAG,
2397 "-\tortsol6/s", NULL, NULL,
2399 S_VALUE(snip->OutRouterSolicits6, snic->OutRouterSolicits6, itv),
2402 render(isdb, pre, PT_NOFLAG,
2403 "-\tirtad6/s", NULL, NULL,
2405 S_VALUE(snip->InRouterAdvertisements6, snic->InRouterAdvertisements6, itv),
2408 render(isdb, pre, PT_NOFLAG,
2409 "-\tinbsol6/s", NULL, NULL,
2411 S_VALUE(snip->InNeighborSolicits6, snic->InNeighborSolicits6, itv),
2414 render(isdb, pre, PT_NOFLAG,
2415 "-\tonbsol6/s", NULL, NULL,
2417 S_VALUE(snip->OutNeighborSolicits6, snic->OutNeighborSolicits6, itv),
2420 render(isdb, pre, PT_NOFLAG,
2421 "-\tinbad6/s", NULL, NULL,
2423 S_VALUE(snip->InNeighborAdvertisements6, snic->InNeighborAdvertisements6, itv),
2426 render(isdb, pre, pt_newlin,
2427 "-\tonbad6/s", NULL, NULL,
2429 S_VALUE(snip->OutNeighborAdvertisements6, snic->OutNeighborAdvertisements6, itv),
2434 ***************************************************************************
2435 * Display ICMPv6 error messages statistics in selected format.
2438 * @a Activity structure with statistics.
2439 * @isdb Flag, true if db printing, false if ppc printing.
2440 * @pre Prefix string for output entries
2441 * @curr Index in array for current sample statistics.
2442 * @itv Interval of time in 1/100th of a second.
2443 ***************************************************************************
2445 __print_funct_t render_net_eicmp6_stats(struct activity *a, int isdb, char *pre,
2446 int curr, unsigned long long itv)
2448 struct stats_net_eicmp6
2449 *sneic = (struct stats_net_eicmp6 *) a->buf[curr],
2450 *sneip = (struct stats_net_eicmp6 *) a->buf[!curr];
2452 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2454 render(isdb, pre, PT_NOFLAG,
2455 "-\tierr6/s", NULL, NULL,
2457 S_VALUE(sneip->InErrors6, sneic->InErrors6, itv),
2460 render(isdb, pre, PT_NOFLAG,
2461 "-\tidtunr6/s", NULL, NULL,
2463 S_VALUE(sneip->InDestUnreachs6, sneic->InDestUnreachs6, itv),
2466 render(isdb, pre, PT_NOFLAG,
2467 "-\todtunr6/s", NULL, NULL,
2469 S_VALUE(sneip->OutDestUnreachs6, sneic->OutDestUnreachs6, itv),
2472 render(isdb, pre, PT_NOFLAG,
2473 "-\titmex6/s", NULL, NULL,
2475 S_VALUE(sneip->InTimeExcds6, sneic->InTimeExcds6, itv),
2478 render(isdb, pre, PT_NOFLAG,
2479 "-\totmex6/s", NULL, NULL,
2481 S_VALUE(sneip->OutTimeExcds6, sneic->OutTimeExcds6, itv),
2484 render(isdb, pre, PT_NOFLAG,
2485 "-\tiprmpb6/s", NULL, NULL,
2487 S_VALUE(sneip->InParmProblems6, sneic->InParmProblems6, itv),
2490 render(isdb, pre, PT_NOFLAG,
2491 "-\toprmpb6/s", NULL, NULL,
2493 S_VALUE(sneip->OutParmProblems6, sneic->OutParmProblems6, itv),
2496 render(isdb, pre, PT_NOFLAG,
2497 "-\tiredir6/s", NULL, NULL,
2499 S_VALUE(sneip->InRedirects6, sneic->InRedirects6, itv),
2502 render(isdb, pre, PT_NOFLAG,
2503 "-\toredir6/s", NULL, NULL,
2505 S_VALUE(sneip->OutRedirects6, sneic->OutRedirects6, itv),
2508 render(isdb, pre, PT_NOFLAG,
2509 "-\tipck2b6/s", NULL, NULL,
2511 S_VALUE(sneip->InPktTooBigs6, sneic->InPktTooBigs6, itv),
2514 render(isdb, pre, pt_newlin,
2515 "-\topck2b6/s", NULL, NULL,
2517 S_VALUE(sneip->OutPktTooBigs6, sneic->OutPktTooBigs6, itv),
2522 ***************************************************************************
2523 * Display UDP6 network statistics in selected format.
2526 * @a Activity structure with statistics.
2527 * @isdb Flag, true if db printing, false if ppc printing.
2528 * @pre Prefix string for output entries
2529 * @curr Index in array for current sample statistics.
2530 * @itv Interval of time in 1/100th of a second.
2531 ***************************************************************************
2533 __print_funct_t render_net_udp6_stats(struct activity *a, int isdb, char *pre,
2534 int curr, unsigned long long itv)
2536 struct stats_net_udp6
2537 *snuc = (struct stats_net_udp6 *) a->buf[curr],
2538 *snup = (struct stats_net_udp6 *) a->buf[!curr];
2540 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2542 render(isdb, pre, PT_NOFLAG,
2543 "-\tidgm6/s", NULL, NULL,
2545 S_VALUE(snup->InDatagrams6, snuc->InDatagrams6, itv),
2548 render(isdb, pre, PT_NOFLAG,
2549 "-\todgm6/s", NULL, NULL,
2551 S_VALUE(snup->OutDatagrams6, snuc->OutDatagrams6, itv),
2554 render(isdb, pre, PT_NOFLAG,
2555 "-\tnoport6/s", NULL, NULL,
2557 S_VALUE(snup->NoPorts6, snuc->NoPorts6, itv),
2560 render(isdb, pre, pt_newlin,
2561 "-\tidgmer6/s", NULL, NULL,
2563 S_VALUE(snup->InErrors6, snuc->InErrors6, itv),
2568 ***************************************************************************
2569 * Display CPU frequency statistics in selected format.
2572 * @a Activity structure with statistics.
2573 * @isdb Flag, true if db printing, false if ppc printing.
2574 * @pre Prefix string for output entries
2575 * @curr Index in array for current sample statistics.
2576 * @itv Interval of time in 1/100th of a second.
2577 ***************************************************************************
2579 __print_funct_t render_pwr_cpufreq_stats(struct activity *a, int isdb, char *pre,
2580 int curr, unsigned long long itv)
2583 struct stats_pwr_cpufreq *spc;
2585 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2587 for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) {
2589 spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize);
2592 /* This CPU is offline: Don't display it */
2595 /* Should current CPU (including CPU "all") be displayed? */
2596 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))))
2601 /* This is CPU "all" */
2602 render(isdb, pre, pt_newlin,
2606 ((double) spc->cpufreq) / 100,
2610 render(isdb, pre, pt_newlin,
2612 "%d", cons(iv, i - 1, NOVAL),
2614 ((double) spc->cpufreq) / 100,
2621 ***************************************************************************
2622 * Display fan statistics in selected format.
2625 * @a Activity structure with statistics.
2626 * @isdb Flag, true if db printing, false if ppc printing.
2627 * @pre Prefix string for output entries
2628 * @curr Index in array for current sample statistics.
2629 * @itv Interval of time in 1/100th of a second.
2630 ***************************************************************************
2632 __print_funct_t render_pwr_fan_stats(struct activity *a, int isdb, char *pre,
2633 int curr, unsigned long long itv)
2636 struct stats_pwr_fan *spc;
2638 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2640 for (i = 0; i < a->nr[curr]; i++) {
2641 spc = (struct stats_pwr_fan *) ((char *) a->buf[curr] + i * a->msize);
2643 render(isdb, pre, PT_USESTR,
2646 cons(iv, i + 1, NOVAL),
2651 render(isdb, pre, PT_NOFLAG,
2654 cons(iv, i + 1, NOVAL),
2659 render(isdb, pre, pt_newlin,
2662 cons(iv, i + 1, NOVAL),
2664 spc->rpm - spc->rpm_min,
2670 ***************************************************************************
2671 * Display temperature statistics in selected format.
2674 * @a Activity structure with statistics.
2675 * @isdb Flag, true if db printing, false if ppc printing.
2676 * @pre Prefix string for output entries
2677 * @curr Index in array for current sample statistics.
2678 * @itv Interval of time in 1/100th of a second.
2679 ***************************************************************************
2681 __print_funct_t render_pwr_temp_stats(struct activity *a, int isdb, char *pre,
2682 int curr, unsigned long long itv)
2685 struct stats_pwr_temp *spc;
2687 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2689 for (i = 0; i < a->nr[curr]; i++) {
2690 spc = (struct stats_pwr_temp *) ((char *) a->buf[curr] + i * a->msize);
2692 render(isdb, pre, PT_USESTR,
2695 cons(iv, i + 1, NOVAL),
2700 render(isdb, pre, PT_NOFLAG,
2703 cons(iv, i + 1, NOVAL),
2708 render(isdb, pre, pt_newlin,
2711 cons(iv, i + 1, NOVAL),
2713 (spc->temp_max - spc->temp_min) ?
2714 (spc->temp - spc->temp_min) / (spc->temp_max - spc->temp_min) * 100 :
2721 ***************************************************************************
2722 * Display voltage inputs statistics in selected format.
2725 * @a Activity structure with statistics.
2726 * @isdb Flag, true if db printing, false if ppc printing.
2727 * @pre Prefix string for output entries
2728 * @curr Index in array for current sample statistics.
2729 * @itv Interval of time in 1/100th of a second.
2730 ***************************************************************************
2732 __print_funct_t render_pwr_in_stats(struct activity *a, int isdb, char *pre,
2733 int curr, unsigned long long itv)
2736 struct stats_pwr_in *spc;
2738 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2740 for (i = 0; i < a->nr[curr]; i++) {
2741 spc = (struct stats_pwr_in *) ((char *) a->buf[curr] + i * a->msize);
2743 render(isdb, pre, PT_USESTR,
2751 render(isdb, pre, PT_NOFLAG,
2759 render(isdb, pre, pt_newlin,
2764 (spc->in_max - spc->in_min) ?
2765 (spc->in - spc->in_min) / (spc->in_max - spc->in_min) * 100 :
2772 ***************************************************************************
2773 * Display huge pages statistics in selected format.
2776 * @a Activity structure with statistics.
2777 * @isdb Flag, true if db printing, false if ppc printing.
2778 * @pre Prefix string for output entries
2779 * @curr Index in array for current sample statistics.
2780 * @itv Interval of time in 1/100th of a second.
2781 ***************************************************************************
2783 __print_funct_t render_huge_stats(struct activity *a, int isdb, char *pre,
2784 int curr, unsigned long long itv)
2787 *smc = (struct stats_huge *) a->buf[curr];
2789 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2791 render(isdb, pre, PT_USEINT,
2792 "-\tkbhugfree", NULL, NULL,
2793 smc->frhkb, DNOVAL, NULL);
2795 render(isdb, pre, PT_USEINT,
2796 "-\tkbhugused", NULL, NULL,
2797 smc->tlhkb - smc->frhkb, DNOVAL, NULL);
2799 render(isdb, pre, PT_NOFLAG,
2800 "-\t%hugused", NULL, NULL, NOVAL,
2802 SP_VALUE(smc->frhkb, smc->tlhkb, smc->tlhkb) :
2805 render(isdb, pre, PT_USEINT,
2806 "-\tkbhugrsvd", NULL, NULL,
2807 smc->rsvdhkb, DNOVAL, NULL);
2809 render(isdb, pre, PT_USEINT | pt_newlin,
2810 "-\tkbhugsurp", NULL, NULL,
2811 smc->surphkb, DNOVAL, NULL);
2815 ***************************************************************************
2816 * Display weighted CPU frequency statistics in selected format.
2819 * @a Activity structure with statistics.
2820 * @isdb Flag, true if db printing, false if ppc printing.
2821 * @pre Prefix string for output entries
2822 * @curr Index in array for current sample statistics.
2823 * @itv Interval of time in 1/100th of a second.
2824 ***************************************************************************
2826 __print_funct_t render_pwr_wghfreq_stats(struct activity *a, int isdb, char *pre,
2827 int curr, unsigned long long itv)
2830 struct stats_pwr_wghfreq *spc, *spp, *spc_k, *spp_k;
2831 unsigned long long tis, tisfreq;
2833 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2835 for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) {
2837 spc = (struct stats_pwr_wghfreq *) ((char *) a->buf[curr] + i * a->msize * a->nr2);
2838 spp = (struct stats_pwr_wghfreq *) ((char *) a->buf[!curr] + i * a->msize * a->nr2);
2840 /* Should current CPU (including CPU "all") be displayed? */
2841 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))))
2848 for (k = 0; k < a->nr2; k++) {
2850 spc_k = (struct stats_pwr_wghfreq *) ((char *) spc + k * a->msize);
2853 spp_k = (struct stats_pwr_wghfreq *) ((char *) spp + k * a->msize);
2855 tisfreq += (spc_k->freq / 1000) *
2856 (spc_k->time_in_state - spp_k->time_in_state);
2857 tis += (spc_k->time_in_state - spp_k->time_in_state);
2861 /* This is CPU "all" */
2862 render(isdb, pre, pt_newlin,
2866 tis ? ((double) tisfreq) / tis : 0.0,
2870 render(isdb, pre, pt_newlin,
2872 "%d", cons(iv, i - 1, NOVAL),
2874 tis ? ((double) tisfreq) / tis : 0.0,
2881 ***************************************************************************
2882 * Display USB devices statistics in selected format.
2885 * @a Activity structure with statistics.
2886 * @isdb Flag, true if db printing, false if ppc printing.
2887 * @pre Prefix string for output entries
2888 * @curr Index in array for current sample statistics.
2889 * @itv Interval of time in 1/100th of a second.
2890 ***************************************************************************
2892 __print_funct_t render_pwr_usb_stats(struct activity *a, int isdb, char *pre,
2893 int curr, unsigned long long itv)
2896 struct stats_pwr_usb *suc;
2899 for (i = 0; i < a->nr[curr]; i++) {
2900 suc = (struct stats_pwr_usb *) ((char *) a->buf[curr] + i * a->msize);
2902 sprintf(id, "%x", suc->vendor_id);
2903 render(isdb, pre, PT_USESTR,
2906 cons(iv, suc->bus_nr, NOVAL),
2911 sprintf(id, "%x", suc->product_id);
2912 render(isdb, pre, PT_USESTR,
2915 cons(iv, suc->bus_nr, NOVAL),
2920 render(isdb, pre, PT_USEINT,
2923 cons(iv, suc->bus_nr, NOVAL),
2924 (unsigned long long) (suc->bmaxpower << 1),
2928 render(isdb, pre, PT_USESTR,
2931 cons(iv, suc->bus_nr, NOVAL),
2937 (DISPLAY_HORIZONTALLY(flags) ? PT_USESTR : PT_USESTR | PT_NEWLIN),
2940 cons(iv, suc->bus_nr, NOVAL),
2948 ***************************************************************************
2949 * Display filesystems statistics in selected format.
2952 * @a Activity structure with statistics.
2953 * @isdb Flag, true if db printing, false if ppc printing.
2954 * @pre Prefix string for output entries
2955 * @curr Index in array for current sample statistics.
2956 * @itv Interval of time in 1/100th of a second.
2957 ***************************************************************************
2959 __print_funct_t render_filesystem_stats(struct activity *a, int isdb, char *pre,
2960 int curr, unsigned long long itv)
2963 struct stats_filesystem *sfc;
2966 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
2968 for (i = 0; i < a->nr[curr]; i++) {
2969 sfc = (struct stats_filesystem *) ((char *) a->buf[curr] + i * a->msize);
2971 /* Get name to display (persistent or standard fs name, or mount point) */
2972 dev_name = get_fs_name_to_display(a, flags, sfc);
2974 if (a->item_list != NULL) {
2975 /* A list of devices has been entered on the command line */
2976 if (!search_list_item(a->item_list, dev_name))
2977 /* Device not found */
2981 render(isdb, pre, PT_USERND,
2984 cons(sv, dev_name, NOVAL),
2986 (double) sfc->f_bfree / 1024 / 1024,
2989 render(isdb, pre, PT_USERND,
2992 cons(sv, dev_name, NOVAL),
2994 (double) (sfc->f_blocks - sfc->f_bfree) / 1024 / 1024,
2997 render(isdb, pre, PT_NOFLAG,
3000 cons(sv, dev_name, NOVAL),
3002 sfc->f_blocks ? SP_VALUE(sfc->f_bfree, sfc->f_blocks, sfc->f_blocks)
3006 render(isdb, pre, PT_NOFLAG,
3009 cons(sv, dev_name, NOVAL),
3011 sfc->f_blocks ? SP_VALUE(sfc->f_bavail, sfc->f_blocks, sfc->f_blocks)
3015 render(isdb, pre, PT_USEINT,
3018 cons(sv, dev_name, NOVAL),
3023 render(isdb, pre, PT_USEINT,
3026 cons(sv, dev_name, NOVAL),
3027 sfc->f_files - sfc->f_ffree,
3031 render(isdb, pre, pt_newlin,
3034 cons(sv, dev_name, NOVAL),
3036 sfc->f_files ? SP_VALUE(sfc->f_ffree, sfc->f_files, sfc->f_files)
3043 ***************************************************************************
3044 * Display Fibre Channel HBA statistics in selected format.
3047 * @a Activity structure with statistics.
3048 * @isdb Flag, true if db printing, false if ppc printing.
3049 * @pre Prefix string for output entries
3050 * @curr Index in array for current sample statistics.
3051 * @itv Interval of time in 1/100th of a second.
3052 ***************************************************************************
3054 __print_funct_t render_fchost_stats(struct activity *a, int isdb, char *pre,
3055 int curr, unsigned long long itv)
3057 int i, j, j0, found;
3058 struct stats_fchost *sfcc, *sfcp, sfczero;
3060 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
3062 memset(&sfczero, 0, sizeof(struct stats_fchost));
3064 for (i = 0; i < a->nr[curr]; i++) {
3067 sfcc = (struct stats_fchost *) ((char *) a->buf[curr] + i * a->msize);
3069 if (a->nr[!curr] > 0) {
3070 /* Look for corresponding structure in previous iteration */
3073 if (j >= a->nr[!curr]) {
3074 j = a->nr[!curr] - 1;
3080 sfcp = (struct stats_fchost *) ((char *) a->buf[!curr] + j * a->msize);
3081 if (!strcmp(sfcc->fchost_name, sfcp->fchost_name)) {
3085 if (++j >= a->nr[!curr]) {
3093 /* This is a newly registered host */
3097 render(isdb, pre, PT_NOFLAG ,
3100 cons(sv, sfcc->fchost_name, NOVAL),
3102 S_VALUE(sfcp->f_rxframes, sfcc->f_rxframes, itv),
3104 render(isdb, pre, PT_NOFLAG,
3105 "%s\tfch_txf/s", NULL,
3106 cons(sv, sfcc->fchost_name, NOVAL),
3108 S_VALUE(sfcp->f_txframes, sfcc->f_txframes, itv),
3110 render(isdb, pre, PT_NOFLAG,
3111 "%s\tfch_rxw/s", NULL,
3112 cons(sv, sfcc->fchost_name, NOVAL),
3114 S_VALUE(sfcp->f_rxwords, sfcc->f_rxwords, itv),
3116 render(isdb, pre, pt_newlin,
3117 "%s\tfch_txw/s", NULL,
3118 cons(sv, sfcc->fchost_name, NOVAL),
3120 S_VALUE(sfcp->f_txwords, sfcc->f_txwords, itv),
3126 ***************************************************************************
3127 * Display softnet statistics in selected format.
3130 * @a Activity structure with statistics.
3131 * @isdb Flag, true if db printing, false if ppc printing.
3132 * @pre Prefix string for output entries
3133 * @curr Index in array for current sample statistics.
3134 * @itv Interval of time in 1/100th of a second.
3135 ***************************************************************************
3137 __print_funct_t render_softnet_stats(struct activity *a, int isdb, char *pre,
3138 int curr, unsigned long long itv)
3141 struct stats_softnet *ssnc, *ssnp;
3142 unsigned char offline_cpu_bitmap[BITMAP_SIZE(NR_CPUS)] = {0};
3144 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
3146 /* @nr[curr] cannot normally be greater than @nr_ini */
3147 if (a->nr[curr] > a->nr_ini) {
3148 a->nr_ini = a->nr[curr];
3151 /* Compute statistics for CPU "all" */
3152 get_global_soft_statistics(a, !curr, curr, flags, offline_cpu_bitmap);
3154 for (i = 0; (i < a->nr_ini) && (i < a->bitmap->b_size + 1); i++) {
3157 * Note: a->nr is in [1, NR_CPUS + 1].
3158 * Bitmap size is provided for (NR_CPUS + 1) CPUs.
3159 * Anyway, NR_CPUS may vary between the version of sysstat
3160 * used by sadc to create a file, and the version of sysstat
3161 * used by sar to read it...
3163 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) ||
3164 offline_cpu_bitmap[i >> 3] & (1 << (i & 0x07)))
3169 * The size of a->buf[...] CPU structure may be different from the default
3170 * sizeof(struct stats_pwr_cpufreq) value if data have been read from a file!
3171 * That's why we don't use a syntax like:
3172 * ssnc = (struct stats_softnet *) a->buf[...] + i;
3174 ssnc = (struct stats_softnet *) ((char *) a->buf[curr] + i * a->msize);
3175 ssnp = (struct stats_softnet *) ((char *) a->buf[!curr] + i * a->msize);
3178 /* This is CPU "all" */
3179 render(isdb, pre, PT_NOFLAG,
3183 S_VALUE(ssnp->processed, ssnc->processed, itv),
3186 render(isdb, pre, PT_NOFLAG,
3190 S_VALUE(ssnp->dropped, ssnc->dropped, itv),
3193 render(isdb, pre, PT_NOFLAG,
3197 S_VALUE(ssnp->time_squeeze, ssnc->time_squeeze, itv),
3200 render(isdb, pre, PT_NOFLAG,
3204 S_VALUE(ssnp->received_rps, ssnc->received_rps, itv),
3207 render(isdb, pre, PT_NOFLAG,
3211 S_VALUE(ssnp->flow_limit, ssnc->flow_limit, itv),
3214 render(isdb, pre, PT_USEINT | pt_newlin,
3222 render(isdb, pre, PT_NOFLAG,
3224 "%d", cons(iv, i - 1, NOVAL),
3226 S_VALUE(ssnp->processed, ssnc->processed, itv),
3229 render(isdb, pre, PT_NOFLAG,
3231 NULL, cons(iv, i - 1, NOVAL),
3233 S_VALUE(ssnp->dropped, ssnc->dropped, itv),
3236 render(isdb, pre, PT_NOFLAG,
3238 NULL, cons(iv, i - 1, NOVAL),
3240 S_VALUE(ssnp->time_squeeze, ssnc->time_squeeze, itv),
3243 render(isdb, pre, PT_NOFLAG,
3245 NULL, cons(iv, i - 1, NOVAL),
3247 S_VALUE(ssnp->received_rps, ssnc->received_rps, itv),
3250 render(isdb, pre, PT_NOFLAG,
3252 NULL, cons(iv, i - 1, NOVAL),
3254 S_VALUE(ssnp->flow_limit, ssnc->flow_limit, itv),
3257 render(isdb, pre, PT_USEINT | pt_newlin,
3259 NULL, cons(iv, i - 1, NOVAL),
3268 ***************************************************************************
3269 * Display pressure-stall CPU statistics in selected format.
3272 * @a Activity structure with statistics.
3273 * @isdb Flag, true if db printing, false if ppc printing.
3274 * @pre Prefix string for output entries
3275 * @curr Index in array for current sample statistics.
3276 * @itv Interval of time in 1/100th of a second.
3277 ***************************************************************************
3279 __print_funct_t render_psicpu_stats(struct activity *a, int isdb, char *pre,
3280 int curr, unsigned long long itv)
3282 struct stats_psi_cpu
3283 *psic = (struct stats_psi_cpu *) a->buf[curr],
3284 *psip = (struct stats_psi_cpu *) a->buf[!curr];
3286 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
3288 render(isdb, pre, PT_NOFLAG,
3289 "-\t%scpu-10", NULL, NULL,
3291 (double) psic->some_acpu_10 / 100,
3294 render(isdb, pre, PT_NOFLAG,
3295 "-\t%scpu-60", NULL, NULL,
3297 (double) psic->some_acpu_60 / 100,
3300 render(isdb, pre, PT_NOFLAG,
3301 "-\t%scpu-300", NULL, NULL,
3303 (double) psic->some_acpu_300 / 100,
3306 render(isdb, pre, pt_newlin,
3307 "-\t%scpu", NULL, NULL,
3309 ((double) psic->some_cpu_total - psip->some_cpu_total) / (100 * itv),
3314 ***************************************************************************
3315 * Display pressure-stall I/O statistics in selected format.
3318 * @a Activity structure with statistics.
3319 * @isdb Flag, true if db printing, false if ppc printing.
3320 * @pre Prefix string for output entries
3321 * @curr Index in array for current sample statistics.
3322 * @itv Interval of time in 1/100th of a second.
3323 ***************************************************************************
3325 __print_funct_t render_psiio_stats(struct activity *a, int isdb, char *pre,
3326 int curr, unsigned long long itv)
3329 *psic = (struct stats_psi_io *) a->buf[curr],
3330 *psip = (struct stats_psi_io *) a->buf[!curr];
3332 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
3334 render(isdb, pre, PT_NOFLAG,
3335 "-\t%sio-10", NULL, NULL,
3337 (double) psic->some_aio_10 / 100,
3340 render(isdb, pre, PT_NOFLAG,
3341 "-\t%sio-60", NULL, NULL,
3343 (double) psic->some_aio_60 / 100,
3346 render(isdb, pre, PT_NOFLAG,
3347 "-\t%sio-300", NULL, NULL,
3349 (double) psic->some_aio_300 / 100,
3352 render(isdb, pre, PT_NOFLAG,
3353 "-\t%sio", NULL, NULL,
3355 ((double) psic->some_io_total - psip->some_io_total) / (100 * itv),
3358 render(isdb, pre, PT_NOFLAG,
3359 "-\t%fio-10", NULL, NULL,
3361 (double) psic->full_aio_10 / 100,
3364 render(isdb, pre, PT_NOFLAG,
3365 "-\t%fio-60", NULL, NULL,
3367 (double) psic->full_aio_60 / 100,
3370 render(isdb, pre, PT_NOFLAG,
3371 "-\t%fio-300", NULL, NULL,
3373 (double) psic->full_aio_300 / 100,
3376 render(isdb, pre, pt_newlin,
3377 "-\t%fio", NULL, NULL,
3379 ((double) psic->full_io_total - psip->full_io_total) / (100 * itv),
3384 ***************************************************************************
3385 * Display pressure-stall memory statistics in selected format.
3388 * @a Activity structure with statistics.
3389 * @isdb Flag, true if db printing, false if ppc printing.
3390 * @pre Prefix string for output entries
3391 * @curr Index in array for current sample statistics.
3392 * @itv Interval of time in 1/100th of a second.
3393 ***************************************************************************
3395 __print_funct_t render_psimem_stats(struct activity *a, int isdb, char *pre,
3396 int curr, unsigned long long itv)
3398 struct stats_psi_mem
3399 *psic = (struct stats_psi_mem *) a->buf[curr],
3400 *psip = (struct stats_psi_mem *) a->buf[!curr];
3402 = PT_NOFLAG + (DISPLAY_HORIZONTALLY(flags) ? 0 : PT_NEWLIN);
3404 render(isdb, pre, PT_NOFLAG,
3405 "-\t%smem-10", NULL, NULL,
3407 (double) psic->some_amem_10 / 100,
3410 render(isdb, pre, PT_NOFLAG,
3411 "-\t%smem-60", NULL, NULL,
3413 (double) psic->some_amem_60 / 100,
3416 render(isdb, pre, PT_NOFLAG,
3417 "-\t%smem-300", NULL, NULL,
3419 (double) psic->some_amem_300 / 100,
3422 render(isdb, pre, PT_NOFLAG,
3423 "-\t%smem", NULL, NULL,
3425 ((double) psic->some_mem_total - psip->some_mem_total) / (100 * itv),
3428 render(isdb, pre, PT_NOFLAG,
3429 "-\t%fmem-10", NULL, NULL,
3431 (double) psic->full_amem_10 / 100,
3434 render(isdb, pre, PT_NOFLAG,
3435 "-\t%fmem-60", NULL, NULL,
3437 (double) psic->full_amem_60 / 100,
3440 render(isdb, pre, PT_NOFLAG,
3441 "-\t%fmem-300", NULL, NULL,
3443 (double) psic->full_amem_300 / 100,
3446 render(isdb, pre, pt_newlin,
3447 "-\t%fmem", NULL, NULL,
3449 ((double) psic->full_mem_total - psip->full_mem_total) / (100 * itv),