2
* prf_stats.c: Funtions used by sadf to display statistics
3
* (C) 1999-2009 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
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
19
***************************************************************************
28
#include "prf_stats.h"
33
#define _(string) gettext(string)
35
#define _(string) (string)
38
static 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 it's 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
* luval - %lu printable arg (PT_USEINT must be set)
94
* dval - %.2f printable arg (used unless PT_USEINT is set)
96
* does: print [pre<sep>]([dbtxt,arg,arg<sep>]|[pptxt,arg,arg<sep>]) \
97
* (luval|dval)(<sep>|\n)
100
***************************************************************************
102
static void render(int isdb, char *pre, int rflags, const char *pptxt,
103
const char *dbtxt, Cons *mid, unsigned long int luval,
106
static int newline = 1;
107
const char *txt[] = {pptxt, dbtxt};
109
/* Start a new line? */
110
if (newline && !DISPLAY_HORIZONTALLY(flags)) {
114
/* Terminate this one ? ppc always gets a newline */
115
newline = ((rflags & PT_NEWLIN) || !isdb);
120
printf("%s", seps[isdb]); /* Only if something actually gets printed */
123
/* Got format args? */
126
printf(txt[isdb], mid->a.i, mid->b.i);
129
printf(txt[isdb], mid->a.s, mid->b.s);
134
printf(txt[isdb]); /* No args */
138
if (rflags & PT_USEINT) {
139
printf("%s%lu", seps[isdb], luval);
142
printf("%s%.2f", seps[isdb], dval);
150
***************************************************************************
151
* Display CPU statistics in selected format.
154
* @a Activity structure with statistics.
155
* @isdb Flag, true if db printing, false if ppc printing.
156
* @pre Prefix string for output entries
157
* @curr Index in array for current sample statistics.
158
* @g_itv Interval of time in jiffies multiplied by the number
160
***************************************************************************
162
__print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
163
int curr, unsigned long long g_itv)
166
struct stats_cpu *scc, *scp;
168
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
170
for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
172
scc = (struct stats_cpu *) ((char *) a->buf[curr] + i * a->msize);
173
scp = (struct stats_cpu *) ((char *) a->buf[!curr] + i * a->msize);
175
/* Should current CPU (including CPU "all") be displayed? */
176
if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
179
/* This is CPU "all" */
180
if (DISPLAY_CPU_DEF(a->opt_flags)) {
182
PT_NOFLAG, /* that's zero but you know what it means */
183
"all\t%%user", /* all ppctext is used as format, thus '%%' */
184
"-1", /* look! dbtext */
186
NOVAL, /* another 0, named for readability */
187
ll_sp_value(scp->cpu_user, scc->cpu_user, g_itv));
189
else if (DISPLAY_CPU_ALL(a->opt_flags)) {
190
render(isdb, pre, PT_NOFLAG,
191
"all\t%%usr", "-1", NULL,
193
ll_sp_value(scp->cpu_user - scp->cpu_guest,
194
scc->cpu_user - scc->cpu_guest,
198
render(isdb, pre, PT_NOFLAG,
199
"all\t%%nice", NULL, NULL,
201
ll_sp_value(scp->cpu_nice, scc->cpu_nice, g_itv));
203
if (DISPLAY_CPU_DEF(a->opt_flags)) {
204
render(isdb, pre, PT_NOFLAG,
205
"all\t%%system", NULL, NULL,
207
ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq,
208
scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq,
211
else if (DISPLAY_CPU_ALL(a->opt_flags)) {
212
render(isdb, pre, PT_NOFLAG,
213
"all\t%%sys", NULL, NULL,
215
ll_sp_value(scp->cpu_sys, scc->cpu_sys, g_itv));
218
render(isdb, pre, PT_NOFLAG,
219
"all\t%%iowait", NULL, NULL,
221
ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv));
223
render(isdb, pre, PT_NOFLAG,
224
"all\t%%steal", NULL, NULL,
226
ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv));
228
if (DISPLAY_CPU_ALL(a->opt_flags)) {
229
render(isdb, pre, PT_NOFLAG,
230
"all\t%%irq", NULL, NULL,
232
ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, g_itv));
234
render(isdb, pre, PT_NOFLAG,
235
"all\t%%soft", NULL, NULL,
237
ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, g_itv));
239
render(isdb, pre, PT_NOFLAG,
240
"all\t%%guest", NULL, NULL,
242
ll_sp_value(scp->cpu_guest, scc->cpu_guest, g_itv));
245
render(isdb, pre, pt_newlin,
246
"all\t%%idle", NULL, NULL,
248
(scc->cpu_idle < scp->cpu_idle) ?
250
ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv));
253
/* Recalculate itv for current proc */
254
g_itv = get_per_cpu_interval(scc, scp);
256
if (DISPLAY_CPU_DEF(a->opt_flags)) {
257
render(isdb, pre, PT_NOFLAG,
258
"cpu%d\t%%user", /* ppc text with formatting */
259
"%d", /* db text with format char */
260
cons(iv, i - 1, NOVAL), /* how we pass format args */
263
0.0 : /* CPU is offline */
264
ll_sp_value(scp->cpu_user, scc->cpu_user, g_itv));
266
else if (DISPLAY_CPU_ALL(a->opt_flags)) {
267
render(isdb, pre, PT_NOFLAG,
268
"cpu%d\t%%usr", "%d", cons(iv, i - 1, NOVAL),
271
0.0 : /* CPU is offline */
272
ll_sp_value(scp->cpu_user - scp->cpu_guest,
273
scc->cpu_user - scc->cpu_guest, g_itv));
276
render(isdb, pre, PT_NOFLAG,
277
"cpu%d\t%%nice", NULL, cons(iv, i - 1, NOVAL),
281
ll_sp_value(scp->cpu_nice, scc->cpu_nice, g_itv));
283
if (DISPLAY_CPU_DEF(a->opt_flags)) {
284
render(isdb, pre, PT_NOFLAG,
285
"cpu%d\t%%system", NULL, cons(iv, i - 1, NOVAL),
289
ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq,
290
scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq,
293
else if (DISPLAY_CPU_ALL(a->opt_flags)) {
294
render(isdb, pre, PT_NOFLAG,
295
"cpu%d\t%%sys", NULL, cons(iv, i - 1, NOVAL),
299
ll_sp_value(scp->cpu_sys, scc->cpu_sys, g_itv));
302
render(isdb, pre, PT_NOFLAG,
303
"cpu%d\t%%iowait", NULL, cons(iv, i - 1, NOVAL),
307
ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv));
309
render(isdb, pre, PT_NOFLAG,
310
"cpu%d\t%%steal", NULL, cons(iv, i - 1, NOVAL),
314
ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv));
316
if (DISPLAY_CPU_ALL(a->opt_flags)) {
317
render(isdb, pre, PT_NOFLAG,
318
"cpu%d\t%%irq", NULL, cons(iv, i - 1, NOVAL),
322
ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, g_itv));
324
render(isdb, pre, PT_NOFLAG,
325
"cpu%d\t%%soft", NULL, cons(iv, i - 1, NOVAL),
329
ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, g_itv));
331
render(isdb, pre, PT_NOFLAG,
332
"cpu%d\t%%guest", NULL, cons(iv, i - 1, NOVAL),
336
ll_sp_value(scp->cpu_guest, scc->cpu_guest, g_itv));
341
render(isdb, pre, pt_newlin,
342
"cpu%d\t%%idle", NULL, cons(iv, i - 1, NOVAL),
347
render(isdb, pre, pt_newlin,
348
"cpu%d\t%%idle", NULL, cons(iv, i - 1, NOVAL),
350
(scc->cpu_idle < scp->cpu_idle) ?
352
ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv));
360
***************************************************************************
361
* Display task creation and context switch statistics in selected format.
364
* @a Activity structure with statistics.
365
* @isdb Flag, true if db printing, false if ppc printing.
366
* @pre Prefix string for output entries
367
* @curr Index in array for current sample statistics.
368
* @itv Interval of time in jiffies.
369
***************************************************************************
371
__print_funct_t render_pcsw_stats(struct activity *a, int isdb, char *pre,
372
int curr, unsigned long long itv)
375
*spc = (struct stats_pcsw *) a->buf[curr],
376
*spp = (struct stats_pcsw *) a->buf[!curr];
378
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
380
/* The first one as an example */
381
render(isdb, /* db/ppc flag */
382
pre, /* the preformatted line leader */
383
PT_NOFLAG, /* is this the end of a db line? */
384
"-\tproc/s", /* ppc text */
386
NULL, /* db/ppc text format args (Cons *) */
387
NOVAL, /* %lu value (unused unless PT_USEINT) */
388
/* and %.2f value, used unless PT_USEINT */
389
S_VALUE(spp->processes, spc->processes, itv));
391
render(isdb, pre, pt_newlin,
392
"-\tcswch/s", NULL, NULL,
394
ll_s_value(spp->context_switch, spc->context_switch, itv));
398
***************************************************************************
399
* Display interrupts statistics in selected format.
402
* @a Activity structure with statistics.
403
* @isdb Flag, true if db printing, false if ppc printing.
404
* @pre Prefix string for output entries
405
* @curr Index in array for current sample statistics.
406
* @itv Interval of time in jiffies.
407
***************************************************************************
409
__print_funct_t render_irq_stats(struct activity *a, int isdb, char *pre,
410
int curr, unsigned long long itv)
413
struct stats_irq *sic, *sip;
415
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
417
for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
419
sic = (struct stats_irq *) ((char *) a->buf[curr] + i * a->msize);
420
sip = (struct stats_irq *) ((char *) a->buf[!curr] + i * a->msize);
422
/* Should current interrupt (including int "sum") be displayed? */
423
if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
425
/* Yes: Display it */
427
/* This is interrupt "sum" */
428
render(isdb, pre, pt_newlin,
429
"sum\tintr/s", "-1", NULL,
431
ll_s_value(sip->irq_nr, sic->irq_nr, itv));
434
render(isdb, pre, pt_newlin,
435
"i%03d\tintr/s", "%d", cons(iv, i - 1, NOVAL),
437
ll_s_value(sip->irq_nr, sic->irq_nr, itv));
444
***************************************************************************
445
* Display swapping statistics in selected format.
448
* @a Activity structure with statistics.
449
* @isdb Flag, true if db printing, false if ppc printing.
450
* @pre Prefix string for output entries
451
* @curr Index in array for current sample statistics.
452
* @itv Interval of time in jiffies.
453
***************************************************************************
455
__print_funct_t render_swap_stats(struct activity *a, int isdb, char *pre,
456
int curr, unsigned long long itv)
459
*ssc = (struct stats_swap *) a->buf[curr],
460
*ssp = (struct stats_swap *) a->buf[!curr];
462
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
464
render(isdb, pre, PT_NOFLAG,
465
"-\tpswpin/s", NULL, NULL,
467
S_VALUE(ssp->pswpin, ssc->pswpin, itv));
468
render(isdb, pre, pt_newlin,
469
"-\tpswpout/s", NULL, NULL,
471
S_VALUE(ssp->pswpout, ssc->pswpout, itv));
475
***************************************************************************
476
* Display paging statistics in selected format.
479
* @a Activity structure with statistics.
480
* @isdb Flag, true if db printing, false if ppc printing.
481
* @pre Prefix string for output entries
482
* @curr Index in array for current sample statistics.
483
* @itv Interval of time in jiffies.
484
***************************************************************************
486
__print_funct_t render_paging_stats(struct activity *a, int isdb, char *pre,
487
int curr, unsigned long long itv)
490
*spc = (struct stats_paging *) a->buf[curr],
491
*spp = (struct stats_paging *) a->buf[!curr];
493
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
495
render(isdb, pre, PT_NOFLAG,
496
"-\tpgpgin/s", NULL, NULL,
498
S_VALUE(spp->pgpgin, spc->pgpgin, itv));
500
render(isdb, pre, PT_NOFLAG,
501
"-\tpgpgout/s", NULL, NULL,
503
S_VALUE(spp->pgpgout, spc->pgpgout, itv));
505
render(isdb, pre, PT_NOFLAG,
506
"-\tfault/s", NULL, NULL,
508
S_VALUE(spp->pgfault, spc->pgfault, itv));
510
render(isdb, pre, PT_NOFLAG,
511
"-\tmajflt/s", NULL, NULL,
513
S_VALUE(spp->pgmajfault, spc->pgmajfault, itv));
515
render(isdb, pre, PT_NOFLAG,
516
"-\tpgfree/s", NULL, NULL,
518
S_VALUE(spp->pgfree, spc->pgfree, itv));
520
render(isdb, pre, PT_NOFLAG,
521
"-\tpgscank/s", NULL, NULL,
523
S_VALUE(spp->pgscan_kswapd, spc->pgscan_kswapd, itv));
525
render(isdb, pre, PT_NOFLAG,
526
"-\tpgscand/s", NULL, NULL,
528
S_VALUE(spp->pgscan_direct, spc->pgscan_direct, itv));
530
render(isdb, pre, PT_NOFLAG,
531
"-\tpgsteal/s", NULL, NULL,
533
S_VALUE(spp->pgsteal, spc->pgsteal, itv));
535
render(isdb, pre, pt_newlin,
536
"-\t%%vmeff", NULL, NULL,
538
(spc->pgscan_kswapd + spc->pgscan_direct -
539
spp->pgscan_kswapd - spp->pgscan_direct) ?
540
SP_VALUE(spp->pgsteal, spc->pgsteal,
541
spc->pgscan_kswapd + spc->pgscan_direct -
542
spp->pgscan_kswapd - spp->pgscan_direct) : 0.0);
546
***************************************************************************
547
* Display I/O and transfer rate statistics in selected format.
550
* @a Activity structure with statistics.
551
* @isdb Flag, true if db printing, false if ppc printing.
552
* @pre Prefix string for output entries
553
* @curr Index in array for current sample statistics.
554
* @itv Interval of time in jiffies.
555
***************************************************************************
557
__print_funct_t render_io_stats(struct activity *a, int isdb, char *pre,
558
int curr, unsigned long long itv)
561
*sic = (struct stats_io *) a->buf[curr],
562
*sip = (struct stats_io *) a->buf[!curr];
564
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
566
render(isdb, pre, PT_NOFLAG,
567
"-\ttps", NULL, NULL,
569
S_VALUE(sip->dk_drive, sic->dk_drive, itv));
571
render(isdb, pre, PT_NOFLAG,
572
"-\trtps", NULL, NULL,
574
S_VALUE(sip->dk_drive_rio, sic->dk_drive_rio, itv));
576
render(isdb, pre, PT_NOFLAG,
577
"-\twtps", NULL, NULL,
579
S_VALUE(sip->dk_drive_wio, sic->dk_drive_wio, itv));
581
render(isdb, pre, PT_NOFLAG,
582
"-\tbread/s", NULL, NULL,
584
S_VALUE(sip->dk_drive_rblk, sic->dk_drive_rblk, itv));
586
render(isdb, pre, pt_newlin,
587
"-\tbwrtn/s", NULL, NULL,
589
S_VALUE(sip->dk_drive_wblk, sic->dk_drive_wblk, itv));
593
***************************************************************************
594
* Display memory and swap statistics in selected format.
597
* @a Activity structure with statistics.
598
* @isdb Flag, true if db printing, false if ppc printing.
599
* @pre Prefix string for output entries
600
* @curr Index in array for current sample statistics.
601
* @itv Interval of time in jiffies.
602
***************************************************************************
604
__print_funct_t render_memory_stats(struct activity *a, int isdb, char *pre,
605
int curr, unsigned long long itv)
608
*smc = (struct stats_memory *) a->buf[curr],
609
*smp = (struct stats_memory *) a->buf[!curr];
611
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
613
if (DISPLAY_MEMORY(a->opt_flags)) {
615
render(isdb, pre, PT_NOFLAG,
616
"-\tfrmpg/s", NULL, NULL,
618
S_VALUE((double) KB_TO_PG(smp->frmkb),
619
(double) KB_TO_PG(smc->frmkb), itv));
621
render(isdb, pre, PT_NOFLAG,
622
"-\tbufpg/s", NULL, NULL,
624
S_VALUE((double) KB_TO_PG(smp->bufkb),
625
(double) KB_TO_PG(smc->bufkb), itv));
627
render(isdb, pre, pt_newlin,
628
"-\tcampg/s", NULL, NULL,
630
S_VALUE((double) KB_TO_PG(smp->camkb),
631
(double) KB_TO_PG(smc->camkb), itv));
634
if (DISPLAY_MEM_AMT(a->opt_flags)) {
636
render(isdb, pre, PT_USEINT,
637
"-\tkbmemfree", NULL, NULL,
640
render(isdb, pre, PT_USEINT,
641
"-\tkbmemused", NULL, NULL,
642
smc->tlmkb - smc->frmkb, DNOVAL);
644
render(isdb, pre, PT_NOFLAG,
645
"-\t%%memused", NULL, NULL, NOVAL,
647
SP_VALUE(smc->frmkb, smc->tlmkb, smc->tlmkb) :
650
render(isdb, pre, PT_USEINT,
651
"-\tkbbuffers", NULL, NULL,
654
render(isdb, pre, PT_USEINT,
655
"-\tkbcached", NULL, NULL,
658
render(isdb, pre, PT_USEINT,
659
"-\tkbcommit", NULL, NULL,
662
render(isdb, pre, pt_newlin,
663
"-\t%%commit", NULL, NULL, NOVAL,
664
(smc->tlmkb + smc->tlskb) ?
665
SP_VALUE(0, smc->comkb, smc->tlmkb + smc->tlskb) :
669
if (DISPLAY_SWAP(a->opt_flags)) {
671
render(isdb, pre, PT_USEINT,
672
"-\tkbswpfree", NULL, NULL,
675
render(isdb, pre, PT_USEINT,
676
"-\tkbswpused", NULL, NULL,
677
smc->tlskb - smc->frskb, DNOVAL);
679
render(isdb, pre, PT_NOFLAG,
680
"-\t%%swpused", NULL, NULL, NOVAL,
682
SP_VALUE(smc->frskb, smc->tlskb, smc->tlskb) :
685
render(isdb, pre, PT_USEINT,
686
"-\tkbswpcad", NULL, NULL,
689
render(isdb, pre, pt_newlin,
690
"-\t%%swpcad", NULL, NULL, NOVAL,
691
(smc->tlskb - smc->frskb) ?
692
SP_VALUE(0, smc->caskb, smc->tlskb - smc->frskb) :
698
***************************************************************************
699
* Display kernel tables statistics in selected format.
702
* @a Activity structure with statistics.
703
* @isdb Flag, true if db printing, false if ppc printing.
704
* @pre Prefix string for output entries
705
* @curr Index in array for current sample statistics.
706
* @itv Interval of time in jiffies.
707
***************************************************************************
709
__print_funct_t render_ktables_stats(struct activity *a, int isdb, char *pre,
710
int curr, unsigned long long itv)
713
*skc = (struct stats_ktables *) a->buf[curr];
715
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
717
render(isdb, pre, PT_USEINT,
718
"-\tdentunusd", NULL, NULL,
719
skc->dentry_stat, DNOVAL);
721
render(isdb, pre, PT_USEINT,
722
"-\tfile-nr", NULL, NULL,
723
skc->file_used, DNOVAL);
725
render(isdb, pre, PT_USEINT,
726
"-\tinode-nr", NULL, NULL,
727
skc->inode_used, DNOVAL);
729
render(isdb, pre, PT_USEINT | pt_newlin,
730
"-\tpty-nr", NULL, NULL,
731
skc->pty_nr, DNOVAL);
735
***************************************************************************
736
* Display queue and load statistics in selected format.
739
* @a Activity structure with statistics.
740
* @isdb Flag, true if db printing, false if ppc printing.
741
* @pre Prefix string for output entries
742
* @curr Index in array for current sample statistics.
743
* @itv Interval of time in jiffies.
744
***************************************************************************
746
__print_funct_t render_queue_stats(struct activity *a, int isdb, char *pre,
747
int curr, unsigned long long itv)
750
*sqc = (struct stats_queue *) a->buf[curr];
752
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
754
render(isdb, pre, PT_USEINT,
755
"-\trunq-sz", NULL, NULL,
756
sqc->nr_running, DNOVAL);
758
render(isdb, pre, PT_USEINT,
759
"-\tplist-sz", NULL, NULL,
760
sqc->nr_threads, DNOVAL);
762
render(isdb, pre, PT_NOFLAG,
763
"-\tldavg-1", NULL, NULL,
765
(double) sqc->load_avg_1 / 100);
767
render(isdb, pre, PT_NOFLAG,
768
"-\tldavg-5", NULL, NULL,
770
(double) sqc->load_avg_5 / 100);
772
render(isdb, pre, pt_newlin,
773
"-\tldavg-15", NULL, NULL,
775
(double) sqc->load_avg_15 / 100);
779
***************************************************************************
780
* Display serial lines statistics in selected format.
783
* @a Activity structure with statistics.
784
* @isdb Flag, true if db printing, false if ppc printing.
785
* @pre Prefix string for output entries
786
* @curr Index in array for current sample statistics.
787
* @itv Interval of time in jiffies.
788
***************************************************************************
790
__print_funct_t render_serial_stats(struct activity *a, int isdb, char *pre,
791
int curr, unsigned long long itv)
794
struct stats_serial *ssc, *ssp;
796
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
798
for (i = 0; i < a->nr; i++) {
800
ssc = (struct stats_serial *) ((char *) a->buf[curr] + i * a->msize);
801
ssp = (struct stats_serial *) ((char *) a->buf[!curr] + i * a->msize);
806
if (ssc->line == ssp->line) {
807
render(isdb, pre, PT_NOFLAG,
808
"ttyS%d\trcvin/s", "%d",
809
cons(iv, ssc->line - 1, NOVAL),
811
S_VALUE(ssp->rx, ssc->rx, itv));
813
render(isdb, pre, PT_NOFLAG,
814
"ttyS%d\txmtin/s", "%d",
815
cons(iv, ssc->line - 1, NOVAL),
817
S_VALUE(ssp->tx, ssc->tx, itv));
819
render(isdb, pre, PT_NOFLAG,
820
"ttyS%d\tframerr/s", "%d",
821
cons(iv, ssc->line - 1, NOVAL),
823
S_VALUE(ssp->frame, ssc->frame, itv));
825
render(isdb, pre, PT_NOFLAG,
826
"ttyS%d\tprtyerr/s", "%d",
827
cons(iv, ssc->line - 1, NOVAL),
829
S_VALUE(ssp->parity, ssc->parity, itv));
831
render(isdb, pre, PT_NOFLAG,
832
"ttyS%d\tbrk/s", "%d",
833
cons(iv, ssc->line - 1, NOVAL),
835
S_VALUE(ssp->brk, ssc->brk, itv));
837
render(isdb, pre, pt_newlin,
838
"ttyS%d\tovrun/s", "%d",
839
cons(iv, ssc->line - 1, NOVAL),
841
S_VALUE(ssp->overrun, ssc->overrun, itv));
848
***************************************************************************
849
* Display disks statistics in selected format.
852
* @a Activity structure with statistics.
853
* @isdb Flag, true if db printing, false if ppc printing.
854
* @pre Prefix string for output entries
855
* @curr Index in array for current sample statistics.
856
* @itv Interval of time in jiffies.
857
***************************************************************************
859
__print_funct_t render_disk_stats(struct activity *a, int isdb, char *pre,
860
int curr, unsigned long long itv)
863
struct stats_disk *sdc, *sdp;
864
struct ext_disk_stats xds;
867
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
869
for (i = 0; i < a->nr; i++) {
871
sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize);
873
if (!(sdc->major + sdc->minor))
876
j = check_disk_reg(a, curr, !curr, i);
877
sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
879
/* Compute extended stats (service time, etc.) */
880
compute_ext_disk_stats(sdc, sdp, itv, &xds);
884
if ((USE_PRETTY_OPTION(flags)) && (sdc->major == DEVMAP_MAJOR)) {
885
dev_name = transform_devmapname(sdc->major, sdc->minor);
889
dev_name = get_devname(sdc->major, sdc->minor,
890
USE_PRETTY_OPTION(flags));
893
render(isdb, pre, PT_NOFLAG,
895
cons(sv, dev_name, NULL),
897
S_VALUE(sdp->nr_ios, sdc->nr_ios, itv));
899
render(isdb, pre, PT_NOFLAG,
900
"%s\trd_sec/s", NULL,
901
cons(sv, dev_name, NULL),
903
ll_s_value(sdp->rd_sect, sdc->rd_sect, itv));
905
render(isdb, pre, PT_NOFLAG,
906
"%s\twr_sec/s", NULL,
907
cons(sv, dev_name, NULL),
909
ll_s_value(sdp->wr_sect, sdc->wr_sect, itv));
911
render(isdb, pre, PT_NOFLAG,
912
"%s\tavgrq-sz", NULL,
913
cons(sv, dev_name, NULL),
917
render(isdb, pre, PT_NOFLAG,
918
"%s\tavgqu-sz", NULL,
919
cons(sv, dev_name, NULL),
921
S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0);
923
render(isdb, pre, PT_NOFLAG,
925
cons(sv, dev_name, NULL),
929
render(isdb, pre, PT_NOFLAG,
931
cons(sv, dev_name, NULL),
935
render(isdb, pre, pt_newlin,
937
cons(sv, dev_name, NULL),
944
***************************************************************************
945
* Display network interfaces statistics in selected format.
948
* @a Activity structure with statistics.
949
* @isdb Flag, true if db printing, false if ppc printing.
950
* @pre Prefix string for output entries
951
* @curr Index in array for current sample statistics.
952
* @itv Interval of time in jiffies.
953
***************************************************************************
955
__print_funct_t render_net_dev_stats(struct activity *a, int isdb, char *pre,
956
int curr, unsigned long long itv)
959
struct stats_net_dev *sndc, *sndp;
961
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
963
for (i = 0; i < a->nr; i++) {
965
sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize);
967
if (!strcmp(sndc->interface, ""))
970
j = check_net_dev_reg(a, curr, !curr, i);
971
sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize);
973
render(isdb, pre, PT_NOFLAG,
975
cons(sv, sndc->interface, NULL), /* What if the format args are strings? */
977
S_VALUE(sndp->rx_packets, sndc->rx_packets, itv));
979
render(isdb, pre, PT_NOFLAG,
981
cons(sv, sndc->interface, NULL),
983
S_VALUE(sndp->tx_packets, sndc->tx_packets, itv));
985
render(isdb, pre, PT_NOFLAG,
987
cons(sv, sndc->interface, NULL),
989
S_VALUE(sndp->rx_bytes, sndc->rx_bytes, itv) / 1024);
991
render(isdb, pre, PT_NOFLAG,
993
cons(sv, sndc->interface, NULL),
995
S_VALUE(sndp->tx_bytes, sndc->tx_bytes, itv) / 1024);
997
render(isdb, pre, PT_NOFLAG,
999
cons(sv, sndc->interface, NULL),
1001
S_VALUE(sndp->rx_compressed, sndc->rx_compressed, itv));
1003
render(isdb, pre, PT_NOFLAG,
1004
"%s\ttxcmp/s", NULL,
1005
cons(sv, sndc->interface, NULL),
1007
S_VALUE(sndp->tx_compressed, sndc->tx_compressed, itv));
1009
render(isdb, pre, pt_newlin,
1010
"%s\trxmcst/s", NULL,
1011
cons(sv, sndc->interface, NULL),
1013
S_VALUE(sndp->multicast, sndc->multicast, itv));
1018
***************************************************************************
1019
* Display network interface errors statistics in selected format.
1022
* @a Activity structure with statistics.
1023
* @isdb Flag, true if db printing, false if ppc printing.
1024
* @pre Prefix string for output entries
1025
* @curr Index in array for current sample statistics.
1026
* @itv Interval of time in jiffies.
1027
***************************************************************************
1029
__print_funct_t render_net_edev_stats(struct activity *a, int isdb, char *pre,
1030
int curr, unsigned long long itv)
1033
struct stats_net_edev *snedc, *snedp;
1035
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1037
for (i = 0; i < a->nr; i++) {
1039
snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize);
1041
if (!strcmp(snedc->interface, ""))
1044
j = check_net_edev_reg(a, curr, !curr, i);
1045
snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize);
1047
render(isdb, pre, PT_NOFLAG,
1048
"%s\trxerr/s", "%s",
1049
cons(sv, snedc->interface, NULL),
1051
S_VALUE(snedp->rx_errors, snedc->rx_errors, itv));
1053
render(isdb, pre, PT_NOFLAG,
1054
"%s\ttxerr/s", NULL,
1055
cons(sv, snedc->interface, NULL),
1057
S_VALUE(snedp->tx_errors, snedc->tx_errors, itv));
1059
render(isdb, pre, PT_NOFLAG,
1061
cons(sv, snedc->interface, NULL),
1063
S_VALUE(snedp->collisions, snedc->collisions, itv));
1065
render(isdb, pre, PT_NOFLAG,
1066
"%s\trxdrop/s", NULL,
1067
cons(sv, snedc->interface, NULL),
1069
S_VALUE(snedp->rx_dropped, snedc->rx_dropped, itv));
1071
render(isdb, pre, PT_NOFLAG,
1072
"%s\ttxdrop/s", NULL,
1073
cons(sv, snedc->interface, NULL),
1075
S_VALUE(snedp->tx_dropped, snedc->tx_dropped, itv));
1077
render(isdb, pre, PT_NOFLAG,
1078
"%s\ttxcarr/s", NULL,
1079
cons(sv, snedc->interface, NULL),
1081
S_VALUE(snedp->tx_carrier_errors, snedc->tx_carrier_errors, itv));
1083
render(isdb, pre, PT_NOFLAG,
1084
"%s\trxfram/s", NULL,
1085
cons(sv, snedc->interface, NULL),
1087
S_VALUE(snedp->rx_frame_errors, snedc->rx_frame_errors, itv));
1089
render(isdb, pre, PT_NOFLAG,
1090
"%s\trxfifo/s", NULL,
1091
cons(sv, snedc->interface, NULL),
1093
S_VALUE(snedp->rx_fifo_errors, snedc->rx_fifo_errors, itv));
1095
render(isdb, pre, pt_newlin,
1096
"%s\ttxfifo/s", NULL,
1097
cons(sv, snedc->interface, NULL),
1099
S_VALUE(snedp->tx_fifo_errors, snedc->tx_fifo_errors, itv));
1104
***************************************************************************
1105
* Display NFS client statistics in selected format.
1108
* @a Activity structure with statistics.
1109
* @isdb Flag, true if db printing, false if ppc printing.
1110
* @pre Prefix string for output entries
1111
* @curr Index in array for current sample statistics.
1112
* @itv Interval of time in jiffies.
1113
***************************************************************************
1115
__print_funct_t render_net_nfs_stats(struct activity *a, int isdb, char *pre,
1116
int curr, unsigned long long itv)
1118
struct stats_net_nfs
1119
*snnc = (struct stats_net_nfs *) a->buf[curr],
1120
*snnp = (struct stats_net_nfs *) a->buf[!curr];
1122
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1124
render(isdb, pre, PT_NOFLAG,
1125
"-\tcall/s", NULL, NULL,
1127
S_VALUE(snnp->nfs_rpccnt, snnc->nfs_rpccnt, itv));
1129
render(isdb, pre, PT_NOFLAG,
1130
"-\tretrans/s", NULL, NULL,
1132
S_VALUE(snnp->nfs_rpcretrans, snnc->nfs_rpcretrans, itv));
1134
render(isdb, pre, PT_NOFLAG,
1135
"-\tread/s", NULL, NULL,
1137
S_VALUE(snnp->nfs_readcnt, snnc->nfs_readcnt, itv));
1139
render(isdb, pre, PT_NOFLAG,
1140
"-\twrite/s", NULL, NULL,
1142
S_VALUE(snnp->nfs_writecnt, snnc->nfs_writecnt, itv));
1144
render(isdb, pre, PT_NOFLAG,
1145
"-\taccess/s", NULL, NULL,
1147
S_VALUE(snnp->nfs_accesscnt, snnc->nfs_accesscnt, itv));
1149
render(isdb, pre, pt_newlin,
1150
"-\tgetatt/s", NULL, NULL,
1152
S_VALUE(snnp->nfs_getattcnt, snnc->nfs_getattcnt, itv));
1156
***************************************************************************
1157
* Display NFS server statistics in selected format.
1160
* @a Activity structure with statistics.
1161
* @isdb Flag, true if db printing, false if ppc printing.
1162
* @pre Prefix string for output entries
1163
* @curr Index in array for current sample statistics.
1164
* @itv Interval of time in jiffies.
1165
***************************************************************************
1167
__print_funct_t render_net_nfsd_stats(struct activity *a, int isdb, char *pre,
1168
int curr, unsigned long long itv)
1170
struct stats_net_nfsd
1171
*snndc = (struct stats_net_nfsd *) a->buf[curr],
1172
*snndp = (struct stats_net_nfsd *) a->buf[!curr];
1174
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1176
render(isdb, pre, PT_NOFLAG,
1177
"-\tscall/s", NULL, NULL,
1179
S_VALUE(snndp->nfsd_rpccnt, snndc->nfsd_rpccnt, itv));
1181
render(isdb, pre, PT_NOFLAG,
1182
"-\tbadcall/s", NULL, NULL,
1184
S_VALUE(snndp->nfsd_rpcbad, snndc->nfsd_rpcbad, itv));
1186
render(isdb, pre, PT_NOFLAG,
1187
"-\tpacket/s", NULL, NULL,
1189
S_VALUE(snndp->nfsd_netcnt, snndc->nfsd_netcnt, itv));
1191
render(isdb, pre, PT_NOFLAG,
1192
"-\tudp/s", NULL, NULL,
1194
S_VALUE(snndp->nfsd_netudpcnt, snndc->nfsd_netudpcnt, itv));
1196
render(isdb, pre, PT_NOFLAG,
1197
"-\ttcp/s", NULL, NULL,
1199
S_VALUE(snndp->nfsd_nettcpcnt, snndc->nfsd_nettcpcnt, itv));
1201
render(isdb, pre, PT_NOFLAG,
1202
"-\thit/s", NULL, NULL,
1204
S_VALUE(snndp->nfsd_rchits, snndc->nfsd_rchits, itv));
1206
render(isdb, pre, PT_NOFLAG,
1207
"-\tmiss/s", NULL, NULL,
1209
S_VALUE(snndp->nfsd_rcmisses, snndc->nfsd_rcmisses, itv));
1211
render(isdb, pre, PT_NOFLAG,
1212
"-\tsread/s", NULL, NULL,
1214
S_VALUE(snndp->nfsd_readcnt, snndc->nfsd_readcnt, itv));
1216
render(isdb, pre, PT_NOFLAG,
1217
"-\tswrite/s", NULL, NULL,
1219
S_VALUE(snndp->nfsd_writecnt, snndc->nfsd_writecnt, itv));
1221
render(isdb, pre, PT_NOFLAG,
1222
"-\tsaccess/s", NULL, NULL,
1224
S_VALUE(snndp->nfsd_accesscnt, snndc->nfsd_accesscnt, itv));
1226
render(isdb, pre, pt_newlin,
1227
"-\tsgetatt/s", NULL, NULL,
1229
S_VALUE(snndp->nfsd_getattcnt, snndc->nfsd_getattcnt, itv));
1233
***************************************************************************
1234
* Display network sockets statistics in selected format.
1237
* @a Activity structure with statistics.
1238
* @isdb Flag, true if db printing, false if ppc printing.
1239
* @pre Prefix string for output entries
1240
* @curr Index in array for current sample statistics.
1241
* @itv Interval of time in jiffies.
1242
***************************************************************************
1244
__print_funct_t render_net_sock_stats(struct activity *a, int isdb, char *pre,
1245
int curr, unsigned long long itv)
1247
struct stats_net_sock
1248
*snsc = (struct stats_net_sock *) a->buf[curr];
1250
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1252
render(isdb, pre, PT_USEINT,
1253
"-\ttotsck", NULL, NULL,
1254
snsc->sock_inuse, DNOVAL);
1256
render(isdb, pre, PT_USEINT,
1257
"-\ttcpsck", NULL, NULL,
1258
snsc->tcp_inuse, DNOVAL);
1260
render(isdb, pre, PT_USEINT,
1261
"-\tudpsck", NULL, NULL,
1262
snsc->udp_inuse, DNOVAL);
1264
render(isdb, pre, PT_USEINT,
1265
"-\trawsck", NULL, NULL,
1266
snsc->raw_inuse, DNOVAL);
1268
render(isdb, pre, PT_USEINT,
1269
"-\tip-frag", NULL, NULL,
1270
snsc->frag_inuse, DNOVAL);
1272
render(isdb, pre, PT_USEINT | pt_newlin,
1273
"-\ttcp-tw", NULL, NULL,
1274
snsc->tcp_tw, DNOVAL);
1278
***************************************************************************
1279
* Display IP network statistics in selected format.
1282
* @a Activity structure with statistics.
1283
* @isdb Flag, true if db printing, false if ppc printing.
1284
* @pre Prefix string for output entries
1285
* @curr Index in array for current sample statistics.
1286
* @itv Interval of time in jiffies.
1287
***************************************************************************
1289
__print_funct_t render_net_ip_stats(struct activity *a, int isdb, char *pre,
1290
int curr, unsigned long long itv)
1293
*snic = (struct stats_net_ip *) a->buf[curr],
1294
*snip = (struct stats_net_ip *) a->buf[!curr];
1296
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1298
render(isdb, pre, PT_NOFLAG,
1299
"-\tirec/s", NULL, NULL,
1301
S_VALUE(snip->InReceives, snic->InReceives, itv));
1303
render(isdb, pre, PT_NOFLAG,
1304
"-\tfwddgm/s", NULL, NULL,
1306
S_VALUE(snip->ForwDatagrams, snic->ForwDatagrams, itv));
1308
render(isdb, pre, PT_NOFLAG,
1309
"-\tidel/s", NULL, NULL,
1311
S_VALUE(snip->InDelivers, snic->InDelivers, itv));
1313
render(isdb, pre, PT_NOFLAG,
1314
"-\torq/s", NULL, NULL,
1316
S_VALUE(snip->OutRequests, snic->OutRequests, itv));
1318
render(isdb, pre, PT_NOFLAG,
1319
"-\tasmrq/s", NULL, NULL,
1321
S_VALUE(snip->ReasmReqds, snic->ReasmReqds, itv));
1323
render(isdb, pre, PT_NOFLAG,
1324
"-\tasmok/s", NULL, NULL,
1326
S_VALUE(snip->ReasmOKs, snic->ReasmOKs, itv));
1328
render(isdb, pre, PT_NOFLAG,
1329
"-\tfragok/s", NULL, NULL,
1331
S_VALUE(snip->FragOKs, snic->FragOKs, itv));
1333
render(isdb, pre, pt_newlin,
1334
"-\tfragcrt/s", NULL, NULL,
1336
S_VALUE(snip->FragCreates, snic->FragCreates, itv));
1340
***************************************************************************
1341
* Display IP network error statistics in selected format.
1344
* @a Activity structure with statistics.
1345
* @isdb Flag, true if db printing, false if ppc printing.
1346
* @pre Prefix string for output entries
1347
* @curr Index in array for current sample statistics.
1348
* @itv Interval of time in jiffies.
1349
***************************************************************************
1351
__print_funct_t render_net_eip_stats(struct activity *a, int isdb, char *pre,
1352
int curr, unsigned long long itv)
1354
struct stats_net_eip
1355
*sneic = (struct stats_net_eip *) a->buf[curr],
1356
*sneip = (struct stats_net_eip *) a->buf[!curr];
1358
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1360
render(isdb, pre, PT_NOFLAG,
1361
"-\tihdrerr/s", NULL, NULL,
1363
S_VALUE(sneip->InHdrErrors, sneic->InHdrErrors, itv));
1365
render(isdb, pre, PT_NOFLAG,
1366
"-\tiadrerr/s", NULL, NULL,
1368
S_VALUE(sneip->InAddrErrors, sneic->InAddrErrors, itv));
1370
render(isdb, pre, PT_NOFLAG,
1371
"-\tiukwnpr/s", NULL, NULL,
1373
S_VALUE(sneip->InUnknownProtos, sneic->InUnknownProtos, itv));
1375
render(isdb, pre, PT_NOFLAG,
1376
"-\tidisc/s", NULL, NULL,
1378
S_VALUE(sneip->InDiscards, sneic->InDiscards, itv));
1380
render(isdb, pre, PT_NOFLAG,
1381
"-\todisc/s", NULL, NULL,
1383
S_VALUE(sneip->OutDiscards, sneic->OutDiscards, itv));
1385
render(isdb, pre, PT_NOFLAG,
1386
"-\tonort/s", NULL, NULL,
1388
S_VALUE(sneip->OutNoRoutes, sneic->OutNoRoutes, itv));
1390
render(isdb, pre, PT_NOFLAG,
1391
"-\tasmf/s", NULL, NULL,
1393
S_VALUE(sneip->ReasmFails, sneic->ReasmFails, itv));
1395
render(isdb, pre, pt_newlin,
1396
"-\tfragf/s", NULL, NULL,
1398
S_VALUE(sneip->FragFails, sneic->FragFails, itv));
1402
***************************************************************************
1403
* Display ICMP network statistics in selected format.
1406
* @a Activity structure with statistics.
1407
* @isdb Flag, true if db printing, false if ppc printing.
1408
* @pre Prefix string for output entries
1409
* @curr Index in array for current sample statistics.
1410
* @itv Interval of time in jiffies.
1411
***************************************************************************
1413
__print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre,
1414
int curr, unsigned long long itv)
1416
struct stats_net_icmp
1417
*snic = (struct stats_net_icmp *) a->buf[curr],
1418
*snip = (struct stats_net_icmp *) a->buf[!curr];
1420
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1422
render(isdb, pre, PT_NOFLAG,
1423
"-\timsg/s", NULL, NULL,
1425
S_VALUE(snip->InMsgs, snic->InMsgs, itv));
1427
render(isdb, pre, PT_NOFLAG,
1428
"-\tomsg/s", NULL, NULL,
1430
S_VALUE(snip->OutMsgs, snic->OutMsgs, itv));
1432
render(isdb, pre, PT_NOFLAG,
1433
"-\tiech/s", NULL, NULL,
1435
S_VALUE(snip->InEchos, snic->InEchos, itv));
1437
render(isdb, pre, PT_NOFLAG,
1438
"-\tiechr/s", NULL, NULL,
1440
S_VALUE(snip->InEchoReps, snic->InEchoReps, itv));
1442
render(isdb, pre, PT_NOFLAG,
1443
"-\toech/s", NULL, NULL,
1445
S_VALUE(snip->OutEchos, snic->OutEchos, itv));
1447
render(isdb, pre, PT_NOFLAG,
1448
"-\toechr/s", NULL, NULL,
1450
S_VALUE(snip->OutEchoReps, snic->OutEchoReps, itv));
1452
render(isdb, pre, PT_NOFLAG,
1453
"-\titm/s", NULL, NULL,
1455
S_VALUE(snip->InTimestamps, snic->InTimestamps, itv));
1457
render(isdb, pre, PT_NOFLAG,
1458
"-\titmr/s", NULL, NULL,
1460
S_VALUE(snip->InTimestampReps, snic->InTimestampReps, itv));
1462
render(isdb, pre, PT_NOFLAG,
1463
"-\totm/s", NULL, NULL,
1465
S_VALUE(snip->OutTimestamps, snic->OutTimestamps, itv));
1467
render(isdb, pre, PT_NOFLAG,
1468
"-\totmr/s", NULL, NULL,
1470
S_VALUE(snip->OutTimestampReps, snic->OutTimestampReps, itv));
1472
render(isdb, pre, PT_NOFLAG,
1473
"-\tiadrmk/s", NULL, NULL,
1475
S_VALUE(snip->InAddrMasks, snic->InAddrMasks, itv));
1477
render(isdb, pre, PT_NOFLAG,
1478
"-\tiadrmkr/s", NULL, NULL,
1480
S_VALUE(snip->InAddrMaskReps, snic->InAddrMaskReps, itv));
1482
render(isdb, pre, PT_NOFLAG,
1483
"-\toadrmk/s", NULL, NULL,
1485
S_VALUE(snip->OutAddrMasks, snic->OutAddrMasks, itv));
1487
render(isdb, pre, pt_newlin,
1488
"-\toadrmkr/s", NULL, NULL,
1490
S_VALUE(snip->OutAddrMaskReps, snic->OutAddrMaskReps, itv));
1494
***************************************************************************
1495
* Display ICMP error message statistics in selected format.
1498
* @a Activity structure with statistics.
1499
* @isdb Flag, true if db printing, false if ppc printing.
1500
* @pre Prefix string for output entries
1501
* @curr Index in array for current sample statistics.
1502
* @itv Interval of time in jiffies.
1503
***************************************************************************
1505
__print_funct_t render_net_eicmp_stats(struct activity *a, int isdb, char *pre,
1506
int curr, unsigned long long itv)
1508
struct stats_net_eicmp
1509
*sneic = (struct stats_net_eicmp *) a->buf[curr],
1510
*sneip = (struct stats_net_eicmp *) a->buf[!curr];
1512
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1514
render(isdb, pre, PT_NOFLAG,
1515
"-\tierr/s", NULL, NULL,
1517
S_VALUE(sneip->InErrors, sneic->InErrors, itv));
1519
render(isdb, pre, PT_NOFLAG,
1520
"-\toerr/s", NULL, NULL,
1522
S_VALUE(sneip->OutErrors, sneic->OutErrors, itv));
1524
render(isdb, pre, PT_NOFLAG,
1525
"-\tidstunr/s", NULL, NULL,
1527
S_VALUE(sneip->InDestUnreachs, sneic->InDestUnreachs, itv));
1529
render(isdb, pre, PT_NOFLAG,
1530
"-\todstunr/s", NULL, NULL,
1532
S_VALUE(sneip->OutDestUnreachs, sneic->OutDestUnreachs, itv));
1534
render(isdb, pre, PT_NOFLAG,
1535
"-\titmex/s", NULL, NULL,
1537
S_VALUE(sneip->InTimeExcds, sneic->InTimeExcds, itv));
1539
render(isdb, pre, PT_NOFLAG,
1540
"-\totmex/s", NULL, NULL,
1542
S_VALUE(sneip->OutTimeExcds, sneic->OutTimeExcds, itv));
1544
render(isdb, pre, PT_NOFLAG,
1545
"-\tiparmpb/s", NULL, NULL,
1547
S_VALUE(sneip->InParmProbs, sneic->InParmProbs, itv));
1549
render(isdb, pre, PT_NOFLAG,
1550
"-\toparmpb/s", NULL, NULL,
1552
S_VALUE(sneip->OutParmProbs, sneic->OutParmProbs, itv));
1554
render(isdb, pre, PT_NOFLAG,
1555
"-\tisrcq/s", NULL, NULL,
1557
S_VALUE(sneip->InSrcQuenchs, sneic->InSrcQuenchs, itv));
1559
render(isdb, pre, PT_NOFLAG,
1560
"-\tosrcq/s", NULL, NULL,
1562
S_VALUE(sneip->OutSrcQuenchs, sneic->OutSrcQuenchs, itv));
1564
render(isdb, pre, PT_NOFLAG,
1565
"-\tiredir/s", NULL, NULL,
1567
S_VALUE(sneip->InRedirects, sneic->InRedirects, itv));
1569
render(isdb, pre, pt_newlin,
1570
"-\toredir/s", NULL, NULL,
1572
S_VALUE(sneip->OutRedirects, sneic->OutRedirects, itv));
1576
***************************************************************************
1577
* Display TCP network statistics in selected format.
1580
* @a Activity structure with statistics.
1581
* @isdb Flag, true if db printing, false if ppc printing.
1582
* @pre Prefix string for output entries
1583
* @curr Index in array for current sample statistics.
1584
* @itv Interval of time in jiffies.
1585
***************************************************************************
1587
__print_funct_t render_net_tcp_stats(struct activity *a, int isdb, char *pre,
1588
int curr, unsigned long long itv)
1590
struct stats_net_tcp
1591
*sntc = (struct stats_net_tcp *) a->buf[curr],
1592
*sntp = (struct stats_net_tcp *) a->buf[!curr];
1594
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1596
render(isdb, pre, PT_NOFLAG,
1597
"-\tactive/s", NULL, NULL,
1599
S_VALUE(sntp->ActiveOpens, sntc->ActiveOpens, itv));
1601
render(isdb, pre, PT_NOFLAG,
1602
"-\tpassive/s", NULL, NULL,
1604
S_VALUE(sntp->PassiveOpens, sntc->PassiveOpens, itv));
1606
render(isdb, pre, PT_NOFLAG,
1607
"-\tiseg/s", NULL, NULL,
1609
S_VALUE(sntp->InSegs, sntc->InSegs, itv));
1611
render(isdb, pre, pt_newlin,
1612
"-\toseg/s", NULL, NULL,
1614
S_VALUE(sntp->OutSegs, sntc->OutSegs, itv));
1618
***************************************************************************
1619
* Display TCP network error statistics in selected format.
1622
* @a Activity structure with statistics.
1623
* @isdb Flag, true if db printing, false if ppc printing.
1624
* @pre Prefix string for output entries
1625
* @curr Index in array for current sample statistics.
1626
* @itv Interval of time in jiffies.
1627
***************************************************************************
1629
__print_funct_t render_net_etcp_stats(struct activity *a, int isdb, char *pre,
1630
int curr, unsigned long long itv)
1632
struct stats_net_etcp
1633
*snetc = (struct stats_net_etcp *) a->buf[curr],
1634
*snetp = (struct stats_net_etcp *) a->buf[!curr];
1636
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1638
render(isdb, pre, PT_NOFLAG,
1639
"-\tatmptf/s", NULL, NULL,
1641
S_VALUE(snetp->AttemptFails, snetc->AttemptFails, itv));
1643
render(isdb, pre, PT_NOFLAG,
1644
"-\testres/s", NULL, NULL,
1646
S_VALUE(snetp->EstabResets, snetc->EstabResets, itv));
1648
render(isdb, pre, PT_NOFLAG,
1649
"-\tretrans/s", NULL, NULL,
1651
S_VALUE(snetp->RetransSegs, snetc->RetransSegs, itv));
1653
render(isdb, pre, PT_NOFLAG,
1654
"-\tisegerr/s", NULL, NULL,
1656
S_VALUE(snetp->InErrs, snetc->InErrs, itv));
1658
render(isdb, pre, pt_newlin,
1659
"-\torsts/s", NULL, NULL,
1661
S_VALUE(snetp->OutRsts, snetc->OutRsts, itv));
1665
***************************************************************************
1666
* Display UDP network statistics in selected format.
1669
* @a Activity structure with statistics.
1670
* @isdb Flag, true if db printing, false if ppc printing.
1671
* @pre Prefix string for output entries
1672
* @curr Index in array for current sample statistics.
1673
* @itv Interval of time in jiffies.
1674
***************************************************************************
1676
__print_funct_t render_net_udp_stats(struct activity *a, int isdb, char *pre,
1677
int curr, unsigned long long itv)
1679
struct stats_net_udp
1680
*snuc = (struct stats_net_udp *) a->buf[curr],
1681
*snup = (struct stats_net_udp *) a->buf[!curr];
1683
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1685
render(isdb, pre, PT_NOFLAG,
1686
"-\tidgm/s", NULL, NULL,
1688
S_VALUE(snup->InDatagrams, snuc->InDatagrams, itv));
1690
render(isdb, pre, PT_NOFLAG,
1691
"-\todgm/s", NULL, NULL,
1693
S_VALUE(snup->OutDatagrams, snuc->OutDatagrams, itv));
1695
render(isdb, pre, PT_NOFLAG,
1696
"-\tnoport/s", NULL, NULL,
1698
S_VALUE(snup->NoPorts, snuc->NoPorts, itv));
1700
render(isdb, pre, pt_newlin,
1701
"-\tidgmerr/s", NULL, NULL,
1703
S_VALUE(snup->InErrors, snuc->InErrors, itv));
1707
***************************************************************************
1708
* Display IPv6 network sockets statistics in selected format.
1711
* @a Activity structure with statistics.
1712
* @isdb Flag, true if db printing, false if ppc printing.
1713
* @pre Prefix string for output entries
1714
* @curr Index in array for current sample statistics.
1715
* @itv Interval of time in jiffies.
1716
***************************************************************************
1718
__print_funct_t render_net_sock6_stats(struct activity *a, int isdb, char *pre,
1719
int curr, unsigned long long itv)
1721
struct stats_net_sock6
1722
*snsc = (struct stats_net_sock6 *) a->buf[curr];
1724
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1726
render(isdb, pre, PT_USEINT,
1727
"-\ttcp6sck", NULL, NULL,
1728
snsc->tcp6_inuse, DNOVAL);
1730
render(isdb, pre, PT_USEINT,
1731
"-\tudp6sck", NULL, NULL,
1732
snsc->udp6_inuse, DNOVAL);
1734
render(isdb, pre, PT_USEINT,
1735
"-\traw6sck", NULL, NULL,
1736
snsc->raw6_inuse, DNOVAL);
1738
render(isdb, pre, PT_USEINT | pt_newlin,
1739
"-\tip6-frag", NULL, NULL,
1740
snsc->frag6_inuse, DNOVAL);
1744
***************************************************************************
1745
* Display IPv6 network statistics in selected format.
1748
* @a Activity structure with statistics.
1749
* @isdb Flag, true if db printing, false if ppc printing.
1750
* @pre Prefix string for output entries
1751
* @curr Index in array for current sample statistics.
1752
* @itv Interval of time in jiffies.
1753
***************************************************************************
1755
__print_funct_t render_net_ip6_stats(struct activity *a, int isdb, char *pre,
1756
int curr, unsigned long long itv)
1758
struct stats_net_ip6
1759
*snic = (struct stats_net_ip6 *) a->buf[curr],
1760
*snip = (struct stats_net_ip6 *) a->buf[!curr];
1762
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1764
render(isdb, pre, PT_NOFLAG,
1765
"-\tirec6/s", NULL, NULL,
1767
S_VALUE(snip->InReceives6, snic->InReceives6, itv));
1769
render(isdb, pre, PT_NOFLAG,
1770
"-\tfwddgm6/s", NULL, NULL,
1772
S_VALUE(snip->OutForwDatagrams6, snic->OutForwDatagrams6, itv));
1774
render(isdb, pre, PT_NOFLAG,
1775
"-\tidel6/s", NULL, NULL,
1777
S_VALUE(snip->InDelivers6, snic->InDelivers6, itv));
1779
render(isdb, pre, PT_NOFLAG,
1780
"-\torq6/s", NULL, NULL,
1782
S_VALUE(snip->OutRequests6, snic->OutRequests6, itv));
1784
render(isdb, pre, PT_NOFLAG,
1785
"-\tasmrq6/s", NULL, NULL,
1787
S_VALUE(snip->ReasmReqds6, snic->ReasmReqds6, itv));
1789
render(isdb, pre, PT_NOFLAG,
1790
"-\tasmok6/s", NULL, NULL,
1792
S_VALUE(snip->ReasmOKs6, snic->ReasmOKs6, itv));
1794
render(isdb, pre, PT_NOFLAG,
1795
"-\timcpck6/s", NULL, NULL,
1797
S_VALUE(snip->InMcastPkts6, snic->InMcastPkts6, itv));
1799
render(isdb, pre, PT_NOFLAG,
1800
"-\tomcpck6/s", NULL, NULL,
1802
S_VALUE(snip->OutMcastPkts6, snic->OutMcastPkts6, itv));
1804
render(isdb, pre, PT_NOFLAG,
1805
"-\tfragok6/s", NULL, NULL,
1807
S_VALUE(snip->FragOKs6, snic->FragOKs6, itv));
1809
render(isdb, pre, pt_newlin,
1810
"-\tfragcr6/s", NULL, NULL,
1812
S_VALUE(snip->FragCreates6, snic->FragCreates6, itv));
1816
***************************************************************************
1817
* Display IPv6 network error statistics in selected format.
1820
* @a Activity structure with statistics.
1821
* @isdb Flag, true if db printing, false if ppc printing.
1822
* @pre Prefix string for output entries
1823
* @curr Index in array for current sample statistics.
1824
* @itv Interval of time in jiffies.
1825
***************************************************************************
1827
__print_funct_t render_net_eip6_stats(struct activity *a, int isdb, char *pre,
1828
int curr, unsigned long long itv)
1830
struct stats_net_eip6
1831
*sneic = (struct stats_net_eip6 *) a->buf[curr],
1832
*sneip = (struct stats_net_eip6 *) a->buf[!curr];
1834
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1836
render(isdb, pre, PT_NOFLAG,
1837
"-\tihdrer6/s", NULL, NULL,
1839
S_VALUE(sneip->InHdrErrors6, sneic->InHdrErrors6, itv));
1841
render(isdb, pre, PT_NOFLAG,
1842
"-\tiadrer6/s", NULL, NULL,
1844
S_VALUE(sneip->InAddrErrors6, sneic->InAddrErrors6, itv));
1846
render(isdb, pre, PT_NOFLAG,
1847
"-\tiukwnp6/s", NULL, NULL,
1849
S_VALUE(sneip->InUnknownProtos6, sneic->InUnknownProtos6, itv));
1851
render(isdb, pre, PT_NOFLAG,
1852
"-\ti2big6/s", NULL, NULL,
1854
S_VALUE(sneip->InTooBigErrors6, sneic->InTooBigErrors6, itv));
1856
render(isdb, pre, PT_NOFLAG,
1857
"-\tidisc6/s", NULL, NULL,
1859
S_VALUE(sneip->InDiscards6, sneic->InDiscards6, itv));
1861
render(isdb, pre, PT_NOFLAG,
1862
"-\todisc6/s", NULL, NULL,
1864
S_VALUE(sneip->OutDiscards6, sneic->OutDiscards6, itv));
1866
render(isdb, pre, PT_NOFLAG,
1867
"-\tinort6/s", NULL, NULL,
1869
S_VALUE(sneip->InNoRoutes6, sneic->InNoRoutes6, itv));
1871
render(isdb, pre, PT_NOFLAG,
1872
"-\tonort6/s", NULL, NULL,
1874
S_VALUE(sneip->OutNoRoutes6, sneic->OutNoRoutes6, itv));
1876
render(isdb, pre, PT_NOFLAG,
1877
"-\tasmf6/s", NULL, NULL,
1879
S_VALUE(sneip->ReasmFails6, sneic->ReasmFails6, itv));
1881
render(isdb, pre, PT_NOFLAG,
1882
"-\tfragf6/s", NULL, NULL,
1884
S_VALUE(sneip->FragFails6, sneic->FragFails6, itv));
1886
render(isdb, pre, pt_newlin,
1887
"-\titrpck6/s", NULL, NULL,
1889
S_VALUE(sneip->InTruncatedPkts6, sneic->InTruncatedPkts6, itv));
1893
***************************************************************************
1894
* Display ICMPv6 network statistics in selected format.
1897
* @a Activity structure with statistics.
1898
* @isdb Flag, true if db printing, false if ppc printing.
1899
* @pre Prefix string for output entries
1900
* @curr Index in array for current sample statistics.
1901
* @itv Interval of time in jiffies.
1902
***************************************************************************
1904
__print_funct_t render_net_icmp6_stats(struct activity *a, int isdb, char *pre,
1905
int curr, unsigned long long itv)
1907
struct stats_net_icmp6
1908
*snic = (struct stats_net_icmp6 *) a->buf[curr],
1909
*snip = (struct stats_net_icmp6 *) a->buf[!curr];
1911
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
1913
render(isdb, pre, PT_NOFLAG,
1914
"-\timsg6/s", NULL, NULL,
1916
S_VALUE(snip->InMsgs6, snic->InMsgs6, itv));
1918
render(isdb, pre, PT_NOFLAG,
1919
"-\tomsg6/s", NULL, NULL,
1921
S_VALUE(snip->OutMsgs6, snic->OutMsgs6, itv));
1923
render(isdb, pre, PT_NOFLAG,
1924
"-\tiech6/s", NULL, NULL,
1926
S_VALUE(snip->InEchos6, snic->InEchos6, itv));
1928
render(isdb, pre, PT_NOFLAG,
1929
"-\tiechr6/s", NULL, NULL,
1931
S_VALUE(snip->InEchoReplies6, snic->InEchoReplies6, itv));
1933
render(isdb, pre, PT_NOFLAG,
1934
"-\toechr6/s", NULL, NULL,
1936
S_VALUE(snip->OutEchoReplies6, snic->OutEchoReplies6, itv));
1938
render(isdb, pre, PT_NOFLAG,
1939
"-\tigmbq6/s", NULL, NULL,
1941
S_VALUE(snip->InGroupMembQueries6, snic->InGroupMembQueries6, itv));
1943
render(isdb, pre, PT_NOFLAG,
1944
"-\tigmbr6/s", NULL, NULL,
1946
S_VALUE(snip->InGroupMembResponses6, snic->InGroupMembResponses6, itv));
1948
render(isdb, pre, PT_NOFLAG,
1949
"-\togmbr6/s", NULL, NULL,
1951
S_VALUE(snip->OutGroupMembResponses6, snic->OutGroupMembResponses6, itv));
1953
render(isdb, pre, PT_NOFLAG,
1954
"-\tigmbrd6/s", NULL, NULL,
1956
S_VALUE(snip->InGroupMembReductions6, snic->InGroupMembReductions6, itv));
1958
render(isdb, pre, PT_NOFLAG,
1959
"-\togmbrd6/s", NULL, NULL,
1961
S_VALUE(snip->OutGroupMembReductions6, snic->OutGroupMembReductions6, itv));
1963
render(isdb, pre, PT_NOFLAG,
1964
"-\tirtsol6/s", NULL, NULL,
1966
S_VALUE(snip->InRouterSolicits6, snic->InRouterSolicits6, itv));
1968
render(isdb, pre, PT_NOFLAG,
1969
"-\tortsol6/s", NULL, NULL,
1971
S_VALUE(snip->OutRouterSolicits6, snic->OutRouterSolicits6, itv));
1973
render(isdb, pre, PT_NOFLAG,
1974
"-\tirtad6/s", NULL, NULL,
1976
S_VALUE(snip->InRouterAdvertisements6, snic->InRouterAdvertisements6, itv));
1978
render(isdb, pre, PT_NOFLAG,
1979
"-\tinbsol6/s", NULL, NULL,
1981
S_VALUE(snip->InNeighborSolicits6, snic->InNeighborSolicits6, itv));
1983
render(isdb, pre, PT_NOFLAG,
1984
"-\tonbsol6/s", NULL, NULL,
1986
S_VALUE(snip->OutNeighborSolicits6, snic->OutNeighborSolicits6, itv));
1988
render(isdb, pre, PT_NOFLAG,
1989
"-\tinbad6/s", NULL, NULL,
1991
S_VALUE(snip->InNeighborAdvertisements6, snic->InNeighborAdvertisements6, itv));
1993
render(isdb, pre, pt_newlin,
1994
"-\tonbad6/s", NULL, NULL,
1996
S_VALUE(snip->OutNeighborAdvertisements6, snic->OutNeighborAdvertisements6, itv));
2000
***************************************************************************
2001
* Display ICMPv6 error message statistics in selected format.
2004
* @a Activity structure with statistics.
2005
* @isdb Flag, true if db printing, false if ppc printing.
2006
* @pre Prefix string for output entries
2007
* @curr Index in array for current sample statistics.
2008
* @itv Interval of time in jiffies.
2009
***************************************************************************
2011
__print_funct_t render_net_eicmp6_stats(struct activity *a, int isdb, char *pre,
2012
int curr, unsigned long long itv)
2014
struct stats_net_eicmp6
2015
*sneic = (struct stats_net_eicmp6 *) a->buf[curr],
2016
*sneip = (struct stats_net_eicmp6 *) a->buf[!curr];
2018
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2020
render(isdb, pre, PT_NOFLAG,
2021
"-\tierr6/s", NULL, NULL,
2023
S_VALUE(sneip->InErrors6, sneic->InErrors6, itv));
2025
render(isdb, pre, PT_NOFLAG,
2026
"-\tidtunr6/s", NULL, NULL,
2028
S_VALUE(sneip->InDestUnreachs6, sneic->InDestUnreachs6, itv));
2030
render(isdb, pre, PT_NOFLAG,
2031
"-\todtunr6/s", NULL, NULL,
2033
S_VALUE(sneip->OutDestUnreachs6, sneic->OutDestUnreachs6, itv));
2035
render(isdb, pre, PT_NOFLAG,
2036
"-\titmex6/s", NULL, NULL,
2038
S_VALUE(sneip->InTimeExcds6, sneic->InTimeExcds6, itv));
2040
render(isdb, pre, PT_NOFLAG,
2041
"-\totmex6/s", NULL, NULL,
2043
S_VALUE(sneip->OutTimeExcds6, sneic->OutTimeExcds6, itv));
2045
render(isdb, pre, PT_NOFLAG,
2046
"-\tiprmpb6/s", NULL, NULL,
2048
S_VALUE(sneip->InParmProblems6, sneic->InParmProblems6, itv));
2050
render(isdb, pre, PT_NOFLAG,
2051
"-\toprmpb6/s", NULL, NULL,
2053
S_VALUE(sneip->OutParmProblems6, sneic->OutParmProblems6, itv));
2055
render(isdb, pre, PT_NOFLAG,
2056
"-\tiredir6/s", NULL, NULL,
2058
S_VALUE(sneip->InRedirects6, sneic->InRedirects6, itv));
2060
render(isdb, pre, PT_NOFLAG,
2061
"-\toredir6/s", NULL, NULL,
2063
S_VALUE(sneip->OutRedirects6, sneic->OutRedirects6, itv));
2065
render(isdb, pre, PT_NOFLAG,
2066
"-\tipck2b6/s", NULL, NULL,
2068
S_VALUE(sneip->InPktTooBigs6, sneic->InPktTooBigs6, itv));
2070
render(isdb, pre, pt_newlin,
2071
"-\topck2b6/s", NULL, NULL,
2073
S_VALUE(sneip->OutPktTooBigs6, sneic->OutPktTooBigs6, itv));
2077
***************************************************************************
2078
* Display UDP6 network statistics in selected format.
2081
* @a Activity structure with statistics.
2082
* @isdb Flag, true if db printing, false if ppc printing.
2083
* @pre Prefix string for output entries
2084
* @curr Index in array for current sample statistics.
2085
* @itv Interval of time in jiffies.
2086
***************************************************************************
2088
__print_funct_t render_net_udp6_stats(struct activity *a, int isdb, char *pre,
2089
int curr, unsigned long long itv)
2091
struct stats_net_udp6
2092
*snuc = (struct stats_net_udp6 *) a->buf[curr],
2093
*snup = (struct stats_net_udp6 *) a->buf[!curr];
2095
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2097
render(isdb, pre, PT_NOFLAG,
2098
"-\tidgm6/s", NULL, NULL,
2100
S_VALUE(snup->InDatagrams6, snuc->InDatagrams6, itv));
2102
render(isdb, pre, PT_NOFLAG,
2103
"-\todgm6/s", NULL, NULL,
2105
S_VALUE(snup->OutDatagrams6, snuc->OutDatagrams6, itv));
2107
render(isdb, pre, PT_NOFLAG,
2108
"-\tnoport6/s", NULL, NULL,
2110
S_VALUE(snup->NoPorts6, snuc->NoPorts6, itv));
2112
render(isdb, pre, pt_newlin,
2113
"-\tidgmer6/s", NULL, NULL,
2115
S_VALUE(snup->InErrors6, snuc->InErrors6, itv));
2119
***************************************************************************
2120
* Display CPU frequency statistics in selected format.
2123
* @a Activity structure with statistics.
2124
* @isdb Flag, true if db printing, false if ppc printing.
2125
* @pre Prefix string for output entries
2126
* @curr Index in array for current sample statistics.
2127
* @itv Interval of time in jiffies.
2128
***************************************************************************
2130
__print_funct_t render_pwr_cpufreq_stats(struct activity *a, int isdb, char *pre,
2131
int curr, unsigned long long itv)
2134
struct stats_pwr_cpufreq *spc;
2136
= (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
2138
for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
2140
spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize);
2142
/* Should current CPU (including CPU "all") be displayed? */
2143
if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
2146
/* This is CPU "all" */
2147
render(isdb, pre, pt_newlin,
2151
((double) spc->cpufreq) / 100);
2154
render(isdb, pre, pt_newlin,
2156
"%d", cons(iv, i - 1, NOVAL),
2158
((double) spc->cpufreq) / 100);
2165
***************************************************************************
2169
* @nr_tab Number of tabs to print.
2170
***************************************************************************
2172
void prtab(int nr_tab)
2176
for (i = 0; i < nr_tab; i++) {
2182
***************************************************************************
2183
* printf() function modified for XML display
2186
* @nr_tab Number of tabs to print.
2187
* @fmt printf() format.
2188
***************************************************************************
2190
void xprintf(int nr_tab, const char *fmt, ...)
2192
static char buf[1024];
2195
va_start(args, fmt);
2196
vsnprintf(buf, sizeof(buf), fmt, args);
2200
printf("%s\n", buf);
2204
***************************************************************************
2205
* Open or close <network> markup.
2208
* @tab Number of tabulations.
2209
* @action Open or close action.
2210
***************************************************************************
2212
void xml_markup_network(int tab, int action)
2214
static int markup_state = CLOSE_XML_MARKUP;
2216
if (action == markup_state)
2218
markup_state = action;
2220
if (action == OPEN_XML_MARKUP) {
2222
xprintf(tab, "<network per=\"second\">");
2226
xprintf(tab, "</network>");
2231
***************************************************************************
2232
* Open or close <power-management> markup.
2235
* @tab Number of tabulations.
2236
* @action Open or close action.
2237
***************************************************************************
2239
void xml_markup_power_management(int tab, int action)
2241
static int markup_state = CLOSE_XML_MARKUP;
2243
if (action == markup_state)
2245
markup_state = action;
2247
if (action == OPEN_XML_MARKUP) {
2249
xprintf(tab, "<power-management>");
2253
xprintf(tab, "</power-management>");
2258
***************************************************************************
2259
* Display CPU statistics in XML.
2262
* @a Activity structure with statistics.
2263
* @curr Index in array for current sample statistics.
2264
* @tab Indentation in XML output.
2265
* @g_itv Interval of time in jiffies mutliplied by the number of
2267
***************************************************************************
2269
__print_funct_t xml_print_cpu_stats(struct activity *a, int curr, int tab,
2270
unsigned long long g_itv)
2273
struct stats_cpu *scc, *scp;
2276
if (DISPLAY_CPU_DEF(a->opt_flags)) {
2277
xprintf(tab++, "<cpu-load>");
2279
else if (DISPLAY_CPU_ALL(a->opt_flags)) {
2280
xprintf(tab++, "<cpu-load-all>");
2283
for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
2285
scc = (struct stats_cpu *) ((char *) a->buf[curr] + i * a->msize);
2286
scp = (struct stats_cpu *) ((char *) a->buf[!curr] + i * a->msize);
2288
/* Should current CPU (including CPU "all") be displayed? */
2289
if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
2291
/* Yes: Display it */
2293
/* This is CPU "all" */
2294
strcpy(cpuno, "all");
2297
sprintf(cpuno, "%d", i - 1);
2299
/* Recalculate interval for current proc */
2300
g_itv = get_per_cpu_interval(scc, scp);
2303
/* Current CPU is offline */
2304
if (DISPLAY_CPU_DEF(a->opt_flags)) {
2305
xprintf(tab, "<cpu number=\"%d\" "
2314
else if (DISPLAY_CPU_ALL(a->opt_flags)) {
2315
xprintf(tab, "<cpu number=\"%d\" "
2331
if (DISPLAY_CPU_DEF(a->opt_flags)) {
2332
xprintf(tab, "<cpu number=\"%s\" "
2340
ll_sp_value(scp->cpu_user, scc->cpu_user, g_itv),
2341
ll_sp_value(scp->cpu_nice, scc->cpu_nice, g_itv),
2342
ll_sp_value(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq,
2343
scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq,
2345
ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv),
2346
ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv),
2347
scc->cpu_idle < scp->cpu_idle ?
2349
ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv));
2351
else if (DISPLAY_CPU_ALL(a->opt_flags)) {
2352
xprintf(tab, "<cpu number=\"%s\" "
2363
ll_sp_value(scp->cpu_user - scp->cpu_guest,
2364
scc->cpu_user - scc->cpu_guest, g_itv),
2365
ll_sp_value(scp->cpu_nice, scc->cpu_nice, g_itv),
2366
ll_sp_value(scp->cpu_sys, scc->cpu_sys, g_itv),
2367
ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv),
2368
ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv),
2369
ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, g_itv),
2370
ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, g_itv),
2371
ll_sp_value(scp->cpu_guest, scc->cpu_guest, g_itv),
2372
scc->cpu_idle < scp->cpu_idle ?
2374
ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv));
2379
if (DISPLAY_CPU_DEF(a->opt_flags)) {
2380
xprintf(--tab, "</cpu-load>");
2382
else if (DISPLAY_CPU_ALL(a->opt_flags)) {
2383
xprintf(--tab, "</cpu-load-all>");
2388
***************************************************************************
2389
* Display task creation and context switch statistics in XML.
2392
* @a Activity structure with statistics.
2393
* @curr Index in array for current sample statistics.
2394
* @tab Indentation in XML output.
2395
* @itv Interval of time in jiffies.
2396
***************************************************************************
2398
__print_funct_t xml_print_pcsw_stats(struct activity *a, int curr, int tab,
2399
unsigned long long itv)
2402
*spc = (struct stats_pcsw *) a->buf[curr],
2403
*spp = (struct stats_pcsw *) a->buf[!curr];
2405
/* proc/s and cswch/s */
2406
xprintf(tab, "<process-and-context-switch per=\"second\" "
2409
S_VALUE(spp->processes, spc->processes, itv),
2410
ll_s_value(spp->context_switch, spc->context_switch, itv));
2414
***************************************************************************
2415
* Display interrupts statistics in XML.
2418
* @a Activity structure with statistics.
2419
* @curr Index in array for current sample statistics.
2420
* @tab Indentation in XML output.
2421
* @itv Interval of time in jiffies.
2422
***************************************************************************
2424
__print_funct_t xml_print_irq_stats(struct activity *a, int curr, int tab,
2425
unsigned long long itv)
2428
struct stats_irq *sic, *sip;
2431
xprintf(tab++, "<interrupts>");
2432
xprintf(tab++, "<int-global per=\"second\">");
2434
for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
2436
sic = (struct stats_irq *) ((char *) a->buf[curr] + i * a->msize);
2437
sip = (struct stats_irq *) ((char *) a->buf[!curr] + i * a->msize);
2439
/* Should current interrupt (including int "sum") be displayed? */
2440
if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
2442
/* Yes: Display it */
2444
/* This is interrupt "sum" */
2445
strcpy(irqno, "sum");
2448
sprintf(irqno, "%d", i - 1);
2451
xprintf(tab, "<irq intr=\"%s\" value=\"%.2f\"/>", irqno,
2452
ll_s_value(sip->irq_nr, sic->irq_nr, itv));
2456
xprintf(--tab, "</int-global>");
2457
xprintf(--tab, "</interrupts>");
2461
***************************************************************************
2462
* Display swapping statistics in XML.
2465
* @a Activity structure with statistics.
2466
* @curr Index in array for current sample statistics.
2467
* @tab Indentation in XML output.
2468
* @itv Interval of time in jiffies.
2469
***************************************************************************
2471
__print_funct_t xml_print_swap_stats(struct activity *a, int curr, int tab,
2472
unsigned long long itv)
2475
*ssc = (struct stats_swap *) a->buf[curr],
2476
*ssp = (struct stats_swap *) a->buf[!curr];
2478
xprintf(tab, "<swap-pages per=\"second\" "
2480
"pswpout=\"%.2f\"/>",
2481
S_VALUE(ssp->pswpin, ssc->pswpin, itv),
2482
S_VALUE(ssp->pswpout, ssc->pswpout, itv));
2486
***************************************************************************
2487
* Display paging statistics in XML.
2490
* @a Activity structure with statistics.
2491
* @curr Index in array for current sample statistics.
2492
* @tab Indentation in XML output.
2493
* @itv Interval of time in jiffies.
2494
***************************************************************************
2496
__print_funct_t xml_print_paging_stats(struct activity *a, int curr, int tab,
2497
unsigned long long itv)
2500
*spc = (struct stats_paging *) a->buf[curr],
2501
*spp = (struct stats_paging *) a->buf[!curr];
2503
xprintf(tab, "<paging per=\"second\" "
2512
"vmeff-percent=\"%.2f\"/>",
2513
S_VALUE(spp->pgpgin, spc->pgpgin, itv),
2514
S_VALUE(spp->pgpgout, spc->pgpgout, itv),
2515
S_VALUE(spp->pgfault, spc->pgfault, itv),
2516
S_VALUE(spp->pgmajfault, spc->pgmajfault, itv),
2517
S_VALUE(spp->pgfree, spc->pgfree, itv),
2518
S_VALUE(spp->pgscan_kswapd, spc->pgscan_kswapd, itv),
2519
S_VALUE(spp->pgscan_direct, spc->pgscan_direct, itv),
2520
S_VALUE(spp->pgsteal, spc->pgsteal, itv),
2521
(spc->pgscan_kswapd + spc->pgscan_direct -
2522
spp->pgscan_kswapd - spp->pgscan_direct) ?
2523
SP_VALUE(spp->pgsteal, spc->pgsteal,
2524
spc->pgscan_kswapd + spc->pgscan_direct -
2525
spp->pgscan_kswapd - spp->pgscan_direct) : 0.0);
2529
***************************************************************************
2530
* Display I/O and transfer rate statistics in XML.
2533
* @a Activity structure with statistics.
2534
* @curr Index in array for current sample statistics.
2535
* @tab Indentation in XML output.
2536
* @itv Interval of time in jiffies.
2537
***************************************************************************
2539
__print_funct_t xml_print_io_stats(struct activity *a, int curr, int tab,
2540
unsigned long long itv)
2543
*sic = (struct stats_io *) a->buf[curr],
2544
*sip = (struct stats_io *) a->buf[!curr];
2546
xprintf(tab, "<io per=\"second\">");
2548
xprintf(++tab, "<tps>%.2f</tps>",
2549
S_VALUE(sip->dk_drive, sic->dk_drive, itv));
2551
xprintf(tab, "<io-reads rtps=\"%.2f\" bread=\"%.2f\"/>",
2552
S_VALUE(sip->dk_drive_rio, sic->dk_drive_rio, itv),
2553
S_VALUE(sip->dk_drive_rblk, sic->dk_drive_rblk, itv));
2555
xprintf(tab, "<io-writes wtps=\"%.2f\" bwrtn=\"%.2f\"/>",
2556
S_VALUE(sip->dk_drive_wio, sic->dk_drive_wio, itv),
2557
S_VALUE(sip->dk_drive_wblk, sic->dk_drive_wblk, itv));
2559
xprintf(--tab, "</io>");
2563
***************************************************************************
2564
* Display memory statistics in XML.
2567
* @a Activity structure with statistics.
2568
* @curr Index in array for current sample statistics.
2569
* @tab Indentation in XML output.
2570
* @itv Interval of time in jiffies.
2571
***************************************************************************
2573
__print_funct_t xml_print_memory_stats(struct activity *a, int curr, int tab,
2574
unsigned long long itv)
2577
*smc = (struct stats_memory *) a->buf[curr],
2578
*smp = (struct stats_memory *) a->buf[!curr];
2580
xprintf(tab, "<memory per=\"second\" unit=\"kB\">");
2582
if (DISPLAY_MEM_AMT(a->opt_flags)) {
2584
xprintf(++tab, "<memfree>%lu</memfree>",
2587
xprintf(tab, "<memused>%lu</memused>",
2588
smc->tlmkb - smc->frmkb);
2590
xprintf(tab, "<memused-percent>%.2f</memused-percent>",
2592
SP_VALUE(smc->frmkb, smc->tlmkb, smc->tlmkb) :
2595
xprintf(tab, "<buffers>%lu</buffers>",
2598
xprintf(tab, "<cached>%lu</cached>",
2601
xprintf(tab, "<commit>%lu</commit>",
2604
xprintf(tab--, "<commit-percent>%.2f</commit-percent>",
2605
(smc->tlmkb + smc->tlskb) ?
2606
SP_VALUE(0, smc->comkb, smc->tlmkb + smc->tlskb) :
2610
if (DISPLAY_SWAP(a->opt_flags)) {
2612
xprintf(++tab, "<swpfree>%lu</swpfree>",
2615
xprintf(tab, "<swpused>%lu</swpused>",
2616
smc->tlskb - smc->frskb);
2618
xprintf(tab, "<swpused-percent>%.2f</swpused-percent>",
2620
SP_VALUE(smc->frskb, smc->tlskb, smc->tlskb) :
2623
xprintf(tab, "<swpcad>%lu</swpcad>",
2626
xprintf(tab--, "<swpcad-percent>%.2f</swpcad-percent>",
2627
(smc->tlskb - smc->frskb) ?
2628
SP_VALUE(0, smc->caskb, smc->tlskb - smc->frskb) :
2632
if (DISPLAY_MEMORY(a->opt_flags)) {
2634
xprintf(++tab, "<frmpg>%.2f</frmpg>",
2635
S_VALUE((double) KB_TO_PG(smp->frmkb),
2636
(double) KB_TO_PG(smc->frmkb), itv));
2638
xprintf(tab, "<bufpg>%.2f</bufpg>",
2639
S_VALUE((double) KB_TO_PG(smp->bufkb),
2640
(double) KB_TO_PG(smc->bufkb), itv));
2642
xprintf(tab--, "<campg>%.2f</campg>",
2643
S_VALUE((double) KB_TO_PG(smp->camkb),
2644
(double) KB_TO_PG(smc->camkb), itv));
2647
xprintf(tab, "</memory>");
2651
***************************************************************************
2652
* Display kernel tables statistics in XML.
2655
* @a Activity structure with statistics.
2656
* @curr Index in array for current sample statistics.
2657
* @tab Indentation in XML output.
2658
* @itv Interval of time in jiffies.
2659
***************************************************************************
2661
__print_funct_t xml_print_ktables_stats(struct activity *a, int curr, int tab,
2662
unsigned long long itv)
2664
struct stats_ktables
2665
*skc = (struct stats_ktables *) a->buf[curr];
2667
xprintf(tab, "<kernel "
2679
***************************************************************************
2680
* Display queue and load statistics in XML.
2683
* @a Activity structure with statistics.
2684
* @curr Index in array for current sample statistics.
2685
* @tab Indentation in XML output.
2686
* @itv Interval of time in jiffies.
2687
***************************************************************************
2689
__print_funct_t xml_print_queue_stats(struct activity *a, int curr, int tab,
2690
unsigned long long itv)
2693
*sqc = (struct stats_queue *) a->buf[curr];
2695
xprintf(tab, "<queue "
2700
"ldavg-15=\"%.2f\"/>",
2703
(double) sqc->load_avg_1 / 100,
2704
(double) sqc->load_avg_5 / 100,
2705
(double) sqc->load_avg_15 / 100);
2709
***************************************************************************
2710
* Display serial lines statistics in XML.
2713
* @a Activity structure with statistics.
2714
* @curr Index in array for current sample statistics.
2715
* @tab Indentation in XML output.
2716
* @itv Interval of time in jiffies.
2717
***************************************************************************
2719
__print_funct_t xml_print_serial_stats(struct activity *a, int curr, int tab,
2720
unsigned long long itv)
2723
struct stats_serial *ssc, *ssp;
2725
xprintf(tab, "<serial per=\"second\">");
2728
for (i = 0; i < a->nr; i++) {
2730
ssc = (struct stats_serial *) ((char *) a->buf[curr] + i * a->msize);
2731
ssp = (struct stats_serial *) ((char *) a->buf[!curr] + i * a->msize);
2736
if (ssc->line == ssp->line) {
2738
xprintf(tab, "<tty line=\"%d\" "
2746
S_VALUE(ssp->rx, ssc->rx, itv),
2747
S_VALUE(ssp->tx, ssc->tx, itv),
2748
S_VALUE(ssp->frame, ssc->frame, itv),
2749
S_VALUE(ssp->parity, ssc->parity, itv),
2750
S_VALUE(ssp->brk, ssc->brk, itv),
2751
S_VALUE(ssp->overrun, ssc->overrun, itv));
2755
xprintf(--tab, "</serial>");
2759
***************************************************************************
2760
* Display disks statistics in XML.
2763
* @a Activity structure with statistics.
2764
* @curr Index in array for current sample statistics.
2765
* @tab Indentation in XML output.
2766
* @itv Interval of time in jiffies.
2767
***************************************************************************
2769
__print_funct_t xml_print_disk_stats(struct activity *a, int curr, int tab,
2770
unsigned long long itv)
2773
struct stats_disk *sdc, *sdp;
2774
struct ext_disk_stats xds;
2777
xprintf(tab, "<disk per=\"second\">");
2780
for (i = 0; i < a->nr; i++) {
2782
sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize);
2784
if (!(sdc->major + sdc->minor))
2787
j = check_disk_reg(a, curr, !curr, i);
2788
sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
2790
/* Compute extended statistics values */
2791
compute_ext_disk_stats(sdc, sdp, itv, &xds);
2795
if ((USE_PRETTY_OPTION(flags)) && (sdc->major == DEVMAP_MAJOR)) {
2796
dev_name = transform_devmapname(sdc->major, sdc->minor);
2800
dev_name = get_devname(sdc->major, sdc->minor,
2801
USE_PRETTY_OPTION(flags));
2804
xprintf(tab, "<disk-device dev=\"%s\" "
2808
"avgrq-sz=\"%.2f\" "
2809
"avgqu-sz=\"%.2f\" "
2812
"util-percent=\"%.2f\"/>",
2813
/* Confusion possible here between index and minor numbers */
2815
S_VALUE(sdp->nr_ios, sdc->nr_ios, itv),
2816
ll_s_value(sdp->rd_sect, sdc->rd_sect, itv),
2817
ll_s_value(sdp->wr_sect, sdc->wr_sect, itv),
2818
/* See iostat for explanations */
2820
S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,
2826
xprintf(--tab, "</disk>");
2830
***************************************************************************
2831
* Display network interfaces statistics in XML.
2834
* @a Activity structure with statistics.
2835
* @curr Index in array for current sample statistics.
2836
* @tab Indentation in XML output.
2837
* @itv Interval of time in jiffies.
2838
***************************************************************************
2840
__print_funct_t xml_print_net_dev_stats(struct activity *a, int curr, int tab,
2841
unsigned long long itv)
2844
struct stats_net_dev *sndc, *sndp;
2846
if (!IS_SELECTED(a->options) || (a->nr <= 0))
2847
goto close_xml_markup;
2849
xml_markup_network(tab, OPEN_XML_MARKUP);
2852
for (i = 0; i < a->nr; i++) {
2854
sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize);
2856
if (!strcmp(sndc->interface, ""))
2859
j = check_net_dev_reg(a, curr, !curr, i);
2860
sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize);
2862
xprintf(tab, "<net-dev iface=\"%s\" "
2869
"rxmcst=\"%.2f\"/>",
2871
S_VALUE(sndp->rx_packets, sndc->rx_packets, itv),
2872
S_VALUE(sndp->tx_packets, sndc->tx_packets, itv),
2873
S_VALUE(sndp->rx_bytes, sndc->rx_bytes, itv) / 1024,
2874
S_VALUE(sndp->tx_bytes, sndc->tx_bytes, itv) / 1024,
2875
S_VALUE(sndp->rx_compressed, sndc->rx_compressed, itv),
2876
S_VALUE(sndp->tx_compressed, sndc->tx_compressed, itv),
2877
S_VALUE(sndp->multicast, sndc->multicast, itv));
2882
if (CLOSE_MARKUP(a->options)) {
2883
xml_markup_network(tab, CLOSE_XML_MARKUP);
2888
***************************************************************************
2889
* Display network interfaces error statistics in XML.
2892
* @a Activity structure with statistics.
2893
* @curr Index in array for current sample statistics.
2894
* @tab Indentation in XML output.
2895
* @itv Interval of time in jiffies.
2896
***************************************************************************
2898
__print_funct_t xml_print_net_edev_stats(struct activity *a, int curr, int tab,
2899
unsigned long long itv)
2902
struct stats_net_edev *snedc, *snedp;
2904
if (!IS_SELECTED(a->options) || (a->nr <= 0))
2905
goto close_xml_markup;
2907
xml_markup_network(tab, OPEN_XML_MARKUP);
2910
for (i = 0; i < a->nr; i++) {
2912
snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize);
2914
if (!strcmp(snedc->interface, ""))
2917
j = check_net_edev_reg(a, curr, !curr, i);
2918
snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize);
2920
xprintf(tab, "<net-edev iface=\"%s\" "
2929
"txfifo=\"%.2f\"/>",
2931
S_VALUE(snedp->rx_errors, snedc->rx_errors, itv),
2932
S_VALUE(snedp->tx_errors, snedc->tx_errors, itv),
2933
S_VALUE(snedp->collisions, snedc->collisions, itv),
2934
S_VALUE(snedp->rx_dropped, snedc->rx_dropped, itv),
2935
S_VALUE(snedp->tx_dropped, snedc->tx_dropped, itv),
2936
S_VALUE(snedp->tx_carrier_errors, snedc->tx_carrier_errors, itv),
2937
S_VALUE(snedp->rx_frame_errors, snedc->rx_frame_errors, itv),
2938
S_VALUE(snedp->rx_fifo_errors, snedc->rx_fifo_errors, itv),
2939
S_VALUE(snedp->tx_fifo_errors, snedc->tx_fifo_errors, itv));
2944
if (CLOSE_MARKUP(a->options)) {
2945
xml_markup_network(tab, CLOSE_XML_MARKUP);
2950
***************************************************************************
2951
* Display NFS client statistics in XML.
2954
* @a Activity structure with statistics.
2955
* @curr Index in array for current sample statistics.
2956
* @tab Indentation in XML output.
2957
* @itv Interval of time in jiffies.
2958
***************************************************************************
2960
__print_funct_t xml_print_net_nfs_stats(struct activity *a, int curr, int tab,
2961
unsigned long long itv)
2963
struct stats_net_nfs
2964
*snnc = (struct stats_net_nfs *) a->buf[curr],
2965
*snnp = (struct stats_net_nfs *) a->buf[!curr];
2967
if (!IS_SELECTED(a->options) || (a->nr <= 0))
2968
goto close_xml_markup;
2970
xml_markup_network(tab, OPEN_XML_MARKUP);
2973
xprintf(tab, "<net-nfs "
2979
"getatt=\"%.2f\"/>",
2980
S_VALUE(snnp->nfs_rpccnt, snnc->nfs_rpccnt, itv),
2981
S_VALUE(snnp->nfs_rpcretrans, snnc->nfs_rpcretrans, itv),
2982
S_VALUE(snnp->nfs_readcnt, snnc->nfs_readcnt, itv),
2983
S_VALUE(snnp->nfs_writecnt, snnc->nfs_writecnt, itv),
2984
S_VALUE(snnp->nfs_accesscnt, snnc->nfs_accesscnt, itv),
2985
S_VALUE(snnp->nfs_getattcnt, snnc->nfs_getattcnt, itv));
2989
if (CLOSE_MARKUP(a->options)) {
2990
xml_markup_network(tab, CLOSE_XML_MARKUP);
2995
***************************************************************************
2996
* Display NFS server statistics in XML.
2999
* @a Activity structure with statistics.
3000
* @curr Index in array for current sample statistics.
3001
* @tab Indentation in XML output.
3002
* @itv Interval of time in jiffies.
3003
***************************************************************************
3005
__print_funct_t xml_print_net_nfsd_stats(struct activity *a, int curr, int tab,
3006
unsigned long long itv)
3008
struct stats_net_nfsd
3009
*snndc = (struct stats_net_nfsd *) a->buf[curr],
3010
*snndp = (struct stats_net_nfsd *) a->buf[!curr];
3012
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3013
goto close_xml_markup;
3015
xml_markup_network(tab, OPEN_XML_MARKUP);
3018
xprintf(tab, "<net-nfsd "
3029
"sgetatt=\"%.2f\"/>",
3030
S_VALUE(snndp->nfsd_rpccnt, snndc->nfsd_rpccnt, itv),
3031
S_VALUE(snndp->nfsd_rpcbad, snndc->nfsd_rpcbad, itv),
3032
S_VALUE(snndp->nfsd_netcnt, snndc->nfsd_netcnt, itv),
3033
S_VALUE(snndp->nfsd_netudpcnt, snndc->nfsd_netudpcnt, itv),
3034
S_VALUE(snndp->nfsd_nettcpcnt, snndc->nfsd_nettcpcnt, itv),
3035
S_VALUE(snndp->nfsd_rchits, snndc->nfsd_rchits, itv),
3036
S_VALUE(snndp->nfsd_rcmisses, snndc->nfsd_rcmisses, itv),
3037
S_VALUE(snndp->nfsd_readcnt, snndc->nfsd_readcnt, itv),
3038
S_VALUE(snndp->nfsd_writecnt, snndc->nfsd_writecnt, itv),
3039
S_VALUE(snndp->nfsd_accesscnt, snndc->nfsd_accesscnt, itv),
3040
S_VALUE(snndp->nfsd_getattcnt, snndc->nfsd_getattcnt, itv));
3044
if (CLOSE_MARKUP(a->options)) {
3045
xml_markup_network(tab, CLOSE_XML_MARKUP);
3050
***************************************************************************
3051
* Display network socket statistics in XML.
3054
* @a Activity structure with statistics.
3055
* @curr Index in array for current sample statistics.
3056
* @tab Indentation in XML output.
3057
* @itv Interval of time in jiffies.
3058
***************************************************************************
3060
__print_funct_t xml_print_net_sock_stats(struct activity *a, int curr, int tab,
3061
unsigned long long itv)
3063
struct stats_net_sock
3064
*snsc = (struct stats_net_sock *) a->buf[curr];
3066
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3067
goto close_xml_markup;
3069
xml_markup_network(tab, OPEN_XML_MARKUP);
3072
xprintf(tab, "<net-sock "
3088
if (CLOSE_MARKUP(a->options)) {
3089
xml_markup_network(tab, CLOSE_XML_MARKUP);
3094
***************************************************************************
3095
* Display IP network statistics in XML.
3098
* @a Activity structure with statistics.
3099
* @curr Index in array for current sample statistics.
3100
* @tab Indentation in XML output.
3101
* @itv Interval of time in jiffies.
3102
***************************************************************************
3104
__print_funct_t xml_print_net_ip_stats(struct activity *a, int curr, int tab,
3105
unsigned long long itv)
3108
*snic = (struct stats_net_ip *) a->buf[curr],
3109
*snip = (struct stats_net_ip *) a->buf[!curr];
3111
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3112
goto close_xml_markup;
3114
xml_markup_network(tab, OPEN_XML_MARKUP);
3117
xprintf(tab, "<net-ip "
3125
"fragcrt=\"%.2f\"/>",
3126
S_VALUE(snip->InReceives, snic->InReceives, itv),
3127
S_VALUE(snip->ForwDatagrams, snic->ForwDatagrams, itv),
3128
S_VALUE(snip->InDelivers, snic->InDelivers, itv),
3129
S_VALUE(snip->OutRequests, snic->OutRequests, itv),
3130
S_VALUE(snip->ReasmReqds, snic->ReasmReqds, itv),
3131
S_VALUE(snip->ReasmOKs, snic->ReasmOKs, itv),
3132
S_VALUE(snip->FragOKs, snic->FragOKs, itv),
3133
S_VALUE(snip->FragCreates, snic->FragCreates, itv));
3137
if (CLOSE_MARKUP(a->options)) {
3138
xml_markup_network(tab, CLOSE_XML_MARKUP);
3143
***************************************************************************
3144
* Display IP network error statistics in XML.
3147
* @a Activity structure with statistics.
3148
* @curr Index in array for current sample statistics.
3149
* @tab Indentation in XML output.
3150
* @itv Interval of time in jiffies.
3151
***************************************************************************
3153
__print_funct_t xml_print_net_eip_stats(struct activity *a, int curr, int tab,
3154
unsigned long long itv)
3156
struct stats_net_eip
3157
*sneic = (struct stats_net_eip *) a->buf[curr],
3158
*sneip = (struct stats_net_eip *) a->buf[!curr];
3160
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3161
goto close_xml_markup;
3163
xml_markup_network(tab, OPEN_XML_MARKUP);
3166
xprintf(tab, "<net-eip "
3175
S_VALUE(sneip->InHdrErrors, sneic->InHdrErrors, itv),
3176
S_VALUE(sneip->InAddrErrors, sneic->InAddrErrors, itv),
3177
S_VALUE(sneip->InUnknownProtos, sneic->InUnknownProtos, itv),
3178
S_VALUE(sneip->InDiscards, sneic->InDiscards, itv),
3179
S_VALUE(sneip->OutDiscards, sneic->OutDiscards, itv),
3180
S_VALUE(sneip->OutNoRoutes, sneic->OutNoRoutes, itv),
3181
S_VALUE(sneip->ReasmFails, sneic->ReasmFails, itv),
3182
S_VALUE(sneip->FragFails, sneic->FragFails, itv));
3186
if (CLOSE_MARKUP(a->options)) {
3187
xml_markup_network(tab, CLOSE_XML_MARKUP);
3192
***************************************************************************
3193
* Display ICMP network statistics in XML.
3196
* @a Activity structure with statistics.
3197
* @curr Index in array for current sample statistics.
3198
* @tab Indentation in XML output.
3199
* @itv Interval of time in jiffies.
3200
***************************************************************************
3202
__print_funct_t xml_print_net_icmp_stats(struct activity *a, int curr, int tab,
3203
unsigned long long itv)
3205
struct stats_net_icmp
3206
*snic = (struct stats_net_icmp *) a->buf[curr],
3207
*snip = (struct stats_net_icmp *) a->buf[!curr];
3209
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3210
goto close_xml_markup;
3212
xml_markup_network(tab, OPEN_XML_MARKUP);
3215
xprintf(tab, "<net-icmp "
3229
"oadrmkr=\"%.2f\"/>",
3230
S_VALUE(snip->InMsgs, snic->InMsgs, itv),
3231
S_VALUE(snip->OutMsgs, snic->OutMsgs, itv),
3232
S_VALUE(snip->InEchos, snic->InEchos, itv),
3233
S_VALUE(snip->InEchoReps, snic->InEchoReps, itv),
3234
S_VALUE(snip->OutEchos, snic->OutEchos, itv),
3235
S_VALUE(snip->OutEchoReps, snic->OutEchoReps, itv),
3236
S_VALUE(snip->InTimestamps, snic->InTimestamps, itv),
3237
S_VALUE(snip->InTimestampReps, snic->InTimestampReps, itv),
3238
S_VALUE(snip->OutTimestamps, snic->OutTimestamps, itv),
3239
S_VALUE(snip->OutTimestampReps, snic->OutTimestampReps, itv),
3240
S_VALUE(snip->InAddrMasks, snic->InAddrMasks, itv),
3241
S_VALUE(snip->InAddrMaskReps, snic->InAddrMaskReps, itv),
3242
S_VALUE(snip->OutAddrMasks, snic->OutAddrMasks, itv),
3243
S_VALUE(snip->OutAddrMaskReps, snic->OutAddrMaskReps, itv));
3247
if (CLOSE_MARKUP(a->options)) {
3248
xml_markup_network(tab, CLOSE_XML_MARKUP);
3253
***************************************************************************
3254
* Display ICMP error message statistics in XML.
3257
* @a Activity structure with statistics.
3258
* @curr Index in array for current sample statistics.
3259
* @tab Indentation in XML output.
3260
* @itv Interval of time in jiffies.
3261
***************************************************************************
3263
__print_funct_t xml_print_net_eicmp_stats(struct activity *a, int curr, int tab,
3264
unsigned long long itv)
3266
struct stats_net_eicmp
3267
*sneic = (struct stats_net_eicmp *) a->buf[curr],
3268
*sneip = (struct stats_net_eicmp *) a->buf[!curr];
3270
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3271
goto close_xml_markup;
3273
xml_markup_network(tab, OPEN_XML_MARKUP);
3276
xprintf(tab, "<net-eicmp "
3288
"oredir=\"%.2f\"/>",
3289
S_VALUE(sneip->InErrors, sneic->InErrors, itv),
3290
S_VALUE(sneip->OutErrors, sneic->OutErrors, itv),
3291
S_VALUE(sneip->InDestUnreachs, sneic->InDestUnreachs, itv),
3292
S_VALUE(sneip->OutDestUnreachs, sneic->OutDestUnreachs, itv),
3293
S_VALUE(sneip->InTimeExcds, sneic->InTimeExcds, itv),
3294
S_VALUE(sneip->OutTimeExcds, sneic->OutTimeExcds, itv),
3295
S_VALUE(sneip->InParmProbs, sneic->InParmProbs, itv),
3296
S_VALUE(sneip->OutParmProbs, sneic->OutParmProbs, itv),
3297
S_VALUE(sneip->InSrcQuenchs, sneic->InSrcQuenchs, itv),
3298
S_VALUE(sneip->OutSrcQuenchs, sneic->OutSrcQuenchs, itv),
3299
S_VALUE(sneip->InRedirects, sneic->InRedirects, itv),
3300
S_VALUE(sneip->OutRedirects, sneic->OutRedirects, itv));
3304
if (CLOSE_MARKUP(a->options)) {
3305
xml_markup_network(tab, CLOSE_XML_MARKUP);
3310
***************************************************************************
3311
* Display TCP network statistics in XML.
3314
* @a Activity structure with statistics.
3315
* @curr Index in array for current sample statistics.
3316
* @tab Indentation in XML output.
3317
* @itv Interval of time in jiffies.
3318
***************************************************************************
3320
__print_funct_t xml_print_net_tcp_stats(struct activity *a, int curr, int tab,
3321
unsigned long long itv)
3323
struct stats_net_tcp
3324
*sntc = (struct stats_net_tcp *) a->buf[curr],
3325
*sntp = (struct stats_net_tcp *) a->buf[!curr];
3327
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3328
goto close_xml_markup;
3330
xml_markup_network(tab, OPEN_XML_MARKUP);
3333
xprintf(tab, "<net-tcp "
3338
S_VALUE(sntp->ActiveOpens, sntc->ActiveOpens, itv),
3339
S_VALUE(sntp->PassiveOpens, sntc->PassiveOpens, itv),
3340
S_VALUE(sntp->InSegs, sntc->InSegs, itv),
3341
S_VALUE(sntp->OutSegs, sntc->OutSegs, itv));
3345
if (CLOSE_MARKUP(a->options)) {
3346
xml_markup_network(tab, CLOSE_XML_MARKUP);
3351
***************************************************************************
3352
* Display TCP network error statistics in XML.
3355
* @a Activity structure with statistics.
3356
* @curr Index in array for current sample statistics.
3357
* @tab Indentation in XML output.
3358
* @itv Interval of time in jiffies.
3359
***************************************************************************
3361
__print_funct_t xml_print_net_etcp_stats(struct activity *a, int curr, int tab,
3362
unsigned long long itv)
3364
struct stats_net_etcp
3365
*snetc = (struct stats_net_etcp *) a->buf[curr],
3366
*snetp = (struct stats_net_etcp *) a->buf[!curr];
3368
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3369
goto close_xml_markup;
3371
xml_markup_network(tab, OPEN_XML_MARKUP);
3374
xprintf(tab, "<net-etcp "
3380
S_VALUE(snetp->AttemptFails, snetc->AttemptFails, itv),
3381
S_VALUE(snetp->EstabResets, snetc->EstabResets, itv),
3382
S_VALUE(snetp->RetransSegs, snetc->RetransSegs, itv),
3383
S_VALUE(snetp->InErrs, snetc->InErrs, itv),
3384
S_VALUE(snetp->OutRsts, snetc->OutRsts, itv));
3388
if (CLOSE_MARKUP(a->options)) {
3389
xml_markup_network(tab, CLOSE_XML_MARKUP);
3394
***************************************************************************
3395
* Display UDP network statistics in XML.
3398
* @a Activity structure with statistics.
3399
* @curr Index in array for current sample statistics.
3400
* @tab Indentation in XML output.
3401
* @itv Interval of time in jiffies.
3402
***************************************************************************
3404
__print_funct_t xml_print_net_udp_stats(struct activity *a, int curr, int tab,
3405
unsigned long long itv)
3407
struct stats_net_udp
3408
*snuc = (struct stats_net_udp *) a->buf[curr],
3409
*snup = (struct stats_net_udp *) a->buf[!curr];
3411
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3412
goto close_xml_markup;
3414
xml_markup_network(tab, OPEN_XML_MARKUP);
3417
xprintf(tab, "<net-udp "
3421
"idgmerr=\"%.2f\"/>",
3422
S_VALUE(snup->InDatagrams, snuc->InDatagrams, itv),
3423
S_VALUE(snup->OutDatagrams, snuc->OutDatagrams, itv),
3424
S_VALUE(snup->NoPorts, snuc->NoPorts, itv),
3425
S_VALUE(snup->InErrors, snuc->InErrors, itv));
3429
if (CLOSE_MARKUP(a->options)) {
3430
xml_markup_network(tab, CLOSE_XML_MARKUP);
3435
***************************************************************************
3436
* Display IPv6 network socket statistics in XML.
3439
* @a Activity structure with statistics.
3440
* @curr Index in array for current sample statistics.
3441
* @tab Indentation in XML output.
3442
* @itv Interval of time in jiffies.
3443
***************************************************************************
3445
__print_funct_t xml_print_net_sock6_stats(struct activity *a, int curr, int tab,
3446
unsigned long long itv)
3448
struct stats_net_sock6
3449
*snsc = (struct stats_net_sock6 *) a->buf[curr];
3451
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3452
goto close_xml_markup;
3454
xml_markup_network(tab, OPEN_XML_MARKUP);
3457
xprintf(tab, "<net-sock6 "
3461
"ip6-frag=\"%u\"/>",
3469
if (CLOSE_MARKUP(a->options)) {
3470
xml_markup_network(tab, CLOSE_XML_MARKUP);
3475
***************************************************************************
3476
* Display IPv6 network statistics in XML.
3479
* @a Activity structure with statistics.
3480
* @curr Index in array for current sample statistics.
3481
* @tab Indentation in XML output.
3482
* @itv Interval of time in jiffies.
3483
***************************************************************************
3485
__print_funct_t xml_print_net_ip6_stats(struct activity *a, int curr, int tab,
3486
unsigned long long itv)
3488
struct stats_net_ip6
3489
*snic = (struct stats_net_ip6 *) a->buf[curr],
3490
*snip = (struct stats_net_ip6 *) a->buf[!curr];
3492
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3493
goto close_xml_markup;
3495
xml_markup_network(tab, OPEN_XML_MARKUP);
3498
xprintf(tab, "<net-ip6 "
3508
"fragcr6=\"%.2f\"/>",
3509
S_VALUE(snip->InReceives6, snic->InReceives6, itv),
3510
S_VALUE(snip->OutForwDatagrams6, snic->OutForwDatagrams6, itv),
3511
S_VALUE(snip->InDelivers6, snic->InDelivers6, itv),
3512
S_VALUE(snip->OutRequests6, snic->OutRequests6, itv),
3513
S_VALUE(snip->ReasmReqds6, snic->ReasmReqds6, itv),
3514
S_VALUE(snip->ReasmOKs6, snic->ReasmOKs6, itv),
3515
S_VALUE(snip->InMcastPkts6, snic->InMcastPkts6, itv),
3516
S_VALUE(snip->OutMcastPkts6, snic->OutMcastPkts6, itv),
3517
S_VALUE(snip->FragOKs6, snic->FragOKs6, itv),
3518
S_VALUE(snip->FragCreates6, snic->FragCreates6, itv));
3522
if (CLOSE_MARKUP(a->options)) {
3523
xml_markup_network(tab, CLOSE_XML_MARKUP);
3528
***************************************************************************
3529
* Display IPv6 network error statistics in XML.
3532
* @a Activity structure with statistics.
3533
* @curr Index in array for current sample statistics.
3534
* @tab Indentation in XML output.
3535
* @itv Interval of time in jiffies.
3536
***************************************************************************
3538
__print_funct_t xml_print_net_eip6_stats(struct activity *a, int curr, int tab,
3539
unsigned long long itv)
3541
struct stats_net_eip6
3542
*sneic = (struct stats_net_eip6 *) a->buf[curr],
3543
*sneip = (struct stats_net_eip6 *) a->buf[!curr];
3545
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3546
goto close_xml_markup;
3548
xml_markup_network(tab, OPEN_XML_MARKUP);
3551
xprintf(tab, "<net-eip6 "
3562
"itrpck6=\"%.2f\"/>",
3563
S_VALUE(sneip->InHdrErrors6, sneic->InHdrErrors6, itv),
3564
S_VALUE(sneip->InAddrErrors6, sneic->InAddrErrors6, itv),
3565
S_VALUE(sneip->InUnknownProtos6, sneic->InUnknownProtos6, itv),
3566
S_VALUE(sneip->InTooBigErrors6, sneic->InTooBigErrors6, itv),
3567
S_VALUE(sneip->InDiscards6, sneic->InDiscards6, itv),
3568
S_VALUE(sneip->OutDiscards6, sneic->OutDiscards6, itv),
3569
S_VALUE(sneip->InNoRoutes6, sneic->InNoRoutes6, itv),
3570
S_VALUE(sneip->OutNoRoutes6, sneic->OutNoRoutes6, itv),
3571
S_VALUE(sneip->ReasmFails6, sneic->ReasmFails6, itv),
3572
S_VALUE(sneip->FragFails6, sneic->FragFails6, itv),
3573
S_VALUE(sneip->InTruncatedPkts6, sneic->InTruncatedPkts6, itv));
3577
if (CLOSE_MARKUP(a->options)) {
3578
xml_markup_network(tab, CLOSE_XML_MARKUP);
3583
***************************************************************************
3584
* Display ICMPv6 network statistics in XML.
3587
* @a Activity structure with statistics.
3588
* @curr Index in array for current sample statistics.
3589
* @tab Indentation in XML output.
3590
* @itv Interval of time in jiffies.
3591
***************************************************************************
3593
__print_funct_t xml_print_net_icmp6_stats(struct activity *a, int curr, int tab,
3594
unsigned long long itv)
3596
struct stats_net_icmp6
3597
*snic = (struct stats_net_icmp6 *) a->buf[curr],
3598
*snip = (struct stats_net_icmp6 *) a->buf[!curr];
3600
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3601
goto close_xml_markup;
3603
xml_markup_network(tab, OPEN_XML_MARKUP);
3606
xprintf(tab, "<net-icmp6 "
3623
"onbad6=\"%.2f\"/>",
3624
S_VALUE(snip->InMsgs6, snic->InMsgs6, itv),
3625
S_VALUE(snip->OutMsgs6, snic->OutMsgs6, itv),
3626
S_VALUE(snip->InEchos6, snic->InEchos6, itv),
3627
S_VALUE(snip->InEchoReplies6, snic->InEchoReplies6, itv),
3628
S_VALUE(snip->OutEchoReplies6, snic->OutEchoReplies6, itv),
3629
S_VALUE(snip->InGroupMembQueries6, snic->InGroupMembQueries6, itv),
3630
S_VALUE(snip->InGroupMembResponses6, snic->InGroupMembResponses6, itv),
3631
S_VALUE(snip->OutGroupMembResponses6, snic->OutGroupMembResponses6, itv),
3632
S_VALUE(snip->InGroupMembReductions6, snic->InGroupMembReductions6, itv),
3633
S_VALUE(snip->OutGroupMembReductions6, snic->OutGroupMembReductions6, itv),
3634
S_VALUE(snip->InRouterSolicits6, snic->InRouterSolicits6, itv),
3635
S_VALUE(snip->OutRouterSolicits6, snic->OutRouterSolicits6, itv),
3636
S_VALUE(snip->InRouterAdvertisements6, snic->InRouterAdvertisements6, itv),
3637
S_VALUE(snip->InNeighborSolicits6, snic->InNeighborSolicits6, itv),
3638
S_VALUE(snip->OutNeighborSolicits6, snic->OutNeighborSolicits6, itv),
3639
S_VALUE(snip->InNeighborAdvertisements6, snic->InNeighborAdvertisements6, itv),
3640
S_VALUE(snip->OutNeighborAdvertisements6, snic->OutNeighborAdvertisements6, itv));
3644
if (CLOSE_MARKUP(a->options)) {
3645
xml_markup_network(tab, CLOSE_XML_MARKUP);
3650
***************************************************************************
3651
* Display ICMPv6 error message statistics in XML.
3654
* @a Activity structure with statistics.
3655
* @curr Index in array for current sample statistics.
3656
* @tab Indentation in XML output.
3657
* @itv Interval of time in jiffies.
3658
***************************************************************************
3660
__print_funct_t xml_print_net_eicmp6_stats(struct activity *a, int curr, int tab,
3661
unsigned long long itv)
3663
struct stats_net_eicmp6
3664
*sneic = (struct stats_net_eicmp6 *) a->buf[curr],
3665
*sneip = (struct stats_net_eicmp6 *) a->buf[!curr];
3667
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3668
goto close_xml_markup;
3670
xml_markup_network(tab, OPEN_XML_MARKUP);
3673
xprintf(tab, "<net-eicmp6 "
3684
"opck2b6=\"%.2f\"/>",
3685
S_VALUE(sneip->InErrors6, sneic->InErrors6, itv),
3686
S_VALUE(sneip->InDestUnreachs6, sneic->InDestUnreachs6, itv),
3687
S_VALUE(sneip->OutDestUnreachs6, sneic->OutDestUnreachs6, itv),
3688
S_VALUE(sneip->InTimeExcds6, sneic->InTimeExcds6, itv),
3689
S_VALUE(sneip->OutTimeExcds6, sneic->OutTimeExcds6, itv),
3690
S_VALUE(sneip->InParmProblems6, sneic->InParmProblems6, itv),
3691
S_VALUE(sneip->OutParmProblems6, sneic->OutParmProblems6, itv),
3692
S_VALUE(sneip->InRedirects6, sneic->InRedirects6, itv),
3693
S_VALUE(sneip->OutRedirects6, sneic->OutRedirects6, itv),
3694
S_VALUE(sneip->InPktTooBigs6, sneic->InPktTooBigs6, itv),
3695
S_VALUE(sneip->OutPktTooBigs6, sneic->OutPktTooBigs6, itv));
3699
if (CLOSE_MARKUP(a->options)) {
3700
xml_markup_network(tab, CLOSE_XML_MARKUP);
3705
***************************************************************************
3706
* Display UDPv6 network statistics in XML.
3709
* @a Activity structure with statistics.
3710
* @curr Index in array for current sample statistics.
3711
* @tab Indentation in XML output.
3712
* @itv Interval of time in jiffies.
3713
***************************************************************************
3715
__print_funct_t xml_print_net_udp6_stats(struct activity *a, int curr, int tab,
3716
unsigned long long itv)
3718
struct stats_net_udp6
3719
*snuc = (struct stats_net_udp6 *) a->buf[curr],
3720
*snup = (struct stats_net_udp6 *) a->buf[!curr];
3722
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3723
goto close_xml_markup;
3725
xml_markup_network(tab, OPEN_XML_MARKUP);
3728
xprintf(tab, "<net-udp6 "
3732
"idgmer6=\"%.2f\"/>",
3733
S_VALUE(snup->InDatagrams6, snuc->InDatagrams6, itv),
3734
S_VALUE(snup->OutDatagrams6, snuc->OutDatagrams6, itv),
3735
S_VALUE(snup->NoPorts6, snuc->NoPorts6, itv),
3736
S_VALUE(snup->InErrors6, snuc->InErrors6, itv));
3740
if (CLOSE_MARKUP(a->options)) {
3741
xml_markup_network(tab, CLOSE_XML_MARKUP);
3746
***************************************************************************
3747
* Display CPU frequency statistics in XML.
3750
* @a Activity structure with statistics.
3751
* @curr Index in array for current sample statistics.
3752
* @tab Indentation in XML output.
3753
* @itv Interval of time in jiffies.
3754
***************************************************************************
3756
__print_funct_t xml_print_pwr_cpufreq_stats(struct activity *a, int curr, int tab,
3757
unsigned long long itv)
3760
struct stats_pwr_cpufreq *spc;
3763
if (!IS_SELECTED(a->options) || (a->nr <= 0))
3764
goto close_xml_markup;
3766
xml_markup_power_management(tab, OPEN_XML_MARKUP);
3769
xprintf(tab++, "<cpu-frequency unit=\"MHz\">");
3771
for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
3773
spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize);
3775
/* Should current CPU (including CPU "all") be displayed? */
3776
if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
3778
/* Yes: Display it */
3780
/* This is CPU "all" */
3781
strcpy(cpuno, "all");
3784
sprintf(cpuno, "%d", i - 1);
3787
xprintf(tab, "<cpu number=\"%s\" "
3788
"frequency=\"%.2f\"/>",
3790
((double) spc->cpufreq) / 100);
3794
xprintf(--tab, "</cpu-frequency>");
3798
if (CLOSE_MARKUP(a->options)) {
3799
xml_markup_power_management(tab, CLOSE_XML_MARKUP);