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);
687 * If we get negative values, this is probably because
688 * one or more devices/filesystems have been unmounted.
689 * We display 0.0 in this case though we should rather tell
690 * the user that the value cannot be calculated here.
692 render(isdb, pre, PT_NOFLAG,
693 "-\ttps", NULL, NULL,
695 sic->dk_drive < sip->dk_drive ? 0.0 :
696 S_VALUE(sip->dk_drive, sic->dk_drive, itv),
699 render(isdb, pre, PT_NOFLAG,
700 "-\trtps", NULL, NULL,
702 sic->dk_drive_rio < sip->dk_drive_rio ? 0.0 :
703 S_VALUE(sip->dk_drive_rio, sic->dk_drive_rio, itv),
706 render(isdb, pre, PT_NOFLAG,
707 "-\twtps", NULL, NULL,
709 sic->dk_drive_wio < sip->dk_drive_wio ? 0.0 :
710 S_VALUE(sip->dk_drive_wio, sic->dk_drive_wio, itv),
713 render(isdb, pre, PT_NOFLAG,
714 "-\tbread/s", NULL, NULL,
716 sic->dk_drive_rblk < sip->dk_drive_rblk ? 0.0 :
717 S_VALUE(sip->dk_drive_rblk, sic->dk_drive_rblk, itv),
720 render(isdb, pre, pt_newlin,
721 "-\tbwrtn/s", NULL, NULL,
723 sic->dk_drive_wblk < sip->dk_drive_wblk ? 0.0 :
724 S_VALUE(sip->dk_drive_wblk, sic->dk_drive_wblk, itv),
729 ***************************************************************************
730 * Display memory and swap statistics in selected format.
733 * @a Activity structure with statistics.
734 * @isdb Flag, true if db printing, false if ppc printing.
735 * @pre Prefix string for output entries
736 * @curr Index in array for current sample statistics.
737 * @itv Interval of time in jiffies.
738 ***************************************************************************
740 __print_funct_t render_memory_stats(struct activity *a, int isdb, char *pre,
741 int curr, unsigned long long itv)
744 *smc = (struct stats_memory *) a->buf[curr],
745 *smp = (struct stats_memory *) a->buf[!curr];
747 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
750 if (DISPLAY_MEMORY(a->opt_flags)) {
752 render(isdb, pre, PT_NOFLAG,
753 "-\tfrmpg/s", NULL, NULL,
755 S_VALUE((double) KB_TO_PG(smp->frmkb),
756 (double) KB_TO_PG(smc->frmkb), itv),
759 render(isdb, pre, PT_NOFLAG,
760 "-\tbufpg/s", NULL, NULL,
762 S_VALUE((double) KB_TO_PG(smp->bufkb),
763 (double) KB_TO_PG(smc->bufkb), itv),
766 render(isdb, pre, pt_newlin,
767 "-\tcampg/s", NULL, NULL,
769 S_VALUE((double) KB_TO_PG(smp->camkb),
770 (double) KB_TO_PG(smc->camkb), itv),
774 if (DISPLAY_MEM_AMT(a->opt_flags)) {
776 render(isdb, pre, PT_USEINT,
777 "-\tkbmemfree", NULL, NULL,
778 smc->frmkb, DNOVAL, NULL);
780 render(isdb, pre, PT_USEINT,
781 "-\tkbmemused", NULL, NULL,
782 smc->tlmkb - smc->frmkb, DNOVAL, NULL);
784 render(isdb, pre, PT_NOFLAG,
785 "-\t%%memused", NULL, NULL, NOVAL,
787 SP_VALUE(smc->frmkb, smc->tlmkb, smc->tlmkb) :
790 render(isdb, pre, PT_USEINT,
791 "-\tkbbuffers", NULL, NULL,
792 smc->bufkb, DNOVAL, NULL);
794 render(isdb, pre, PT_USEINT,
795 "-\tkbcached", NULL, NULL,
796 smc->camkb, DNOVAL, NULL);
798 render(isdb, pre, PT_USEINT,
799 "-\tkbcommit", NULL, NULL,
800 smc->comkb, DNOVAL, NULL);
802 render(isdb, pre, PT_NOFLAG,
803 "-\t%%commit", NULL, NULL, NOVAL,
804 (smc->tlmkb + smc->tlskb) ?
805 SP_VALUE(0, smc->comkb, smc->tlmkb + smc->tlskb) :
808 render(isdb, pre, PT_USEINT,
809 "-\tkbactive", NULL, NULL,
810 smc->activekb, DNOVAL, NULL);
812 render(isdb, pre, PT_USEINT,
813 "-\tkbinact", NULL, NULL,
814 smc->inactkb, DNOVAL, NULL);
816 ptn = DISPLAY_MEM_ALL(a->opt_flags) ? 0 : pt_newlin;
817 render(isdb, pre, PT_USEINT | ptn,
818 "-\tkbdirty", NULL, NULL,
819 smc->dirtykb, DNOVAL, NULL);
821 if (DISPLAY_MEM_ALL(a->opt_flags)) {
822 render(isdb, pre, PT_USEINT,
823 "-\tkbanonpg", NULL, NULL,
824 smc->anonpgkb, DNOVAL, NULL);
826 render(isdb, pre, PT_USEINT,
827 "-\tkbslab", NULL, NULL,
828 smc->slabkb, DNOVAL, NULL);
830 render(isdb, pre, PT_USEINT,
831 "-\tkbkstack", NULL, NULL,
832 smc->kstackkb, DNOVAL, NULL);
834 render(isdb, pre, PT_USEINT,
835 "-\tkbpgtbl", NULL, NULL,
836 smc->pgtblkb, DNOVAL, NULL);
838 render(isdb, pre, PT_USEINT | pt_newlin,
839 "-\tkbvmused", NULL, NULL,
840 smc->vmusedkb, DNOVAL, NULL);
844 if (DISPLAY_SWAP(a->opt_flags)) {
846 render(isdb, pre, PT_USEINT,
847 "-\tkbswpfree", NULL, NULL,
848 smc->frskb, DNOVAL, NULL);
850 render(isdb, pre, PT_USEINT,
851 "-\tkbswpused", NULL, NULL,
852 smc->tlskb - smc->frskb, DNOVAL, NULL);
854 render(isdb, pre, PT_NOFLAG,
855 "-\t%%swpused", NULL, NULL, NOVAL,
857 SP_VALUE(smc->frskb, smc->tlskb, smc->tlskb) :
860 render(isdb, pre, PT_USEINT,
861 "-\tkbswpcad", NULL, NULL,
862 smc->caskb, DNOVAL, NULL);
864 render(isdb, pre, pt_newlin,
865 "-\t%%swpcad", NULL, NULL, NOVAL,
866 (smc->tlskb - smc->frskb) ?
867 SP_VALUE(0, smc->caskb, smc->tlskb - smc->frskb) :
873 ***************************************************************************
874 * Display kernel tables statistics in selected format.
877 * @a Activity structure with statistics.
878 * @isdb Flag, true if db printing, false if ppc printing.
879 * @pre Prefix string for output entries
880 * @curr Index in array for current sample statistics.
881 * @itv Interval of time in jiffies.
882 ***************************************************************************
884 __print_funct_t render_ktables_stats(struct activity *a, int isdb, char *pre,
885 int curr, unsigned long long itv)
888 *skc = (struct stats_ktables *) a->buf[curr];
890 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
892 render(isdb, pre, PT_USEINT,
893 "-\tdentunusd", NULL, NULL,
894 skc->dentry_stat, DNOVAL, NULL);
896 render(isdb, pre, PT_USEINT,
897 "-\tfile-nr", NULL, NULL,
898 skc->file_used, DNOVAL, NULL);
900 render(isdb, pre, PT_USEINT,
901 "-\tinode-nr", NULL, NULL,
902 skc->inode_used, DNOVAL, NULL);
904 render(isdb, pre, PT_USEINT | pt_newlin,
905 "-\tpty-nr", NULL, NULL,
906 skc->pty_nr, DNOVAL, NULL);
910 ***************************************************************************
911 * Display queue and load statistics in selected format.
914 * @a Activity structure with statistics.
915 * @isdb Flag, true if db printing, false if ppc printing.
916 * @pre Prefix string for output entries
917 * @curr Index in array for current sample statistics.
918 * @itv Interval of time in jiffies.
919 ***************************************************************************
921 __print_funct_t render_queue_stats(struct activity *a, int isdb, char *pre,
922 int curr, unsigned long long itv)
925 *sqc = (struct stats_queue *) a->buf[curr];
927 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
929 render(isdb, pre, PT_USEINT,
930 "-\trunq-sz", NULL, NULL,
931 sqc->nr_running, DNOVAL, NULL);
933 render(isdb, pre, PT_USEINT,
934 "-\tplist-sz", NULL, NULL,
935 sqc->nr_threads, DNOVAL, NULL);
937 render(isdb, pre, PT_NOFLAG,
938 "-\tldavg-1", NULL, NULL,
940 (double) sqc->load_avg_1 / 100,
943 render(isdb, pre, PT_NOFLAG,
944 "-\tldavg-5", NULL, NULL,
946 (double) sqc->load_avg_5 / 100,
949 render(isdb, pre, PT_NOFLAG,
950 "-\tldavg-15", NULL, NULL,
952 (double) sqc->load_avg_15 / 100,
955 render(isdb, pre, PT_USEINT | pt_newlin,
956 "-\tblocked", NULL, NULL,
957 sqc->procs_blocked, DNOVAL, NULL);
961 ***************************************************************************
962 * Display serial lines statistics in selected format.
965 * @a Activity structure with statistics.
966 * @isdb Flag, true if db printing, false if ppc printing.
967 * @pre Prefix string for output entries
968 * @curr Index in array for current sample statistics.
969 * @itv Interval of time in jiffies.
970 ***************************************************************************
972 __print_funct_t render_serial_stats(struct activity *a, int isdb, char *pre,
973 int curr, unsigned long long itv)
976 struct stats_serial *ssc, *ssp;
978 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
980 for (i = 0; i < a->nr; i++) {
982 ssc = (struct stats_serial *) ((char *) a->buf[curr] + i * a->msize);
983 ssp = (struct stats_serial *) ((char *) a->buf[!curr] + i * a->msize);
988 if (ssc->line == ssp->line) {
989 render(isdb, pre, PT_NOFLAG,
990 "ttyS%d\trcvin/s", "%d",
991 cons(iv, ssc->line - 1, NOVAL),
993 S_VALUE(ssp->rx, ssc->rx, itv),
996 render(isdb, pre, PT_NOFLAG,
997 "ttyS%d\txmtin/s", "%d",
998 cons(iv, ssc->line - 1, NOVAL),
1000 S_VALUE(ssp->tx, ssc->tx, itv),
1003 render(isdb, pre, PT_NOFLAG,
1004 "ttyS%d\tframerr/s", "%d",
1005 cons(iv, ssc->line - 1, NOVAL),
1007 S_VALUE(ssp->frame, ssc->frame, itv),
1010 render(isdb, pre, PT_NOFLAG,
1011 "ttyS%d\tprtyerr/s", "%d",
1012 cons(iv, ssc->line - 1, NOVAL),
1014 S_VALUE(ssp->parity, ssc->parity, itv),
1017 render(isdb, pre, PT_NOFLAG,
1018 "ttyS%d\tbrk/s", "%d",
1019 cons(iv, ssc->line - 1, NOVAL),
1021 S_VALUE(ssp->brk, ssc->brk, itv),
1024 render(isdb, pre, pt_newlin,
1025 "ttyS%d\tovrun/s", "%d",
1026 cons(iv, ssc->line - 1, NOVAL),
1028 S_VALUE(ssp->overrun, ssc->overrun, itv),
1035 ***************************************************************************
1036 * Display disks statistics in selected format.
1039 * @a Activity structure with statistics.
1040 * @isdb Flag, true if db printing, false if ppc printing.
1041 * @pre Prefix string for output entries
1042 * @curr Index in array for current sample statistics.
1043 * @itv Interval of time in jiffies.
1044 ***************************************************************************
1046 __print_funct_t render_disk_stats(struct activity *a, int isdb, char *pre,
1047 int curr, unsigned long long itv)
1050 struct stats_disk *sdc, *sdp;
1051 struct ext_disk_stats xds;
1052 char *dev_name, *persist_dev_name;
1054 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1056 for (i = 0; i < a->nr; i++) {
1058 sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize);
1060 if (!(sdc->major + sdc->minor))
1063 j = check_disk_reg(a, curr, !curr, i);
1064 sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
1066 /* Compute extended stats (service time, etc.) */
1067 compute_ext_disk_stats(sdc, sdp, itv, &xds);
1070 persist_dev_name = NULL;
1072 if (DISPLAY_PERSIST_NAME_S(flags)) {
1073 persist_dev_name = get_persistent_name_from_pretty(get_devname(sdc->major, sdc->minor, TRUE));
1076 if (persist_dev_name) {
1077 dev_name = persist_dev_name;
1080 if ((USE_PRETTY_OPTION(flags)) && (sdc->major == dm_major)) {
1081 dev_name = transform_devmapname(sdc->major, sdc->minor);
1085 dev_name = get_devname(sdc->major, sdc->minor,
1086 USE_PRETTY_OPTION(flags));
1090 render(isdb, pre, PT_NOFLAG,
1092 cons(sv, dev_name, NULL),
1094 S_VALUE(sdp->nr_ios, sdc->nr_ios, itv),
1097 render(isdb, pre, PT_NOFLAG,
1098 "%s\trd_sec/s", NULL,
1099 cons(sv, dev_name, NULL),
1101 S_VALUE(sdp->rd_sect, sdc->rd_sect, itv),
1104 render(isdb, pre, PT_NOFLAG,
1105 "%s\twr_sec/s", NULL,
1106 cons(sv, dev_name, NULL),
1108 S_VALUE(sdp->wr_sect, sdc->wr_sect, itv),
1111 render(isdb, pre, PT_NOFLAG,
1112 "%s\tavgrq-sz", NULL,
1113 cons(sv, dev_name, NULL),
1118 render(isdb, pre, PT_NOFLAG,
1119 "%s\tavgqu-sz", NULL,
1120 cons(sv, dev_name, NULL),
1122 S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,
1125 render(isdb, pre, PT_NOFLAG,
1127 cons(sv, dev_name, NULL),
1132 render(isdb, pre, PT_NOFLAG,
1134 cons(sv, dev_name, NULL),
1139 render(isdb, pre, pt_newlin,
1141 cons(sv, dev_name, NULL),
1149 ***************************************************************************
1150 * Display network interfaces statistics in selected format.
1153 * @a Activity structure with statistics.
1154 * @isdb Flag, true if db printing, false if ppc printing.
1155 * @pre Prefix string for output entries
1156 * @curr Index in array for current sample statistics.
1157 * @itv Interval of time in jiffies.
1158 ***************************************************************************
1160 __print_funct_t render_net_dev_stats(struct activity *a, int isdb, char *pre,
1161 int curr, unsigned long long itv)
1164 struct stats_net_dev *sndc, *sndp;
1165 double rxkb, txkb, ifutil;
1167 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1169 for (i = 0; i < a->nr; i++) {
1171 sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize);
1173 if (!strcmp(sndc->interface, ""))
1176 j = check_net_dev_reg(a, curr, !curr, i);
1177 sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize);
1179 render(isdb, pre, PT_NOFLAG,
1180 "%s\trxpck/s", "%s",
1181 cons(sv, sndc->interface, NULL), /* What if the format args are strings? */
1183 S_VALUE(sndp->rx_packets, sndc->rx_packets, itv),
1186 render(isdb, pre, PT_NOFLAG,
1187 "%s\ttxpck/s", NULL,
1188 cons(sv, sndc->interface, NULL),
1190 S_VALUE(sndp->tx_packets, sndc->tx_packets, itv),
1193 rxkb = S_VALUE(sndp->rx_bytes, sndc->rx_bytes, itv);
1194 render(isdb, pre, PT_NOFLAG,
1196 cons(sv, sndc->interface, NULL),
1201 txkb = S_VALUE(sndp->tx_bytes, sndc->tx_bytes, itv);
1202 render(isdb, pre, PT_NOFLAG,
1204 cons(sv, sndc->interface, NULL),
1209 render(isdb, pre, PT_NOFLAG,
1210 "%s\trxcmp/s", NULL,
1211 cons(sv, sndc->interface, NULL),
1213 S_VALUE(sndp->rx_compressed, sndc->rx_compressed, itv),
1216 render(isdb, pre, PT_NOFLAG,
1217 "%s\ttxcmp/s", NULL,
1218 cons(sv, sndc->interface, NULL),
1220 S_VALUE(sndp->tx_compressed, sndc->tx_compressed, itv),
1223 render(isdb, pre, PT_NOFLAG,
1224 "%s\trxmcst/s", NULL,
1225 cons(sv, sndc->interface, NULL),
1227 S_VALUE(sndp->multicast, sndc->multicast, itv),
1230 ifutil = compute_ifutil(sndc, rxkb, txkb);
1231 render(isdb, pre, pt_newlin,
1232 "%s\t%%ifutil", NULL,
1233 cons(sv, sndc->interface, NULL),
1241 ***************************************************************************
1242 * Display network interface errors statistics in selected format.
1245 * @a Activity structure with statistics.
1246 * @isdb Flag, true if db printing, false if ppc printing.
1247 * @pre Prefix string for output entries
1248 * @curr Index in array for current sample statistics.
1249 * @itv Interval of time in jiffies.
1250 ***************************************************************************
1252 __print_funct_t render_net_edev_stats(struct activity *a, int isdb, char *pre,
1253 int curr, unsigned long long itv)
1256 struct stats_net_edev *snedc, *snedp;
1258 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1260 for (i = 0; i < a->nr; i++) {
1262 snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize);
1264 if (!strcmp(snedc->interface, ""))
1267 j = check_net_edev_reg(a, curr, !curr, i);
1268 snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize);
1270 render(isdb, pre, PT_NOFLAG,
1271 "%s\trxerr/s", "%s",
1272 cons(sv, snedc->interface, NULL),
1274 S_VALUE(snedp->rx_errors, snedc->rx_errors, itv),
1277 render(isdb, pre, PT_NOFLAG,
1278 "%s\ttxerr/s", NULL,
1279 cons(sv, snedc->interface, NULL),
1281 S_VALUE(snedp->tx_errors, snedc->tx_errors, itv),
1284 render(isdb, pre, PT_NOFLAG,
1286 cons(sv, snedc->interface, NULL),
1288 S_VALUE(snedp->collisions, snedc->collisions, itv),
1291 render(isdb, pre, PT_NOFLAG,
1292 "%s\trxdrop/s", NULL,
1293 cons(sv, snedc->interface, NULL),
1295 S_VALUE(snedp->rx_dropped, snedc->rx_dropped, itv),
1298 render(isdb, pre, PT_NOFLAG,
1299 "%s\ttxdrop/s", NULL,
1300 cons(sv, snedc->interface, NULL),
1302 S_VALUE(snedp->tx_dropped, snedc->tx_dropped, itv),
1305 render(isdb, pre, PT_NOFLAG,
1306 "%s\ttxcarr/s", NULL,
1307 cons(sv, snedc->interface, NULL),
1309 S_VALUE(snedp->tx_carrier_errors, snedc->tx_carrier_errors, itv),
1312 render(isdb, pre, PT_NOFLAG,
1313 "%s\trxfram/s", NULL,
1314 cons(sv, snedc->interface, NULL),
1316 S_VALUE(snedp->rx_frame_errors, snedc->rx_frame_errors, itv),
1319 render(isdb, pre, PT_NOFLAG,
1320 "%s\trxfifo/s", NULL,
1321 cons(sv, snedc->interface, NULL),
1323 S_VALUE(snedp->rx_fifo_errors, snedc->rx_fifo_errors, itv),
1326 render(isdb, pre, pt_newlin,
1327 "%s\ttxfifo/s", NULL,
1328 cons(sv, snedc->interface, NULL),
1330 S_VALUE(snedp->tx_fifo_errors, snedc->tx_fifo_errors, itv),
1336 ***************************************************************************
1337 * Display NFS client statistics in selected format.
1340 * @a Activity structure with statistics.
1341 * @isdb Flag, true if db printing, false if ppc printing.
1342 * @pre Prefix string for output entries
1343 * @curr Index in array for current sample statistics.
1344 * @itv Interval of time in jiffies.
1345 ***************************************************************************
1347 __print_funct_t render_net_nfs_stats(struct activity *a, int isdb, char *pre,
1348 int curr, unsigned long long itv)
1350 struct stats_net_nfs
1351 *snnc = (struct stats_net_nfs *) a->buf[curr],
1352 *snnp = (struct stats_net_nfs *) a->buf[!curr];
1354 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1356 render(isdb, pre, PT_NOFLAG,
1357 "-\tcall/s", NULL, NULL,
1359 S_VALUE(snnp->nfs_rpccnt, snnc->nfs_rpccnt, itv),
1362 render(isdb, pre, PT_NOFLAG,
1363 "-\tretrans/s", NULL, NULL,
1365 S_VALUE(snnp->nfs_rpcretrans, snnc->nfs_rpcretrans, itv),
1368 render(isdb, pre, PT_NOFLAG,
1369 "-\tread/s", NULL, NULL,
1371 S_VALUE(snnp->nfs_readcnt, snnc->nfs_readcnt, itv),
1374 render(isdb, pre, PT_NOFLAG,
1375 "-\twrite/s", NULL, NULL,
1377 S_VALUE(snnp->nfs_writecnt, snnc->nfs_writecnt, itv),
1380 render(isdb, pre, PT_NOFLAG,
1381 "-\taccess/s", NULL, NULL,
1383 S_VALUE(snnp->nfs_accesscnt, snnc->nfs_accesscnt, itv),
1386 render(isdb, pre, pt_newlin,
1387 "-\tgetatt/s", NULL, NULL,
1389 S_VALUE(snnp->nfs_getattcnt, snnc->nfs_getattcnt, itv),
1394 ***************************************************************************
1395 * Display NFS server statistics in selected format.
1398 * @a Activity structure with statistics.
1399 * @isdb Flag, true if db printing, false if ppc printing.
1400 * @pre Prefix string for output entries
1401 * @curr Index in array for current sample statistics.
1402 * @itv Interval of time in jiffies.
1403 ***************************************************************************
1405 __print_funct_t render_net_nfsd_stats(struct activity *a, int isdb, char *pre,
1406 int curr, unsigned long long itv)
1408 struct stats_net_nfsd
1409 *snndc = (struct stats_net_nfsd *) a->buf[curr],
1410 *snndp = (struct stats_net_nfsd *) a->buf[!curr];
1412 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1414 render(isdb, pre, PT_NOFLAG,
1415 "-\tscall/s", NULL, NULL,
1417 S_VALUE(snndp->nfsd_rpccnt, snndc->nfsd_rpccnt, itv),
1420 render(isdb, pre, PT_NOFLAG,
1421 "-\tbadcall/s", NULL, NULL,
1423 S_VALUE(snndp->nfsd_rpcbad, snndc->nfsd_rpcbad, itv),
1426 render(isdb, pre, PT_NOFLAG,
1427 "-\tpacket/s", NULL, NULL,
1429 S_VALUE(snndp->nfsd_netcnt, snndc->nfsd_netcnt, itv),
1432 render(isdb, pre, PT_NOFLAG,
1433 "-\tudp/s", NULL, NULL,
1435 S_VALUE(snndp->nfsd_netudpcnt, snndc->nfsd_netudpcnt, itv),
1438 render(isdb, pre, PT_NOFLAG,
1439 "-\ttcp/s", NULL, NULL,
1441 S_VALUE(snndp->nfsd_nettcpcnt, snndc->nfsd_nettcpcnt, itv),
1444 render(isdb, pre, PT_NOFLAG,
1445 "-\thit/s", NULL, NULL,
1447 S_VALUE(snndp->nfsd_rchits, snndc->nfsd_rchits, itv),
1450 render(isdb, pre, PT_NOFLAG,
1451 "-\tmiss/s", NULL, NULL,
1453 S_VALUE(snndp->nfsd_rcmisses, snndc->nfsd_rcmisses, itv),
1456 render(isdb, pre, PT_NOFLAG,
1457 "-\tsread/s", NULL, NULL,
1459 S_VALUE(snndp->nfsd_readcnt, snndc->nfsd_readcnt, itv),
1462 render(isdb, pre, PT_NOFLAG,
1463 "-\tswrite/s", NULL, NULL,
1465 S_VALUE(snndp->nfsd_writecnt, snndc->nfsd_writecnt, itv),
1468 render(isdb, pre, PT_NOFLAG,
1469 "-\tsaccess/s", NULL, NULL,
1471 S_VALUE(snndp->nfsd_accesscnt, snndc->nfsd_accesscnt, itv),
1474 render(isdb, pre, pt_newlin,
1475 "-\tsgetatt/s", NULL, NULL,
1477 S_VALUE(snndp->nfsd_getattcnt, snndc->nfsd_getattcnt, itv),
1482 ***************************************************************************
1483 * Display network sockets statistics in selected format.
1486 * @a Activity structure with statistics.
1487 * @isdb Flag, true if db printing, false if ppc printing.
1488 * @pre Prefix string for output entries
1489 * @curr Index in array for current sample statistics.
1490 * @itv Interval of time in jiffies.
1491 ***************************************************************************
1493 __print_funct_t render_net_sock_stats(struct activity *a, int isdb, char *pre,
1494 int curr, unsigned long long itv)
1496 struct stats_net_sock
1497 *snsc = (struct stats_net_sock *) a->buf[curr];
1499 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1501 render(isdb, pre, PT_USEINT,
1502 "-\ttotsck", NULL, NULL,
1503 snsc->sock_inuse, DNOVAL, NULL);
1505 render(isdb, pre, PT_USEINT,
1506 "-\ttcpsck", NULL, NULL,
1507 snsc->tcp_inuse, DNOVAL, NULL);
1509 render(isdb, pre, PT_USEINT,
1510 "-\tudpsck", NULL, NULL,
1511 snsc->udp_inuse, DNOVAL, NULL);
1513 render(isdb, pre, PT_USEINT,
1514 "-\trawsck", NULL, NULL,
1515 snsc->raw_inuse, DNOVAL, NULL);
1517 render(isdb, pre, PT_USEINT,
1518 "-\tip-frag", NULL, NULL,
1519 snsc->frag_inuse, DNOVAL, NULL);
1521 render(isdb, pre, PT_USEINT | pt_newlin,
1522 "-\ttcp-tw", NULL, NULL,
1523 snsc->tcp_tw, DNOVAL, NULL);
1527 ***************************************************************************
1528 * Display IP network statistics in selected format.
1531 * @a Activity structure with statistics.
1532 * @isdb Flag, true if db printing, false if ppc printing.
1533 * @pre Prefix string for output entries
1534 * @curr Index in array for current sample statistics.
1535 * @itv Interval of time in jiffies.
1536 ***************************************************************************
1538 __print_funct_t render_net_ip_stats(struct activity *a, int isdb, char *pre,
1539 int curr, unsigned long long itv)
1542 *snic = (struct stats_net_ip *) a->buf[curr],
1543 *snip = (struct stats_net_ip *) a->buf[!curr];
1545 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1547 render(isdb, pre, PT_NOFLAG,
1548 "-\tirec/s", NULL, NULL,
1550 S_VALUE(snip->InReceives, snic->InReceives, itv),
1553 render(isdb, pre, PT_NOFLAG,
1554 "-\tfwddgm/s", NULL, NULL,
1556 S_VALUE(snip->ForwDatagrams, snic->ForwDatagrams, itv),
1559 render(isdb, pre, PT_NOFLAG,
1560 "-\tidel/s", NULL, NULL,
1562 S_VALUE(snip->InDelivers, snic->InDelivers, itv),
1565 render(isdb, pre, PT_NOFLAG,
1566 "-\torq/s", NULL, NULL,
1568 S_VALUE(snip->OutRequests, snic->OutRequests, itv),
1571 render(isdb, pre, PT_NOFLAG,
1572 "-\tasmrq/s", NULL, NULL,
1574 S_VALUE(snip->ReasmReqds, snic->ReasmReqds, itv),
1577 render(isdb, pre, PT_NOFLAG,
1578 "-\tasmok/s", NULL, NULL,
1580 S_VALUE(snip->ReasmOKs, snic->ReasmOKs, itv),
1583 render(isdb, pre, PT_NOFLAG,
1584 "-\tfragok/s", NULL, NULL,
1586 S_VALUE(snip->FragOKs, snic->FragOKs, itv),
1589 render(isdb, pre, pt_newlin,
1590 "-\tfragcrt/s", NULL, NULL,
1592 S_VALUE(snip->FragCreates, snic->FragCreates, itv),
1597 ***************************************************************************
1598 * Display IP network errors statistics in selected format.
1601 * @a Activity structure with statistics.
1602 * @isdb Flag, true if db printing, false if ppc printing.
1603 * @pre Prefix string for output entries
1604 * @curr Index in array for current sample statistics.
1605 * @itv Interval of time in jiffies.
1606 ***************************************************************************
1608 __print_funct_t render_net_eip_stats(struct activity *a, int isdb, char *pre,
1609 int curr, unsigned long long itv)
1611 struct stats_net_eip
1612 *sneic = (struct stats_net_eip *) a->buf[curr],
1613 *sneip = (struct stats_net_eip *) a->buf[!curr];
1615 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1617 render(isdb, pre, PT_NOFLAG,
1618 "-\tihdrerr/s", NULL, NULL,
1620 S_VALUE(sneip->InHdrErrors, sneic->InHdrErrors, itv),
1623 render(isdb, pre, PT_NOFLAG,
1624 "-\tiadrerr/s", NULL, NULL,
1626 S_VALUE(sneip->InAddrErrors, sneic->InAddrErrors, itv),
1629 render(isdb, pre, PT_NOFLAG,
1630 "-\tiukwnpr/s", NULL, NULL,
1632 S_VALUE(sneip->InUnknownProtos, sneic->InUnknownProtos, itv),
1635 render(isdb, pre, PT_NOFLAG,
1636 "-\tidisc/s", NULL, NULL,
1638 S_VALUE(sneip->InDiscards, sneic->InDiscards, itv),
1641 render(isdb, pre, PT_NOFLAG,
1642 "-\todisc/s", NULL, NULL,
1644 S_VALUE(sneip->OutDiscards, sneic->OutDiscards, itv),
1647 render(isdb, pre, PT_NOFLAG,
1648 "-\tonort/s", NULL, NULL,
1650 S_VALUE(sneip->OutNoRoutes, sneic->OutNoRoutes, itv),
1653 render(isdb, pre, PT_NOFLAG,
1654 "-\tasmf/s", NULL, NULL,
1656 S_VALUE(sneip->ReasmFails, sneic->ReasmFails, itv),
1659 render(isdb, pre, pt_newlin,
1660 "-\tfragf/s", NULL, NULL,
1662 S_VALUE(sneip->FragFails, sneic->FragFails, itv),
1667 ***************************************************************************
1668 * Display ICMP network statistics in selected format.
1671 * @a Activity structure with statistics.
1672 * @isdb Flag, true if db printing, false if ppc printing.
1673 * @pre Prefix string for output entries
1674 * @curr Index in array for current sample statistics.
1675 * @itv Interval of time in jiffies.
1676 ***************************************************************************
1678 __print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre,
1679 int curr, unsigned long long itv)
1681 struct stats_net_icmp
1682 *snic = (struct stats_net_icmp *) a->buf[curr],
1683 *snip = (struct stats_net_icmp *) a->buf[!curr];
1685 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1687 render(isdb, pre, PT_NOFLAG,
1688 "-\timsg/s", NULL, NULL,
1690 S_VALUE(snip->InMsgs, snic->InMsgs, itv),
1693 render(isdb, pre, PT_NOFLAG,
1694 "-\tomsg/s", NULL, NULL,
1696 S_VALUE(snip->OutMsgs, snic->OutMsgs, itv),
1699 render(isdb, pre, PT_NOFLAG,
1700 "-\tiech/s", NULL, NULL,
1702 S_VALUE(snip->InEchos, snic->InEchos, itv),
1705 render(isdb, pre, PT_NOFLAG,
1706 "-\tiechr/s", NULL, NULL,
1708 S_VALUE(snip->InEchoReps, snic->InEchoReps, itv),
1711 render(isdb, pre, PT_NOFLAG,
1712 "-\toech/s", NULL, NULL,
1714 S_VALUE(snip->OutEchos, snic->OutEchos, itv),
1717 render(isdb, pre, PT_NOFLAG,
1718 "-\toechr/s", NULL, NULL,
1720 S_VALUE(snip->OutEchoReps, snic->OutEchoReps, itv),
1723 render(isdb, pre, PT_NOFLAG,
1724 "-\titm/s", NULL, NULL,
1726 S_VALUE(snip->InTimestamps, snic->InTimestamps, itv),
1729 render(isdb, pre, PT_NOFLAG,
1730 "-\titmr/s", NULL, NULL,
1732 S_VALUE(snip->InTimestampReps, snic->InTimestampReps, itv),
1735 render(isdb, pre, PT_NOFLAG,
1736 "-\totm/s", NULL, NULL,
1738 S_VALUE(snip->OutTimestamps, snic->OutTimestamps, itv),
1741 render(isdb, pre, PT_NOFLAG,
1742 "-\totmr/s", NULL, NULL,
1744 S_VALUE(snip->OutTimestampReps, snic->OutTimestampReps, itv),
1747 render(isdb, pre, PT_NOFLAG,
1748 "-\tiadrmk/s", NULL, NULL,
1750 S_VALUE(snip->InAddrMasks, snic->InAddrMasks, itv),
1753 render(isdb, pre, PT_NOFLAG,
1754 "-\tiadrmkr/s", NULL, NULL,
1756 S_VALUE(snip->InAddrMaskReps, snic->InAddrMaskReps, itv),
1759 render(isdb, pre, PT_NOFLAG,
1760 "-\toadrmk/s", NULL, NULL,
1762 S_VALUE(snip->OutAddrMasks, snic->OutAddrMasks, itv),
1765 render(isdb, pre, pt_newlin,
1766 "-\toadrmkr/s", NULL, NULL,
1768 S_VALUE(snip->OutAddrMaskReps, snic->OutAddrMaskReps, itv),
1773 ***************************************************************************
1774 * Display ICMP error messages statistics in selected format.
1777 * @a Activity structure with statistics.
1778 * @isdb Flag, true if db printing, false if ppc printing.
1779 * @pre Prefix string for output entries
1780 * @curr Index in array for current sample statistics.
1781 * @itv Interval of time in jiffies.
1782 ***************************************************************************
1784 __print_funct_t render_net_eicmp_stats(struct activity *a, int isdb, char *pre,
1785 int curr, unsigned long long itv)
1787 struct stats_net_eicmp
1788 *sneic = (struct stats_net_eicmp *) a->buf[curr],
1789 *sneip = (struct stats_net_eicmp *) a->buf[!curr];
1791 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1793 render(isdb, pre, PT_NOFLAG,
1794 "-\tierr/s", NULL, NULL,
1796 S_VALUE(sneip->InErrors, sneic->InErrors, itv),
1799 render(isdb, pre, PT_NOFLAG,
1800 "-\toerr/s", NULL, NULL,
1802 S_VALUE(sneip->OutErrors, sneic->OutErrors, itv),
1805 render(isdb, pre, PT_NOFLAG,
1806 "-\tidstunr/s", NULL, NULL,
1808 S_VALUE(sneip->InDestUnreachs, sneic->InDestUnreachs, itv),
1811 render(isdb, pre, PT_NOFLAG,
1812 "-\todstunr/s", NULL, NULL,
1814 S_VALUE(sneip->OutDestUnreachs, sneic->OutDestUnreachs, itv),
1817 render(isdb, pre, PT_NOFLAG,
1818 "-\titmex/s", NULL, NULL,
1820 S_VALUE(sneip->InTimeExcds, sneic->InTimeExcds, itv),
1823 render(isdb, pre, PT_NOFLAG,
1824 "-\totmex/s", NULL, NULL,
1826 S_VALUE(sneip->OutTimeExcds, sneic->OutTimeExcds, itv),
1829 render(isdb, pre, PT_NOFLAG,
1830 "-\tiparmpb/s", NULL, NULL,
1832 S_VALUE(sneip->InParmProbs, sneic->InParmProbs, itv),
1835 render(isdb, pre, PT_NOFLAG,
1836 "-\toparmpb/s", NULL, NULL,
1838 S_VALUE(sneip->OutParmProbs, sneic->OutParmProbs, itv),
1841 render(isdb, pre, PT_NOFLAG,
1842 "-\tisrcq/s", NULL, NULL,
1844 S_VALUE(sneip->InSrcQuenchs, sneic->InSrcQuenchs, itv),
1847 render(isdb, pre, PT_NOFLAG,
1848 "-\tosrcq/s", NULL, NULL,
1850 S_VALUE(sneip->OutSrcQuenchs, sneic->OutSrcQuenchs, itv),
1853 render(isdb, pre, PT_NOFLAG,
1854 "-\tiredir/s", NULL, NULL,
1856 S_VALUE(sneip->InRedirects, sneic->InRedirects, itv),
1859 render(isdb, pre, pt_newlin,
1860 "-\toredir/s", NULL, NULL,
1862 S_VALUE(sneip->OutRedirects, sneic->OutRedirects, itv),
1867 ***************************************************************************
1868 * Display TCP network statistics in selected format.
1871 * @a Activity structure with statistics.
1872 * @isdb Flag, true if db printing, false if ppc printing.
1873 * @pre Prefix string for output entries
1874 * @curr Index in array for current sample statistics.
1875 * @itv Interval of time in jiffies.
1876 ***************************************************************************
1878 __print_funct_t render_net_tcp_stats(struct activity *a, int isdb, char *pre,
1879 int curr, unsigned long long itv)
1881 struct stats_net_tcp
1882 *sntc = (struct stats_net_tcp *) a->buf[curr],
1883 *sntp = (struct stats_net_tcp *) a->buf[!curr];
1885 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1887 render(isdb, pre, PT_NOFLAG,
1888 "-\tactive/s", NULL, NULL,
1890 S_VALUE(sntp->ActiveOpens, sntc->ActiveOpens, itv),
1893 render(isdb, pre, PT_NOFLAG,
1894 "-\tpassive/s", NULL, NULL,
1896 S_VALUE(sntp->PassiveOpens, sntc->PassiveOpens, itv),
1899 render(isdb, pre, PT_NOFLAG,
1900 "-\tiseg/s", NULL, NULL,
1902 S_VALUE(sntp->InSegs, sntc->InSegs, itv),
1905 render(isdb, pre, pt_newlin,
1906 "-\toseg/s", NULL, NULL,
1908 S_VALUE(sntp->OutSegs, sntc->OutSegs, itv),
1913 ***************************************************************************
1914 * Display TCP network errors statistics in selected format.
1917 * @a Activity structure with statistics.
1918 * @isdb Flag, true if db printing, false if ppc printing.
1919 * @pre Prefix string for output entries
1920 * @curr Index in array for current sample statistics.
1921 * @itv Interval of time in jiffies.
1922 ***************************************************************************
1924 __print_funct_t render_net_etcp_stats(struct activity *a, int isdb, char *pre,
1925 int curr, unsigned long long itv)
1927 struct stats_net_etcp
1928 *snetc = (struct stats_net_etcp *) a->buf[curr],
1929 *snetp = (struct stats_net_etcp *) a->buf[!curr];
1931 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1933 render(isdb, pre, PT_NOFLAG,
1934 "-\tatmptf/s", NULL, NULL,
1936 S_VALUE(snetp->AttemptFails, snetc->AttemptFails, itv),
1939 render(isdb, pre, PT_NOFLAG,
1940 "-\testres/s", NULL, NULL,
1942 S_VALUE(snetp->EstabResets, snetc->EstabResets, itv),
1945 render(isdb, pre, PT_NOFLAG,
1946 "-\tretrans/s", NULL, NULL,
1948 S_VALUE(snetp->RetransSegs, snetc->RetransSegs, itv),
1951 render(isdb, pre, PT_NOFLAG,
1952 "-\tisegerr/s", NULL, NULL,
1954 S_VALUE(snetp->InErrs, snetc->InErrs, itv),
1957 render(isdb, pre, pt_newlin,
1958 "-\torsts/s", NULL, NULL,
1960 S_VALUE(snetp->OutRsts, snetc->OutRsts, itv),
1965 ***************************************************************************
1966 * Display UDP network statistics in selected format.
1969 * @a Activity structure with statistics.
1970 * @isdb Flag, true if db printing, false if ppc printing.
1971 * @pre Prefix string for output entries
1972 * @curr Index in array for current sample statistics.
1973 * @itv Interval of time in jiffies.
1974 ***************************************************************************
1976 __print_funct_t render_net_udp_stats(struct activity *a, int isdb, char *pre,
1977 int curr, unsigned long long itv)
1979 struct stats_net_udp
1980 *snuc = (struct stats_net_udp *) a->buf[curr],
1981 *snup = (struct stats_net_udp *) a->buf[!curr];
1983 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1985 render(isdb, pre, PT_NOFLAG,
1986 "-\tidgm/s", NULL, NULL,
1988 S_VALUE(snup->InDatagrams, snuc->InDatagrams, itv),
1991 render(isdb, pre, PT_NOFLAG,
1992 "-\todgm/s", NULL, NULL,
1994 S_VALUE(snup->OutDatagrams, snuc->OutDatagrams, itv),
1997 render(isdb, pre, PT_NOFLAG,
1998 "-\tnoport/s", NULL, NULL,
2000 S_VALUE(snup->NoPorts, snuc->NoPorts, itv),
2003 render(isdb, pre, pt_newlin,
2004 "-\tidgmerr/s", NULL, NULL,
2006 S_VALUE(snup->InErrors, snuc->InErrors, itv),
2011 ***************************************************************************
2012 * Display IPv6 network sockets statistics in selected format.
2015 * @a Activity structure with statistics.
2016 * @isdb Flag, true if db printing, false if ppc printing.
2017 * @pre Prefix string for output entries
2018 * @curr Index in array for current sample statistics.
2019 * @itv Interval of time in jiffies.
2020 ***************************************************************************
2022 __print_funct_t render_net_sock6_stats(struct activity *a, int isdb, char *pre,
2023 int curr, unsigned long long itv)
2025 struct stats_net_sock6
2026 *snsc = (struct stats_net_sock6 *) a->buf[curr];
2028 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2030 render(isdb, pre, PT_USEINT,
2031 "-\ttcp6sck", NULL, NULL,
2032 snsc->tcp6_inuse, DNOVAL, NULL);
2034 render(isdb, pre, PT_USEINT,
2035 "-\tudp6sck", NULL, NULL,
2036 snsc->udp6_inuse, DNOVAL, NULL);
2038 render(isdb, pre, PT_USEINT,
2039 "-\traw6sck", NULL, NULL,
2040 snsc->raw6_inuse, DNOVAL, NULL);
2042 render(isdb, pre, PT_USEINT | pt_newlin,
2043 "-\tip6-frag", NULL, NULL,
2044 snsc->frag6_inuse, DNOVAL, NULL);
2048 ***************************************************************************
2049 * Display IPv6 network statistics in selected format.
2052 * @a Activity structure with statistics.
2053 * @isdb Flag, true if db printing, false if ppc printing.
2054 * @pre Prefix string for output entries
2055 * @curr Index in array for current sample statistics.
2056 * @itv Interval of time in jiffies.
2057 ***************************************************************************
2059 __print_funct_t render_net_ip6_stats(struct activity *a, int isdb, char *pre,
2060 int curr, unsigned long long itv)
2062 struct stats_net_ip6
2063 *snic = (struct stats_net_ip6 *) a->buf[curr],
2064 *snip = (struct stats_net_ip6 *) a->buf[!curr];
2066 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2068 render(isdb, pre, PT_NOFLAG,
2069 "-\tirec6/s", NULL, NULL,
2071 S_VALUE(snip->InReceives6, snic->InReceives6, itv),
2074 render(isdb, pre, PT_NOFLAG,
2075 "-\tfwddgm6/s", NULL, NULL,
2077 S_VALUE(snip->OutForwDatagrams6, snic->OutForwDatagrams6, itv),
2080 render(isdb, pre, PT_NOFLAG,
2081 "-\tidel6/s", NULL, NULL,
2083 S_VALUE(snip->InDelivers6, snic->InDelivers6, itv),
2086 render(isdb, pre, PT_NOFLAG,
2087 "-\torq6/s", NULL, NULL,
2089 S_VALUE(snip->OutRequests6, snic->OutRequests6, itv),
2092 render(isdb, pre, PT_NOFLAG,
2093 "-\tasmrq6/s", NULL, NULL,
2095 S_VALUE(snip->ReasmReqds6, snic->ReasmReqds6, itv),
2098 render(isdb, pre, PT_NOFLAG,
2099 "-\tasmok6/s", NULL, NULL,
2101 S_VALUE(snip->ReasmOKs6, snic->ReasmOKs6, itv),
2104 render(isdb, pre, PT_NOFLAG,
2105 "-\timcpck6/s", NULL, NULL,
2107 S_VALUE(snip->InMcastPkts6, snic->InMcastPkts6, itv),
2110 render(isdb, pre, PT_NOFLAG,
2111 "-\tomcpck6/s", NULL, NULL,
2113 S_VALUE(snip->OutMcastPkts6, snic->OutMcastPkts6, itv),
2116 render(isdb, pre, PT_NOFLAG,
2117 "-\tfragok6/s", NULL, NULL,
2119 S_VALUE(snip->FragOKs6, snic->FragOKs6, itv),
2122 render(isdb, pre, pt_newlin,
2123 "-\tfragcr6/s", NULL, NULL,
2125 S_VALUE(snip->FragCreates6, snic->FragCreates6, itv),
2130 ***************************************************************************
2131 * Display IPv6 network errors statistics in selected format.
2134 * @a Activity structure with statistics.
2135 * @isdb Flag, true if db printing, false if ppc printing.
2136 * @pre Prefix string for output entries
2137 * @curr Index in array for current sample statistics.
2138 * @itv Interval of time in jiffies.
2139 ***************************************************************************
2141 __print_funct_t render_net_eip6_stats(struct activity *a, int isdb, char *pre,
2142 int curr, unsigned long long itv)
2144 struct stats_net_eip6
2145 *sneic = (struct stats_net_eip6 *) a->buf[curr],
2146 *sneip = (struct stats_net_eip6 *) a->buf[!curr];
2148 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2150 render(isdb, pre, PT_NOFLAG,
2151 "-\tihdrer6/s", NULL, NULL,
2153 S_VALUE(sneip->InHdrErrors6, sneic->InHdrErrors6, itv),
2156 render(isdb, pre, PT_NOFLAG,
2157 "-\tiadrer6/s", NULL, NULL,
2159 S_VALUE(sneip->InAddrErrors6, sneic->InAddrErrors6, itv),
2162 render(isdb, pre, PT_NOFLAG,
2163 "-\tiukwnp6/s", NULL, NULL,
2165 S_VALUE(sneip->InUnknownProtos6, sneic->InUnknownProtos6, itv),
2168 render(isdb, pre, PT_NOFLAG,
2169 "-\ti2big6/s", NULL, NULL,
2171 S_VALUE(sneip->InTooBigErrors6, sneic->InTooBigErrors6, itv),
2174 render(isdb, pre, PT_NOFLAG,
2175 "-\tidisc6/s", NULL, NULL,
2177 S_VALUE(sneip->InDiscards6, sneic->InDiscards6, itv),
2180 render(isdb, pre, PT_NOFLAG,
2181 "-\todisc6/s", NULL, NULL,
2183 S_VALUE(sneip->OutDiscards6, sneic->OutDiscards6, itv),
2186 render(isdb, pre, PT_NOFLAG,
2187 "-\tinort6/s", NULL, NULL,
2189 S_VALUE(sneip->InNoRoutes6, sneic->InNoRoutes6, itv),
2192 render(isdb, pre, PT_NOFLAG,
2193 "-\tonort6/s", NULL, NULL,
2195 S_VALUE(sneip->OutNoRoutes6, sneic->OutNoRoutes6, itv),
2198 render(isdb, pre, PT_NOFLAG,
2199 "-\tasmf6/s", NULL, NULL,
2201 S_VALUE(sneip->ReasmFails6, sneic->ReasmFails6, itv),
2204 render(isdb, pre, PT_NOFLAG,
2205 "-\tfragf6/s", NULL, NULL,
2207 S_VALUE(sneip->FragFails6, sneic->FragFails6, itv),
2210 render(isdb, pre, pt_newlin,
2211 "-\titrpck6/s", NULL, NULL,
2213 S_VALUE(sneip->InTruncatedPkts6, sneic->InTruncatedPkts6, itv),
2218 ***************************************************************************
2219 * Display ICMPv6 network statistics in selected format.
2222 * @a Activity structure with statistics.
2223 * @isdb Flag, true if db printing, false if ppc printing.
2224 * @pre Prefix string for output entries
2225 * @curr Index in array for current sample statistics.
2226 * @itv Interval of time in jiffies.
2227 ***************************************************************************
2229 __print_funct_t render_net_icmp6_stats(struct activity *a, int isdb, char *pre,
2230 int curr, unsigned long long itv)
2232 struct stats_net_icmp6
2233 *snic = (struct stats_net_icmp6 *) a->buf[curr],
2234 *snip = (struct stats_net_icmp6 *) a->buf[!curr];
2236 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2238 render(isdb, pre, PT_NOFLAG,
2239 "-\timsg6/s", NULL, NULL,
2241 S_VALUE(snip->InMsgs6, snic->InMsgs6, itv),
2244 render(isdb, pre, PT_NOFLAG,
2245 "-\tomsg6/s", NULL, NULL,
2247 S_VALUE(snip->OutMsgs6, snic->OutMsgs6, itv),
2250 render(isdb, pre, PT_NOFLAG,
2251 "-\tiech6/s", NULL, NULL,
2253 S_VALUE(snip->InEchos6, snic->InEchos6, itv),
2256 render(isdb, pre, PT_NOFLAG,
2257 "-\tiechr6/s", NULL, NULL,
2259 S_VALUE(snip->InEchoReplies6, snic->InEchoReplies6, itv),
2262 render(isdb, pre, PT_NOFLAG,
2263 "-\toechr6/s", NULL, NULL,
2265 S_VALUE(snip->OutEchoReplies6, snic->OutEchoReplies6, itv),
2268 render(isdb, pre, PT_NOFLAG,
2269 "-\tigmbq6/s", NULL, NULL,
2271 S_VALUE(snip->InGroupMembQueries6, snic->InGroupMembQueries6, itv),
2274 render(isdb, pre, PT_NOFLAG,
2275 "-\tigmbr6/s", NULL, NULL,
2277 S_VALUE(snip->InGroupMembResponses6, snic->InGroupMembResponses6, itv),
2280 render(isdb, pre, PT_NOFLAG,
2281 "-\togmbr6/s", NULL, NULL,
2283 S_VALUE(snip->OutGroupMembResponses6, snic->OutGroupMembResponses6, itv),
2286 render(isdb, pre, PT_NOFLAG,
2287 "-\tigmbrd6/s", NULL, NULL,
2289 S_VALUE(snip->InGroupMembReductions6, snic->InGroupMembReductions6, itv),
2292 render(isdb, pre, PT_NOFLAG,
2293 "-\togmbrd6/s", NULL, NULL,
2295 S_VALUE(snip->OutGroupMembReductions6, snic->OutGroupMembReductions6, itv),
2298 render(isdb, pre, PT_NOFLAG,
2299 "-\tirtsol6/s", NULL, NULL,
2301 S_VALUE(snip->InRouterSolicits6, snic->InRouterSolicits6, itv),
2304 render(isdb, pre, PT_NOFLAG,
2305 "-\tortsol6/s", NULL, NULL,
2307 S_VALUE(snip->OutRouterSolicits6, snic->OutRouterSolicits6, itv),
2310 render(isdb, pre, PT_NOFLAG,
2311 "-\tirtad6/s", NULL, NULL,
2313 S_VALUE(snip->InRouterAdvertisements6, snic->InRouterAdvertisements6, itv),
2316 render(isdb, pre, PT_NOFLAG,
2317 "-\tinbsol6/s", NULL, NULL,
2319 S_VALUE(snip->InNeighborSolicits6, snic->InNeighborSolicits6, itv),
2322 render(isdb, pre, PT_NOFLAG,
2323 "-\tonbsol6/s", NULL, NULL,
2325 S_VALUE(snip->OutNeighborSolicits6, snic->OutNeighborSolicits6, itv),
2328 render(isdb, pre, PT_NOFLAG,
2329 "-\tinbad6/s", NULL, NULL,
2331 S_VALUE(snip->InNeighborAdvertisements6, snic->InNeighborAdvertisements6, itv),
2334 render(isdb, pre, pt_newlin,
2335 "-\tonbad6/s", NULL, NULL,
2337 S_VALUE(snip->OutNeighborAdvertisements6, snic->OutNeighborAdvertisements6, itv),
2342 ***************************************************************************
2343 * Display ICMPv6 error messages statistics in selected format.
2346 * @a Activity structure with statistics.
2347 * @isdb Flag, true if db printing, false if ppc printing.
2348 * @pre Prefix string for output entries
2349 * @curr Index in array for current sample statistics.
2350 * @itv Interval of time in jiffies.
2351 ***************************************************************************
2353 __print_funct_t render_net_eicmp6_stats(struct activity *a, int isdb, char *pre,
2354 int curr, unsigned long long itv)
2356 struct stats_net_eicmp6
2357 *sneic = (struct stats_net_eicmp6 *) a->buf[curr],
2358 *sneip = (struct stats_net_eicmp6 *) a->buf[!curr];
2360 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2362 render(isdb, pre, PT_NOFLAG,
2363 "-\tierr6/s", NULL, NULL,
2365 S_VALUE(sneip->InErrors6, sneic->InErrors6, itv),
2368 render(isdb, pre, PT_NOFLAG,
2369 "-\tidtunr6/s", NULL, NULL,
2371 S_VALUE(sneip->InDestUnreachs6, sneic->InDestUnreachs6, itv),
2374 render(isdb, pre, PT_NOFLAG,
2375 "-\todtunr6/s", NULL, NULL,
2377 S_VALUE(sneip->OutDestUnreachs6, sneic->OutDestUnreachs6, itv),
2380 render(isdb, pre, PT_NOFLAG,
2381 "-\titmex6/s", NULL, NULL,
2383 S_VALUE(sneip->InTimeExcds6, sneic->InTimeExcds6, itv),
2386 render(isdb, pre, PT_NOFLAG,
2387 "-\totmex6/s", NULL, NULL,
2389 S_VALUE(sneip->OutTimeExcds6, sneic->OutTimeExcds6, itv),
2392 render(isdb, pre, PT_NOFLAG,
2393 "-\tiprmpb6/s", NULL, NULL,
2395 S_VALUE(sneip->InParmProblems6, sneic->InParmProblems6, itv),
2398 render(isdb, pre, PT_NOFLAG,
2399 "-\toprmpb6/s", NULL, NULL,
2401 S_VALUE(sneip->OutParmProblems6, sneic->OutParmProblems6, itv),
2404 render(isdb, pre, PT_NOFLAG,
2405 "-\tiredir6/s", NULL, NULL,
2407 S_VALUE(sneip->InRedirects6, sneic->InRedirects6, itv),
2410 render(isdb, pre, PT_NOFLAG,
2411 "-\toredir6/s", NULL, NULL,
2413 S_VALUE(sneip->OutRedirects6, sneic->OutRedirects6, itv),
2416 render(isdb, pre, PT_NOFLAG,
2417 "-\tipck2b6/s", NULL, NULL,
2419 S_VALUE(sneip->InPktTooBigs6, sneic->InPktTooBigs6, itv),
2422 render(isdb, pre, pt_newlin,
2423 "-\topck2b6/s", NULL, NULL,
2425 S_VALUE(sneip->OutPktTooBigs6, sneic->OutPktTooBigs6, itv),
2430 ***************************************************************************
2431 * Display UDP6 network statistics in selected format.
2434 * @a Activity structure with statistics.
2435 * @isdb Flag, true if db printing, false if ppc printing.
2436 * @pre Prefix string for output entries
2437 * @curr Index in array for current sample statistics.
2438 * @itv Interval of time in jiffies.
2439 ***************************************************************************
2441 __print_funct_t render_net_udp6_stats(struct activity *a, int isdb, char *pre,
2442 int curr, unsigned long long itv)
2444 struct stats_net_udp6
2445 *snuc = (struct stats_net_udp6 *) a->buf[curr],
2446 *snup = (struct stats_net_udp6 *) a->buf[!curr];
2448 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2450 render(isdb, pre, PT_NOFLAG,
2451 "-\tidgm6/s", NULL, NULL,
2453 S_VALUE(snup->InDatagrams6, snuc->InDatagrams6, itv),
2456 render(isdb, pre, PT_NOFLAG,
2457 "-\todgm6/s", NULL, NULL,
2459 S_VALUE(snup->OutDatagrams6, snuc->OutDatagrams6, itv),
2462 render(isdb, pre, PT_NOFLAG,
2463 "-\tnoport6/s", NULL, NULL,
2465 S_VALUE(snup->NoPorts6, snuc->NoPorts6, itv),
2468 render(isdb, pre, pt_newlin,
2469 "-\tidgmer6/s", NULL, NULL,
2471 S_VALUE(snup->InErrors6, snuc->InErrors6, itv),
2476 ***************************************************************************
2477 * Display CPU frequency statistics in selected format.
2480 * @a Activity structure with statistics.
2481 * @isdb Flag, true if db printing, false if ppc printing.
2482 * @pre Prefix string for output entries
2483 * @curr Index in array for current sample statistics.
2484 * @itv Interval of time in jiffies.
2485 ***************************************************************************
2487 __print_funct_t render_pwr_cpufreq_stats(struct activity *a, int isdb, char *pre,
2488 int curr, unsigned long long itv)
2491 struct stats_pwr_cpufreq *spc;
2493 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2495 for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
2497 spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize);
2499 /* Should current CPU (including CPU "all") be displayed? */
2500 if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
2503 /* This is CPU "all" */
2504 render(isdb, pre, pt_newlin,
2508 ((double) spc->cpufreq) / 100,
2512 render(isdb, pre, pt_newlin,
2514 "%d", cons(iv, i - 1, NOVAL),
2516 ((double) spc->cpufreq) / 100,
2524 ***************************************************************************
2525 * Display fan statistics in selected format.
2528 * @a Activity structure with statistics.
2529 * @isdb Flag, true if db printing, false if ppc printing.
2530 * @pre Prefix string for output entries
2531 * @curr Index in array for current sample statistics.
2532 * @itv Interval of time in jiffies.
2533 ***************************************************************************
2535 __print_funct_t render_pwr_fan_stats(struct activity *a, int isdb, char *pre,
2536 int curr, unsigned long long itv)
2539 struct stats_pwr_fan *spc;
2541 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2543 for (i = 0; i < a->nr; i++) {
2544 spc = (struct stats_pwr_fan *) ((char *) a->buf[curr] + i * a->msize);
2546 render(isdb, pre, PT_USESTR,
2549 cons(iv, i + 1, NOVAL),
2554 render(isdb, pre, PT_NOFLAG,
2557 cons(iv, i + 1, NOVAL),
2562 render(isdb, pre, pt_newlin,
2565 cons(iv, i + 1, NOVAL),
2567 spc->rpm - spc->rpm_min,
2573 ***************************************************************************
2574 * Display temperature statistics in selected format.
2577 * @a Activity structure with statistics.
2578 * @isdb Flag, true if db printing, false if ppc printing.
2579 * @pre Prefix string for output entries
2580 * @curr Index in array for current sample statistics.
2581 * @itv Interval of time in jiffies.
2582 ***************************************************************************
2584 __print_funct_t render_pwr_temp_stats(struct activity *a, int isdb, char *pre,
2585 int curr, unsigned long long itv)
2588 struct stats_pwr_temp *spc;
2590 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2592 for (i = 0; i < a->nr; i++) {
2593 spc = (struct stats_pwr_temp *) ((char *) a->buf[curr] + i * a->msize);
2595 render(isdb, pre, PT_USESTR,
2598 cons(iv, i + 1, NOVAL),
2603 render(isdb, pre, PT_NOFLAG,
2606 cons(iv, i + 1, NOVAL),
2611 render(isdb, pre, pt_newlin,
2614 cons(iv, i + 1, NOVAL),
2616 (spc->temp_max - spc->temp_min) ?
2617 (spc->temp - spc->temp_min) / (spc->temp_max - spc->temp_min) * 100 :
2624 ***************************************************************************
2625 * Display voltage inputs statistics in selected format.
2628 * @a Activity structure with statistics.
2629 * @isdb Flag, true if db printing, false if ppc printing.
2630 * @pre Prefix string for output entries
2631 * @curr Index in array for current sample statistics.
2632 * @itv Interval of time in jiffies.
2633 ***************************************************************************
2635 __print_funct_t render_pwr_in_stats(struct activity *a, int isdb, char *pre,
2636 int curr, unsigned long long itv)
2639 struct stats_pwr_in *spc;
2641 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2643 for (i = 0; i < a->nr; i++) {
2644 spc = (struct stats_pwr_in *) ((char *) a->buf[curr] + i * a->msize);
2646 render(isdb, pre, PT_USESTR,
2654 render(isdb, pre, PT_NOFLAG,
2662 render(isdb, pre, pt_newlin,
2667 (spc->in_max - spc->in_min) ?
2668 (spc->in - spc->in_min) / (spc->in_max - spc->in_min) * 100 :
2675 ***************************************************************************
2676 * Display huge pages statistics in selected format.
2679 * @a Activity structure with statistics.
2680 * @isdb Flag, true if db printing, false if ppc printing.
2681 * @pre Prefix string for output entries
2682 * @curr Index in array for current sample statistics.
2683 * @itv Interval of time in jiffies.
2684 ***************************************************************************
2686 __print_funct_t render_huge_stats(struct activity *a, int isdb, char *pre,
2687 int curr, unsigned long long itv)
2690 *smc = (struct stats_huge *) a->buf[curr];
2692 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2694 render(isdb, pre, PT_USEINT,
2695 "-\tkbhugfree", NULL, NULL,
2696 smc->frhkb, DNOVAL, NULL);
2698 render(isdb, pre, PT_USEINT,
2699 "-\tkbhugused", NULL, NULL,
2700 smc->tlhkb - smc->frhkb, DNOVAL, NULL);
2702 render(isdb, pre, pt_newlin,
2703 "-\t%%hugused", NULL, NULL, NOVAL,
2705 SP_VALUE(smc->frhkb, smc->tlhkb, smc->tlhkb) :
2710 ***************************************************************************
2711 * Display weighted CPU frequency statistics in selected format.
2714 * @a Activity structure with statistics.
2715 * @isdb Flag, true if db printing, false if ppc printing.
2716 * @pre Prefix string for output entries
2717 * @curr Index in array for current sample statistics.
2718 * @itv Interval of time in jiffies.
2719 ***************************************************************************
2721 __print_funct_t render_pwr_wghfreq_stats(struct activity *a, int isdb, char *pre,
2722 int curr, unsigned long long itv)
2725 struct stats_pwr_wghfreq *spc, *spp, *spc_k, *spp_k;
2726 unsigned long long tis, tisfreq;
2728 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2730 for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
2732 spc = (struct stats_pwr_wghfreq *) ((char *) a->buf[curr] + i * a->msize * a->nr2);
2733 spp = (struct stats_pwr_wghfreq *) ((char *) a->buf[!curr] + i * a->msize * a->nr2);
2735 /* Should current CPU (including CPU "all") be displayed? */
2736 if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
2742 for (k = 0; k < a->nr2; k++) {
2744 spc_k = (struct stats_pwr_wghfreq *) ((char *) spc + k * a->msize);
2747 spp_k = (struct stats_pwr_wghfreq *) ((char *) spp + k * a->msize);
2749 tisfreq += (spc_k->freq / 1000) *
2750 (spc_k->time_in_state - spp_k->time_in_state);
2751 tis += (spc_k->time_in_state - spp_k->time_in_state);
2755 /* This is CPU "all" */
2756 render(isdb, pre, pt_newlin,
2760 tis ? ((double) tisfreq) / tis : 0.0,
2764 render(isdb, pre, pt_newlin,
2766 "%d", cons(iv, i - 1, NOVAL),
2768 tis ? ((double) tisfreq) / tis : 0.0,
2776 ***************************************************************************
2777 * Display USB devices statistics in selected format.
2780 * @a Activity structure with statistics.
2781 * @isdb Flag, true if db printing, false if ppc printing.
2782 * @pre Prefix string for output entries
2783 * @curr Index in array for current sample statistics.
2784 * @itv Interval of time in jiffies.
2785 ***************************************************************************
2787 __print_funct_t render_pwr_usb_stats(struct activity *a, int isdb, char *pre,
2788 int curr, unsigned long long itv)
2791 struct stats_pwr_usb *suc;
2794 for (i = 0; i < a->nr; i++) {
2795 suc = (struct stats_pwr_usb *) ((char *) a->buf[curr] + i * a->msize);
2798 /* Bus#0 doesn't exist: We are at the end of the list */
2801 sprintf(id, "%x", suc->vendor_id);
2802 render(isdb, pre, PT_USESTR,
2805 cons(iv, suc->bus_nr, NOVAL),
2810 sprintf(id, "%x", suc->product_id);
2811 render(isdb, pre, PT_USESTR,
2814 cons(iv, suc->bus_nr, NOVAL),
2819 render(isdb, pre, PT_USEINT,
2822 cons(iv, suc->bus_nr, NOVAL),
2823 suc->bmaxpower << 1,
2827 render(isdb, pre, PT_USESTR,
2830 cons(iv, suc->bus_nr, NOVAL),
2836 (DISPLAY_HORIZONTALLY(flags) ? PT_USESTR : PT_USESTR | PT_NEWLIN),
2839 cons(iv, suc->bus_nr, NOVAL),
2847 ***************************************************************************
2848 * Display filesystems statistics in selected format.
2851 * @a Activity structure with statistics.
2852 * @isdb Flag, true if db printing, false if ppc printing.
2853 * @pre Prefix string for output entries
2854 * @curr Index in array for current sample statistics.
2855 * @itv Interval of time in jiffies.
2856 ***************************************************************************
2858 __print_funct_t render_filesystem_stats(struct activity *a, int isdb, char *pre,
2859 int curr, unsigned long long itv)
2862 struct stats_filesystem *sfc;
2864 for (i = 0; i < a->nr; i++) {
2865 sfc = (struct stats_filesystem *) ((char *) a->buf[curr] + i * a->msize);
2868 /* Size of filesystem is zero: We are at the end of the list */
2871 render(isdb, pre, PT_USERND,
2874 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2876 (double) sfc->f_bfree / 1024 / 1024,
2879 render(isdb, pre, PT_USERND,
2882 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2884 (double) (sfc->f_blocks - sfc->f_bfree) / 1024 / 1024,
2887 render(isdb, pre, PT_NOFLAG,
2890 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2892 sfc->f_blocks ? SP_VALUE(sfc->f_bfree, sfc->f_blocks, sfc->f_blocks)
2896 render(isdb, pre, PT_NOFLAG,
2899 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2901 sfc->f_blocks ? SP_VALUE(sfc->f_bavail, sfc->f_blocks, sfc->f_blocks)
2905 render(isdb, pre, PT_USEINT,
2908 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2913 render(isdb, pre, PT_USEINT,
2916 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2917 sfc->f_files - sfc->f_ffree,
2922 (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN),
2925 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2927 sfc->f_files ? SP_VALUE(sfc->f_ffree, sfc->f_files, sfc->f_files)
2934 ***************************************************************************
2935 * Display Fibre Channel HBA statistics in selected format.
2938 * @a Activity structure with statistics.
2939 * @isdb Flag, true if db printing, false if ppc printing.
2940 * @pre Prefix string for output entries
2941 * @curr Index in array for current sample statistics.
2942 * @itv Interval of time in jiffies.
2943 ***************************************************************************
2945 __print_funct_t render_fchost_stats(struct activity *a, int isdb, char *pre,
2946 int curr, unsigned long long itv)
2949 struct stats_fchost *sfcc, *sfcp;
2951 for (i = 0; i < a->nr; i++) {
2952 sfcc = (struct stats_fchost *) ((char *) a->buf[curr] + i * a->msize);
2953 sfcp = (struct stats_fchost *) ((char *) a->buf[!curr] + i * a->msize);
2955 if (!sfcc->fchost_name[0])
2956 /* We are at the end of the list */
2959 render(isdb, pre, PT_NOFLAG ,
2962 cons(sv, sfcc->fchost_name, NOVAL),
2964 S_VALUE(sfcp->f_rxframes, sfcc->f_rxframes, itv),
2966 render(isdb, pre, PT_NOFLAG,
2967 "%s\tfch_txf/s", NULL,
2968 cons(sv, sfcc->fchost_name, NULL),
2970 S_VALUE(sfcp->f_txframes, sfcc->f_txframes, itv),
2972 render(isdb, pre, PT_NOFLAG,
2973 "%s\tfch_rxw/s", NULL,
2974 cons(sv, sfcc->fchost_name, NULL),
2976 S_VALUE(sfcp->f_rxwords, sfcc->f_rxwords, itv),
2979 (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN),
2980 "%s\tfch_txw/s", NULL,
2981 cons(sv, sfcc->fchost_name, NULL),
2983 S_VALUE(sfcp->f_txwords, sfcc->f_txwords, itv),
2989 ***************************************************************************
2990 * Display softnet statistics in selected format.
2993 * @a Activity structure with statistics.
2994 * @isdb Flag, true if db printing, false if ppc printing.
2995 * @pre Prefix string for output entries
2996 * @curr Index in array for current sample statistics.
2997 * @itv Interval of time in jiffies.
2998 ***************************************************************************
3000 __print_funct_t render_softnet_stats(struct activity *a, int isdb, char *pre,
3001 int curr, unsigned long long itv)
3004 struct stats_softnet
3005 *ssnc = (struct stats_softnet *) a->buf[curr],
3006 *ssnp = (struct stats_softnet *) a->buf[!curr];
3008 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
3010 for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
3013 * The size of a->buf[...] CPU structure may be different from the default
3014 * sizeof(struct stats_pwr_cpufreq) value if data have been read from a file!
3015 * That's why we don't use a syntax like:
3016 * ssnc = (struct stats_softnet *) a->buf[...] + i;
3018 ssnc = (struct stats_softnet *) ((char *) a->buf[curr] + i * a->msize);
3019 ssnp = (struct stats_softnet *) ((char *) a->buf[!curr] + i * a->msize);
3022 * Note: a->nr is in [1, NR_CPUS + 1].
3023 * Bitmap size is provided for (NR_CPUS + 1) CPUs.
3024 * Anyway, NR_CPUS may vary between the version of sysstat
3025 * used by sadc to create a file, and the version of sysstat
3026 * used by sar to read it...
3029 /* Should current CPU (including CPU "all") be displayed? */
3030 if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
3033 /* This is CPU "all" */
3034 render(isdb, pre, PT_NOFLAG,
3038 S_VALUE(ssnp->processed, ssnc->processed, itv),
3041 render(isdb, pre, PT_NOFLAG,
3045 S_VALUE(ssnp->dropped, ssnc->dropped, itv),
3048 render(isdb, pre, PT_NOFLAG,
3052 S_VALUE(ssnp->time_squeeze, ssnc->time_squeeze, itv),
3055 render(isdb, pre, PT_NOFLAG,
3059 S_VALUE(ssnp->received_rps, ssnc->received_rps, itv),
3062 render(isdb, pre, pt_newlin,
3066 S_VALUE(ssnp->flow_limit, ssnc->flow_limit, itv),
3070 render(isdb, pre, PT_NOFLAG,
3072 "%d", cons(iv, i - 1, NOVAL),
3074 S_VALUE(ssnp->processed, ssnc->processed, itv),
3077 render(isdb, pre, PT_NOFLAG,
3079 NULL, cons(iv, i - 1, NOVAL),
3081 S_VALUE(ssnp->dropped, ssnc->dropped, itv),
3084 render(isdb, pre, PT_NOFLAG,
3086 NULL, cons(iv, i - 1, NOVAL),
3088 S_VALUE(ssnp->time_squeeze, ssnc->time_squeeze, itv),
3091 render(isdb, pre, PT_NOFLAG,
3093 NULL, cons(iv, i - 1, NOVAL),
3095 S_VALUE(ssnp->received_rps, ssnc->received_rps, itv),
3098 render(isdb, pre, pt_newlin,
3100 NULL, cons(iv, i - 1, NOVAL),
3102 S_VALUE(ssnp->flow_limit, ssnc->flow_limit, itv),