2 * rndr_stats.c: Funtions used by sadf to display statistics in selected format.
3 * (C) 1999-2019 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;
43 ***************************************************************************
45 * encapsulate a pair of ints or pair of char * into a static Cons and
46 * return a pointer to it.
48 * given: t - type of Cons {iv, sv}
49 * arg1 - unsigned long int (if iv), char * (if sv) to become
51 * arg2 - unsigned long int (if iv), char * (if sv) to become
54 * does: load a static Cons with values using the t parameter to
55 * guide pulling values from the arglist
57 * return: the address of its static Cons. If you need to keep
58 * the contents of this Cons, copy it somewhere before calling
59 * cons() against to avoid overwrite.
60 * ie. don't do this: f( cons( iv, i, j ), cons( iv, a, b ) );
61 ***************************************************************************
63 static Cons *cons(tcons t, ...)
72 c.a.i = va_arg(ap, unsigned long int);
73 c.b.i = va_arg(ap, unsigned long int);
76 c.a.s = va_arg(ap, char *);
77 c.b.s = va_arg(ap, char *);
84 ***************************************************************************
87 * given: isdb - flag, true if db printing, false if ppc printing
88 * pre - prefix string for output entries
89 * rflags - PT_.... rendering flags
90 * pptxt - printf-format text required for ppc output (may be null)
91 * dbtxt - printf-format text required for db output (may be null)
92 * mid - pptxt/dbtxt format args as a Cons.
93 * lluval - %llu printable arg (PT_USEINT must be set)
94 * dval - %.2f printable arg (used unless PT_USEINT is set)
95 * sval - %s printable arg (PT_USESTR must be set)
97 * does: print [pre<sep>]([dbtxt,arg,arg<sep>]|[pptxt,arg,arg<sep>]) \
98 * (luval|dval)(<sep>|\n)
101 ***************************************************************************
103 static void render(int isdb, char *pre, int rflags, const char *pptxt,
104 const char *dbtxt, Cons *mid, unsigned long long lluval,
105 double dval, char *sval)
107 static int newline = 1;
108 const char *txt[] = {pptxt, dbtxt};
110 /* Start a new line? */
111 if (newline && !DISPLAY_HORIZONTALLY(flags)) {
115 /* Terminate this one ? ppc always gets a newline */
116 newline = ((rflags & PT_NEWLIN) || !isdb);
121 printf("%s", seps[isdb]); /* Only if something actually gets printed */
124 /* Got format args? */
127 printf(txt[isdb], mid->a.i, mid->b.i);
130 printf(txt[isdb], mid->a.s, mid->b.s);
135 printf("%s", txt[isdb]);
139 if (rflags & PT_USEINT) {
140 printf("%s%llu", seps[isdb], lluval);
142 else if (rflags & PT_USESTR) {
143 printf("%s%s", seps[isdb], sval);
145 else if (rflags & PT_USERND) {
146 printf("%s%.0f", seps[isdb], dval);
149 printf("%s%.2f", seps[isdb], dval);
157 ***************************************************************************
158 * Display CPU statistics in selected format.
161 * @a Activity structure with statistics.
162 * @isdb Flag, true if db printing, false if ppc printing.
163 * @pre Prefix string for output entries
164 * @curr Index in array for current sample statistics.
165 * @itv Interval of time in 1/100th of a second (independent of the
166 * number of processors). Unused here.
167 ***************************************************************************
169 __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
170 int curr, unsigned long long itv)
173 unsigned long long deltot_jiffies = 1;
174 struct stats_cpu *scc, *scp;
175 unsigned char offline_cpu_bitmap[BITMAP_SIZE(NR_CPUS)] = {0};
177 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
179 /* @nr[curr] cannot normally be greater than @nr_ini */
180 if (a->nr[curr] > a->nr_ini) {
181 a->nr_ini = a->nr[curr];
185 * Compute CPU "all" as sum of all individual CPU (on SMP machines)
186 * and look for offline CPU.
189 deltot_jiffies = get_global_cpu_statistics(a, !curr, curr,
190 flags, offline_cpu_bitmap);
193 for (i = 0; (i < a->nr_ini) && (i < a->bitmap->b_size + 1); i++) {
195 /* Should current CPU (including CPU "all") be displayed? */
196 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) ||
197 offline_cpu_bitmap[i >> 3] & (1 << (i & 0x07)))
198 /* Don't display CPU */
201 scc = (struct stats_cpu *) ((char *) a->buf[curr] + i * a->msize);
202 scp = (struct stats_cpu *) ((char *) a->buf[!curr] + i * a->msize);
205 /* This is CPU "all" */
206 if (a->nr_ini == 1) {
208 * This is a UP machine. In this case
209 * interval has still not been calculated.
211 deltot_jiffies = get_per_cpu_interval(scc, scp);
213 if (!deltot_jiffies) {
214 /* CPU "all" cannot be tickless */
218 if (DISPLAY_CPU_DEF(a->opt_flags)) {
220 PT_NOFLAG, /* that's zero but you know what it means */
221 "all\t%user", /* ppctext */
222 "-1", /* look! dbtext */
224 NOVAL, /* another 0, named for readability */
225 ll_sp_value(scp->cpu_user, scc->cpu_user, deltot_jiffies),
226 NULL); /* No string arg */
228 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
229 render(isdb, pre, PT_NOFLAG,
230 "all\t%usr", "-1", NULL,
232 (scc->cpu_user - scc->cpu_guest) < (scp->cpu_user - scp->cpu_guest) ?
234 ll_sp_value(scp->cpu_user - scp->cpu_guest,
235 scc->cpu_user - scc->cpu_guest,
240 if (DISPLAY_CPU_DEF(a->opt_flags)) {
241 render(isdb, pre, PT_NOFLAG,
242 "all\t%nice", NULL, NULL,
244 ll_sp_value(scp->cpu_nice, scc->cpu_nice, deltot_jiffies),
247 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
248 render(isdb, pre, PT_NOFLAG,
249 "all\t%nice", NULL, NULL,
251 (scc->cpu_nice - scc->cpu_guest_nice) < (scp->cpu_nice - scp->cpu_guest_nice) ?
253 ll_sp_value(scp->cpu_nice - scp->cpu_guest_nice,
254 scc->cpu_nice - scc->cpu_guest_nice,
259 if (DISPLAY_CPU_DEF(a->opt_flags)) {
260 render(isdb, pre, PT_NOFLAG,
261 "all\t%system", NULL, NULL,
263 ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq,
264 scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq,
268 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
269 render(isdb, pre, PT_NOFLAG,
270 "all\t%sys", NULL, NULL,
272 ll_sp_value(scp->cpu_sys, scc->cpu_sys, deltot_jiffies),
276 render(isdb, pre, PT_NOFLAG,
277 "all\t%iowait", NULL, NULL,
279 ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, deltot_jiffies),
282 render(isdb, pre, PT_NOFLAG,
283 "all\t%steal", NULL, NULL,
285 ll_sp_value(scp->cpu_steal, scc->cpu_steal, deltot_jiffies),
288 if (DISPLAY_CPU_ALL(a->opt_flags)) {
289 render(isdb, pre, PT_NOFLAG,
290 "all\t%irq", NULL, NULL,
292 ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, deltot_jiffies),
295 render(isdb, pre, PT_NOFLAG,
296 "all\t%soft", NULL, NULL,
298 ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, deltot_jiffies),
301 render(isdb, pre, PT_NOFLAG,
302 "all\t%guest", NULL, NULL,
304 ll_sp_value(scp->cpu_guest, scc->cpu_guest, deltot_jiffies),
307 render(isdb, pre, PT_NOFLAG,
308 "all\t%gnice", NULL, NULL,
310 ll_sp_value(scp->cpu_guest_nice, scc->cpu_guest_nice, deltot_jiffies),
314 render(isdb, pre, pt_newlin,
315 "all\t%idle", NULL, NULL,
317 (scc->cpu_idle < scp->cpu_idle) ?
319 ll_sp_value(scp->cpu_idle, scc->cpu_idle, deltot_jiffies),
324 * Recalculate itv for current proc.
325 * If the result is 0, then current CPU is a tickless one.
327 deltot_jiffies = get_per_cpu_interval(scc, scp);
329 if (DISPLAY_CPU_DEF(a->opt_flags)) {
330 render(isdb, pre, PT_NOFLAG,
331 "cpu%d\t%%user", /* ppc text with formatting */
332 "%d", /* db text with format char */
333 cons(iv, i - 1, NOVAL), /* how we pass format args */
336 0.0 : /* CPU is tickless */
337 ll_sp_value(scp->cpu_user, scc->cpu_user, deltot_jiffies),
340 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
341 render(isdb, pre, PT_NOFLAG,
342 "cpu%d\t%%usr", "%d", cons(iv, i - 1, NOVAL),
345 ((scc->cpu_user - scc->cpu_guest) < (scp->cpu_user - scp->cpu_guest))) ?
347 ll_sp_value(scp->cpu_user - scp->cpu_guest,
348 scc->cpu_user - scc->cpu_guest, deltot_jiffies),
352 if (DISPLAY_CPU_DEF(a->opt_flags)) {
353 render(isdb, pre, PT_NOFLAG,
354 "cpu%d\t%%nice", NULL, cons(iv, i - 1, NOVAL),
358 ll_sp_value(scp->cpu_nice, scc->cpu_nice, deltot_jiffies),
361 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
362 render(isdb, pre, PT_NOFLAG,
363 "cpu%d\t%%nice", NULL, cons(iv, i - 1, NOVAL),
366 ((scc->cpu_nice - scc->cpu_guest_nice) < (scp->cpu_nice - scp->cpu_guest_nice))) ?
368 ll_sp_value(scp->cpu_nice - scp->cpu_guest_nice,
369 scc->cpu_nice - scc->cpu_guest_nice, deltot_jiffies),
373 if (DISPLAY_CPU_DEF(a->opt_flags)) {
374 render(isdb, pre, PT_NOFLAG,
375 "cpu%d\t%%system", NULL, cons(iv, i - 1, NOVAL),
379 ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq,
380 scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq,
384 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
385 render(isdb, pre, PT_NOFLAG,
386 "cpu%d\t%%sys", NULL, cons(iv, i - 1, NOVAL),
390 ll_sp_value(scp->cpu_sys, scc->cpu_sys, deltot_jiffies),
394 render(isdb, pre, PT_NOFLAG,
395 "cpu%d\t%%iowait", NULL, cons(iv, i - 1, NOVAL),
399 ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, deltot_jiffies),
402 render(isdb, pre, PT_NOFLAG,
403 "cpu%d\t%%steal", NULL, cons(iv, i - 1, NOVAL),
407 ll_sp_value(scp->cpu_steal, scc->cpu_steal, deltot_jiffies),
410 if (DISPLAY_CPU_ALL(a->opt_flags)) {
411 render(isdb, pre, PT_NOFLAG,
412 "cpu%d\t%%irq", NULL, cons(iv, i - 1, NOVAL),
416 ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, deltot_jiffies),
419 render(isdb, pre, PT_NOFLAG,
420 "cpu%d\t%%soft", NULL, cons(iv, i - 1, NOVAL),
424 ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, deltot_jiffies),
427 render(isdb, pre, PT_NOFLAG,
428 "cpu%d\t%%guest", NULL, cons(iv, i - 1, NOVAL),
432 ll_sp_value(scp->cpu_guest, scc->cpu_guest, deltot_jiffies),
435 render(isdb, pre, PT_NOFLAG,
436 "cpu%d\t%%gnice", NULL, cons(iv, i - 1, NOVAL),
440 ll_sp_value(scp->cpu_guest_nice, scc->cpu_guest_nice, deltot_jiffies),
444 if (!deltot_jiffies) {
445 /* CPU is tickless */
446 render(isdb, pre, pt_newlin,
447 "cpu%d\t%%idle", NULL, cons(iv, i - 1, NOVAL),
453 render(isdb, pre, pt_newlin,
454 "cpu%d\t%%idle", NULL, cons(iv, i - 1, NOVAL),
456 (scc->cpu_idle < scp->cpu_idle) ?
458 ll_sp_value(scp->cpu_idle, scc->cpu_idle, deltot_jiffies),
466 ***************************************************************************
467 * Display task creation and context switch statistics in selected format.
470 * @a Activity structure with statistics.
471 * @isdb Flag, true if db printing, false if ppc printing.
472 * @pre Prefix string for output entries
473 * @curr Index in array for current sample statistics.
474 * @itv Interval of time in 1/100th of a second.
475 ***************************************************************************
477 __print_funct_t render_pcsw_stats(struct activity *a, int isdb, char *pre,
478 int curr, unsigned long long itv)
481 *spc = (struct stats_pcsw *) a->buf[curr],
482 *spp = (struct stats_pcsw *) a->buf[!curr];
484 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
486 /* The first one as an example */
487 render(isdb, /* db/ppc flag */
488 pre, /* the preformatted line leader */
489 PT_NOFLAG, /* is this the end of a db line? */
490 "-\tproc/s", /* ppc text */
492 NULL, /* db/ppc text format args (Cons *) */
493 NOVAL, /* %lu value (unused unless PT_USEINT) */
494 /* and %.2f value, used unless PT_USEINT */
495 S_VALUE(spp->processes, spc->processes, itv),
496 NULL); /* %s value */
498 render(isdb, pre, pt_newlin,
499 "-\tcswch/s", NULL, NULL,
501 S_VALUE(spp->context_switch, spc->context_switch, itv),
506 ***************************************************************************
507 * Display interrupts statistics in selected format.
510 * @a Activity structure with statistics.
511 * @isdb Flag, true if db printing, false if ppc printing.
512 * @pre Prefix string for output entries
513 * @curr Index in array for current sample statistics.
514 * @itv Interval of time in 1/100th of a second.
515 ***************************************************************************
517 __print_funct_t render_irq_stats(struct activity *a, int isdb, char *pre,
518 int curr, unsigned long long itv)
521 struct stats_irq *sic, *sip;
523 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
525 for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) {
527 sic = (struct stats_irq *) ((char *) a->buf[curr] + i * a->msize);
528 sip = (struct stats_irq *) ((char *) a->buf[!curr] + i * a->msize);
530 /* Should current interrupt (including int "sum") be displayed? */
531 if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
533 /* Yes: Display it */
535 /* This is interrupt "sum" */
536 render(isdb, pre, pt_newlin,
537 "sum\tintr/s", "-1", NULL,
539 S_VALUE(sip->irq_nr, sic->irq_nr, itv),
543 render(isdb, pre, pt_newlin,
544 "i%03d\tintr/s", "%d", cons(iv, i - 1, NOVAL),
546 S_VALUE(sip->irq_nr, sic->irq_nr, itv),
554 ***************************************************************************
555 * Display swapping statistics in selected format.
558 * @a Activity structure with statistics.
559 * @isdb Flag, true if db printing, false if ppc printing.
560 * @pre Prefix string for output entries
561 * @curr Index in array for current sample statistics.
562 * @itv Interval of time in 1/100th of a second.
563 ***************************************************************************
565 __print_funct_t render_swap_stats(struct activity *a, int isdb, char *pre,
566 int curr, unsigned long long itv)
569 *ssc = (struct stats_swap *) a->buf[curr],
570 *ssp = (struct stats_swap *) a->buf[!curr];
572 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
574 render(isdb, pre, PT_NOFLAG,
575 "-\tpswpin/s", NULL, NULL,
577 S_VALUE(ssp->pswpin, ssc->pswpin, itv),
579 render(isdb, pre, pt_newlin,
580 "-\tpswpout/s", NULL, NULL,
582 S_VALUE(ssp->pswpout, ssc->pswpout, itv),
587 ***************************************************************************
588 * Display paging statistics in selected format.
591 * @a Activity structure with statistics.
592 * @isdb Flag, true if db printing, false if ppc printing.
593 * @pre Prefix string for output entries
594 * @curr Index in array for current sample statistics.
595 * @itv Interval of time in 1/100th of a second.
596 ***************************************************************************
598 __print_funct_t render_paging_stats(struct activity *a, int isdb, char *pre,
599 int curr, unsigned long long itv)
602 *spc = (struct stats_paging *) a->buf[curr],
603 *spp = (struct stats_paging *) a->buf[!curr];
605 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
607 render(isdb, pre, PT_NOFLAG,
608 "-\tpgpgin/s", NULL, NULL,
610 S_VALUE(spp->pgpgin, spc->pgpgin, itv),
613 render(isdb, pre, PT_NOFLAG,
614 "-\tpgpgout/s", NULL, NULL,
616 S_VALUE(spp->pgpgout, spc->pgpgout, itv),
619 render(isdb, pre, PT_NOFLAG,
620 "-\tfault/s", NULL, NULL,
622 S_VALUE(spp->pgfault, spc->pgfault, itv),
625 render(isdb, pre, PT_NOFLAG,
626 "-\tmajflt/s", NULL, NULL,
628 S_VALUE(spp->pgmajfault, spc->pgmajfault, itv),
631 render(isdb, pre, PT_NOFLAG,
632 "-\tpgfree/s", NULL, NULL,
634 S_VALUE(spp->pgfree, spc->pgfree, itv),
637 render(isdb, pre, PT_NOFLAG,
638 "-\tpgscank/s", NULL, NULL,
640 S_VALUE(spp->pgscan_kswapd, spc->pgscan_kswapd, itv),
643 render(isdb, pre, PT_NOFLAG,
644 "-\tpgscand/s", NULL, NULL,
646 S_VALUE(spp->pgscan_direct, spc->pgscan_direct, itv),
649 render(isdb, pre, PT_NOFLAG,
650 "-\tpgsteal/s", NULL, NULL,
652 S_VALUE(spp->pgsteal, spc->pgsteal, itv),
655 render(isdb, pre, pt_newlin,
656 "-\t%vmeff", NULL, NULL,
658 (spc->pgscan_kswapd + spc->pgscan_direct -
659 spp->pgscan_kswapd - spp->pgscan_direct) ?
660 SP_VALUE(spp->pgsteal, spc->pgsteal,
661 spc->pgscan_kswapd + spc->pgscan_direct -
662 spp->pgscan_kswapd - spp->pgscan_direct) : 0.0,
667 ***************************************************************************
668 * Display I/O and transfer rate statistics in selected format.
671 * @a Activity structure with statistics.
672 * @isdb Flag, true if db printing, false if ppc printing.
673 * @pre Prefix string for output entries
674 * @curr Index in array for current sample statistics.
675 * @itv Interval of time in 1/100th of a second.
676 ***************************************************************************
678 __print_funct_t render_io_stats(struct activity *a, int isdb, char *pre,
679 int curr, unsigned long long itv)
682 *sic = (struct stats_io *) a->buf[curr],
683 *sip = (struct stats_io *) a->buf[!curr];
685 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
688 * If we get negative values, this is probably because
689 * one or more devices/filesystems have been unmounted.
690 * We display 0.0 in this case though we should rather tell
691 * the user that the value cannot be calculated here.
693 render(isdb, pre, PT_NOFLAG,
694 "-\ttps", NULL, NULL,
696 sic->dk_drive < sip->dk_drive ? 0.0 :
697 S_VALUE(sip->dk_drive, sic->dk_drive, itv),
700 render(isdb, pre, PT_NOFLAG,
701 "-\trtps", NULL, NULL,
703 sic->dk_drive_rio < sip->dk_drive_rio ? 0.0 :
704 S_VALUE(sip->dk_drive_rio, sic->dk_drive_rio, itv),
707 render(isdb, pre, PT_NOFLAG,
708 "-\twtps", NULL, NULL,
710 sic->dk_drive_wio < sip->dk_drive_wio ? 0.0 :
711 S_VALUE(sip->dk_drive_wio, sic->dk_drive_wio, itv),
714 render(isdb, pre, PT_NOFLAG,
715 "-\tdtps", NULL, NULL,
717 sic->dk_drive_dio < sip->dk_drive_dio ? 0.0 :
718 S_VALUE(sip->dk_drive_dio, sic->dk_drive_dio, itv),
721 render(isdb, pre, PT_NOFLAG,
722 "-\tbread/s", NULL, NULL,
724 sic->dk_drive_rblk < sip->dk_drive_rblk ? 0.0 :
725 S_VALUE(sip->dk_drive_rblk, sic->dk_drive_rblk, itv),
728 render(isdb, pre, PT_NOFLAG,
729 "-\tbwrtn/s", NULL, NULL,
731 sic->dk_drive_wblk < sip->dk_drive_wblk ? 0.0 :
732 S_VALUE(sip->dk_drive_wblk, sic->dk_drive_wblk, itv),
735 render(isdb, pre, pt_newlin,
736 "-\tbdscd/s", NULL, NULL,
738 sic->dk_drive_dblk < sip->dk_drive_dblk ? 0.0 :
739 S_VALUE(sip->dk_drive_dblk, sic->dk_drive_dblk, itv),
744 ***************************************************************************
745 * Display memory and swap statistics in selected format.
748 * @a Activity structure with statistics.
749 * @isdb Flag, true if db printing, false if ppc printing.
750 * @pre Prefix string for output entries
751 * @curr Index in array for current sample statistics.
752 * @itv Interval of time in 1/100th of a second.
753 ***************************************************************************
755 __print_funct_t render_memory_stats(struct activity *a, int isdb, char *pre,
756 int curr, unsigned long long itv)
759 *smc = (struct stats_memory *) a->buf[curr];
761 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
763 unsigned long long nousedmem;
765 if (DISPLAY_MEMORY(a->opt_flags)) {
767 nousedmem = smc->frmkb + smc->bufkb + smc->camkb + smc->slabkb;
768 if (nousedmem > smc->tlmkb) {
769 nousedmem = smc->tlmkb;
772 render(isdb, pre, PT_USEINT,
773 "-\tkbmemfree", NULL, NULL,
774 smc->frmkb, DNOVAL, NULL);
776 render(isdb, pre, PT_USEINT,
777 "-\tkbavail", NULL, NULL,
778 smc->availablekb, DNOVAL, NULL);
780 render(isdb, pre, PT_USEINT,
781 "-\tkbmemused", NULL, NULL,
782 smc->tlmkb - nousedmem, DNOVAL, NULL);
784 render(isdb, pre, PT_NOFLAG,
785 "-\t%memused", NULL, NULL, NOVAL,
787 SP_VALUE(nousedmem, 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 1/100th of a second.
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 1/100th of a second.
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 1/100th of a second.
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[curr]; i++) {
984 if (a->nr[!curr] > 0) {
985 ssc = (struct stats_serial *) ((char *) a->buf[curr] + i * a->msize);
987 /* Look for corresponding serial line in previous iteration */
990 if (j >= a->nr[!curr]) {
991 j = a->nr[!curr] - 1;
997 ssp = (struct stats_serial *) ((char *) a->buf[!curr] + j * a->msize);
998 if (ssc->line == ssp->line) {
1002 if (++j >= a->nr[!curr]) {
1012 render(isdb, pre, PT_NOFLAG,
1013 "ttyS%d\trcvin/s", "%d",
1014 cons(iv, ssc->line, NOVAL),
1016 S_VALUE(ssp->rx, ssc->rx, itv),
1019 render(isdb, pre, PT_NOFLAG,
1020 "ttyS%d\txmtin/s", NULL,
1021 cons(iv, ssc->line, NOVAL),
1023 S_VALUE(ssp->tx, ssc->tx, itv),
1026 render(isdb, pre, PT_NOFLAG,
1027 "ttyS%d\tframerr/s", NULL,
1028 cons(iv, ssc->line, NOVAL),
1030 S_VALUE(ssp->frame, ssc->frame, itv),
1033 render(isdb, pre, PT_NOFLAG,
1034 "ttyS%d\tprtyerr/s", NULL,
1035 cons(iv, ssc->line, NOVAL),
1037 S_VALUE(ssp->parity, ssc->parity, itv),
1040 render(isdb, pre, PT_NOFLAG,
1041 "ttyS%d\tbrk/s", NULL,
1042 cons(iv, ssc->line, NOVAL),
1044 S_VALUE(ssp->brk, ssc->brk, itv),
1047 render(isdb, pre, pt_newlin,
1048 "ttyS%d\tovrun/s", NULL,
1049 cons(iv, ssc->line, NOVAL),
1051 S_VALUE(ssp->overrun, ssc->overrun, itv),
1057 ***************************************************************************
1058 * Display disks statistics in selected format.
1061 * @a Activity structure with statistics.
1062 * @isdb Flag, true if db printing, false if ppc printing.
1063 * @pre Prefix string for output entries
1064 * @curr Index in array for current sample statistics.
1065 * @itv Interval of time in 1/100th of a second.
1066 ***************************************************************************
1068 __print_funct_t render_disk_stats(struct activity *a, int isdb, char *pre,
1069 int curr, unsigned long long itv)
1072 struct stats_disk *sdc, *sdp, sdpzero;
1073 struct ext_disk_stats xds;
1076 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1078 memset(&sdpzero, 0, STATS_DISK_SIZE);
1080 for (i = 0; i < a->nr[curr]; i++) {
1082 sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize);
1084 j = check_disk_reg(a, curr, !curr, i);
1086 /* This is a newly registered interface. Previous stats are zero */
1090 sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
1093 /* Get device name */
1094 dev_name = get_sa_devname(sdc->major, sdc->minor,
1095 sdc->wwn, sdc->part_nr, flags);
1097 if (a->item_list != NULL) {
1098 /* A list of devices has been entered on the command line */
1099 if (!search_list_item(a->item_list, dev_name))
1100 /* Device not found */
1104 /* Compute extended stats (service time, etc.) */
1105 compute_ext_disk_stats(sdc, sdp, itv, &xds);
1107 render(isdb, pre, PT_NOFLAG,
1109 cons(sv, dev_name, NULL),
1111 S_VALUE(sdp->nr_ios, sdc->nr_ios, itv),
1114 render(isdb, pre, PT_NOFLAG,
1116 cons(sv, dev_name, NULL),
1118 S_VALUE(sdp->rd_sect, sdc->rd_sect, itv) / 2,
1121 render(isdb, pre, PT_NOFLAG,
1123 cons(sv, dev_name, NULL),
1125 S_VALUE(sdp->wr_sect, sdc->wr_sect, itv) / 2,
1128 render(isdb, pre, PT_NOFLAG,
1130 cons(sv, dev_name, NULL),
1132 S_VALUE(sdp->dc_sect, sdc->dc_sect, itv) / 2,
1135 render(isdb, pre, PT_NOFLAG,
1136 "%s\tareq-sz", NULL,
1137 cons(sv, dev_name, NULL),
1142 render(isdb, pre, PT_NOFLAG,
1144 cons(sv, dev_name, NULL),
1146 S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,
1149 render(isdb, pre, PT_NOFLAG,
1151 cons(sv, dev_name, NULL),
1156 render(isdb, pre, pt_newlin,
1158 cons(sv, dev_name, NULL),
1166 ***************************************************************************
1167 * Display network interfaces statistics in selected format.
1170 * @a Activity structure with statistics.
1171 * @isdb Flag, true if db printing, false if ppc printing.
1172 * @pre Prefix string for output entries
1173 * @curr Index in array for current sample statistics.
1174 * @itv Interval of time in 1/100th of a second.
1175 ***************************************************************************
1177 __print_funct_t render_net_dev_stats(struct activity *a, int isdb, char *pre,
1178 int curr, unsigned long long itv)
1181 struct stats_net_dev *sndc, *sndp, sndzero;
1182 double rxkb, txkb, ifutil;
1184 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1186 memset(&sndzero, 0, STATS_NET_DEV_SIZE);
1188 for (i = 0; i < a->nr[curr]; i++) {
1190 sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize);
1192 if (a->item_list != NULL) {
1193 /* A list of devices has been entered on the command line */
1194 if (!search_list_item(a->item_list, sndc->interface))
1195 /* Device not found */
1199 j = check_net_dev_reg(a, curr, !curr, i);
1201 /* This is a newly registered interface. Previous stats are zero */
1205 sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize);
1208 render(isdb, pre, PT_NOFLAG,
1209 "%s\trxpck/s", "%s",
1210 cons(sv, sndc->interface, NULL), /* What if the format args are strings? */
1212 S_VALUE(sndp->rx_packets, sndc->rx_packets, itv),
1215 render(isdb, pre, PT_NOFLAG,
1216 "%s\ttxpck/s", NULL,
1217 cons(sv, sndc->interface, NULL),
1219 S_VALUE(sndp->tx_packets, sndc->tx_packets, itv),
1222 rxkb = S_VALUE(sndp->rx_bytes, sndc->rx_bytes, itv);
1223 render(isdb, pre, PT_NOFLAG,
1225 cons(sv, sndc->interface, NULL),
1230 txkb = S_VALUE(sndp->tx_bytes, sndc->tx_bytes, itv);
1231 render(isdb, pre, PT_NOFLAG,
1233 cons(sv, sndc->interface, NULL),
1238 render(isdb, pre, PT_NOFLAG,
1239 "%s\trxcmp/s", NULL,
1240 cons(sv, sndc->interface, NULL),
1242 S_VALUE(sndp->rx_compressed, sndc->rx_compressed, itv),
1245 render(isdb, pre, PT_NOFLAG,
1246 "%s\ttxcmp/s", NULL,
1247 cons(sv, sndc->interface, NULL),
1249 S_VALUE(sndp->tx_compressed, sndc->tx_compressed, itv),
1252 render(isdb, pre, PT_NOFLAG,
1253 "%s\trxmcst/s", NULL,
1254 cons(sv, sndc->interface, NULL),
1256 S_VALUE(sndp->multicast, sndc->multicast, itv),
1259 ifutil = compute_ifutil(sndc, rxkb, txkb);
1260 render(isdb, pre, pt_newlin,
1261 "%s\t%%ifutil", NULL,
1262 cons(sv, sndc->interface, NULL),
1270 ***************************************************************************
1271 * Display network interface errors statistics in selected format.
1274 * @a Activity structure with statistics.
1275 * @isdb Flag, true if db printing, false if ppc printing.
1276 * @pre Prefix string for output entries
1277 * @curr Index in array for current sample statistics.
1278 * @itv Interval of time in 1/100th of a second.
1279 ***************************************************************************
1281 __print_funct_t render_net_edev_stats(struct activity *a, int isdb, char *pre,
1282 int curr, unsigned long long itv)
1285 struct stats_net_edev *snedc, *snedp, snedzero;
1287 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1289 memset(&snedzero, 0, STATS_NET_EDEV_SIZE);
1291 for (i = 0; i < a->nr[curr]; i++) {
1293 snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize);
1295 if (a->item_list != NULL) {
1296 /* A list of devices has been entered on the command line */
1297 if (!search_list_item(a->item_list, snedc->interface))
1298 /* Device not found */
1302 j = check_net_edev_reg(a, curr, !curr, i);
1304 /* This is a newly registered interface. Previous stats are zero */
1308 snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize);
1311 render(isdb, pre, PT_NOFLAG,
1312 "%s\trxerr/s", "%s",
1313 cons(sv, snedc->interface, NULL),
1315 S_VALUE(snedp->rx_errors, snedc->rx_errors, itv),
1318 render(isdb, pre, PT_NOFLAG,
1319 "%s\ttxerr/s", NULL,
1320 cons(sv, snedc->interface, NULL),
1322 S_VALUE(snedp->tx_errors, snedc->tx_errors, itv),
1325 render(isdb, pre, PT_NOFLAG,
1327 cons(sv, snedc->interface, NULL),
1329 S_VALUE(snedp->collisions, snedc->collisions, itv),
1332 render(isdb, pre, PT_NOFLAG,
1333 "%s\trxdrop/s", NULL,
1334 cons(sv, snedc->interface, NULL),
1336 S_VALUE(snedp->rx_dropped, snedc->rx_dropped, itv),
1339 render(isdb, pre, PT_NOFLAG,
1340 "%s\ttxdrop/s", NULL,
1341 cons(sv, snedc->interface, NULL),
1343 S_VALUE(snedp->tx_dropped, snedc->tx_dropped, itv),
1346 render(isdb, pre, PT_NOFLAG,
1347 "%s\ttxcarr/s", NULL,
1348 cons(sv, snedc->interface, NULL),
1350 S_VALUE(snedp->tx_carrier_errors, snedc->tx_carrier_errors, itv),
1353 render(isdb, pre, PT_NOFLAG,
1354 "%s\trxfram/s", NULL,
1355 cons(sv, snedc->interface, NULL),
1357 S_VALUE(snedp->rx_frame_errors, snedc->rx_frame_errors, itv),
1360 render(isdb, pre, PT_NOFLAG,
1361 "%s\trxfifo/s", NULL,
1362 cons(sv, snedc->interface, NULL),
1364 S_VALUE(snedp->rx_fifo_errors, snedc->rx_fifo_errors, itv),
1367 render(isdb, pre, pt_newlin,
1368 "%s\ttxfifo/s", NULL,
1369 cons(sv, snedc->interface, NULL),
1371 S_VALUE(snedp->tx_fifo_errors, snedc->tx_fifo_errors, itv),
1377 ***************************************************************************
1378 * Display NFS client statistics in selected format.
1381 * @a Activity structure with statistics.
1382 * @isdb Flag, true if db printing, false if ppc printing.
1383 * @pre Prefix string for output entries
1384 * @curr Index in array for current sample statistics.
1385 * @itv Interval of time in 1/100th of a second.
1386 ***************************************************************************
1388 __print_funct_t render_net_nfs_stats(struct activity *a, int isdb, char *pre,
1389 int curr, unsigned long long itv)
1391 struct stats_net_nfs
1392 *snnc = (struct stats_net_nfs *) a->buf[curr],
1393 *snnp = (struct stats_net_nfs *) a->buf[!curr];
1395 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1397 render(isdb, pre, PT_NOFLAG,
1398 "-\tcall/s", NULL, NULL,
1400 S_VALUE(snnp->nfs_rpccnt, snnc->nfs_rpccnt, itv),
1403 render(isdb, pre, PT_NOFLAG,
1404 "-\tretrans/s", NULL, NULL,
1406 S_VALUE(snnp->nfs_rpcretrans, snnc->nfs_rpcretrans, itv),
1409 render(isdb, pre, PT_NOFLAG,
1410 "-\tread/s", NULL, NULL,
1412 S_VALUE(snnp->nfs_readcnt, snnc->nfs_readcnt, itv),
1415 render(isdb, pre, PT_NOFLAG,
1416 "-\twrite/s", NULL, NULL,
1418 S_VALUE(snnp->nfs_writecnt, snnc->nfs_writecnt, itv),
1421 render(isdb, pre, PT_NOFLAG,
1422 "-\taccess/s", NULL, NULL,
1424 S_VALUE(snnp->nfs_accesscnt, snnc->nfs_accesscnt, itv),
1427 render(isdb, pre, pt_newlin,
1428 "-\tgetatt/s", NULL, NULL,
1430 S_VALUE(snnp->nfs_getattcnt, snnc->nfs_getattcnt, itv),
1435 ***************************************************************************
1436 * Display NFS server statistics in selected format.
1439 * @a Activity structure with statistics.
1440 * @isdb Flag, true if db printing, false if ppc printing.
1441 * @pre Prefix string for output entries
1442 * @curr Index in array for current sample statistics.
1443 * @itv Interval of time in 1/100th of a second.
1444 ***************************************************************************
1446 __print_funct_t render_net_nfsd_stats(struct activity *a, int isdb, char *pre,
1447 int curr, unsigned long long itv)
1449 struct stats_net_nfsd
1450 *snndc = (struct stats_net_nfsd *) a->buf[curr],
1451 *snndp = (struct stats_net_nfsd *) a->buf[!curr];
1453 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1455 render(isdb, pre, PT_NOFLAG,
1456 "-\tscall/s", NULL, NULL,
1458 S_VALUE(snndp->nfsd_rpccnt, snndc->nfsd_rpccnt, itv),
1461 render(isdb, pre, PT_NOFLAG,
1462 "-\tbadcall/s", NULL, NULL,
1464 S_VALUE(snndp->nfsd_rpcbad, snndc->nfsd_rpcbad, itv),
1467 render(isdb, pre, PT_NOFLAG,
1468 "-\tpacket/s", NULL, NULL,
1470 S_VALUE(snndp->nfsd_netcnt, snndc->nfsd_netcnt, itv),
1473 render(isdb, pre, PT_NOFLAG,
1474 "-\tudp/s", NULL, NULL,
1476 S_VALUE(snndp->nfsd_netudpcnt, snndc->nfsd_netudpcnt, itv),
1479 render(isdb, pre, PT_NOFLAG,
1480 "-\ttcp/s", NULL, NULL,
1482 S_VALUE(snndp->nfsd_nettcpcnt, snndc->nfsd_nettcpcnt, itv),
1485 render(isdb, pre, PT_NOFLAG,
1486 "-\thit/s", NULL, NULL,
1488 S_VALUE(snndp->nfsd_rchits, snndc->nfsd_rchits, itv),
1491 render(isdb, pre, PT_NOFLAG,
1492 "-\tmiss/s", NULL, NULL,
1494 S_VALUE(snndp->nfsd_rcmisses, snndc->nfsd_rcmisses, itv),
1497 render(isdb, pre, PT_NOFLAG,
1498 "-\tsread/s", NULL, NULL,
1500 S_VALUE(snndp->nfsd_readcnt, snndc->nfsd_readcnt, itv),
1503 render(isdb, pre, PT_NOFLAG,
1504 "-\tswrite/s", NULL, NULL,
1506 S_VALUE(snndp->nfsd_writecnt, snndc->nfsd_writecnt, itv),
1509 render(isdb, pre, PT_NOFLAG,
1510 "-\tsaccess/s", NULL, NULL,
1512 S_VALUE(snndp->nfsd_accesscnt, snndc->nfsd_accesscnt, itv),
1515 render(isdb, pre, pt_newlin,
1516 "-\tsgetatt/s", NULL, NULL,
1518 S_VALUE(snndp->nfsd_getattcnt, snndc->nfsd_getattcnt, itv),
1523 ***************************************************************************
1524 * Display network sockets statistics in selected format.
1527 * @a Activity structure with statistics.
1528 * @isdb Flag, true if db printing, false if ppc printing.
1529 * @pre Prefix string for output entries
1530 * @curr Index in array for current sample statistics.
1531 * @itv Interval of time in 1/100th of a second.
1532 ***************************************************************************
1534 __print_funct_t render_net_sock_stats(struct activity *a, int isdb, char *pre,
1535 int curr, unsigned long long itv)
1537 struct stats_net_sock
1538 *snsc = (struct stats_net_sock *) a->buf[curr];
1540 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1542 render(isdb, pre, PT_USEINT,
1543 "-\ttotsck", NULL, NULL,
1544 (unsigned long long) snsc->sock_inuse, DNOVAL, NULL);
1546 render(isdb, pre, PT_USEINT,
1547 "-\ttcpsck", NULL, NULL,
1548 (unsigned long long) snsc->tcp_inuse, DNOVAL, NULL);
1550 render(isdb, pre, PT_USEINT,
1551 "-\tudpsck", NULL, NULL,
1552 (unsigned long long) snsc->udp_inuse, DNOVAL, NULL);
1554 render(isdb, pre, PT_USEINT,
1555 "-\trawsck", NULL, NULL,
1556 (unsigned long long) snsc->raw_inuse, DNOVAL, NULL);
1558 render(isdb, pre, PT_USEINT,
1559 "-\tip-frag", NULL, NULL,
1560 (unsigned long long) snsc->frag_inuse, DNOVAL, NULL);
1562 render(isdb, pre, PT_USEINT | pt_newlin,
1563 "-\ttcp-tw", NULL, NULL,
1564 (unsigned long long) snsc->tcp_tw, DNOVAL, NULL);
1568 ***************************************************************************
1569 * Display IP network statistics in selected format.
1572 * @a Activity structure with statistics.
1573 * @isdb Flag, true if db printing, false if ppc printing.
1574 * @pre Prefix string for output entries
1575 * @curr Index in array for current sample statistics.
1576 * @itv Interval of time in 1/100th of a second.
1577 ***************************************************************************
1579 __print_funct_t render_net_ip_stats(struct activity *a, int isdb, char *pre,
1580 int curr, unsigned long long itv)
1583 *snic = (struct stats_net_ip *) a->buf[curr],
1584 *snip = (struct stats_net_ip *) a->buf[!curr];
1586 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1588 render(isdb, pre, PT_NOFLAG,
1589 "-\tirec/s", NULL, NULL,
1591 S_VALUE(snip->InReceives, snic->InReceives, itv),
1594 render(isdb, pre, PT_NOFLAG,
1595 "-\tfwddgm/s", NULL, NULL,
1597 S_VALUE(snip->ForwDatagrams, snic->ForwDatagrams, itv),
1600 render(isdb, pre, PT_NOFLAG,
1601 "-\tidel/s", NULL, NULL,
1603 S_VALUE(snip->InDelivers, snic->InDelivers, itv),
1606 render(isdb, pre, PT_NOFLAG,
1607 "-\torq/s", NULL, NULL,
1609 S_VALUE(snip->OutRequests, snic->OutRequests, itv),
1612 render(isdb, pre, PT_NOFLAG,
1613 "-\tasmrq/s", NULL, NULL,
1615 S_VALUE(snip->ReasmReqds, snic->ReasmReqds, itv),
1618 render(isdb, pre, PT_NOFLAG,
1619 "-\tasmok/s", NULL, NULL,
1621 S_VALUE(snip->ReasmOKs, snic->ReasmOKs, itv),
1624 render(isdb, pre, PT_NOFLAG,
1625 "-\tfragok/s", NULL, NULL,
1627 S_VALUE(snip->FragOKs, snic->FragOKs, itv),
1630 render(isdb, pre, pt_newlin,
1631 "-\tfragcrt/s", NULL, NULL,
1633 S_VALUE(snip->FragCreates, snic->FragCreates, itv),
1638 ***************************************************************************
1639 * Display IP network errors statistics in selected format.
1642 * @a Activity structure with statistics.
1643 * @isdb Flag, true if db printing, false if ppc printing.
1644 * @pre Prefix string for output entries
1645 * @curr Index in array for current sample statistics.
1646 * @itv Interval of time in 1/100th of a second.
1647 ***************************************************************************
1649 __print_funct_t render_net_eip_stats(struct activity *a, int isdb, char *pre,
1650 int curr, unsigned long long itv)
1652 struct stats_net_eip
1653 *sneic = (struct stats_net_eip *) a->buf[curr],
1654 *sneip = (struct stats_net_eip *) a->buf[!curr];
1656 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1658 render(isdb, pre, PT_NOFLAG,
1659 "-\tihdrerr/s", NULL, NULL,
1661 S_VALUE(sneip->InHdrErrors, sneic->InHdrErrors, itv),
1664 render(isdb, pre, PT_NOFLAG,
1665 "-\tiadrerr/s", NULL, NULL,
1667 S_VALUE(sneip->InAddrErrors, sneic->InAddrErrors, itv),
1670 render(isdb, pre, PT_NOFLAG,
1671 "-\tiukwnpr/s", NULL, NULL,
1673 S_VALUE(sneip->InUnknownProtos, sneic->InUnknownProtos, itv),
1676 render(isdb, pre, PT_NOFLAG,
1677 "-\tidisc/s", NULL, NULL,
1679 S_VALUE(sneip->InDiscards, sneic->InDiscards, itv),
1682 render(isdb, pre, PT_NOFLAG,
1683 "-\todisc/s", NULL, NULL,
1685 S_VALUE(sneip->OutDiscards, sneic->OutDiscards, itv),
1688 render(isdb, pre, PT_NOFLAG,
1689 "-\tonort/s", NULL, NULL,
1691 S_VALUE(sneip->OutNoRoutes, sneic->OutNoRoutes, itv),
1694 render(isdb, pre, PT_NOFLAG,
1695 "-\tasmf/s", NULL, NULL,
1697 S_VALUE(sneip->ReasmFails, sneic->ReasmFails, itv),
1700 render(isdb, pre, pt_newlin,
1701 "-\tfragf/s", NULL, NULL,
1703 S_VALUE(sneip->FragFails, sneic->FragFails, itv),
1708 ***************************************************************************
1709 * Display ICMP network statistics in selected format.
1712 * @a Activity structure with statistics.
1713 * @isdb Flag, true if db printing, false if ppc printing.
1714 * @pre Prefix string for output entries
1715 * @curr Index in array for current sample statistics.
1716 * @itv Interval of time in 1/100th of a second.
1717 ***************************************************************************
1719 __print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre,
1720 int curr, unsigned long long itv)
1722 struct stats_net_icmp
1723 *snic = (struct stats_net_icmp *) a->buf[curr],
1724 *snip = (struct stats_net_icmp *) a->buf[!curr];
1726 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1728 render(isdb, pre, PT_NOFLAG,
1729 "-\timsg/s", NULL, NULL,
1731 S_VALUE(snip->InMsgs, snic->InMsgs, itv),
1734 render(isdb, pre, PT_NOFLAG,
1735 "-\tomsg/s", NULL, NULL,
1737 S_VALUE(snip->OutMsgs, snic->OutMsgs, itv),
1740 render(isdb, pre, PT_NOFLAG,
1741 "-\tiech/s", NULL, NULL,
1743 S_VALUE(snip->InEchos, snic->InEchos, itv),
1746 render(isdb, pre, PT_NOFLAG,
1747 "-\tiechr/s", NULL, NULL,
1749 S_VALUE(snip->InEchoReps, snic->InEchoReps, itv),
1752 render(isdb, pre, PT_NOFLAG,
1753 "-\toech/s", NULL, NULL,
1755 S_VALUE(snip->OutEchos, snic->OutEchos, itv),
1758 render(isdb, pre, PT_NOFLAG,
1759 "-\toechr/s", NULL, NULL,
1761 S_VALUE(snip->OutEchoReps, snic->OutEchoReps, itv),
1764 render(isdb, pre, PT_NOFLAG,
1765 "-\titm/s", NULL, NULL,
1767 S_VALUE(snip->InTimestamps, snic->InTimestamps, itv),
1770 render(isdb, pre, PT_NOFLAG,
1771 "-\titmr/s", NULL, NULL,
1773 S_VALUE(snip->InTimestampReps, snic->InTimestampReps, itv),
1776 render(isdb, pre, PT_NOFLAG,
1777 "-\totm/s", NULL, NULL,
1779 S_VALUE(snip->OutTimestamps, snic->OutTimestamps, itv),
1782 render(isdb, pre, PT_NOFLAG,
1783 "-\totmr/s", NULL, NULL,
1785 S_VALUE(snip->OutTimestampReps, snic->OutTimestampReps, itv),
1788 render(isdb, pre, PT_NOFLAG,
1789 "-\tiadrmk/s", NULL, NULL,
1791 S_VALUE(snip->InAddrMasks, snic->InAddrMasks, itv),
1794 render(isdb, pre, PT_NOFLAG,
1795 "-\tiadrmkr/s", NULL, NULL,
1797 S_VALUE(snip->InAddrMaskReps, snic->InAddrMaskReps, itv),
1800 render(isdb, pre, PT_NOFLAG,
1801 "-\toadrmk/s", NULL, NULL,
1803 S_VALUE(snip->OutAddrMasks, snic->OutAddrMasks, itv),
1806 render(isdb, pre, pt_newlin,
1807 "-\toadrmkr/s", NULL, NULL,
1809 S_VALUE(snip->OutAddrMaskReps, snic->OutAddrMaskReps, itv),
1814 ***************************************************************************
1815 * Display ICMP error messages statistics in selected format.
1818 * @a Activity structure with statistics.
1819 * @isdb Flag, true if db printing, false if ppc printing.
1820 * @pre Prefix string for output entries
1821 * @curr Index in array for current sample statistics.
1822 * @itv Interval of time in 1/100th of a second.
1823 ***************************************************************************
1825 __print_funct_t render_net_eicmp_stats(struct activity *a, int isdb, char *pre,
1826 int curr, unsigned long long itv)
1828 struct stats_net_eicmp
1829 *sneic = (struct stats_net_eicmp *) a->buf[curr],
1830 *sneip = (struct stats_net_eicmp *) a->buf[!curr];
1832 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1834 render(isdb, pre, PT_NOFLAG,
1835 "-\tierr/s", NULL, NULL,
1837 S_VALUE(sneip->InErrors, sneic->InErrors, itv),
1840 render(isdb, pre, PT_NOFLAG,
1841 "-\toerr/s", NULL, NULL,
1843 S_VALUE(sneip->OutErrors, sneic->OutErrors, itv),
1846 render(isdb, pre, PT_NOFLAG,
1847 "-\tidstunr/s", NULL, NULL,
1849 S_VALUE(sneip->InDestUnreachs, sneic->InDestUnreachs, itv),
1852 render(isdb, pre, PT_NOFLAG,
1853 "-\todstunr/s", NULL, NULL,
1855 S_VALUE(sneip->OutDestUnreachs, sneic->OutDestUnreachs, itv),
1858 render(isdb, pre, PT_NOFLAG,
1859 "-\titmex/s", NULL, NULL,
1861 S_VALUE(sneip->InTimeExcds, sneic->InTimeExcds, itv),
1864 render(isdb, pre, PT_NOFLAG,
1865 "-\totmex/s", NULL, NULL,
1867 S_VALUE(sneip->OutTimeExcds, sneic->OutTimeExcds, itv),
1870 render(isdb, pre, PT_NOFLAG,
1871 "-\tiparmpb/s", NULL, NULL,
1873 S_VALUE(sneip->InParmProbs, sneic->InParmProbs, itv),
1876 render(isdb, pre, PT_NOFLAG,
1877 "-\toparmpb/s", NULL, NULL,
1879 S_VALUE(sneip->OutParmProbs, sneic->OutParmProbs, itv),
1882 render(isdb, pre, PT_NOFLAG,
1883 "-\tisrcq/s", NULL, NULL,
1885 S_VALUE(sneip->InSrcQuenchs, sneic->InSrcQuenchs, itv),
1888 render(isdb, pre, PT_NOFLAG,
1889 "-\tosrcq/s", NULL, NULL,
1891 S_VALUE(sneip->OutSrcQuenchs, sneic->OutSrcQuenchs, itv),
1894 render(isdb, pre, PT_NOFLAG,
1895 "-\tiredir/s", NULL, NULL,
1897 S_VALUE(sneip->InRedirects, sneic->InRedirects, itv),
1900 render(isdb, pre, pt_newlin,
1901 "-\toredir/s", NULL, NULL,
1903 S_VALUE(sneip->OutRedirects, sneic->OutRedirects, itv),
1908 ***************************************************************************
1909 * Display TCP network statistics in selected format.
1912 * @a Activity structure with statistics.
1913 * @isdb Flag, true if db printing, false if ppc printing.
1914 * @pre Prefix string for output entries
1915 * @curr Index in array for current sample statistics.
1916 * @itv Interval of time in 1/100th of a second.
1917 ***************************************************************************
1919 __print_funct_t render_net_tcp_stats(struct activity *a, int isdb, char *pre,
1920 int curr, unsigned long long itv)
1922 struct stats_net_tcp
1923 *sntc = (struct stats_net_tcp *) a->buf[curr],
1924 *sntp = (struct stats_net_tcp *) a->buf[!curr];
1926 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1928 render(isdb, pre, PT_NOFLAG,
1929 "-\tactive/s", NULL, NULL,
1931 S_VALUE(sntp->ActiveOpens, sntc->ActiveOpens, itv),
1934 render(isdb, pre, PT_NOFLAG,
1935 "-\tpassive/s", NULL, NULL,
1937 S_VALUE(sntp->PassiveOpens, sntc->PassiveOpens, itv),
1940 render(isdb, pre, PT_NOFLAG,
1941 "-\tiseg/s", NULL, NULL,
1943 S_VALUE(sntp->InSegs, sntc->InSegs, itv),
1946 render(isdb, pre, pt_newlin,
1947 "-\toseg/s", NULL, NULL,
1949 S_VALUE(sntp->OutSegs, sntc->OutSegs, itv),
1954 ***************************************************************************
1955 * Display TCP network errors 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 1/100th of a second.
1963 ***************************************************************************
1965 __print_funct_t render_net_etcp_stats(struct activity *a, int isdb, char *pre,
1966 int curr, unsigned long long itv)
1968 struct stats_net_etcp
1969 *snetc = (struct stats_net_etcp *) a->buf[curr],
1970 *snetp = (struct stats_net_etcp *) a->buf[!curr];
1972 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1974 render(isdb, pre, PT_NOFLAG,
1975 "-\tatmptf/s", NULL, NULL,
1977 S_VALUE(snetp->AttemptFails, snetc->AttemptFails, itv),
1980 render(isdb, pre, PT_NOFLAG,
1981 "-\testres/s", NULL, NULL,
1983 S_VALUE(snetp->EstabResets, snetc->EstabResets, itv),
1986 render(isdb, pre, PT_NOFLAG,
1987 "-\tretrans/s", NULL, NULL,
1989 S_VALUE(snetp->RetransSegs, snetc->RetransSegs, itv),
1992 render(isdb, pre, PT_NOFLAG,
1993 "-\tisegerr/s", NULL, NULL,
1995 S_VALUE(snetp->InErrs, snetc->InErrs, itv),
1998 render(isdb, pre, pt_newlin,
1999 "-\torsts/s", NULL, NULL,
2001 S_VALUE(snetp->OutRsts, snetc->OutRsts, itv),
2006 ***************************************************************************
2007 * Display UDP network statistics in selected format.
2010 * @a Activity structure with statistics.
2011 * @isdb Flag, true if db printing, false if ppc printing.
2012 * @pre Prefix string for output entries
2013 * @curr Index in array for current sample statistics.
2014 * @itv Interval of time in 1/100th of a second.
2015 ***************************************************************************
2017 __print_funct_t render_net_udp_stats(struct activity *a, int isdb, char *pre,
2018 int curr, unsigned long long itv)
2020 struct stats_net_udp
2021 *snuc = (struct stats_net_udp *) a->buf[curr],
2022 *snup = (struct stats_net_udp *) a->buf[!curr];
2024 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2026 render(isdb, pre, PT_NOFLAG,
2027 "-\tidgm/s", NULL, NULL,
2029 S_VALUE(snup->InDatagrams, snuc->InDatagrams, itv),
2032 render(isdb, pre, PT_NOFLAG,
2033 "-\todgm/s", NULL, NULL,
2035 S_VALUE(snup->OutDatagrams, snuc->OutDatagrams, itv),
2038 render(isdb, pre, PT_NOFLAG,
2039 "-\tnoport/s", NULL, NULL,
2041 S_VALUE(snup->NoPorts, snuc->NoPorts, itv),
2044 render(isdb, pre, pt_newlin,
2045 "-\tidgmerr/s", NULL, NULL,
2047 S_VALUE(snup->InErrors, snuc->InErrors, itv),
2052 ***************************************************************************
2053 * Display IPv6 network sockets statistics in selected format.
2056 * @a Activity structure with statistics.
2057 * @isdb Flag, true if db printing, false if ppc printing.
2058 * @pre Prefix string for output entries
2059 * @curr Index in array for current sample statistics.
2060 * @itv Interval of time in 1/100th of a second.
2061 ***************************************************************************
2063 __print_funct_t render_net_sock6_stats(struct activity *a, int isdb, char *pre,
2064 int curr, unsigned long long itv)
2066 struct stats_net_sock6
2067 *snsc = (struct stats_net_sock6 *) a->buf[curr];
2069 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2071 render(isdb, pre, PT_USEINT,
2072 "-\ttcp6sck", NULL, NULL,
2073 (unsigned long long) snsc->tcp6_inuse, DNOVAL, NULL);
2075 render(isdb, pre, PT_USEINT,
2076 "-\tudp6sck", NULL, NULL,
2077 (unsigned long long) snsc->udp6_inuse, DNOVAL, NULL);
2079 render(isdb, pre, PT_USEINT,
2080 "-\traw6sck", NULL, NULL,
2081 (unsigned long long) snsc->raw6_inuse, DNOVAL, NULL);
2083 render(isdb, pre, PT_USEINT | pt_newlin,
2084 "-\tip6-frag", NULL, NULL,
2085 (unsigned long long) snsc->frag6_inuse, DNOVAL, NULL);
2089 ***************************************************************************
2090 * Display IPv6 network statistics in selected format.
2093 * @a Activity structure with statistics.
2094 * @isdb Flag, true if db printing, false if ppc printing.
2095 * @pre Prefix string for output entries
2096 * @curr Index in array for current sample statistics.
2097 * @itv Interval of time in 1/100th of a second.
2098 ***************************************************************************
2100 __print_funct_t render_net_ip6_stats(struct activity *a, int isdb, char *pre,
2101 int curr, unsigned long long itv)
2103 struct stats_net_ip6
2104 *snic = (struct stats_net_ip6 *) a->buf[curr],
2105 *snip = (struct stats_net_ip6 *) a->buf[!curr];
2107 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2109 render(isdb, pre, PT_NOFLAG,
2110 "-\tirec6/s", NULL, NULL,
2112 S_VALUE(snip->InReceives6, snic->InReceives6, itv),
2115 render(isdb, pre, PT_NOFLAG,
2116 "-\tfwddgm6/s", NULL, NULL,
2118 S_VALUE(snip->OutForwDatagrams6, snic->OutForwDatagrams6, itv),
2121 render(isdb, pre, PT_NOFLAG,
2122 "-\tidel6/s", NULL, NULL,
2124 S_VALUE(snip->InDelivers6, snic->InDelivers6, itv),
2127 render(isdb, pre, PT_NOFLAG,
2128 "-\torq6/s", NULL, NULL,
2130 S_VALUE(snip->OutRequests6, snic->OutRequests6, itv),
2133 render(isdb, pre, PT_NOFLAG,
2134 "-\tasmrq6/s", NULL, NULL,
2136 S_VALUE(snip->ReasmReqds6, snic->ReasmReqds6, itv),
2139 render(isdb, pre, PT_NOFLAG,
2140 "-\tasmok6/s", NULL, NULL,
2142 S_VALUE(snip->ReasmOKs6, snic->ReasmOKs6, itv),
2145 render(isdb, pre, PT_NOFLAG,
2146 "-\timcpck6/s", NULL, NULL,
2148 S_VALUE(snip->InMcastPkts6, snic->InMcastPkts6, itv),
2151 render(isdb, pre, PT_NOFLAG,
2152 "-\tomcpck6/s", NULL, NULL,
2154 S_VALUE(snip->OutMcastPkts6, snic->OutMcastPkts6, itv),
2157 render(isdb, pre, PT_NOFLAG,
2158 "-\tfragok6/s", NULL, NULL,
2160 S_VALUE(snip->FragOKs6, snic->FragOKs6, itv),
2163 render(isdb, pre, pt_newlin,
2164 "-\tfragcr6/s", NULL, NULL,
2166 S_VALUE(snip->FragCreates6, snic->FragCreates6, itv),
2171 ***************************************************************************
2172 * Display IPv6 network errors statistics in selected format.
2175 * @a Activity structure with statistics.
2176 * @isdb Flag, true if db printing, false if ppc printing.
2177 * @pre Prefix string for output entries
2178 * @curr Index in array for current sample statistics.
2179 * @itv Interval of time in 1/100th of a second.
2180 ***************************************************************************
2182 __print_funct_t render_net_eip6_stats(struct activity *a, int isdb, char *pre,
2183 int curr, unsigned long long itv)
2185 struct stats_net_eip6
2186 *sneic = (struct stats_net_eip6 *) a->buf[curr],
2187 *sneip = (struct stats_net_eip6 *) a->buf[!curr];
2189 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2191 render(isdb, pre, PT_NOFLAG,
2192 "-\tihdrer6/s", NULL, NULL,
2194 S_VALUE(sneip->InHdrErrors6, sneic->InHdrErrors6, itv),
2197 render(isdb, pre, PT_NOFLAG,
2198 "-\tiadrer6/s", NULL, NULL,
2200 S_VALUE(sneip->InAddrErrors6, sneic->InAddrErrors6, itv),
2203 render(isdb, pre, PT_NOFLAG,
2204 "-\tiukwnp6/s", NULL, NULL,
2206 S_VALUE(sneip->InUnknownProtos6, sneic->InUnknownProtos6, itv),
2209 render(isdb, pre, PT_NOFLAG,
2210 "-\ti2big6/s", NULL, NULL,
2212 S_VALUE(sneip->InTooBigErrors6, sneic->InTooBigErrors6, itv),
2215 render(isdb, pre, PT_NOFLAG,
2216 "-\tidisc6/s", NULL, NULL,
2218 S_VALUE(sneip->InDiscards6, sneic->InDiscards6, itv),
2221 render(isdb, pre, PT_NOFLAG,
2222 "-\todisc6/s", NULL, NULL,
2224 S_VALUE(sneip->OutDiscards6, sneic->OutDiscards6, itv),
2227 render(isdb, pre, PT_NOFLAG,
2228 "-\tinort6/s", NULL, NULL,
2230 S_VALUE(sneip->InNoRoutes6, sneic->InNoRoutes6, itv),
2233 render(isdb, pre, PT_NOFLAG,
2234 "-\tonort6/s", NULL, NULL,
2236 S_VALUE(sneip->OutNoRoutes6, sneic->OutNoRoutes6, itv),
2239 render(isdb, pre, PT_NOFLAG,
2240 "-\tasmf6/s", NULL, NULL,
2242 S_VALUE(sneip->ReasmFails6, sneic->ReasmFails6, itv),
2245 render(isdb, pre, PT_NOFLAG,
2246 "-\tfragf6/s", NULL, NULL,
2248 S_VALUE(sneip->FragFails6, sneic->FragFails6, itv),
2251 render(isdb, pre, pt_newlin,
2252 "-\titrpck6/s", NULL, NULL,
2254 S_VALUE(sneip->InTruncatedPkts6, sneic->InTruncatedPkts6, itv),
2259 ***************************************************************************
2260 * Display ICMPv6 network statistics in selected format.
2263 * @a Activity structure with statistics.
2264 * @isdb Flag, true if db printing, false if ppc printing.
2265 * @pre Prefix string for output entries
2266 * @curr Index in array for current sample statistics.
2267 * @itv Interval of time in 1/100th of a second.
2268 ***************************************************************************
2270 __print_funct_t render_net_icmp6_stats(struct activity *a, int isdb, char *pre,
2271 int curr, unsigned long long itv)
2273 struct stats_net_icmp6
2274 *snic = (struct stats_net_icmp6 *) a->buf[curr],
2275 *snip = (struct stats_net_icmp6 *) a->buf[!curr];
2277 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2279 render(isdb, pre, PT_NOFLAG,
2280 "-\timsg6/s", NULL, NULL,
2282 S_VALUE(snip->InMsgs6, snic->InMsgs6, itv),
2285 render(isdb, pre, PT_NOFLAG,
2286 "-\tomsg6/s", NULL, NULL,
2288 S_VALUE(snip->OutMsgs6, snic->OutMsgs6, itv),
2291 render(isdb, pre, PT_NOFLAG,
2292 "-\tiech6/s", NULL, NULL,
2294 S_VALUE(snip->InEchos6, snic->InEchos6, itv),
2297 render(isdb, pre, PT_NOFLAG,
2298 "-\tiechr6/s", NULL, NULL,
2300 S_VALUE(snip->InEchoReplies6, snic->InEchoReplies6, itv),
2303 render(isdb, pre, PT_NOFLAG,
2304 "-\toechr6/s", NULL, NULL,
2306 S_VALUE(snip->OutEchoReplies6, snic->OutEchoReplies6, itv),
2309 render(isdb, pre, PT_NOFLAG,
2310 "-\tigmbq6/s", NULL, NULL,
2312 S_VALUE(snip->InGroupMembQueries6, snic->InGroupMembQueries6, itv),
2315 render(isdb, pre, PT_NOFLAG,
2316 "-\tigmbr6/s", NULL, NULL,
2318 S_VALUE(snip->InGroupMembResponses6, snic->InGroupMembResponses6, itv),
2321 render(isdb, pre, PT_NOFLAG,
2322 "-\togmbr6/s", NULL, NULL,
2324 S_VALUE(snip->OutGroupMembResponses6, snic->OutGroupMembResponses6, itv),
2327 render(isdb, pre, PT_NOFLAG,
2328 "-\tigmbrd6/s", NULL, NULL,
2330 S_VALUE(snip->InGroupMembReductions6, snic->InGroupMembReductions6, itv),
2333 render(isdb, pre, PT_NOFLAG,
2334 "-\togmbrd6/s", NULL, NULL,
2336 S_VALUE(snip->OutGroupMembReductions6, snic->OutGroupMembReductions6, itv),
2339 render(isdb, pre, PT_NOFLAG,
2340 "-\tirtsol6/s", NULL, NULL,
2342 S_VALUE(snip->InRouterSolicits6, snic->InRouterSolicits6, itv),
2345 render(isdb, pre, PT_NOFLAG,
2346 "-\tortsol6/s", NULL, NULL,
2348 S_VALUE(snip->OutRouterSolicits6, snic->OutRouterSolicits6, itv),
2351 render(isdb, pre, PT_NOFLAG,
2352 "-\tirtad6/s", NULL, NULL,
2354 S_VALUE(snip->InRouterAdvertisements6, snic->InRouterAdvertisements6, itv),
2357 render(isdb, pre, PT_NOFLAG,
2358 "-\tinbsol6/s", NULL, NULL,
2360 S_VALUE(snip->InNeighborSolicits6, snic->InNeighborSolicits6, itv),
2363 render(isdb, pre, PT_NOFLAG,
2364 "-\tonbsol6/s", NULL, NULL,
2366 S_VALUE(snip->OutNeighborSolicits6, snic->OutNeighborSolicits6, itv),
2369 render(isdb, pre, PT_NOFLAG,
2370 "-\tinbad6/s", NULL, NULL,
2372 S_VALUE(snip->InNeighborAdvertisements6, snic->InNeighborAdvertisements6, itv),
2375 render(isdb, pre, pt_newlin,
2376 "-\tonbad6/s", NULL, NULL,
2378 S_VALUE(snip->OutNeighborAdvertisements6, snic->OutNeighborAdvertisements6, itv),
2383 ***************************************************************************
2384 * Display ICMPv6 error messages statistics in selected format.
2387 * @a Activity structure with statistics.
2388 * @isdb Flag, true if db printing, false if ppc printing.
2389 * @pre Prefix string for output entries
2390 * @curr Index in array for current sample statistics.
2391 * @itv Interval of time in 1/100th of a second.
2392 ***************************************************************************
2394 __print_funct_t render_net_eicmp6_stats(struct activity *a, int isdb, char *pre,
2395 int curr, unsigned long long itv)
2397 struct stats_net_eicmp6
2398 *sneic = (struct stats_net_eicmp6 *) a->buf[curr],
2399 *sneip = (struct stats_net_eicmp6 *) a->buf[!curr];
2401 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2403 render(isdb, pre, PT_NOFLAG,
2404 "-\tierr6/s", NULL, NULL,
2406 S_VALUE(sneip->InErrors6, sneic->InErrors6, itv),
2409 render(isdb, pre, PT_NOFLAG,
2410 "-\tidtunr6/s", NULL, NULL,
2412 S_VALUE(sneip->InDestUnreachs6, sneic->InDestUnreachs6, itv),
2415 render(isdb, pre, PT_NOFLAG,
2416 "-\todtunr6/s", NULL, NULL,
2418 S_VALUE(sneip->OutDestUnreachs6, sneic->OutDestUnreachs6, itv),
2421 render(isdb, pre, PT_NOFLAG,
2422 "-\titmex6/s", NULL, NULL,
2424 S_VALUE(sneip->InTimeExcds6, sneic->InTimeExcds6, itv),
2427 render(isdb, pre, PT_NOFLAG,
2428 "-\totmex6/s", NULL, NULL,
2430 S_VALUE(sneip->OutTimeExcds6, sneic->OutTimeExcds6, itv),
2433 render(isdb, pre, PT_NOFLAG,
2434 "-\tiprmpb6/s", NULL, NULL,
2436 S_VALUE(sneip->InParmProblems6, sneic->InParmProblems6, itv),
2439 render(isdb, pre, PT_NOFLAG,
2440 "-\toprmpb6/s", NULL, NULL,
2442 S_VALUE(sneip->OutParmProblems6, sneic->OutParmProblems6, itv),
2445 render(isdb, pre, PT_NOFLAG,
2446 "-\tiredir6/s", NULL, NULL,
2448 S_VALUE(sneip->InRedirects6, sneic->InRedirects6, itv),
2451 render(isdb, pre, PT_NOFLAG,
2452 "-\toredir6/s", NULL, NULL,
2454 S_VALUE(sneip->OutRedirects6, sneic->OutRedirects6, itv),
2457 render(isdb, pre, PT_NOFLAG,
2458 "-\tipck2b6/s", NULL, NULL,
2460 S_VALUE(sneip->InPktTooBigs6, sneic->InPktTooBigs6, itv),
2463 render(isdb, pre, pt_newlin,
2464 "-\topck2b6/s", NULL, NULL,
2466 S_VALUE(sneip->OutPktTooBigs6, sneic->OutPktTooBigs6, itv),
2471 ***************************************************************************
2472 * Display UDP6 network statistics in selected format.
2475 * @a Activity structure with statistics.
2476 * @isdb Flag, true if db printing, false if ppc printing.
2477 * @pre Prefix string for output entries
2478 * @curr Index in array for current sample statistics.
2479 * @itv Interval of time in 1/100th of a second.
2480 ***************************************************************************
2482 __print_funct_t render_net_udp6_stats(struct activity *a, int isdb, char *pre,
2483 int curr, unsigned long long itv)
2485 struct stats_net_udp6
2486 *snuc = (struct stats_net_udp6 *) a->buf[curr],
2487 *snup = (struct stats_net_udp6 *) a->buf[!curr];
2489 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2491 render(isdb, pre, PT_NOFLAG,
2492 "-\tidgm6/s", NULL, NULL,
2494 S_VALUE(snup->InDatagrams6, snuc->InDatagrams6, itv),
2497 render(isdb, pre, PT_NOFLAG,
2498 "-\todgm6/s", NULL, NULL,
2500 S_VALUE(snup->OutDatagrams6, snuc->OutDatagrams6, itv),
2503 render(isdb, pre, PT_NOFLAG,
2504 "-\tnoport6/s", NULL, NULL,
2506 S_VALUE(snup->NoPorts6, snuc->NoPorts6, itv),
2509 render(isdb, pre, pt_newlin,
2510 "-\tidgmer6/s", NULL, NULL,
2512 S_VALUE(snup->InErrors6, snuc->InErrors6, itv),
2517 ***************************************************************************
2518 * Display CPU frequency statistics in selected format.
2521 * @a Activity structure with statistics.
2522 * @isdb Flag, true if db printing, false if ppc printing.
2523 * @pre Prefix string for output entries
2524 * @curr Index in array for current sample statistics.
2525 * @itv Interval of time in 1/100th of a second.
2526 ***************************************************************************
2528 __print_funct_t render_pwr_cpufreq_stats(struct activity *a, int isdb, char *pre,
2529 int curr, unsigned long long itv)
2532 struct stats_pwr_cpufreq *spc;
2534 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2536 for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) {
2538 spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize);
2541 /* This CPU is offline: Don't display it */
2544 /* Should current CPU (including CPU "all") be displayed? */
2545 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))))
2550 /* This is CPU "all" */
2551 render(isdb, pre, pt_newlin,
2555 ((double) spc->cpufreq) / 100,
2559 render(isdb, pre, pt_newlin,
2561 "%d", cons(iv, i - 1, NOVAL),
2563 ((double) spc->cpufreq) / 100,
2570 ***************************************************************************
2571 * Display fan statistics in selected format.
2574 * @a Activity structure with statistics.
2575 * @isdb Flag, true if db printing, false if ppc printing.
2576 * @pre Prefix string for output entries
2577 * @curr Index in array for current sample statistics.
2578 * @itv Interval of time in 1/100th of a second.
2579 ***************************************************************************
2581 __print_funct_t render_pwr_fan_stats(struct activity *a, int isdb, char *pre,
2582 int curr, unsigned long long itv)
2585 struct stats_pwr_fan *spc;
2587 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2589 for (i = 0; i < a->nr[curr]; i++) {
2590 spc = (struct stats_pwr_fan *) ((char *) a->buf[curr] + i * a->msize);
2592 render(isdb, pre, PT_USESTR,
2595 cons(iv, i + 1, NOVAL),
2600 render(isdb, pre, PT_NOFLAG,
2603 cons(iv, i + 1, NOVAL),
2608 render(isdb, pre, pt_newlin,
2611 cons(iv, i + 1, NOVAL),
2613 spc->rpm - spc->rpm_min,
2619 ***************************************************************************
2620 * Display temperature statistics in selected format.
2623 * @a Activity structure with statistics.
2624 * @isdb Flag, true if db printing, false if ppc printing.
2625 * @pre Prefix string for output entries
2626 * @curr Index in array for current sample statistics.
2627 * @itv Interval of time in 1/100th of a second.
2628 ***************************************************************************
2630 __print_funct_t render_pwr_temp_stats(struct activity *a, int isdb, char *pre,
2631 int curr, unsigned long long itv)
2634 struct stats_pwr_temp *spc;
2636 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2638 for (i = 0; i < a->nr[curr]; i++) {
2639 spc = (struct stats_pwr_temp *) ((char *) a->buf[curr] + i * a->msize);
2641 render(isdb, pre, PT_USESTR,
2644 cons(iv, i + 1, NOVAL),
2649 render(isdb, pre, PT_NOFLAG,
2652 cons(iv, i + 1, NOVAL),
2657 render(isdb, pre, pt_newlin,
2660 cons(iv, i + 1, NOVAL),
2662 (spc->temp_max - spc->temp_min) ?
2663 (spc->temp - spc->temp_min) / (spc->temp_max - spc->temp_min) * 100 :
2670 ***************************************************************************
2671 * Display voltage inputs statistics in selected format.
2674 * @a Activity structure with statistics.
2675 * @isdb Flag, true if db printing, false if ppc printing.
2676 * @pre Prefix string for output entries
2677 * @curr Index in array for current sample statistics.
2678 * @itv Interval of time in 1/100th of a second.
2679 ***************************************************************************
2681 __print_funct_t render_pwr_in_stats(struct activity *a, int isdb, char *pre,
2682 int curr, unsigned long long itv)
2685 struct stats_pwr_in *spc;
2687 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2689 for (i = 0; i < a->nr[curr]; i++) {
2690 spc = (struct stats_pwr_in *) ((char *) a->buf[curr] + i * a->msize);
2692 render(isdb, pre, PT_USESTR,
2700 render(isdb, pre, PT_NOFLAG,
2708 render(isdb, pre, pt_newlin,
2713 (spc->in_max - spc->in_min) ?
2714 (spc->in - spc->in_min) / (spc->in_max - spc->in_min) * 100 :
2721 ***************************************************************************
2722 * Display huge pages statistics in selected format.
2725 * @a Activity structure with statistics.
2726 * @isdb Flag, true if db printing, false if ppc printing.
2727 * @pre Prefix string for output entries
2728 * @curr Index in array for current sample statistics.
2729 * @itv Interval of time in 1/100th of a second.
2730 ***************************************************************************
2732 __print_funct_t render_huge_stats(struct activity *a, int isdb, char *pre,
2733 int curr, unsigned long long itv)
2736 *smc = (struct stats_huge *) a->buf[curr];
2738 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2740 render(isdb, pre, PT_USEINT,
2741 "-\tkbhugfree", NULL, NULL,
2742 smc->frhkb, DNOVAL, NULL);
2744 render(isdb, pre, PT_USEINT,
2745 "-\tkbhugused", NULL, NULL,
2746 smc->tlhkb - smc->frhkb, DNOVAL, NULL);
2748 render(isdb, pre, PT_NOFLAG,
2749 "-\t%hugused", NULL, NULL, NOVAL,
2751 SP_VALUE(smc->frhkb, smc->tlhkb, smc->tlhkb) :
2754 render(isdb, pre, PT_USEINT,
2755 "-\tkbhugrsvd", NULL, NULL,
2756 smc->rsvdhkb, DNOVAL, NULL);
2758 render(isdb, pre, PT_USEINT | pt_newlin,
2759 "-\tkbhugsurp", NULL, NULL,
2760 smc->surphkb, DNOVAL, NULL);
2764 ***************************************************************************
2765 * Display weighted CPU frequency statistics in selected format.
2768 * @a Activity structure with statistics.
2769 * @isdb Flag, true if db printing, false if ppc printing.
2770 * @pre Prefix string for output entries
2771 * @curr Index in array for current sample statistics.
2772 * @itv Interval of time in 1/100th of a second.
2773 ***************************************************************************
2775 __print_funct_t render_pwr_wghfreq_stats(struct activity *a, int isdb, char *pre,
2776 int curr, unsigned long long itv)
2779 struct stats_pwr_wghfreq *spc, *spp, *spc_k, *spp_k;
2780 unsigned long long tis, tisfreq;
2782 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2784 for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) {
2786 spc = (struct stats_pwr_wghfreq *) ((char *) a->buf[curr] + i * a->msize * a->nr2);
2787 spp = (struct stats_pwr_wghfreq *) ((char *) a->buf[!curr] + i * a->msize * a->nr2);
2789 /* Should current CPU (including CPU "all") be displayed? */
2790 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))))
2797 for (k = 0; k < a->nr2; k++) {
2799 spc_k = (struct stats_pwr_wghfreq *) ((char *) spc + k * a->msize);
2802 spp_k = (struct stats_pwr_wghfreq *) ((char *) spp + k * a->msize);
2804 tisfreq += (spc_k->freq / 1000) *
2805 (spc_k->time_in_state - spp_k->time_in_state);
2806 tis += (spc_k->time_in_state - spp_k->time_in_state);
2810 /* This is CPU "all" */
2811 render(isdb, pre, pt_newlin,
2815 tis ? ((double) tisfreq) / tis : 0.0,
2819 render(isdb, pre, pt_newlin,
2821 "%d", cons(iv, i - 1, NOVAL),
2823 tis ? ((double) tisfreq) / tis : 0.0,
2830 ***************************************************************************
2831 * Display USB devices statistics in selected format.
2834 * @a Activity structure with statistics.
2835 * @isdb Flag, true if db printing, false if ppc printing.
2836 * @pre Prefix string for output entries
2837 * @curr Index in array for current sample statistics.
2838 * @itv Interval of time in 1/100th of a second.
2839 ***************************************************************************
2841 __print_funct_t render_pwr_usb_stats(struct activity *a, int isdb, char *pre,
2842 int curr, unsigned long long itv)
2845 struct stats_pwr_usb *suc;
2848 for (i = 0; i < a->nr[curr]; i++) {
2849 suc = (struct stats_pwr_usb *) ((char *) a->buf[curr] + i * a->msize);
2851 sprintf(id, "%x", suc->vendor_id);
2852 render(isdb, pre, PT_USESTR,
2855 cons(iv, suc->bus_nr, NOVAL),
2860 sprintf(id, "%x", suc->product_id);
2861 render(isdb, pre, PT_USESTR,
2864 cons(iv, suc->bus_nr, NOVAL),
2869 render(isdb, pre, PT_USEINT,
2872 cons(iv, suc->bus_nr, NOVAL),
2873 (unsigned long long) (suc->bmaxpower << 1),
2877 render(isdb, pre, PT_USESTR,
2880 cons(iv, suc->bus_nr, NOVAL),
2886 (DISPLAY_HORIZONTALLY(flags) ? PT_USESTR : PT_USESTR | PT_NEWLIN),
2889 cons(iv, suc->bus_nr, NOVAL),
2897 ***************************************************************************
2898 * Display filesystems statistics in selected format.
2901 * @a Activity structure with statistics.
2902 * @isdb Flag, true if db printing, false if ppc printing.
2903 * @pre Prefix string for output entries
2904 * @curr Index in array for current sample statistics.
2905 * @itv Interval of time in 1/100th of a second.
2906 ***************************************************************************
2908 __print_funct_t render_filesystem_stats(struct activity *a, int isdb, char *pre,
2909 int curr, unsigned long long itv)
2912 struct stats_filesystem *sfc;
2914 for (i = 0; i < a->nr[curr]; i++) {
2915 sfc = (struct stats_filesystem *) ((char *) a->buf[curr] + i * a->msize);
2917 if (a->item_list != NULL) {
2918 /* A list of devices has been entered on the command line */
2919 if (!search_list_item(a->item_list,
2920 DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name))
2921 /* Device not found */
2925 render(isdb, pre, PT_USERND,
2928 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2930 (double) sfc->f_bfree / 1024 / 1024,
2933 render(isdb, pre, PT_USERND,
2936 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2938 (double) (sfc->f_blocks - sfc->f_bfree) / 1024 / 1024,
2941 render(isdb, pre, PT_NOFLAG,
2944 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2946 sfc->f_blocks ? SP_VALUE(sfc->f_bfree, sfc->f_blocks, sfc->f_blocks)
2950 render(isdb, pre, PT_NOFLAG,
2953 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2955 sfc->f_blocks ? SP_VALUE(sfc->f_bavail, sfc->f_blocks, sfc->f_blocks)
2959 render(isdb, pre, PT_USEINT,
2962 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2967 render(isdb, pre, PT_USEINT,
2970 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2971 sfc->f_files - sfc->f_ffree,
2976 (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN),
2979 cons(sv, DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name, NOVAL),
2981 sfc->f_files ? SP_VALUE(sfc->f_ffree, sfc->f_files, sfc->f_files)
2988 ***************************************************************************
2989 * Display Fibre Channel HBA statistics in selected format.
2992 * @a Activity structure with statistics.
2993 * @isdb Flag, true if db printing, false if ppc printing.
2994 * @pre Prefix string for output entries
2995 * @curr Index in array for current sample statistics.
2996 * @itv Interval of time in 1/100th of a second.
2997 ***************************************************************************
2999 __print_funct_t render_fchost_stats(struct activity *a, int isdb, char *pre,
3000 int curr, unsigned long long itv)
3002 int i, j, j0, found;
3003 struct stats_fchost *sfcc, *sfcp, sfczero;
3005 memset(&sfczero, 0, sizeof(struct stats_fchost));
3007 for (i = 0; i < a->nr[curr]; i++) {
3010 sfcc = (struct stats_fchost *) ((char *) a->buf[curr] + i * a->msize);
3012 if (a->nr[!curr] > 0) {
3013 /* Look for corresponding structure in previous iteration */
3016 if (j >= a->nr[!curr]) {
3017 j = a->nr[!curr] - 1;
3023 sfcp = (struct stats_fchost *) ((char *) a->buf[!curr] + j * a->msize);
3024 if (!strcmp(sfcc->fchost_name, sfcp->fchost_name)) {
3028 if (++j >= a->nr[!curr]) {
3036 /* This is a newly registered host */
3040 render(isdb, pre, PT_NOFLAG ,
3043 cons(sv, sfcc->fchost_name, NOVAL),
3045 S_VALUE(sfcp->f_rxframes, sfcc->f_rxframes, itv),
3047 render(isdb, pre, PT_NOFLAG,
3048 "%s\tfch_txf/s", NULL,
3049 cons(sv, sfcc->fchost_name, NULL),
3051 S_VALUE(sfcp->f_txframes, sfcc->f_txframes, itv),
3053 render(isdb, pre, PT_NOFLAG,
3054 "%s\tfch_rxw/s", NULL,
3055 cons(sv, sfcc->fchost_name, NULL),
3057 S_VALUE(sfcp->f_rxwords, sfcc->f_rxwords, itv),
3060 (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN),
3061 "%s\tfch_txw/s", NULL,
3062 cons(sv, sfcc->fchost_name, NULL),
3064 S_VALUE(sfcp->f_txwords, sfcc->f_txwords, itv),
3070 ***************************************************************************
3071 * Display softnet statistics in selected format.
3074 * @a Activity structure with statistics.
3075 * @isdb Flag, true if db printing, false if ppc printing.
3076 * @pre Prefix string for output entries
3077 * @curr Index in array for current sample statistics.
3078 * @itv Interval of time in 1/100th of a second.
3079 ***************************************************************************
3081 __print_funct_t render_softnet_stats(struct activity *a, int isdb, char *pre,
3082 int curr, unsigned long long itv)
3085 struct stats_softnet *ssnc, *ssnp;
3086 unsigned char offline_cpu_bitmap[BITMAP_SIZE(NR_CPUS)] = {0};
3088 = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
3090 /* @nr[curr] cannot normally be greater than @nr_ini */
3091 if (a->nr[curr] > a->nr_ini) {
3092 a->nr_ini = a->nr[curr];
3095 /* Compute statistics for CPU "all" */
3096 get_global_soft_statistics(a, !curr, curr, flags, offline_cpu_bitmap);
3098 for (i = 0; (i < a->nr_ini) && (i < a->bitmap->b_size + 1); i++) {
3101 * Note: a->nr is in [1, NR_CPUS + 1].
3102 * Bitmap size is provided for (NR_CPUS + 1) CPUs.
3103 * Anyway, NR_CPUS may vary between the version of sysstat
3104 * used by sadc to create a file, and the version of sysstat
3105 * used by sar to read it...
3107 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) ||
3108 offline_cpu_bitmap[i >> 3] & (1 << (i & 0x07)))
3113 * The size of a->buf[...] CPU structure may be different from the default
3114 * sizeof(struct stats_pwr_cpufreq) value if data have been read from a file!
3115 * That's why we don't use a syntax like:
3116 * ssnc = (struct stats_softnet *) a->buf[...] + i;
3118 ssnc = (struct stats_softnet *) ((char *) a->buf[curr] + i * a->msize);
3119 ssnp = (struct stats_softnet *) ((char *) a->buf[!curr] + i * a->msize);
3122 /* This is CPU "all" */
3123 render(isdb, pre, PT_NOFLAG,
3127 S_VALUE(ssnp->processed, ssnc->processed, itv),
3130 render(isdb, pre, PT_NOFLAG,
3134 S_VALUE(ssnp->dropped, ssnc->dropped, itv),
3137 render(isdb, pre, PT_NOFLAG,
3141 S_VALUE(ssnp->time_squeeze, ssnc->time_squeeze, itv),
3144 render(isdb, pre, PT_NOFLAG,
3148 S_VALUE(ssnp->received_rps, ssnc->received_rps, itv),
3151 render(isdb, pre, pt_newlin,
3155 S_VALUE(ssnp->flow_limit, ssnc->flow_limit, itv),
3159 render(isdb, pre, PT_NOFLAG,
3161 "%d", cons(iv, i - 1, NOVAL),
3163 S_VALUE(ssnp->processed, ssnc->processed, itv),
3166 render(isdb, pre, PT_NOFLAG,
3168 NULL, cons(iv, i - 1, NOVAL),
3170 S_VALUE(ssnp->dropped, ssnc->dropped, itv),
3173 render(isdb, pre, PT_NOFLAG,
3175 NULL, cons(iv, i - 1, NOVAL),
3177 S_VALUE(ssnp->time_squeeze, ssnc->time_squeeze, itv),
3180 render(isdb, pre, PT_NOFLAG,
3182 NULL, cons(iv, i - 1, NOVAL),
3184 S_VALUE(ssnp->received_rps, ssnc->received_rps, itv),
3187 render(isdb, pre, pt_newlin,
3189 NULL, cons(iv, i - 1, NOVAL),
3191 S_VALUE(ssnp->flow_limit, ssnc->flow_limit, itv),