2 * rndr_stats.c: Funtions used by sadf to display statistics in selected format.
3 * (C) 1999-2016 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 unsigned int flags;
41 extern unsigned int dm_major;
44 ***************************************************************************
46 * encapsulate a pair of ints or pair of char * into a static Cons and
47 * return a pointer to it.
49 * given: t - type of Cons {iv, sv}
50 * arg1 - unsigned long int (if iv), char * (if sv) to become
52 * arg2 - unsigned long int (if iv), char * (if sv) to become
55 * does: load a static Cons with values using the t parameter to
56 * guide pulling values from the arglist
58 * return: the address of its static Cons. If you need to keep
59 * the contents of this Cons, copy it somewhere before calling
60 * cons() against to avoid overwrite.
61 * ie. don't do this: f( cons( iv, i, j ), cons( iv, a, b ) );
62 ***************************************************************************
64 static Cons *cons(tcons t, ...)
73 c.a.i = va_arg(ap, unsigned long int);
74 c.b.i = va_arg(ap, unsigned long int);
77 c.a.s = va_arg(ap, char *);
78 c.b.s = va_arg(ap, char *);
85 ***************************************************************************
88 * given: isdb - flag, true if db printing, false if ppc printing
89 * pre - prefix string for output entries
90 * rflags - PT_.... rendering flags
91 * pptxt - printf-format text required for ppc output (may be null)
92 * dbtxt - printf-format text required for db output (may be null)
93 * mid - pptxt/dbtxt format args as a Cons.
94 * luval - %lu printable arg (PT_USEINT must be set)
95 * dval - %.2f printable arg (used unless PT_USEINT is set)
96 * sval - %s printable arg (PT_USESTR must be set)
98 * does: print [pre<sep>]([dbtxt,arg,arg<sep>]|[pptxt,arg,arg<sep>]) \
99 * (luval|dval)(<sep>|\n)
102 ***************************************************************************
104 static void render(int isdb, char *pre, int rflags, const char *pptxt,
105 const char *dbtxt, Cons *mid, unsigned long int luval,
106 double dval, char *sval)
108 static int newline = 1;
109 const char *txt[] = {pptxt, dbtxt};
111 /* Start a new line? */
112 if (newline && !DISPLAY_HORIZONTALLY(flags)) {
116 /* Terminate this one ? ppc always gets a newline */
117 newline = ((rflags & PT_NEWLIN) || !isdb);
122 printf("%s", seps[isdb]); /* Only if something actually gets printed */
125 /* Got format args? */
128 printf(txt[isdb], mid->a.i, mid->b.i);
131 printf(txt[isdb], mid->a.s, mid->b.s);
137 * Additional NULL parameter below works around
138 * fatal error when compiled with -Werror=format-security.
140 printf(txt[isdb], NULL); /* No args */
144 if (rflags & PT_USEINT) {
145 printf("%s%lu", seps[isdb], luval);
147 else if (rflags & PT_USESTR) {
148 printf("%s%s", seps[isdb], sval);
150 else if (rflags & PT_USERND) {
151 printf("%s%.0f", seps[isdb], dval);
154 printf("%s%.2f", seps[isdb], dval);
162 ***************************************************************************
163 * Display CPU statistics in selected format.
166 * @a Activity structure with statistics.
167 * @isdb Flag, true if db printing, false if ppc printing.
168 * @pre Prefix string for output entries
169 * @curr Index in array for current sample statistics.
170 * @g_itv Interval of time in jiffies multiplied by the number
172 ***************************************************************************
174 __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
175 int curr, unsigned long long g_itv)
178 struct stats_cpu *scc, *scp;
180 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
182 for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
184 scc = (struct stats_cpu *) ((char *) a->buf[curr] + i * a->msize);
185 scp = (struct stats_cpu *) ((char *) a->buf[!curr] + i * a->msize);
187 /* Should current CPU (including CPU "all") be displayed? */
188 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))))
193 /* This is CPU "all" */
194 if (DISPLAY_CPU_DEF(a->opt_flags)) {
196 PT_NOFLAG, /* that's zero but you know what it means */
197 "all\t%%user", /* all ppctext is used as format, thus '%%' */
198 "-1", /* look! dbtext */
200 NOVAL, /* another 0, named for readability */
201 ll_sp_value(scp->cpu_user, scc->cpu_user, g_itv),
202 NULL); /* No string arg */
204 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
205 render(isdb, pre, PT_NOFLAG,
206 "all\t%%usr", "-1", NULL,
208 (scc->cpu_user - scc->cpu_guest) < (scp->cpu_user - scp->cpu_guest) ?
210 ll_sp_value(scp->cpu_user - scp->cpu_guest,
211 scc->cpu_user - scc->cpu_guest,
216 if (DISPLAY_CPU_DEF(a->opt_flags)) {
217 render(isdb, pre, PT_NOFLAG,
218 "all\t%%nice", NULL, NULL,
220 ll_sp_value(scp->cpu_nice, scc->cpu_nice, g_itv),
223 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
224 render(isdb, pre, PT_NOFLAG,
225 "all\t%%nice", NULL, NULL,
227 (scc->cpu_nice - scc->cpu_guest_nice) < (scp->cpu_nice - scp->cpu_guest_nice) ?
229 ll_sp_value(scp->cpu_nice - scp->cpu_guest_nice,
230 scc->cpu_nice - scc->cpu_guest_nice,
235 if (DISPLAY_CPU_DEF(a->opt_flags)) {
236 render(isdb, pre, PT_NOFLAG,
237 "all\t%%system", NULL, NULL,
239 ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq,
240 scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq,
244 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
245 render(isdb, pre, PT_NOFLAG,
246 "all\t%%sys", NULL, NULL,
248 ll_sp_value(scp->cpu_sys, scc->cpu_sys, g_itv),
252 render(isdb, pre, PT_NOFLAG,
253 "all\t%%iowait", NULL, NULL,
255 ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv),
258 render(isdb, pre, PT_NOFLAG,
259 "all\t%%steal", NULL, NULL,
261 ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv),
264 if (DISPLAY_CPU_ALL(a->opt_flags)) {
265 render(isdb, pre, PT_NOFLAG,
266 "all\t%%irq", NULL, NULL,
268 ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, g_itv),
271 render(isdb, pre, PT_NOFLAG,
272 "all\t%%soft", NULL, NULL,
274 ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, g_itv),
277 render(isdb, pre, PT_NOFLAG,
278 "all\t%%guest", NULL, NULL,
280 ll_sp_value(scp->cpu_guest, scc->cpu_guest, g_itv),
283 render(isdb, pre, PT_NOFLAG,
284 "all\t%%gnice", NULL, NULL,
286 ll_sp_value(scp->cpu_guest_nice, scc->cpu_guest_nice, g_itv),
290 render(isdb, pre, pt_newlin,
291 "all\t%%idle", NULL, NULL,
293 (scc->cpu_idle < scp->cpu_idle) ?
295 ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv),
300 * If the CPU is offline then it is omited from /proc/stat:
301 * All the fields couldn't have been read and the sum of them is zero.
302 * (Remember that guest/guest_nice times are already included in
305 if ((scc->cpu_user + scc->cpu_nice + scc->cpu_sys +
306 scc->cpu_iowait + scc->cpu_idle + scc->cpu_steal +
307 scc->cpu_hardirq + scc->cpu_softirq) == 0) {
309 * Set current struct fields (which have been set to zero)
310 * to values from previous iteration. Hence their values won't
311 * jump from zero when the CPU comes back online.
320 * Recalculate itv for current proc.
321 * If the result is 0, then current CPU is a tickless one.
323 g_itv = get_per_cpu_interval(scc, scp);
327 if (DISPLAY_CPU_DEF(a->opt_flags)) {
328 render(isdb, pre, PT_NOFLAG,
329 "cpu%d\t%%user", /* ppc text with formatting */
330 "%d", /* db text with format char */
331 cons(iv, i - 1, NOVAL), /* how we pass format args */
334 0.0 : /* CPU is offline or tickless */
335 ll_sp_value(scp->cpu_user, scc->cpu_user, g_itv),
338 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
339 render(isdb, pre, PT_NOFLAG,
340 "cpu%d\t%%usr", "%d", cons(iv, i - 1, NOVAL),
343 ((scc->cpu_user - scc->cpu_guest) < (scp->cpu_user - scp->cpu_guest))) ?
345 ll_sp_value(scp->cpu_user - scp->cpu_guest,
346 scc->cpu_user - scc->cpu_guest, g_itv),
350 if (DISPLAY_CPU_DEF(a->opt_flags)) {
351 render(isdb, pre, PT_NOFLAG,
352 "cpu%d\t%%nice", NULL, cons(iv, i - 1, NOVAL),
356 ll_sp_value(scp->cpu_nice, scc->cpu_nice, g_itv),
359 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
360 render(isdb, pre, PT_NOFLAG,
361 "cpu%d\t%%nice", NULL, cons(iv, i - 1, NOVAL),
364 ((scc->cpu_nice - scc->cpu_guest_nice) < (scp->cpu_nice - scp->cpu_guest_nice))) ?
366 ll_sp_value(scp->cpu_nice - scp->cpu_guest_nice,
367 scc->cpu_nice - scc->cpu_guest_nice, g_itv),
371 if (DISPLAY_CPU_DEF(a->opt_flags)) {
372 render(isdb, pre, PT_NOFLAG,
373 "cpu%d\t%%system", NULL, cons(iv, i - 1, NOVAL),
377 ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq,
378 scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq,
382 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
383 render(isdb, pre, PT_NOFLAG,
384 "cpu%d\t%%sys", NULL, cons(iv, i - 1, NOVAL),
388 ll_sp_value(scp->cpu_sys, scc->cpu_sys, g_itv),
392 render(isdb, pre, PT_NOFLAG,
393 "cpu%d\t%%iowait", NULL, cons(iv, i - 1, NOVAL),
397 ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv),
400 render(isdb, pre, PT_NOFLAG,
401 "cpu%d\t%%steal", NULL, cons(iv, i - 1, NOVAL),
405 ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv),
408 if (DISPLAY_CPU_ALL(a->opt_flags)) {
409 render(isdb, pre, PT_NOFLAG,
410 "cpu%d\t%%irq", NULL, cons(iv, i - 1, NOVAL),
414 ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, g_itv),
417 render(isdb, pre, PT_NOFLAG,
418 "cpu%d\t%%soft", NULL, cons(iv, i - 1, NOVAL),
422 ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, g_itv),
425 render(isdb, pre, PT_NOFLAG,
426 "cpu%d\t%%guest", NULL, cons(iv, i - 1, NOVAL),
430 ll_sp_value(scp->cpu_guest, scc->cpu_guest, g_itv),
433 render(isdb, pre, PT_NOFLAG,
434 "cpu%d\t%%gnice", NULL, cons(iv, i - 1, NOVAL),
438 ll_sp_value(scp->cpu_guest_nice, scc->cpu_guest_nice, g_itv),
443 /* CPU is offline or tickless */
444 render(isdb, pre, pt_newlin,
445 "cpu%d\t%%idle", NULL, cons(iv, i - 1, NOVAL),
452 render(isdb, pre, pt_newlin,
453 "cpu%d\t%%idle", NULL, cons(iv, i - 1, NOVAL),
455 (scc->cpu_idle < scp->cpu_idle) ?
457 ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv),
465 ***************************************************************************
466 * Display task creation and context switch statistics in selected format.
469 * @a Activity structure with statistics.
470 * @isdb Flag, true if db printing, false if ppc printing.
471 * @pre Prefix string for output entries
472 * @curr Index in array for current sample statistics.
473 * @itv Interval of time in jiffies.
474 ***************************************************************************
476 __print_funct_t render_pcsw_stats(struct activity *a, int isdb, char *pre,
477 int curr, unsigned long long itv)
480 *spc = (struct stats_pcsw *) a->buf[curr],
481 *spp = (struct stats_pcsw *) a->buf[!curr];
483 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
485 /* The first one as an example */
486 render(isdb, /* db/ppc flag */
487 pre, /* the preformatted line leader */
488 PT_NOFLAG, /* is this the end of a db line? */
489 "-\tproc/s", /* ppc text */
491 NULL, /* db/ppc text format args (Cons *) */
492 NOVAL, /* %lu value (unused unless PT_USEINT) */
493 /* and %.2f value, used unless PT_USEINT */
494 S_VALUE(spp->processes, spc->processes, itv),
495 NULL); /* %s value */
497 render(isdb, pre, pt_newlin,
498 "-\tcswch/s", NULL, NULL,
500 S_VALUE(spp->context_switch, spc->context_switch, itv),
505 ***************************************************************************
506 * Display interrupts statistics in selected format.
509 * @a Activity structure with statistics.
510 * @isdb Flag, true if db printing, false if ppc printing.
511 * @pre Prefix string for output entries
512 * @curr Index in array for current sample statistics.
513 * @itv Interval of time in jiffies.
514 ***************************************************************************
516 __print_funct_t render_irq_stats(struct activity *a, int isdb, char *pre,
517 int curr, unsigned long long itv)
520 struct stats_irq *sic, *sip;
522 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
524 for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
526 sic = (struct stats_irq *) ((char *) a->buf[curr] + i * a->msize);
527 sip = (struct stats_irq *) ((char *) a->buf[!curr] + i * a->msize);
529 /* Should current interrupt (including int "sum") be displayed? */
530 if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
532 /* Yes: Display it */
534 /* This is interrupt "sum" */
535 render(isdb, pre, pt_newlin,
536 "sum\tintr/s", "-1", NULL,
538 S_VALUE(sip->irq_nr, sic->irq_nr, itv),
542 render(isdb, pre, pt_newlin,
543 "i%03d\tintr/s", "%d", cons(iv, i - 1, NOVAL),
545 S_VALUE(sip->irq_nr, sic->irq_nr, itv),
553 ***************************************************************************
554 * Display swapping statistics in selected format.
557 * @a Activity structure with statistics.
558 * @isdb Flag, true if db printing, false if ppc printing.
559 * @pre Prefix string for output entries
560 * @curr Index in array for current sample statistics.
561 * @itv Interval of time in jiffies.
562 ***************************************************************************
564 __print_funct_t render_swap_stats(struct activity *a, int isdb, char *pre,
565 int curr, unsigned long long itv)
568 *ssc = (struct stats_swap *) a->buf[curr],
569 *ssp = (struct stats_swap *) a->buf[!curr];
571 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
573 render(isdb, pre, PT_NOFLAG,
574 "-\tpswpin/s", NULL, NULL,
576 S_VALUE(ssp->pswpin, ssc->pswpin, itv),
578 render(isdb, pre, pt_newlin,
579 "-\tpswpout/s", NULL, NULL,
581 S_VALUE(ssp->pswpout, ssc->pswpout, itv),
586 ***************************************************************************
587 * Display paging statistics in selected format.
590 * @a Activity structure with statistics.
591 * @isdb Flag, true if db printing, false if ppc printing.
592 * @pre Prefix string for output entries
593 * @curr Index in array for current sample statistics.
594 * @itv Interval of time in jiffies.
595 ***************************************************************************
597 __print_funct_t render_paging_stats(struct activity *a, int isdb, char *pre,
598 int curr, unsigned long long itv)
601 *spc = (struct stats_paging *) a->buf[curr],
602 *spp = (struct stats_paging *) a->buf[!curr];
604 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
606 render(isdb, pre, PT_NOFLAG,
607 "-\tpgpgin/s", NULL, NULL,
609 S_VALUE(spp->pgpgin, spc->pgpgin, itv),
612 render(isdb, pre, PT_NOFLAG,
613 "-\tpgpgout/s", NULL, NULL,
615 S_VALUE(spp->pgpgout, spc->pgpgout, itv),
618 render(isdb, pre, PT_NOFLAG,
619 "-\tfault/s", NULL, NULL,
621 S_VALUE(spp->pgfault, spc->pgfault, itv),
624 render(isdb, pre, PT_NOFLAG,
625 "-\tmajflt/s", NULL, NULL,
627 S_VALUE(spp->pgmajfault, spc->pgmajfault, itv),
630 render(isdb, pre, PT_NOFLAG,
631 "-\tpgfree/s", NULL, NULL,
633 S_VALUE(spp->pgfree, spc->pgfree, itv),
636 render(isdb, pre, PT_NOFLAG,
637 "-\tpgscank/s", NULL, NULL,
639 S_VALUE(spp->pgscan_kswapd, spc->pgscan_kswapd, itv),
642 render(isdb, pre, PT_NOFLAG,
643 "-\tpgscand/s", NULL, NULL,
645 S_VALUE(spp->pgscan_direct, spc->pgscan_direct, itv),
648 render(isdb, pre, PT_NOFLAG,
649 "-\tpgsteal/s", NULL, NULL,
651 S_VALUE(spp->pgsteal, spc->pgsteal, itv),
654 render(isdb, pre, pt_newlin,
655 "-\t%%vmeff", NULL, NULL,
657 (spc->pgscan_kswapd + spc->pgscan_direct -
658 spp->pgscan_kswapd - spp->pgscan_direct) ?
659 SP_VALUE(spp->pgsteal, spc->pgsteal,
660 spc->pgscan_kswapd + spc->pgscan_direct -
661 spp->pgscan_kswapd - spp->pgscan_direct) : 0.0,
666 ***************************************************************************
667 * Display I/O and transfer rate statistics in selected format.
670 * @a Activity structure with statistics.
671 * @isdb Flag, true if db printing, false if ppc printing.
672 * @pre Prefix string for output entries
673 * @curr Index in array for current sample statistics.
674 * @itv Interval of time in jiffies.
675 ***************************************************************************
677 __print_funct_t render_io_stats(struct activity *a, int isdb, char *pre,
678 int curr, unsigned long long itv)
681 *sic = (struct stats_io *) a->buf[curr],
682 *sip = (struct stats_io *) a->buf[!curr];
684 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
686 render(isdb, pre, PT_NOFLAG,
687 "-\ttps", NULL, NULL,
689 S_VALUE(sip->dk_drive, sic->dk_drive, itv),
692 render(isdb, pre, PT_NOFLAG,
693 "-\trtps", NULL, NULL,
695 S_VALUE(sip->dk_drive_rio, sic->dk_drive_rio, itv),
698 render(isdb, pre, PT_NOFLAG,
699 "-\twtps", NULL, NULL,
701 S_VALUE(sip->dk_drive_wio, sic->dk_drive_wio, itv),
704 render(isdb, pre, PT_NOFLAG,
705 "-\tbread/s", NULL, NULL,
707 S_VALUE(sip->dk_drive_rblk, sic->dk_drive_rblk, itv),
710 render(isdb, pre, pt_newlin,
711 "-\tbwrtn/s", NULL, NULL,
713 S_VALUE(sip->dk_drive_wblk, sic->dk_drive_wblk, itv),
718 ***************************************************************************
719 * Display memory and swap statistics in selected format.
722 * @a Activity structure with statistics.
723 * @isdb Flag, true if db printing, false if ppc printing.
724 * @pre Prefix string for output entries
725 * @curr Index in array for current sample statistics.
726 * @itv Interval of time in jiffies.
727 ***************************************************************************
729 __print_funct_t render_memory_stats(struct activity *a, int isdb, char *pre,
730 int curr, unsigned long long itv)
733 *smc = (struct stats_memory *) a->buf[curr],
734 *smp = (struct stats_memory *) a->buf[!curr];
736 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
739 if (DISPLAY_MEMORY(a->opt_flags)) {
741 render(isdb, pre, PT_NOFLAG,
742 "-\tfrmpg/s", NULL, NULL,
744 S_VALUE((double) KB_TO_PG(smp->frmkb),
745 (double) KB_TO_PG(smc->frmkb), itv),
748 render(isdb, pre, PT_NOFLAG,
749 "-\tbufpg/s", NULL, NULL,
751 S_VALUE((double) KB_TO_PG(smp->bufkb),
752 (double) KB_TO_PG(smc->bufkb), itv),
755 render(isdb, pre, pt_newlin,
756 "-\tcampg/s", NULL, NULL,
758 S_VALUE((double) KB_TO_PG(smp->camkb),
759 (double) KB_TO_PG(smc->camkb), itv),
763 if (DISPLAY_MEM_AMT(a->opt_flags)) {
765 render(isdb, pre, PT_USEINT,
766 "-\tkbmemfree", NULL, NULL,
767 smc->frmkb, DNOVAL, NULL);
769 render(isdb, pre, PT_USEINT,
770 "-\tkbmemused", NULL, NULL,
771 smc->tlmkb - smc->frmkb, DNOVAL, NULL);
773 render(isdb, pre, PT_NOFLAG,
774 "-\t%%memused", NULL, NULL, NOVAL,
776 SP_VALUE(smc->frmkb, smc->tlmkb, smc->tlmkb) :
779 render(isdb, pre, PT_USEINT,
780 "-\tkbbuffers", NULL, NULL,
781 smc->bufkb, DNOVAL, NULL);
783 render(isdb, pre, PT_USEINT,
784 "-\tkbcached", NULL, NULL,
785 smc->camkb, DNOVAL, NULL);
787 render(isdb, pre, PT_USEINT,
788 "-\tkbcommit", NULL, NULL,
789 smc->comkb, DNOVAL, NULL);
791 render(isdb, pre, PT_NOFLAG,
792 "-\t%%commit", NULL, NULL, NOVAL,
793 (smc->tlmkb + smc->tlskb) ?
794 SP_VALUE(0, smc->comkb, smc->tlmkb + smc->tlskb) :
797 render(isdb, pre, PT_USEINT,
798 "-\tkbactive", NULL, NULL,
799 smc->activekb, DNOVAL, NULL);
801 render(isdb, pre, PT_USEINT,
802 "-\tkbinact", NULL, NULL,
803 smc->inactkb, DNOVAL, NULL);
805 ptn = DISPLAY_MEM_ALL(a->opt_flags) ? 0 : pt_newlin;
806 render(isdb, pre, PT_USEINT | ptn,
807 "-\tkbdirty", NULL, NULL,
808 smc->dirtykb, DNOVAL, NULL);
810 if (DISPLAY_MEM_ALL(a->opt_flags)) {
811 render(isdb, pre, PT_USEINT,
812 "-\tkbanonpg", NULL, NULL,
813 smc->anonpgkb, DNOVAL, NULL);
815 render(isdb, pre, PT_USEINT,
816 "-\tkbslab", NULL, NULL,
817 smc->slabkb, DNOVAL, NULL);
819 render(isdb, pre, PT_USEINT,
820 "-\tkbkstack", NULL, NULL,
821 smc->kstackkb, DNOVAL, NULL);
823 render(isdb, pre, PT_USEINT,
824 "-\tkbpgtbl", NULL, NULL,
825 smc->pgtblkb, DNOVAL, NULL);
827 render(isdb, pre, PT_USEINT | pt_newlin,
828 "-\tkbvmused", NULL, NULL,
829 smc->vmusedkb, DNOVAL, NULL);
833 if (DISPLAY_SWAP(a->opt_flags)) {
835 render(isdb, pre, PT_USEINT,
836 "-\tkbswpfree", NULL, NULL,
837 smc->frskb, DNOVAL, NULL);
839 render(isdb, pre, PT_USEINT,
840 "-\tkbswpused", NULL, NULL,
841 smc->tlskb - smc->frskb, DNOVAL, NULL);
843 render(isdb, pre, PT_NOFLAG,
844 "-\t%%swpused", NULL, NULL, NOVAL,
846 SP_VALUE(smc->frskb, smc->tlskb, smc->tlskb) :
849 render(isdb, pre, PT_USEINT,
850 "-\tkbswpcad", NULL, NULL,
851 smc->caskb, DNOVAL, NULL);
853 render(isdb, pre, pt_newlin,
854 "-\t%%swpcad", NULL, NULL, NOVAL,
855 (smc->tlskb - smc->frskb) ?
856 SP_VALUE(0, smc->caskb, smc->tlskb - smc->frskb) :
862 ***************************************************************************
863 * Display kernel tables statistics in selected format.
866 * @a Activity structure with statistics.
867 * @isdb Flag, true if db printing, false if ppc printing.
868 * @pre Prefix string for output entries
869 * @curr Index in array for current sample statistics.
870 * @itv Interval of time in jiffies.
871 ***************************************************************************
873 __print_funct_t render_ktables_stats(struct activity *a, int isdb, char *pre,
874 int curr, unsigned long long itv)
877 *skc = (struct stats_ktables *) a->buf[curr];
879 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
881 render(isdb, pre, PT_USEINT,
882 "-\tdentunusd", NULL, NULL,
883 skc->dentry_stat, DNOVAL, NULL);
885 render(isdb, pre, PT_USEINT,
886 "-\tfile-nr", NULL, NULL,
887 skc->file_used, DNOVAL, NULL);
889 render(isdb, pre, PT_USEINT,
890 "-\tinode-nr", NULL, NULL,
891 skc->inode_used, DNOVAL, NULL);
893 render(isdb, pre, PT_USEINT | pt_newlin,
894 "-\tpty-nr", NULL, NULL,
895 skc->pty_nr, DNOVAL, NULL);
899 ***************************************************************************
900 * Display queue and load statistics in selected format.
903 * @a Activity structure with statistics.
904 * @isdb Flag, true if db printing, false if ppc printing.
905 * @pre Prefix string for output entries
906 * @curr Index in array for current sample statistics.
907 * @itv Interval of time in jiffies.
908 ***************************************************************************
910 __print_funct_t render_queue_stats(struct activity *a, int isdb, char *pre,
911 int curr, unsigned long long itv)
914 *sqc = (struct stats_queue *) a->buf[curr];
916 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
918 render(isdb, pre, PT_USEINT,
919 "-\trunq-sz", NULL, NULL,
920 sqc->nr_running, DNOVAL, NULL);
922 render(isdb, pre, PT_USEINT,
923 "-\tplist-sz", NULL, NULL,
924 sqc->nr_threads, DNOVAL, NULL);
926 render(isdb, pre, PT_NOFLAG,
927 "-\tldavg-1", NULL, NULL,
929 (double) sqc->load_avg_1 / 100,
932 render(isdb, pre, PT_NOFLAG,
933 "-\tldavg-5", NULL, NULL,
935 (double) sqc->load_avg_5 / 100,
938 render(isdb, pre, PT_NOFLAG,
939 "-\tldavg-15", NULL, NULL,
941 (double) sqc->load_avg_15 / 100,
944 render(isdb, pre, PT_USEINT | pt_newlin,
945 "-\tblocked", NULL, NULL,
946 sqc->procs_blocked, DNOVAL, NULL);
950 ***************************************************************************
951 * Display serial lines statistics in selected format.
954 * @a Activity structure with statistics.
955 * @isdb Flag, true if db printing, false if ppc printing.
956 * @pre Prefix string for output entries
957 * @curr Index in array for current sample statistics.
958 * @itv Interval of time in jiffies.
959 ***************************************************************************
961 __print_funct_t render_serial_stats(struct activity *a, int isdb, char *pre,
962 int curr, unsigned long long itv)
965 struct stats_serial *ssc, *ssp;
967 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
969 for (i = 0; i < a->nr; i++) {
971 ssc = (struct stats_serial *) ((char *) a->buf[curr] + i * a->msize);
972 ssp = (struct stats_serial *) ((char *) a->buf[!curr] + i * a->msize);
977 if (ssc->line == ssp->line) {
978 render(isdb, pre, PT_NOFLAG,
979 "ttyS%d\trcvin/s", "%d",
980 cons(iv, ssc->line - 1, NOVAL),
982 S_VALUE(ssp->rx, ssc->rx, itv),
985 render(isdb, pre, PT_NOFLAG,
986 "ttyS%d\txmtin/s", "%d",
987 cons(iv, ssc->line - 1, NOVAL),
989 S_VALUE(ssp->tx, ssc->tx, itv),
992 render(isdb, pre, PT_NOFLAG,
993 "ttyS%d\tframerr/s", "%d",
994 cons(iv, ssc->line - 1, NOVAL),
996 S_VALUE(ssp->frame, ssc->frame, itv),
999 render(isdb, pre, PT_NOFLAG,
1000 "ttyS%d\tprtyerr/s", "%d",
1001 cons(iv, ssc->line - 1, NOVAL),
1003 S_VALUE(ssp->parity, ssc->parity, itv),
1006 render(isdb, pre, PT_NOFLAG,
1007 "ttyS%d\tbrk/s", "%d",
1008 cons(iv, ssc->line - 1, NOVAL),
1010 S_VALUE(ssp->brk, ssc->brk, itv),
1013 render(isdb, pre, pt_newlin,
1014 "ttyS%d\tovrun/s", "%d",
1015 cons(iv, ssc->line - 1, NOVAL),
1017 S_VALUE(ssp->overrun, ssc->overrun, itv),
1024 ***************************************************************************
1025 * Display disks statistics in selected format.
1028 * @a Activity structure with statistics.
1029 * @isdb Flag, true if db printing, false if ppc printing.
1030 * @pre Prefix string for output entries
1031 * @curr Index in array for current sample statistics.
1032 * @itv Interval of time in jiffies.
1033 ***************************************************************************
1035 __print_funct_t render_disk_stats(struct activity *a, int isdb, char *pre,
1036 int curr, unsigned long long itv)
1039 struct stats_disk *sdc, *sdp;
1040 struct ext_disk_stats xds;
1041 char *dev_name, *persist_dev_name;
1043 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1045 for (i = 0; i < a->nr; i++) {
1047 sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize);
1049 if (!(sdc->major + sdc->minor))
1052 j = check_disk_reg(a, curr, !curr, i);
1053 sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
1055 /* Compute extended stats (service time, etc.) */
1056 compute_ext_disk_stats(sdc, sdp, itv, &xds);
1059 persist_dev_name = NULL;
1061 if (DISPLAY_PERSIST_NAME_S(flags)) {
1062 persist_dev_name = get_persistent_name_from_pretty(get_devname(sdc->major, sdc->minor, TRUE));
1065 if (persist_dev_name) {
1066 dev_name = persist_dev_name;
1069 if ((USE_PRETTY_OPTION(flags)) && (sdc->major == dm_major)) {
1070 dev_name = transform_devmapname(sdc->major, sdc->minor);
1074 dev_name = get_devname(sdc->major, sdc->minor,
1075 USE_PRETTY_OPTION(flags));
1079 render(isdb, pre, PT_NOFLAG,
1081 cons(sv, dev_name, NULL),
1083 S_VALUE(sdp->nr_ios, sdc->nr_ios, itv),
1086 render(isdb, pre, PT_NOFLAG,
1087 "%s\trd_sec/s", NULL,
1088 cons(sv, dev_name, NULL),
1090 S_VALUE(sdp->rd_sect, sdc->rd_sect, itv),
1093 render(isdb, pre, PT_NOFLAG,
1094 "%s\twr_sec/s", NULL,
1095 cons(sv, dev_name, NULL),
1097 S_VALUE(sdp->wr_sect, sdc->wr_sect, itv),
1100 render(isdb, pre, PT_NOFLAG,
1101 "%s\tavgrq-sz", NULL,
1102 cons(sv, dev_name, NULL),
1107 render(isdb, pre, PT_NOFLAG,
1108 "%s\tavgqu-sz", NULL,
1109 cons(sv, dev_name, NULL),
1111 S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,
1114 render(isdb, pre, PT_NOFLAG,
1116 cons(sv, dev_name, NULL),
1121 render(isdb, pre, PT_NOFLAG,
1123 cons(sv, dev_name, NULL),
1128 render(isdb, pre, pt_newlin,
1130 cons(sv, dev_name, NULL),
1138 ***************************************************************************
1139 * Display network interfaces statistics in selected format.
1142 * @a Activity structure with statistics.
1143 * @isdb Flag, true if db printing, false if ppc printing.
1144 * @pre Prefix string for output entries
1145 * @curr Index in array for current sample statistics.
1146 * @itv Interval of time in jiffies.
1147 ***************************************************************************
1149 __print_funct_t render_net_dev_stats(struct activity *a, int isdb, char *pre,
1150 int curr, unsigned long long itv)
1153 struct stats_net_dev *sndc, *sndp;
1154 double rxkb, txkb, ifutil;
1156 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1158 for (i = 0; i < a->nr; i++) {
1160 sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize);
1162 if (!strcmp(sndc->interface, ""))
1165 j = check_net_dev_reg(a, curr, !curr, i);
1166 sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize);
1168 render(isdb, pre, PT_NOFLAG,
1169 "%s\trxpck/s", "%s",
1170 cons(sv, sndc->interface, NULL), /* What if the format args are strings? */
1172 S_VALUE(sndp->rx_packets, sndc->rx_packets, itv),
1175 render(isdb, pre, PT_NOFLAG,
1176 "%s\ttxpck/s", NULL,
1177 cons(sv, sndc->interface, NULL),
1179 S_VALUE(sndp->tx_packets, sndc->tx_packets, itv),
1182 rxkb = S_VALUE(sndp->rx_bytes, sndc->rx_bytes, itv);
1183 render(isdb, pre, PT_NOFLAG,
1185 cons(sv, sndc->interface, NULL),
1190 txkb = S_VALUE(sndp->tx_bytes, sndc->tx_bytes, itv);
1191 render(isdb, pre, PT_NOFLAG,
1193 cons(sv, sndc->interface, NULL),
1198 render(isdb, pre, PT_NOFLAG,
1199 "%s\trxcmp/s", NULL,
1200 cons(sv, sndc->interface, NULL),
1202 S_VALUE(sndp->rx_compressed, sndc->rx_compressed, itv),
1205 render(isdb, pre, PT_NOFLAG,
1206 "%s\ttxcmp/s", NULL,
1207 cons(sv, sndc->interface, NULL),
1209 S_VALUE(sndp->tx_compressed, sndc->tx_compressed, itv),
1212 render(isdb, pre, PT_NOFLAG,
1213 "%s\trxmcst/s", NULL,
1214 cons(sv, sndc->interface, NULL),
1216 S_VALUE(sndp->multicast, sndc->multicast, itv),
1219 ifutil = compute_ifutil(sndc, rxkb, txkb);
1220 render(isdb, pre, pt_newlin,
1221 "%s\t%%ifutil", NULL,
1222 cons(sv, sndc->interface, NULL),
1230 ***************************************************************************
1231 * Display network interface errors statistics in selected format.
1234 * @a Activity structure with statistics.
1235 * @isdb Flag, true if db printing, false if ppc printing.
1236 * @pre Prefix string for output entries
1237 * @curr Index in array for current sample statistics.
1238 * @itv Interval of time in jiffies.
1239 ***************************************************************************
1241 __print_funct_t render_net_edev_stats(struct activity *a, int isdb, char *pre,
1242 int curr, unsigned long long itv)
1245 struct stats_net_edev *snedc, *snedp;
1247 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1249 for (i = 0; i < a->nr; i++) {
1251 snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize);
1253 if (!strcmp(snedc->interface, ""))
1256 j = check_net_edev_reg(a, curr, !curr, i);
1257 snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize);
1259 render(isdb, pre, PT_NOFLAG,
1260 "%s\trxerr/s", "%s",
1261 cons(sv, snedc->interface, NULL),
1263 S_VALUE(snedp->rx_errors, snedc->rx_errors, itv),
1266 render(isdb, pre, PT_NOFLAG,
1267 "%s\ttxerr/s", NULL,
1268 cons(sv, snedc->interface, NULL),
1270 S_VALUE(snedp->tx_errors, snedc->tx_errors, itv),
1273 render(isdb, pre, PT_NOFLAG,
1275 cons(sv, snedc->interface, NULL),
1277 S_VALUE(snedp->collisions, snedc->collisions, itv),
1280 render(isdb, pre, PT_NOFLAG,
1281 "%s\trxdrop/s", NULL,
1282 cons(sv, snedc->interface, NULL),
1284 S_VALUE(snedp->rx_dropped, snedc->rx_dropped, itv),
1287 render(isdb, pre, PT_NOFLAG,
1288 "%s\ttxdrop/s", NULL,
1289 cons(sv, snedc->interface, NULL),
1291 S_VALUE(snedp->tx_dropped, snedc->tx_dropped, itv),
1294 render(isdb, pre, PT_NOFLAG,
1295 "%s\ttxcarr/s", NULL,
1296 cons(sv, snedc->interface, NULL),
1298 S_VALUE(snedp->tx_carrier_errors, snedc->tx_carrier_errors, itv),
1301 render(isdb, pre, PT_NOFLAG,
1302 "%s\trxfram/s", NULL,
1303 cons(sv, snedc->interface, NULL),
1305 S_VALUE(snedp->rx_frame_errors, snedc->rx_frame_errors, itv),
1308 render(isdb, pre, PT_NOFLAG,
1309 "%s\trxfifo/s", NULL,
1310 cons(sv, snedc->interface, NULL),
1312 S_VALUE(snedp->rx_fifo_errors, snedc->rx_fifo_errors, itv),
1315 render(isdb, pre, pt_newlin,
1316 "%s\ttxfifo/s", NULL,
1317 cons(sv, snedc->interface, NULL),
1319 S_VALUE(snedp->tx_fifo_errors, snedc->tx_fifo_errors, itv),
1325 ***************************************************************************
1326 * Display NFS client statistics in selected format.
1329 * @a Activity structure with statistics.
1330 * @isdb Flag, true if db printing, false if ppc printing.
1331 * @pre Prefix string for output entries
1332 * @curr Index in array for current sample statistics.
1333 * @itv Interval of time in jiffies.
1334 ***************************************************************************
1336 __print_funct_t render_net_nfs_stats(struct activity *a, int isdb, char *pre,
1337 int curr, unsigned long long itv)
1339 struct stats_net_nfs
1340 *snnc = (struct stats_net_nfs *) a->buf[curr],
1341 *snnp = (struct stats_net_nfs *) a->buf[!curr];
1343 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1345 render(isdb, pre, PT_NOFLAG,
1346 "-\tcall/s", NULL, NULL,
1348 S_VALUE(snnp->nfs_rpccnt, snnc->nfs_rpccnt, itv),
1351 render(isdb, pre, PT_NOFLAG,
1352 "-\tretrans/s", NULL, NULL,
1354 S_VALUE(snnp->nfs_rpcretrans, snnc->nfs_rpcretrans, itv),
1357 render(isdb, pre, PT_NOFLAG,
1358 "-\tread/s", NULL, NULL,
1360 S_VALUE(snnp->nfs_readcnt, snnc->nfs_readcnt, itv),
1363 render(isdb, pre, PT_NOFLAG,
1364 "-\twrite/s", NULL, NULL,
1366 S_VALUE(snnp->nfs_writecnt, snnc->nfs_writecnt, itv),
1369 render(isdb, pre, PT_NOFLAG,
1370 "-\taccess/s", NULL, NULL,
1372 S_VALUE(snnp->nfs_accesscnt, snnc->nfs_accesscnt, itv),
1375 render(isdb, pre, pt_newlin,
1376 "-\tgetatt/s", NULL, NULL,
1378 S_VALUE(snnp->nfs_getattcnt, snnc->nfs_getattcnt, itv),
1383 ***************************************************************************
1384 * Display NFS server statistics in selected format.
1387 * @a Activity structure with statistics.
1388 * @isdb Flag, true if db printing, false if ppc printing.
1389 * @pre Prefix string for output entries
1390 * @curr Index in array for current sample statistics.
1391 * @itv Interval of time in jiffies.
1392 ***************************************************************************
1394 __print_funct_t render_net_nfsd_stats(struct activity *a, int isdb, char *pre,
1395 int curr, unsigned long long itv)
1397 struct stats_net_nfsd
1398 *snndc = (struct stats_net_nfsd *) a->buf[curr],
1399 *snndp = (struct stats_net_nfsd *) a->buf[!curr];
1401 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1403 render(isdb, pre, PT_NOFLAG,
1404 "-\tscall/s", NULL, NULL,
1406 S_VALUE(snndp->nfsd_rpccnt, snndc->nfsd_rpccnt, itv),
1409 render(isdb, pre, PT_NOFLAG,
1410 "-\tbadcall/s", NULL, NULL,
1412 S_VALUE(snndp->nfsd_rpcbad, snndc->nfsd_rpcbad, itv),
1415 render(isdb, pre, PT_NOFLAG,
1416 "-\tpacket/s", NULL, NULL,
1418 S_VALUE(snndp->nfsd_netcnt, snndc->nfsd_netcnt, itv),
1421 render(isdb, pre, PT_NOFLAG,
1422 "-\tudp/s", NULL, NULL,
1424 S_VALUE(snndp->nfsd_netudpcnt, snndc->nfsd_netudpcnt, itv),
1427 render(isdb, pre, PT_NOFLAG,
1428 "-\ttcp/s", NULL, NULL,
1430 S_VALUE(snndp->nfsd_nettcpcnt, snndc->nfsd_nettcpcnt, itv),
1433 render(isdb, pre, PT_NOFLAG,
1434 "-\thit/s", NULL, NULL,
1436 S_VALUE(snndp->nfsd_rchits, snndc->nfsd_rchits, itv),
1439 render(isdb, pre, PT_NOFLAG,
1440 "-\tmiss/s", NULL, NULL,
1442 S_VALUE(snndp->nfsd_rcmisses, snndc->nfsd_rcmisses, itv),
1445 render(isdb, pre, PT_NOFLAG,
1446 "-\tsread/s", NULL, NULL,
1448 S_VALUE(snndp->nfsd_readcnt, snndc->nfsd_readcnt, itv),
1451 render(isdb, pre, PT_NOFLAG,
1452 "-\tswrite/s", NULL, NULL,
1454 S_VALUE(snndp->nfsd_writecnt, snndc->nfsd_writecnt, itv),
1457 render(isdb, pre, PT_NOFLAG,
1458 "-\tsaccess/s", NULL, NULL,
1460 S_VALUE(snndp->nfsd_accesscnt, snndc->nfsd_accesscnt, itv),
1463 render(isdb, pre, pt_newlin,
1464 "-\tsgetatt/s", NULL, NULL,
1466 S_VALUE(snndp->nfsd_getattcnt, snndc->nfsd_getattcnt, itv),
1471 ***************************************************************************
1472 * Display network sockets statistics in selected format.
1475 * @a Activity structure with statistics.
1476 * @isdb Flag, true if db printing, false if ppc printing.
1477 * @pre Prefix string for output entries
1478 * @curr Index in array for current sample statistics.
1479 * @itv Interval of time in jiffies.
1480 ***************************************************************************
1482 __print_funct_t render_net_sock_stats(struct activity *a, int isdb, char *pre,
1483 int curr, unsigned long long itv)
1485 struct stats_net_sock
1486 *snsc = (struct stats_net_sock *) a->buf[curr];
1488 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1490 render(isdb, pre, PT_USEINT,
1491 "-\ttotsck", NULL, NULL,
1492 snsc->sock_inuse, DNOVAL, NULL);
1494 render(isdb, pre, PT_USEINT,
1495 "-\ttcpsck", NULL, NULL,
1496 snsc->tcp_inuse, DNOVAL, NULL);
1498 render(isdb, pre, PT_USEINT,
1499 "-\tudpsck", NULL, NULL,
1500 snsc->udp_inuse, DNOVAL, NULL);
1502 render(isdb, pre, PT_USEINT,
1503 "-\trawsck", NULL, NULL,
1504 snsc->raw_inuse, DNOVAL, NULL);
1506 render(isdb, pre, PT_USEINT,
1507 "-\tip-frag", NULL, NULL,
1508 snsc->frag_inuse, DNOVAL, NULL);
1510 render(isdb, pre, PT_USEINT | pt_newlin,
1511 "-\ttcp-tw", NULL, NULL,
1512 snsc->tcp_tw, DNOVAL, NULL);
1516 ***************************************************************************
1517 * Display IP network statistics in selected format.
1520 * @a Activity structure with statistics.
1521 * @isdb Flag, true if db printing, false if ppc printing.
1522 * @pre Prefix string for output entries
1523 * @curr Index in array for current sample statistics.
1524 * @itv Interval of time in jiffies.
1525 ***************************************************************************
1527 __print_funct_t render_net_ip_stats(struct activity *a, int isdb, char *pre,
1528 int curr, unsigned long long itv)
1531 *snic = (struct stats_net_ip *) a->buf[curr],
1532 *snip = (struct stats_net_ip *) a->buf[!curr];
1534 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1536 render(isdb, pre, PT_NOFLAG,
1537 "-\tirec/s", NULL, NULL,
1539 S_VALUE(snip->InReceives, snic->InReceives, itv),
1542 render(isdb, pre, PT_NOFLAG,
1543 "-\tfwddgm/s", NULL, NULL,
1545 S_VALUE(snip->ForwDatagrams, snic->ForwDatagrams, itv),
1548 render(isdb, pre, PT_NOFLAG,
1549 "-\tidel/s", NULL, NULL,
1551 S_VALUE(snip->InDelivers, snic->InDelivers, itv),
1554 render(isdb, pre, PT_NOFLAG,
1555 "-\torq/s", NULL, NULL,
1557 S_VALUE(snip->OutRequests, snic->OutRequests, itv),
1560 render(isdb, pre, PT_NOFLAG,
1561 "-\tasmrq/s", NULL, NULL,
1563 S_VALUE(snip->ReasmReqds, snic->ReasmReqds, itv),
1566 render(isdb, pre, PT_NOFLAG,
1567 "-\tasmok/s", NULL, NULL,
1569 S_VALUE(snip->ReasmOKs, snic->ReasmOKs, itv),
1572 render(isdb, pre, PT_NOFLAG,
1573 "-\tfragok/s", NULL, NULL,
1575 S_VALUE(snip->FragOKs, snic->FragOKs, itv),
1578 render(isdb, pre, pt_newlin,
1579 "-\tfragcrt/s", NULL, NULL,
1581 S_VALUE(snip->FragCreates, snic->FragCreates, itv),
1586 ***************************************************************************
1587 * Display IP network error statistics in selected format.
1590 * @a Activity structure with statistics.
1591 * @isdb Flag, true if db printing, false if ppc printing.
1592 * @pre Prefix string for output entries
1593 * @curr Index in array for current sample statistics.
1594 * @itv Interval of time in jiffies.
1595 ***************************************************************************
1597 __print_funct_t render_net_eip_stats(struct activity *a, int isdb, char *pre,
1598 int curr, unsigned long long itv)
1600 struct stats_net_eip
1601 *sneic = (struct stats_net_eip *) a->buf[curr],
1602 *sneip = (struct stats_net_eip *) a->buf[!curr];
1604 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1606 render(isdb, pre, PT_NOFLAG,
1607 "-\tihdrerr/s", NULL, NULL,
1609 S_VALUE(sneip->InHdrErrors, sneic->InHdrErrors, itv),
1612 render(isdb, pre, PT_NOFLAG,
1613 "-\tiadrerr/s", NULL, NULL,
1615 S_VALUE(sneip->InAddrErrors, sneic->InAddrErrors, itv),
1618 render(isdb, pre, PT_NOFLAG,
1619 "-\tiukwnpr/s", NULL, NULL,
1621 S_VALUE(sneip->InUnknownProtos, sneic->InUnknownProtos, itv),
1624 render(isdb, pre, PT_NOFLAG,
1625 "-\tidisc/s", NULL, NULL,
1627 S_VALUE(sneip->InDiscards, sneic->InDiscards, itv),
1630 render(isdb, pre, PT_NOFLAG,
1631 "-\todisc/s", NULL, NULL,
1633 S_VALUE(sneip->OutDiscards, sneic->OutDiscards, itv),
1636 render(isdb, pre, PT_NOFLAG,
1637 "-\tonort/s", NULL, NULL,
1639 S_VALUE(sneip->OutNoRoutes, sneic->OutNoRoutes, itv),
1642 render(isdb, pre, PT_NOFLAG,
1643 "-\tasmf/s", NULL, NULL,
1645 S_VALUE(sneip->ReasmFails, sneic->ReasmFails, itv),
1648 render(isdb, pre, pt_newlin,
1649 "-\tfragf/s", NULL, NULL,
1651 S_VALUE(sneip->FragFails, sneic->FragFails, itv),
1656 ***************************************************************************
1657 * Display ICMP network statistics in selected format.
1660 * @a Activity structure with statistics.
1661 * @isdb Flag, true if db printing, false if ppc printing.
1662 * @pre Prefix string for output entries
1663 * @curr Index in array for current sample statistics.
1664 * @itv Interval of time in jiffies.
1665 ***************************************************************************
1667 __print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre,
1668 int curr, unsigned long long itv)
1670 struct stats_net_icmp
1671 *snic = (struct stats_net_icmp *) a->buf[curr],
1672 *snip = (struct stats_net_icmp *) a->buf[!curr];
1674 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1676 render(isdb, pre, PT_NOFLAG,
1677 "-\timsg/s", NULL, NULL,
1679 S_VALUE(snip->InMsgs, snic->InMsgs, itv),
1682 render(isdb, pre, PT_NOFLAG,
1683 "-\tomsg/s", NULL, NULL,
1685 S_VALUE(snip->OutMsgs, snic->OutMsgs, itv),
1688 render(isdb, pre, PT_NOFLAG,
1689 "-\tiech/s", NULL, NULL,
1691 S_VALUE(snip->InEchos, snic->InEchos, itv),
1694 render(isdb, pre, PT_NOFLAG,
1695 "-\tiechr/s", NULL, NULL,
1697 S_VALUE(snip->InEchoReps, snic->InEchoReps, itv),
1700 render(isdb, pre, PT_NOFLAG,
1701 "-\toech/s", NULL, NULL,
1703 S_VALUE(snip->OutEchos, snic->OutEchos, itv),
1706 render(isdb, pre, PT_NOFLAG,
1707 "-\toechr/s", NULL, NULL,
1709 S_VALUE(snip->OutEchoReps, snic->OutEchoReps, itv),
1712 render(isdb, pre, PT_NOFLAG,
1713 "-\titm/s", NULL, NULL,
1715 S_VALUE(snip->InTimestamps, snic->InTimestamps, itv),
1718 render(isdb, pre, PT_NOFLAG,
1719 "-\titmr/s", NULL, NULL,
1721 S_VALUE(snip->InTimestampReps, snic->InTimestampReps, itv),
1724 render(isdb, pre, PT_NOFLAG,
1725 "-\totm/s", NULL, NULL,
1727 S_VALUE(snip->OutTimestamps, snic->OutTimestamps, itv),
1730 render(isdb, pre, PT_NOFLAG,
1731 "-\totmr/s", NULL, NULL,
1733 S_VALUE(snip->OutTimestampReps, snic->OutTimestampReps, itv),
1736 render(isdb, pre, PT_NOFLAG,
1737 "-\tiadrmk/s", NULL, NULL,
1739 S_VALUE(snip->InAddrMasks, snic->InAddrMasks, itv),
1742 render(isdb, pre, PT_NOFLAG,
1743 "-\tiadrmkr/s", NULL, NULL,
1745 S_VALUE(snip->InAddrMaskReps, snic->InAddrMaskReps, itv),
1748 render(isdb, pre, PT_NOFLAG,
1749 "-\toadrmk/s", NULL, NULL,
1751 S_VALUE(snip->OutAddrMasks, snic->OutAddrMasks, itv),
1754 render(isdb, pre, pt_newlin,
1755 "-\toadrmkr/s", NULL, NULL,
1757 S_VALUE(snip->OutAddrMaskReps, snic->OutAddrMaskReps, itv),
1762 ***************************************************************************
1763 * Display ICMP error message statistics in selected format.
1766 * @a Activity structure with statistics.
1767 * @isdb Flag, true if db printing, false if ppc printing.
1768 * @pre Prefix string for output entries
1769 * @curr Index in array for current sample statistics.
1770 * @itv Interval of time in jiffies.
1771 ***************************************************************************
1773 __print_funct_t render_net_eicmp_stats(struct activity *a, int isdb, char *pre,
1774 int curr, unsigned long long itv)
1776 struct stats_net_eicmp
1777 *sneic = (struct stats_net_eicmp *) a->buf[curr],
1778 *sneip = (struct stats_net_eicmp *) a->buf[!curr];
1780 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1782 render(isdb, pre, PT_NOFLAG,
1783 "-\tierr/s", NULL, NULL,
1785 S_VALUE(sneip->InErrors, sneic->InErrors, itv),
1788 render(isdb, pre, PT_NOFLAG,
1789 "-\toerr/s", NULL, NULL,
1791 S_VALUE(sneip->OutErrors, sneic->OutErrors, itv),
1794 render(isdb, pre, PT_NOFLAG,
1795 "-\tidstunr/s", NULL, NULL,
1797 S_VALUE(sneip->InDestUnreachs, sneic->InDestUnreachs, itv),
1800 render(isdb, pre, PT_NOFLAG,
1801 "-\todstunr/s", NULL, NULL,
1803 S_VALUE(sneip->OutDestUnreachs, sneic->OutDestUnreachs, itv),
1806 render(isdb, pre, PT_NOFLAG,
1807 "-\titmex/s", NULL, NULL,
1809 S_VALUE(sneip->InTimeExcds, sneic->InTimeExcds, itv),
1812 render(isdb, pre, PT_NOFLAG,
1813 "-\totmex/s", NULL, NULL,
1815 S_VALUE(sneip->OutTimeExcds, sneic->OutTimeExcds, itv),
1818 render(isdb, pre, PT_NOFLAG,
1819 "-\tiparmpb/s", NULL, NULL,
1821 S_VALUE(sneip->InParmProbs, sneic->InParmProbs, itv),
1824 render(isdb, pre, PT_NOFLAG,
1825 "-\toparmpb/s", NULL, NULL,
1827 S_VALUE(sneip->OutParmProbs, sneic->OutParmProbs, itv),
1830 render(isdb, pre, PT_NOFLAG,
1831 "-\tisrcq/s", NULL, NULL,
1833 S_VALUE(sneip->InSrcQuenchs, sneic->InSrcQuenchs, itv),
1836 render(isdb, pre, PT_NOFLAG,
1837 "-\tosrcq/s", NULL, NULL,
1839 S_VALUE(sneip->OutSrcQuenchs, sneic->OutSrcQuenchs, itv),
1842 render(isdb, pre, PT_NOFLAG,
1843 "-\tiredir/s", NULL, NULL,
1845 S_VALUE(sneip->InRedirects, sneic->InRedirects, itv),
1848 render(isdb, pre, pt_newlin,
1849 "-\toredir/s", NULL, NULL,
1851 S_VALUE(sneip->OutRedirects, sneic->OutRedirects, itv),
1856 ***************************************************************************
1857 * Display TCP network statistics in selected format.
1860 * @a Activity structure with statistics.
1861 * @isdb Flag, true if db printing, false if ppc printing.
1862 * @pre Prefix string for output entries
1863 * @curr Index in array for current sample statistics.
1864 * @itv Interval of time in jiffies.
1865 ***************************************************************************
1867 __print_funct_t render_net_tcp_stats(struct activity *a, int isdb, char *pre,
1868 int curr, unsigned long long itv)
1870 struct stats_net_tcp
1871 *sntc = (struct stats_net_tcp *) a->buf[curr],
1872 *sntp = (struct stats_net_tcp *) a->buf[!curr];
1874 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1876 render(isdb, pre, PT_NOFLAG,
1877 "-\tactive/s", NULL, NULL,
1879 S_VALUE(sntp->ActiveOpens, sntc->ActiveOpens, itv),
1882 render(isdb, pre, PT_NOFLAG,
1883 "-\tpassive/s", NULL, NULL,
1885 S_VALUE(sntp->PassiveOpens, sntc->PassiveOpens, itv),
1888 render(isdb, pre, PT_NOFLAG,
1889 "-\tiseg/s", NULL, NULL,
1891 S_VALUE(sntp->InSegs, sntc->InSegs, itv),
1894 render(isdb, pre, pt_newlin,
1895 "-\toseg/s", NULL, NULL,
1897 S_VALUE(sntp->OutSegs, sntc->OutSegs, itv),
1902 ***************************************************************************
1903 * Display TCP network error statistics in selected format.
1906 * @a Activity structure with statistics.
1907 * @isdb Flag, true if db printing, false if ppc printing.
1908 * @pre Prefix string for output entries
1909 * @curr Index in array for current sample statistics.
1910 * @itv Interval of time in jiffies.
1911 ***************************************************************************
1913 __print_funct_t render_net_etcp_stats(struct activity *a, int isdb, char *pre,
1914 int curr, unsigned long long itv)
1916 struct stats_net_etcp
1917 *snetc = (struct stats_net_etcp *) a->buf[curr],
1918 *snetp = (struct stats_net_etcp *) a->buf[!curr];
1920 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1922 render(isdb, pre, PT_NOFLAG,
1923 "-\tatmptf/s", NULL, NULL,
1925 S_VALUE(snetp->AttemptFails, snetc->AttemptFails, itv),
1928 render(isdb, pre, PT_NOFLAG,
1929 "-\testres/s", NULL, NULL,
1931 S_VALUE(snetp->EstabResets, snetc->EstabResets, itv),
1934 render(isdb, pre, PT_NOFLAG,
1935 "-\tretrans/s", NULL, NULL,
1937 S_VALUE(snetp->RetransSegs, snetc->RetransSegs, itv),
1940 render(isdb, pre, PT_NOFLAG,
1941 "-\tisegerr/s", NULL, NULL,
1943 S_VALUE(snetp->InErrs, snetc->InErrs, itv),
1946 render(isdb, pre, pt_newlin,
1947 "-\torsts/s", NULL, NULL,
1949 S_VALUE(snetp->OutRsts, snetc->OutRsts, itv),
1954 ***************************************************************************
1955 * Display UDP network statistics in selected format.
1958 * @a Activity structure with statistics.
1959 * @isdb Flag, true if db printing, false if ppc printing.
1960 * @pre Prefix string for output entries
1961 * @curr Index in array for current sample statistics.
1962 * @itv Interval of time in jiffies.
1963 ***************************************************************************
1965 __print_funct_t render_net_udp_stats(struct activity *a, int isdb, char *pre,
1966 int curr, unsigned long long itv)
1968 struct stats_net_udp
1969 *snuc = (struct stats_net_udp *) a->buf[curr],
1970 *snup = (struct stats_net_udp *) a->buf[!curr];
1972 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1974 render(isdb, pre, PT_NOFLAG,
1975 "-\tidgm/s", NULL, NULL,
1977 S_VALUE(snup->InDatagrams, snuc->InDatagrams, itv),
1980 render(isdb, pre, PT_NOFLAG,
1981 "-\todgm/s", NULL, NULL,
1983 S_VALUE(snup->OutDatagrams, snuc->OutDatagrams, itv),
1986 render(isdb, pre, PT_NOFLAG,
1987 "-\tnoport/s", NULL, NULL,
1989 S_VALUE(snup->NoPorts, snuc->NoPorts, itv),
1992 render(isdb, pre, pt_newlin,
1993 "-\tidgmerr/s", NULL, NULL,
1995 S_VALUE(snup->InErrors, snuc->InErrors, itv),
2000 ***************************************************************************
2001 * Display IPv6 network sockets statistics in selected format.
2004 * @a Activity structure with statistics.
2005 * @isdb Flag, true if db printing, false if ppc printing.
2006 * @pre Prefix string for output entries
2007 * @curr Index in array for current sample statistics.
2008 * @itv Interval of time in jiffies.
2009 ***************************************************************************
2011 __print_funct_t render_net_sock6_stats(struct activity *a, int isdb, char *pre,
2012 int curr, unsigned long long itv)
2014 struct stats_net_sock6
2015 *snsc = (struct stats_net_sock6 *) a->buf[curr];
2017 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2019 render(isdb, pre, PT_USEINT,
2020 "-\ttcp6sck", NULL, NULL,
2021 snsc->tcp6_inuse, DNOVAL, NULL);
2023 render(isdb, pre, PT_USEINT,
2024 "-\tudp6sck", NULL, NULL,
2025 snsc->udp6_inuse, DNOVAL, NULL);
2027 render(isdb, pre, PT_USEINT,
2028 "-\traw6sck", NULL, NULL,
2029 snsc->raw6_inuse, DNOVAL, NULL);
2031 render(isdb, pre, PT_USEINT | pt_newlin,
2032 "-\tip6-frag", NULL, NULL,
2033 snsc->frag6_inuse, DNOVAL, NULL);
2037 ***************************************************************************
2038 * Display IPv6 network statistics in selected format.
2041 * @a Activity structure with statistics.
2042 * @isdb Flag, true if db printing, false if ppc printing.
2043 * @pre Prefix string for output entries
2044 * @curr Index in array for current sample statistics.
2045 * @itv Interval of time in jiffies.
2046 ***************************************************************************
2048 __print_funct_t render_net_ip6_stats(struct activity *a, int isdb, char *pre,
2049 int curr, unsigned long long itv)
2051 struct stats_net_ip6
2052 *snic = (struct stats_net_ip6 *) a->buf[curr],
2053 *snip = (struct stats_net_ip6 *) a->buf[!curr];
2055 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2057 render(isdb, pre, PT_NOFLAG,
2058 "-\tirec6/s", NULL, NULL,
2060 S_VALUE(snip->InReceives6, snic->InReceives6, itv),
2063 render(isdb, pre, PT_NOFLAG,
2064 "-\tfwddgm6/s", NULL, NULL,
2066 S_VALUE(snip->OutForwDatagrams6, snic->OutForwDatagrams6, itv),
2069 render(isdb, pre, PT_NOFLAG,
2070 "-\tidel6/s", NULL, NULL,
2072 S_VALUE(snip->InDelivers6, snic->InDelivers6, itv),
2075 render(isdb, pre, PT_NOFLAG,
2076 "-\torq6/s", NULL, NULL,
2078 S_VALUE(snip->OutRequests6, snic->OutRequests6, itv),
2081 render(isdb, pre, PT_NOFLAG,
2082 "-\tasmrq6/s", NULL, NULL,
2084 S_VALUE(snip->ReasmReqds6, snic->ReasmReqds6, itv),
2087 render(isdb, pre, PT_NOFLAG,
2088 "-\tasmok6/s", NULL, NULL,
2090 S_VALUE(snip->ReasmOKs6, snic->ReasmOKs6, itv),
2093 render(isdb, pre, PT_NOFLAG,
2094 "-\timcpck6/s", NULL, NULL,
2096 S_VALUE(snip->InMcastPkts6, snic->InMcastPkts6, itv),
2099 render(isdb, pre, PT_NOFLAG,
2100 "-\tomcpck6/s", NULL, NULL,
2102 S_VALUE(snip->OutMcastPkts6, snic->OutMcastPkts6, itv),
2105 render(isdb, pre, PT_NOFLAG,
2106 "-\tfragok6/s", NULL, NULL,
2108 S_VALUE(snip->FragOKs6, snic->FragOKs6, itv),
2111 render(isdb, pre, pt_newlin,
2112 "-\tfragcr6/s", NULL, NULL,
2114 S_VALUE(snip->FragCreates6, snic->FragCreates6, itv),
2119 ***************************************************************************
2120 * Display IPv6 network error statistics in selected format.
2123 * @a Activity structure with statistics.
2124 * @isdb Flag, true if db printing, false if ppc printing.
2125 * @pre Prefix string for output entries
2126 * @curr Index in array for current sample statistics.
2127 * @itv Interval of time in jiffies.
2128 ***************************************************************************
2130 __print_funct_t render_net_eip6_stats(struct activity *a, int isdb, char *pre,
2131 int curr, unsigned long long itv)
2133 struct stats_net_eip6
2134 *sneic = (struct stats_net_eip6 *) a->buf[curr],
2135 *sneip = (struct stats_net_eip6 *) a->buf[!curr];
2137 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2139 render(isdb, pre, PT_NOFLAG,
2140 "-\tihdrer6/s", NULL, NULL,
2142 S_VALUE(sneip->InHdrErrors6, sneic->InHdrErrors6, itv),
2145 render(isdb, pre, PT_NOFLAG,
2146 "-\tiadrer6/s", NULL, NULL,
2148 S_VALUE(sneip->InAddrErrors6, sneic->InAddrErrors6, itv),
2151 render(isdb, pre, PT_NOFLAG,
2152 "-\tiukwnp6/s", NULL, NULL,
2154 S_VALUE(sneip->InUnknownProtos6, sneic->InUnknownProtos6, itv),
2157 render(isdb, pre, PT_NOFLAG,
2158 "-\ti2big6/s", NULL, NULL,
2160 S_VALUE(sneip->InTooBigErrors6, sneic->InTooBigErrors6, itv),
2163 render(isdb, pre, PT_NOFLAG,
2164 "-\tidisc6/s", NULL, NULL,
2166 S_VALUE(sneip->InDiscards6, sneic->InDiscards6, itv),
2169 render(isdb, pre, PT_NOFLAG,
2170 "-\todisc6/s", NULL, NULL,
2172 S_VALUE(sneip->OutDiscards6, sneic->OutDiscards6, itv),
2175 render(isdb, pre, PT_NOFLAG,
2176 "-\tinort6/s", NULL, NULL,
2178 S_VALUE(sneip->InNoRoutes6, sneic->InNoRoutes6, itv),
2181 render(isdb, pre, PT_NOFLAG,
2182 "-\tonort6/s", NULL, NULL,
2184 S_VALUE(sneip->OutNoRoutes6, sneic->OutNoRoutes6, itv),
2187 render(isdb, pre, PT_NOFLAG,
2188 "-\tasmf6/s", NULL, NULL,
2190 S_VALUE(sneip->ReasmFails6, sneic->ReasmFails6, itv),
2193 render(isdb, pre, PT_NOFLAG,
2194 "-\tfragf6/s", NULL, NULL,
2196 S_VALUE(sneip->FragFails6, sneic->FragFails6, itv),
2199 render(isdb, pre, pt_newlin,
2200 "-\titrpck6/s", NULL, NULL,
2202 S_VALUE(sneip->InTruncatedPkts6, sneic->InTruncatedPkts6, itv),
2207 ***************************************************************************
2208 * Display ICMPv6 network statistics in selected format.
2211 * @a Activity structure with statistics.
2212 * @isdb Flag, true if db printing, false if ppc printing.
2213 * @pre Prefix string for output entries
2214 * @curr Index in array for current sample statistics.
2215 * @itv Interval of time in jiffies.
2216 ***************************************************************************
2218 __print_funct_t render_net_icmp6_stats(struct activity *a, int isdb, char *pre,
2219 int curr, unsigned long long itv)
2221 struct stats_net_icmp6
2222 *snic = (struct stats_net_icmp6 *) a->buf[curr],
2223 *snip = (struct stats_net_icmp6 *) a->buf[!curr];
2225 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2227 render(isdb, pre, PT_NOFLAG,
2228 "-\timsg6/s", NULL, NULL,
2230 S_VALUE(snip->InMsgs6, snic->InMsgs6, itv),
2233 render(isdb, pre, PT_NOFLAG,
2234 "-\tomsg6/s", NULL, NULL,
2236 S_VALUE(snip->OutMsgs6, snic->OutMsgs6, itv),
2239 render(isdb, pre, PT_NOFLAG,
2240 "-\tiech6/s", NULL, NULL,
2242 S_VALUE(snip->InEchos6, snic->InEchos6, itv),
2245 render(isdb, pre, PT_NOFLAG,
2246 "-\tiechr6/s", NULL, NULL,
2248 S_VALUE(snip->InEchoReplies6, snic->InEchoReplies6, itv),
2251 render(isdb, pre, PT_NOFLAG,
2252 "-\toechr6/s", NULL, NULL,
2254 S_VALUE(snip->OutEchoReplies6, snic->OutEchoReplies6, itv),
2257 render(isdb, pre, PT_NOFLAG,
2258 "-\tigmbq6/s", NULL, NULL,
2260 S_VALUE(snip->InGroupMembQueries6, snic->InGroupMembQueries6, itv),
2263 render(isdb, pre, PT_NOFLAG,
2264 "-\tigmbr6/s", NULL, NULL,
2266 S_VALUE(snip->InGroupMembResponses6, snic->InGroupMembResponses6, itv),
2269 render(isdb, pre, PT_NOFLAG,
2270 "-\togmbr6/s", NULL, NULL,
2272 S_VALUE(snip->OutGroupMembResponses6, snic->OutGroupMembResponses6, itv),
2275 render(isdb, pre, PT_NOFLAG,
2276 "-\tigmbrd6/s", NULL, NULL,
2278 S_VALUE(snip->InGroupMembReductions6, snic->InGroupMembReductions6, itv),
2281 render(isdb, pre, PT_NOFLAG,
2282 "-\togmbrd6/s", NULL, NULL,
2284 S_VALUE(snip->OutGroupMembReductions6, snic->OutGroupMembReductions6, itv),
2287 render(isdb, pre, PT_NOFLAG,
2288 "-\tirtsol6/s", NULL, NULL,
2290 S_VALUE(snip->InRouterSolicits6, snic->InRouterSolicits6, itv),
2293 render(isdb, pre, PT_NOFLAG,
2294 "-\tortsol6/s", NULL, NULL,
2296 S_VALUE(snip->OutRouterSolicits6, snic->OutRouterSolicits6, itv),
2299 render(isdb, pre, PT_NOFLAG,
2300 "-\tirtad6/s", NULL, NULL,
2302 S_VALUE(snip->InRouterAdvertisements6, snic->InRouterAdvertisements6, itv),
2305 render(isdb, pre, PT_NOFLAG,
2306 "-\tinbsol6/s", NULL, NULL,
2308 S_VALUE(snip->InNeighborSolicits6, snic->InNeighborSolicits6, itv),
2311 render(isdb, pre, PT_NOFLAG,
2312 "-\tonbsol6/s", NULL, NULL,
2314 S_VALUE(snip->OutNeighborSolicits6, snic->OutNeighborSolicits6, itv),
2317 render(isdb, pre, PT_NOFLAG,
2318 "-\tinbad6/s", NULL, NULL,
2320 S_VALUE(snip->InNeighborAdvertisements6, snic->InNeighborAdvertisements6, itv),
2323 render(isdb, pre, pt_newlin,
2324 "-\tonbad6/s", NULL, NULL,
2326 S_VALUE(snip->OutNeighborAdvertisements6, snic->OutNeighborAdvertisements6, itv),
2331 ***************************************************************************
2332 * Display ICMPv6 error message statistics in selected format.
2335 * @a Activity structure with statistics.
2336 * @isdb Flag, true if db printing, false if ppc printing.
2337 * @pre Prefix string for output entries
2338 * @curr Index in array for current sample statistics.
2339 * @itv Interval of time in jiffies.
2340 ***************************************************************************
2342 __print_funct_t render_net_eicmp6_stats(struct activity *a, int isdb, char *pre,
2343 int curr, unsigned long long itv)
2345 struct stats_net_eicmp6
2346 *sneic = (struct stats_net_eicmp6 *) a->buf[curr],
2347 *sneip = (struct stats_net_eicmp6 *) a->buf[!curr];
2349 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2351 render(isdb, pre, PT_NOFLAG,
2352 "-\tierr6/s", NULL, NULL,
2354 S_VALUE(sneip->InErrors6, sneic->InErrors6, itv),
2357 render(isdb, pre, PT_NOFLAG,
2358 "-\tidtunr6/s", NULL, NULL,
2360 S_VALUE(sneip->InDestUnreachs6, sneic->InDestUnreachs6, itv),
2363 render(isdb, pre, PT_NOFLAG,
2364 "-\todtunr6/s", NULL, NULL,
2366 S_VALUE(sneip->OutDestUnreachs6, sneic->OutDestUnreachs6, itv),
2369 render(isdb, pre, PT_NOFLAG,
2370 "-\titmex6/s", NULL, NULL,
2372 S_VALUE(sneip->InTimeExcds6, sneic->InTimeExcds6, itv),
2375 render(isdb, pre, PT_NOFLAG,
2376 "-\totmex6/s", NULL, NULL,
2378 S_VALUE(sneip->OutTimeExcds6, sneic->OutTimeExcds6, itv),
2381 render(isdb, pre, PT_NOFLAG,
2382 "-\tiprmpb6/s", NULL, NULL,
2384 S_VALUE(sneip->InParmProblems6, sneic->InParmProblems6, itv),
2387 render(isdb, pre, PT_NOFLAG,
2388 "-\toprmpb6/s", NULL, NULL,
2390 S_VALUE(sneip->OutParmProblems6, sneic->OutParmProblems6, itv),
2393 render(isdb, pre, PT_NOFLAG,
2394 "-\tiredir6/s", NULL, NULL,
2396 S_VALUE(sneip->InRedirects6, sneic->InRedirects6, itv),
2399 render(isdb, pre, PT_NOFLAG,
2400 "-\toredir6/s", NULL, NULL,
2402 S_VALUE(sneip->OutRedirects6, sneic->OutRedirects6, itv),
2405 render(isdb, pre, PT_NOFLAG,
2406 "-\tipck2b6/s", NULL, NULL,
2408 S_VALUE(sneip->InPktTooBigs6, sneic->InPktTooBigs6, itv),
2411 render(isdb, pre, pt_newlin,
2412 "-\topck2b6/s", NULL, NULL,
2414 S_VALUE(sneip->OutPktTooBigs6, sneic->OutPktTooBigs6, itv),
2419 ***************************************************************************
2420 * Display UDP6 network statistics in selected format.
2423 * @a Activity structure with statistics.
2424 * @isdb Flag, true if db printing, false if ppc printing.
2425 * @pre Prefix string for output entries
2426 * @curr Index in array for current sample statistics.
2427 * @itv Interval of time in jiffies.
2428 ***************************************************************************
2430 __print_funct_t render_net_udp6_stats(struct activity *a, int isdb, char *pre,
2431 int curr, unsigned long long itv)
2433 struct stats_net_udp6
2434 *snuc = (struct stats_net_udp6 *) a->buf[curr],
2435 *snup = (struct stats_net_udp6 *) a->buf[!curr];
2437 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2439 render(isdb, pre, PT_NOFLAG,
2440 "-\tidgm6/s", NULL, NULL,
2442 S_VALUE(snup->InDatagrams6, snuc->InDatagrams6, itv),
2445 render(isdb, pre, PT_NOFLAG,
2446 "-\todgm6/s", NULL, NULL,
2448 S_VALUE(snup->OutDatagrams6, snuc->OutDatagrams6, itv),
2451 render(isdb, pre, PT_NOFLAG,
2452 "-\tnoport6/s", NULL, NULL,
2454 S_VALUE(snup->NoPorts6, snuc->NoPorts6, itv),
2457 render(isdb, pre, pt_newlin,
2458 "-\tidgmer6/s", NULL, NULL,
2460 S_VALUE(snup->InErrors6, snuc->InErrors6, itv),
2465 ***************************************************************************
2466 * Display CPU frequency statistics in selected format.
2469 * @a Activity structure with statistics.
2470 * @isdb Flag, true if db printing, false if ppc printing.
2471 * @pre Prefix string for output entries
2472 * @curr Index in array for current sample statistics.
2473 * @itv Interval of time in jiffies.
2474 ***************************************************************************
2476 __print_funct_t render_pwr_cpufreq_stats(struct activity *a, int isdb, char *pre,
2477 int curr, unsigned long long itv)
2480 struct stats_pwr_cpufreq *spc;
2482 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2484 for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
2486 spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize);
2488 /* Should current CPU (including CPU "all") be displayed? */
2489 if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
2492 /* This is CPU "all" */
2493 render(isdb, pre, pt_newlin,
2497 ((double) spc->cpufreq) / 100,
2501 render(isdb, pre, pt_newlin,
2503 "%d", cons(iv, i - 1, NOVAL),
2505 ((double) spc->cpufreq) / 100,
2513 ***************************************************************************
2514 * Display fan statistics in selected format.
2517 * @a Activity structure with statistics.
2518 * @isdb Flag, true if db printing, false if ppc printing.
2519 * @pre Prefix string for output entries
2520 * @curr Index in array for current sample statistics.
2521 * @itv Interval of time in jiffies.
2522 ***************************************************************************
2524 __print_funct_t render_pwr_fan_stats(struct activity *a, int isdb, char *pre,
2525 int curr, unsigned long long itv)
2528 struct stats_pwr_fan *spc;
2530 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2532 for (i = 0; i < a->nr; i++) {
2533 spc = (struct stats_pwr_fan *) ((char *) a->buf[curr] + i * a->msize);
2535 render(isdb, pre, PT_USESTR,
2538 cons(iv, i + 1, NOVAL),
2543 render(isdb, pre, PT_NOFLAG,
2546 cons(iv, i + 1, NOVAL),
2551 render(isdb, pre, pt_newlin,
2554 cons(iv, i + 1, NOVAL),
2556 spc->rpm - spc->rpm_min,
2562 ***************************************************************************
2563 * Display temperature statistics in selected format.
2566 * @a Activity structure with statistics.
2567 * @isdb Flag, true if db printing, false if ppc printing.
2568 * @pre Prefix string for output entries
2569 * @curr Index in array for current sample statistics.
2570 * @itv Interval of time in jiffies.
2571 ***************************************************************************
2573 __print_funct_t render_pwr_temp_stats(struct activity *a, int isdb, char *pre,
2574 int curr, unsigned long long itv)
2577 struct stats_pwr_temp *spc;
2579 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2581 for (i = 0; i < a->nr; i++) {
2582 spc = (struct stats_pwr_temp *) ((char *) a->buf[curr] + i * a->msize);
2584 render(isdb, pre, PT_USESTR,
2587 cons(iv, i + 1, NOVAL),
2592 render(isdb, pre, PT_NOFLAG,
2595 cons(iv, i + 1, NOVAL),
2600 render(isdb, pre, pt_newlin,
2603 cons(iv, i + 1, NOVAL),
2605 (spc->temp_max - spc->temp_min) ?
2606 (spc->temp - spc->temp_min) / (spc->temp_max - spc->temp_min) * 100 :
2613 ***************************************************************************
2614 * Display voltage inputs statistics in selected format.
2617 * @a Activity structure with statistics.
2618 * @isdb Flag, true if db printing, false if ppc printing.
2619 * @pre Prefix string for output entries
2620 * @curr Index in array for current sample statistics.
2621 * @itv Interval of time in jiffies.
2622 ***************************************************************************
2624 __print_funct_t render_pwr_in_stats(struct activity *a, int isdb, char *pre,
2625 int curr, unsigned long long itv)
2628 struct stats_pwr_in *spc;
2630 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2632 for (i = 0; i < a->nr; i++) {
2633 spc = (struct stats_pwr_in *) ((char *) a->buf[curr] + i * a->msize);
2635 render(isdb, pre, PT_USESTR,
2643 render(isdb, pre, PT_NOFLAG,
2651 render(isdb, pre, pt_newlin,
2656 (spc->in_max - spc->in_min) ?
2657 (spc->in - spc->in_min) / (spc->in_max - spc->in_min) * 100 :
2664 ***************************************************************************
2665 * Display huge pages statistics in selected format.
2668 * @a Activity structure with statistics.
2669 * @isdb Flag, true if db printing, false if ppc printing.
2670 * @pre Prefix string for output entries
2671 * @curr Index in array for current sample statistics.
2672 * @itv Interval of time in jiffies.
2673 ***************************************************************************
2675 __print_funct_t render_huge_stats(struct activity *a, int isdb, char *pre,
2676 int curr, unsigned long long itv)
2679 *smc = (struct stats_huge *) a->buf[curr];
2681 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2683 render(isdb, pre, PT_USEINT,
2684 "-\tkbhugfree", NULL, NULL,
2685 smc->frhkb, DNOVAL, NULL);
2687 render(isdb, pre, PT_USEINT,
2688 "-\tkbhugused", NULL, NULL,
2689 smc->tlhkb - smc->frhkb, DNOVAL, NULL);
2691 render(isdb, pre, pt_newlin,
2692 "-\t%%hugused", NULL, NULL, NOVAL,
2694 SP_VALUE(smc->frhkb, smc->tlhkb, smc->tlhkb) :
2699 ***************************************************************************
2700 * Display weighted CPU frequency statistics in selected format.
2703 * @a Activity structure with statistics.
2704 * @isdb Flag, true if db printing, false if ppc printing.
2705 * @pre Prefix string for output entries
2706 * @curr Index in array for current sample statistics.
2707 * @itv Interval of time in jiffies.
2708 ***************************************************************************
2710 __print_funct_t render_pwr_wghfreq_stats(struct activity *a, int isdb, char *pre,
2711 int curr, unsigned long long itv)
2714 struct stats_pwr_wghfreq *spc, *spp, *spc_k, *spp_k;
2715 unsigned long long tis, tisfreq;
2717 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2719 for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
2721 spc = (struct stats_pwr_wghfreq *) ((char *) a->buf[curr] + i * a->msize * a->nr2);
2722 spp = (struct stats_pwr_wghfreq *) ((char *) a->buf[!curr] + i * a->msize * a->nr2);
2724 /* Should current CPU (including CPU "all") be displayed? */
2725 if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
2731 for (k = 0; k < a->nr2; k++) {
2733 spc_k = (struct stats_pwr_wghfreq *) ((char *) spc + k * a->msize);
2736 spp_k = (struct stats_pwr_wghfreq *) ((char *) spp + k * a->msize);
2738 tisfreq += (spc_k->freq / 1000) *
2739 (spc_k->time_in_state - spp_k->time_in_state);
2740 tis += (spc_k->time_in_state - spp_k->time_in_state);
2744 /* This is CPU "all" */
2745 render(isdb, pre, pt_newlin,
2749 tis ? ((double) tisfreq) / tis : 0.0,
2753 render(isdb, pre, pt_newlin,
2755 "%d", cons(iv, i - 1, NOVAL),
2757 tis ? ((double) tisfreq) / tis : 0.0,
2765 ***************************************************************************
2766 * Display USB devices statistics in selected format.
2769 * @a Activity structure with statistics.
2770 * @isdb Flag, true if db printing, false if ppc printing.
2771 * @pre Prefix string for output entries
2772 * @curr Index in array for current sample statistics.
2773 * @itv Interval of time in jiffies.
2774 ***************************************************************************
2776 __print_funct_t render_pwr_usb_stats(struct activity *a, int isdb, char *pre,
2777 int curr, unsigned long long itv)
2780 struct stats_pwr_usb *suc;
2783 for (i = 0; i < a->nr; i++) {
2784 suc = (struct stats_pwr_usb *) ((char *) a->buf[curr] + i * a->msize);
2787 /* Bus#0 doesn't exist: We are at the end of the list */
2790 sprintf(id, "%x", suc->vendor_id);
2791 render(isdb, pre, PT_USESTR,
2794 cons(iv, suc->bus_nr, NOVAL),
2799 sprintf(id, "%x", suc->product_id);
2800 render(isdb, pre, PT_USESTR,
2803 cons(iv, suc->bus_nr, NOVAL),
2808 render(isdb, pre, PT_USEINT,
2811 cons(iv, suc->bus_nr, NOVAL),
2812 suc->bmaxpower << 1,
2816 render(isdb, pre, PT_USESTR,
2819 cons(iv, suc->bus_nr, NOVAL),
2825 (DISPLAY_HORIZONTALLY(flags) ? PT_USESTR : PT_USESTR | PT_NEWLIN),
2828 cons(iv, suc->bus_nr, NOVAL),
2836 ***************************************************************************
2837 * Display filesystems statistics in selected format.
2840 * @a Activity structure with statistics.
2841 * @isdb Flag, true if db printing, false if ppc printing.
2842 * @pre Prefix string for output entries
2843 * @curr Index in array for current sample statistics.
2844 * @itv Interval of time in jiffies.
2845 ***************************************************************************
2847 __print_funct_t render_filesystem_stats(struct activity *a, int isdb, char *pre,
2848 int curr, unsigned long long itv)
2851 struct stats_filesystem *sfc;
2853 for (i = 0; i < a->nr; i++) {
2854 sfc = (struct stats_filesystem *) ((char *) a->buf[curr] + i * a->msize);
2857 /* Size of filesystem is null: We are at the end of the list */
2860 render(isdb, pre, PT_USERND,
2863 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2865 (double) sfc->f_bfree / 1024 / 1024,
2868 render(isdb, pre, PT_USERND,
2871 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2873 (double) (sfc->f_blocks - sfc->f_bfree) / 1024 / 1024,
2876 render(isdb, pre, PT_NOFLAG,
2879 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2881 sfc->f_blocks ? SP_VALUE(sfc->f_bfree, sfc->f_blocks, sfc->f_blocks)
2885 render(isdb, pre, PT_NOFLAG,
2888 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2890 sfc->f_blocks ? SP_VALUE(sfc->f_bavail, sfc->f_blocks, sfc->f_blocks)
2894 render(isdb, pre, PT_USEINT,
2897 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2902 render(isdb, pre, PT_USEINT,
2905 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2906 sfc->f_files - sfc->f_ffree,
2911 (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN),
2914 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2916 sfc->f_files ? SP_VALUE(sfc->f_ffree, sfc->f_files, sfc->f_files)
2923 ***************************************************************************
2924 * Display Fibre Channel HBA statistics in selected format.
2927 * @a Activity structure with statistics.
2928 * @isdb Flag, true if db printing, false if ppc printing.
2929 * @pre Prefix string for output entries
2930 * @curr Index in array for current sample statistics.
2931 * @itv Interval of time in jiffies.
2932 ***************************************************************************
2934 __print_funct_t render_fchost_stats(struct activity *a, int isdb, char *pre,
2935 int curr, unsigned long long itv)
2938 struct stats_fchost *sfcc, *sfcp;
2940 for (i = 0; i < a->nr; i++) {
2941 sfcc = (struct stats_fchost *) ((char *) a->buf[curr] + i * a->msize);
2942 sfcp = (struct stats_fchost *) ((char *) a->buf[!curr] + i * a->msize);
2944 if (!sfcc->fchost_name[0])
2945 /* We are at the end of the list */
2948 render(isdb, pre, PT_NOFLAG ,
2951 cons(sv, sfcc->fchost_name, NOVAL),
2953 S_VALUE(sfcp->f_rxframes, sfcc->f_rxframes, itv),
2955 render(isdb, pre, PT_NOFLAG,
2956 "%s\tfch_txf/s", NULL,
2957 cons(sv, sfcc->fchost_name, NULL),
2959 S_VALUE(sfcp->f_txframes, sfcc->f_txframes, itv),
2961 render(isdb, pre, PT_NOFLAG,
2962 "%s\tfch_rxw/s", NULL,
2963 cons(sv, sfcc->fchost_name, NULL),
2965 S_VALUE(sfcp->f_rxwords, sfcc->f_rxwords, itv),
2968 (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN),
2969 "%s\tfch_txw/s", NULL,
2970 cons(sv, sfcc->fchost_name, NULL),
2972 S_VALUE(sfcp->f_txwords, sfcc->f_txwords, itv),