2 * raw_stats.c: Functions used by sar to display statistics in raw format.
3 * (C) 1999-2017 by Sebastien GODARD (sysstat <at> orange.fr)
5 ***************************************************************************
6 * This program is free software; you can redistribute it and/or modify it *
7 * under the terms of the GNU General Public License as published by the *
8 * Free Software Foundation; either version 2 of the License, or (at your *
9 * option) any later version. *
11 * This program is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY *
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
16 * You should have received a copy of the GNU General Public License along *
17 * with this program; if not, write to the Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA *
19 ***************************************************************************
29 #include "raw_stats.h"
31 extern unsigned int flags;
32 extern unsigned int dm_major;
35 ***************************************************************************
36 * Display current field name.
39 * @hdr_line On the first call, complete header line, containing all the
40 * metric names. In each subsequent call, must be NULL.
41 * @pos Index in @hdr_line string, 0 being the first one (headers
42 * are delimited by the '|' character).
45 * Pointer on string containing field name.
46 ***************************************************************************
48 char *pfield(char *hdr_line, int pos)
50 char hline[HEADER_LINE_LEN] = "";
51 static char field[HEADER_LINE_LEN] = "";
57 strncpy(hline, hdr_line, HEADER_LINE_LEN - 1);
58 hline[HEADER_LINE_LEN - 1] = '\0';
61 for (hl = strtok(hline, "|"); hl && (pos > 0); hl = strtok(NULL, "|"), pos--);
63 /* Bad @pos arg given to function */
67 if (strchr(hl, '&')) {
74 /* Display current field */
75 if (strchr(field + idx, ';')) {
76 j = strcspn(field + idx, ";");
77 *(field + idx + j) = '\0';
86 ***************************************************************************
87 * Display field values.
90 * @valp Field's value from previous statistics sample.
91 * @valc Field's value from current statistics sample.
92 ***************************************************************************
94 void pval(unsigned long long valp, unsigned long long valc)
96 printf("%llu>%llu", valp, valc);
97 if (DISPLAY_HINTS(flags)) {
99 /* Field's value has decreased */
106 ***************************************************************************
107 * Display CPU statistics in raw format.
110 * @a Activity structure with statistics.
111 * @timestr Time for current statistics sample.
112 * @curr Index in array for current statistics sample.
113 ***************************************************************************
115 __print_funct_t raw_print_cpu_stats(struct activity *a, char *timestr, int curr)
118 struct stats_cpu *scc, *scp;
120 for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
123 * The size of a->buf[...] CPU structure may be different from the default
124 * sizeof(struct stats_cpu) value if data have been read from a file!
125 * That's why we don't use a syntax like:
126 * scc = (struct stats_cpu *) a->buf[...] + i;
128 scc = (struct stats_cpu *) ((char *) a->buf[curr] + i * a->msize);
129 scp = (struct stats_cpu *) ((char *) a->buf[!curr] + i * a->msize);
132 * Note: a->nr is in [1, NR_CPUS + 1].
133 * Bitmap size is provided for (NR_CPUS + 1) CPUs.
134 * Anyway, NR_CPUS may vary between the version of sysstat
135 * used by sadc to create a file, and the version of sysstat
136 * used by sar to read it...
139 /* Should current CPU (including CPU "all") be displayed? */
140 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))))
144 /* Yes: Display it */
145 printf("%s %s:%d", timestr,
146 pfield(a->hdr_line, DISPLAY_CPU_ALL(a->opt_flags)), i - 1);
148 if (DISPLAY_HINTS(flags) && i) {
149 if ((scc->cpu_user + scc->cpu_nice + scc->cpu_sys +
150 scc->cpu_iowait + scc->cpu_idle + scc->cpu_steal +
151 scc->cpu_hardirq + scc->cpu_softirq) == 0) {
156 if (!get_per_cpu_interval(scc, scp)) {
157 /* CPU is tickless */
163 if (DISPLAY_CPU_DEF(a->opt_flags)) {
164 printf(" %s:", pfield(NULL, 0));
165 pval(scp->cpu_user, scc->cpu_user);
166 printf(" %s:", pfield(NULL, 0));
167 pval(scp->cpu_nice, scc->cpu_nice);
168 printf(" %s:", pfield(NULL, 0));
169 pval(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq,
170 scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq);
171 printf(" %s:", pfield(NULL, 0));
172 pval(scp->cpu_iowait, scc->cpu_iowait);
173 printf(" %s:", pfield(NULL, 0));
174 pval(scp->cpu_steal, scc->cpu_steal);
175 printf(" %s:", pfield(NULL, 0));
176 pval(scp->cpu_idle, scc->cpu_idle);
178 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
179 printf(" %s:", pfield(NULL, 0));
180 pval(scp->cpu_user - scp->cpu_guest, scc->cpu_user - scc->cpu_guest);
181 printf(" %s:", pfield(NULL, 0));
182 pval(scp->cpu_nice - scp->cpu_guest_nice, scc->cpu_nice - scc->cpu_guest_nice);
183 printf(" %s:", pfield(NULL, 0));
184 pval(scp->cpu_sys, scc->cpu_sys);
185 printf(" %s:", pfield(NULL, 0));
186 pval(scp->cpu_iowait, scc->cpu_iowait);
187 printf(" %s:", pfield(NULL, 0));
188 pval(scp->cpu_steal, scc->cpu_steal);
189 printf(" %s:", pfield(NULL, 0));
190 pval(scp->cpu_hardirq, scc->cpu_hardirq);
191 printf(" %s:", pfield(NULL, 0));
192 pval(scp->cpu_softirq, scc->cpu_softirq);
193 printf(" %s:", pfield(NULL, 0));
194 pval(scp->cpu_guest, scc->cpu_guest);
195 printf(" %s:", pfield(NULL, 0));
196 pval(scp->cpu_guest_nice, scc->cpu_guest_nice);
197 printf(" %s:", pfield(NULL, 0));
198 pval(scp->cpu_idle, scc->cpu_idle);
205 ***************************************************************************
206 * Display tasks creation and context switches statistics in raw format.
209 * @a Activity structure with statistics.
210 * @timestr Time for current statistics sample.
211 * @curr Index in array for current sample statistics.
212 ***************************************************************************
214 __print_funct_t raw_print_pcsw_stats(struct activity *a, char *timestr, int curr)
217 *spc = (struct stats_pcsw *) a->buf[curr],
218 *spp = (struct stats_pcsw *) a->buf[!curr];
220 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
221 pval(spp->processes, spc->processes);
222 printf(" %s:", pfield(NULL, 0));
223 pval(spp->context_switch, spc->context_switch);
228 ***************************************************************************
229 * Display interrupts statistics in raw format.
232 * @a Activity structure with statistics.
233 * @timestr Time for current statistics sample.
234 * @curr Index in array for current sample statistics.
235 ***************************************************************************
237 __print_funct_t raw_print_irq_stats(struct activity *a, char *timestr, int curr)
240 struct stats_irq *sic, *sip;
242 for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
244 sic = (struct stats_irq *) ((char *) a->buf[curr] + i * a->msize);
245 sip = (struct stats_irq *) ((char *) a->buf[!curr] + i * a->msize);
247 /* Should current interrupt (including int "sum") be displayed? */
248 if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
250 /* Yes: Display it */
251 printf("%s %s:%d", timestr,
252 pfield(a->hdr_line, FIRST), i - 1);
253 printf(" %s:", pfield(NULL, 0));
254 pval(sip->irq_nr, sic->irq_nr);
261 ***************************************************************************
262 * Display swapping statistics in raw format.
265 * @a Activity structure with statistics.
266 * @timestr Time for current statistics sample.
267 * @curr Index in array for current sample statistics.
268 ***************************************************************************
270 __print_funct_t raw_print_swap_stats(struct activity *a, char *timestr, int curr)
273 *ssc = (struct stats_swap *) a->buf[curr],
274 *ssp = (struct stats_swap *) a->buf[!curr];
276 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
277 pval(ssp->pswpin, ssc->pswpin);
278 printf(" %s:", pfield(NULL, 0));
279 pval(ssp->pswpout, ssc->pswpout);
284 ***************************************************************************
285 * Display paging statistics in raw format.
288 * @a Activity structure with statistics.
289 * @timestr Time for current statistics sample.
290 * @curr Index in array for current sample statistics.
291 ***************************************************************************
293 __print_funct_t raw_print_paging_stats(struct activity *a, char *timestr, int curr)
296 *spc = (struct stats_paging *) a->buf[curr],
297 *spp = (struct stats_paging *) a->buf[!curr];
299 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
300 pval(spp->pgpgin, spc->pgpgin);
301 printf(" %s:", pfield(NULL, 0));
302 pval(spp->pgpgout, spc->pgpgout);
303 printf(" %s:", pfield(NULL, 0));
304 pval(spp->pgfault, spc->pgfault);
305 printf(" %s:", pfield(NULL, 0));
306 pval(spp->pgmajfault, spc->pgmajfault);
307 printf(" %s:", pfield(NULL, 0));
308 pval(spp->pgfree, spc->pgfree);
309 printf(" %s:", pfield(NULL, 0));
310 pval(spp->pgscan_kswapd, spc->pgscan_kswapd);
311 printf(" %s:", pfield(NULL, 0));
312 pval(spp->pgscan_direct, spc->pgscan_direct);
313 printf(" %s:", pfield(NULL, 0));
314 pval(spp->pgsteal, spc->pgsteal);
319 ***************************************************************************
320 * Display I/O and transfer rate statistics in raw format.
323 * @a Activity structure with statistics.
324 * @timestr Time for current statistics sample.
325 * @curr Index in array for current sample statistics.
326 ***************************************************************************
328 __print_funct_t raw_print_io_stats(struct activity *a, char *timestr, int curr)
331 *sic = (struct stats_io *) a->buf[curr],
332 *sip = (struct stats_io *) a->buf[!curr];
334 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
335 pval(sip->dk_drive, sic->dk_drive);
336 printf(" %s:", pfield(NULL, 0));
337 pval(sip->dk_drive_rio, sic->dk_drive_rio);
338 printf(" %s:", pfield(NULL, 0));
339 pval(sip->dk_drive_wio, sic->dk_drive_wio);
340 printf(" %s:", pfield(NULL, 0));
341 pval(sip->dk_drive_rblk, sic->dk_drive_rblk);
342 printf(" %s:", pfield(NULL, 0));
343 pval(sip->dk_drive_wblk, sic->dk_drive_wblk);
348 ***************************************************************************
349 * Display memory statistics in raw format.
352 * @a Activity structure with statistics.
353 * @timestr Time for current statistics sample.
354 * @curr Index in array for current sample statistics.
355 ***************************************************************************
357 __print_funct_t raw_print_memory_stats(struct activity *a, char *timestr, int curr)
360 *smc = (struct stats_memory *) a->buf[curr];
362 if (DISPLAY_MEM_AMT(a->opt_flags)) {
363 printf("%s %s:%lu", timestr, pfield(a->hdr_line, SECOND), smc->frmkb);
364 printf(" %s:%lu", pfield(NULL, 0), smc->availablekb);
365 printf(" kbttlmem:%lu", smc->tlmkb);
366 pfield(NULL, 0); /* Skip kbmemused */
367 pfield(NULL, 0); /* Skip %memused */
368 printf(" %s:%lu", pfield(NULL, 0), smc->bufkb);
369 printf(" %s:%lu", pfield(NULL, 0), smc->camkb);
370 printf(" %s:%lu", pfield(NULL, 0), smc->comkb);
371 pfield(NULL, 0); /* Skip %commit */
372 printf(" %s:%lu", pfield(NULL, 0), smc->activekb);
373 printf(" %s:%lu", pfield(NULL, 0), smc->inactkb);
374 printf(" %s:%lu", pfield(NULL, 0), smc->dirtykb);
376 if (DISPLAY_MEM_ALL(a->opt_flags)) {
377 printf(" %s:%lu", pfield(NULL, 0), smc->anonpgkb);
378 printf(" %s:%lu", pfield(NULL, 0), smc->slabkb);
379 printf(" %s:%lu", pfield(NULL, 0), smc->kstackkb);
380 printf(" %s:%lu", pfield(NULL, 0), smc->pgtblkb);
381 printf(" %s:%lu", pfield(NULL, 0), smc->vmusedkb);
386 if (DISPLAY_SWAP(a->opt_flags)) {
387 printf("%s %s:%lu", timestr, pfield(a->hdr_line, THIRD), smc->frskb);
388 printf(" kbttlswp:%lu", smc->tlskb);
389 pfield(NULL, 0); /* Skip kbswpused */
390 pfield(NULL, 0); /* Skip %swpused */
391 printf(" %s:%lu", pfield(NULL, 0), smc->caskb);
397 ***************************************************************************
398 * Display kernel tables statistics in raw format.
401 * @a Activity structure with statistics.
402 * @timestr Time for current statistics sample.
403 * @curr Index in array for current sample statistics.
404 ***************************************************************************
406 __print_funct_t raw_print_ktables_stats(struct activity *a, char *timestr, int curr)
409 *skc = (struct stats_ktables *) a->buf[curr];
411 printf("%s %s:%u", timestr, pfield(a->hdr_line, FIRST), skc->dentry_stat);
412 printf(" %s:%u", pfield(NULL, 0), skc->file_used);
413 printf(" %s:%u", pfield(NULL, 0), skc->inode_used);
414 printf(" %s:%u", pfield(NULL, 0), skc->pty_nr);
419 ***************************************************************************
420 * Display queue and load statistics in raw format.
423 * @a Activity structure with statistics.
424 * @timestr Time for current statistics sample.
425 * @curr Index in array for current sample statistics.
426 ***************************************************************************
428 __print_funct_t raw_print_queue_stats(struct activity *a, char *timestr, int curr)
431 *sqc = (struct stats_queue *) a->buf[curr];
433 printf("%s %s:%lu", timestr, pfield(a->hdr_line, FIRST), sqc->nr_running);
434 printf(" %s:%u", pfield(NULL, 0), sqc->nr_threads);
435 printf(" %s:%u", pfield(NULL, 0), sqc->load_avg_1);
436 printf(" %s:%u", pfield(NULL, 0), sqc->load_avg_5);
437 printf(" %s:%u", pfield(NULL, 0), sqc->load_avg_15);
438 printf(" %s:%lu", pfield(NULL, 0), sqc->procs_blocked);
443 ***************************************************************************
444 * Display serial lines statistics in raw format.
447 * @a Activity structure with statistics.
448 * @timestr Time for current statistics sample.
449 * @curr Index in array for current sample statistics.
450 ***************************************************************************
452 __print_funct_t raw_print_serial_stats(struct activity *a, char *timestr, int curr)
455 struct stats_serial *ssc, *ssp;
457 for (i = 0; i < a->nr; i++) {
459 ssc = (struct stats_serial *) ((char *) a->buf[curr] + i * a->msize);
460 ssp = (struct stats_serial *) ((char *) a->buf[!curr] + i * a->msize);
462 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
463 pval(ssp->line, ssc->line);
465 if (ssc->line == 0) {
466 if (DISPLAY_HINTS(flags)) {
473 if (ssc->line == ssp->line) {
474 printf(" %s:", pfield(NULL, 0));
475 pval(ssp->rx, ssc->rx);
476 printf(" %s:", pfield(NULL, 0));
477 pval(ssp->tx, ssc->tx);
478 printf(" %s:", pfield(NULL, 0));
479 pval(ssp->frame, ssc->frame);
480 printf(" %s:", pfield(NULL, 0));
481 pval(ssp->parity, ssc->parity);
482 printf(" %s:", pfield(NULL, 0));
483 pval(ssp->brk, ssc->brk);
484 printf(" %s:", pfield(NULL, 0));
485 pval(ssp->overrun, ssc->overrun);
487 else if (DISPLAY_HINTS(flags)) {
496 ***************************************************************************
497 * Display disks statistics in raw format.
500 * @a Activity structure with statistics.
501 * @timestr Time for current statistics sample.
502 * @curr Index in array for current sample statistics.
503 ***************************************************************************
505 __print_funct_t raw_print_disk_stats(struct activity *a, char *timestr, int curr)
508 struct stats_disk *sdc, *sdp, sdpzero;
509 char *dev_name, *persist_dev_name;
511 memset(&sdpzero, 0, STATS_DISK_SIZE);
513 for (i = 0; i < a->nr; i++) {
515 sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize);
517 printf("%s major:%u minor:%u", timestr, sdc->major, sdc->minor);
519 if (!(sdc->major + sdc->minor)) {
520 if (DISPLAY_HINTS(flags)) {
527 j = check_disk_reg(a, curr, !curr, i);
529 /* This is a newly registered interface. Previous stats are zero */
531 if (DISPLAY_HINTS(flags)) {
536 sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
540 persist_dev_name = NULL;
542 if (DISPLAY_PERSIST_NAME_S(flags)) {
543 persist_dev_name = get_persistent_name_from_pretty(get_devname(sdc->major, sdc->minor, TRUE));
546 if (persist_dev_name) {
547 dev_name = persist_dev_name;
550 /* Always use pretty option (-p) */
551 if (sdc->major == dm_major) {
552 dev_name = transform_devmapname(sdc->major, sdc->minor);
556 dev_name = get_devname(sdc->major, sdc->minor, TRUE);
560 printf(" %s:%s", pfield(a->hdr_line, FIRST), dev_name);
561 printf(" %s:", pfield(NULL, 0));
562 pval(sdp->nr_ios, sdc->nr_ios);
563 printf(" %s:", pfield(NULL, 0));
564 pval(sdp->rd_sect, sdc->rd_sect);
565 printf(" %s:", pfield(NULL, 0));
566 pval(sdp->wr_sect, sdc->wr_sect);
567 printf(" tot_ticks:");
568 pval(sdp->tot_ticks, sdc->tot_ticks);
569 pfield(NULL, 0); /* Skip avgrq-sz */
570 printf(" %s:", pfield(NULL, 0));
571 pval(sdp->rq_ticks, sdc->rq_ticks);
577 ***************************************************************************
578 * Display network interfaces statistics in raw format.
581 * @a Activity structure with statistics.
582 * @timestr Time for current statistics sample.
583 * @curr Index in array for current sample statistics.
584 ***************************************************************************
586 __print_funct_t raw_print_net_dev_stats(struct activity *a, char *timestr, int curr)
589 struct stats_net_dev *sndc, *sndp, sndzero;
591 memset(&sndzero, 0, STATS_NET_DEV_SIZE);
593 for (i = 0; i < a->nr; i++) {
595 sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize);
597 if (!strcmp(sndc->interface, ""))
600 printf("%s %s:%s", timestr, pfield(a->hdr_line, FIRST), sndc->interface);
602 j = check_net_dev_reg(a, curr, !curr, i);
604 /* This is a newly registered interface. Previous stats are zero */
606 if (DISPLAY_HINTS(flags)) {
611 sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize);
614 printf(" %s:", pfield(NULL, 0));
615 pval(sndp->rx_packets, sndc->rx_packets);
616 printf(" %s:", pfield(NULL, 0));
617 pval(sndp->tx_packets, sndc->tx_packets);
618 printf(" %s:", pfield(NULL, 0));
619 pval(sndp->rx_bytes, sndc->rx_bytes);
620 printf(" %s:", pfield(NULL, 0));
621 pval(sndp->tx_bytes, sndc->tx_bytes);
622 printf(" %s:", pfield(NULL, 0));
623 pval(sndp->rx_compressed, sndc->rx_compressed);
624 printf(" %s:", pfield(NULL, 0));
625 pval(sndp->tx_compressed, sndc->tx_compressed);
626 printf(" %s:", pfield(NULL, 0));
627 pval(sndp->multicast, sndc->multicast);
628 printf(" speed:%u duplex:%u\n", sndc->speed, sndc->duplex);
633 ***************************************************************************
634 * Display network interfaces errors statistics in raw format.
637 * @a Activity structure with statistics.
638 * @timestr Time for current statistics sample.
639 * @curr Index in array for current sample statistics.
640 ***************************************************************************
642 __print_funct_t raw_print_net_edev_stats(struct activity *a, char *timestr, int curr)
645 struct stats_net_edev *snedc, *snedp, snedzero;
647 memset(&snedzero, 0, STATS_NET_EDEV_SIZE);
649 for (i = 0; i < a->nr; i++) {
651 snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize);
653 if (!strcmp(snedc->interface, ""))
656 printf("%s %s:%s", timestr, pfield(a->hdr_line, FIRST), snedc->interface);
658 j = check_net_edev_reg(a, curr, !curr, i);
660 /* This is a newly registered interface. Previous stats are zero */
662 if (DISPLAY_HINTS(flags)) {
667 snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize);
670 printf(" %s:", pfield(NULL, 0));
671 pval(snedp->rx_errors, snedc->rx_errors);
672 printf(" %s:", pfield(NULL, 0));
673 pval(snedp->tx_errors, snedc->tx_errors);
674 printf(" %s:", pfield(NULL, 0));
675 pval(snedp->collisions, snedc->collisions);
676 printf(" %s:", pfield(NULL, 0));
677 pval(snedp->rx_dropped, snedc->rx_dropped);
678 printf(" %s:", pfield(NULL, 0));
679 pval(snedp->tx_dropped, snedc->tx_dropped);
680 printf(" %s:", pfield(NULL, 0));
681 pval(snedp->tx_carrier_errors, snedc->tx_carrier_errors);
682 printf(" %s:", pfield(NULL, 0));
683 pval(snedp->rx_frame_errors, snedc->rx_frame_errors);
684 printf(" %s:", pfield(NULL, 0));
685 pval(snedp->rx_fifo_errors, snedc->rx_fifo_errors);
686 printf(" %s:", pfield(NULL, 0));
687 pval(snedp->tx_fifo_errors, snedc->tx_fifo_errors);
693 ***************************************************************************
694 * Display NFS client statistics in raw format.
697 * @a Activity structure with statistics.
698 * @timestr Time for current statistics sample.
699 * @curr Index in array for current sample statistics.
700 ***************************************************************************
702 __print_funct_t raw_print_net_nfs_stats(struct activity *a, char *timestr, int curr)
705 *snnc = (struct stats_net_nfs *) a->buf[curr],
706 *snnp = (struct stats_net_nfs *) a->buf[!curr];
708 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
709 pval(snnp->nfs_rpccnt, snnc->nfs_rpccnt);
710 printf(" %s:", pfield(NULL, 0));
711 pval(snnp->nfs_rpcretrans, snnc->nfs_rpcretrans);
712 printf(" %s:", pfield(NULL, 0));
713 pval(snnp->nfs_readcnt, snnc->nfs_readcnt);
714 printf(" %s:", pfield(NULL, 0));
715 pval(snnp->nfs_writecnt, snnc->nfs_writecnt);
716 printf(" %s:", pfield(NULL, 0));
717 pval(snnp->nfs_accesscnt, snnc->nfs_accesscnt);
718 printf(" %s:", pfield(NULL, 0));
719 pval(snnp->nfs_getattcnt, snnc->nfs_getattcnt);
724 ***************************************************************************
725 * Display NFS server statistics in raw format.
728 * @a Activity structure with statistics.
729 * @timestr Time for current statistics sample.
730 * @curr Index in array for current sample statistics.
731 ***************************************************************************
733 __print_funct_t raw_print_net_nfsd_stats(struct activity *a, char *timestr, int curr)
735 struct stats_net_nfsd
736 *snndc = (struct stats_net_nfsd *) a->buf[curr],
737 *snndp = (struct stats_net_nfsd *) a->buf[!curr];
739 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
740 pval(snndp->nfsd_rpccnt, snndc->nfsd_rpccnt);
741 printf(" %s:", pfield(NULL, 0));
742 pval(snndp->nfsd_rpcbad, snndc->nfsd_rpcbad);
743 printf(" %s:", pfield(NULL, 0));
744 pval(snndp->nfsd_netcnt, snndc->nfsd_netcnt);
745 printf(" %s:", pfield(NULL, 0));
746 pval(snndp->nfsd_netudpcnt, snndc->nfsd_netudpcnt);
747 printf(" %s:", pfield(NULL, 0));
748 pval(snndp->nfsd_nettcpcnt, snndc->nfsd_nettcpcnt);
749 printf(" %s:", pfield(NULL, 0));
750 pval(snndp->nfsd_rchits, snndc->nfsd_rchits);
751 printf(" %s:", pfield(NULL, 0));
752 pval(snndp->nfsd_rcmisses, snndc->nfsd_rcmisses);
753 printf(" %s:", pfield(NULL, 0));
754 pval(snndp->nfsd_readcnt, snndc->nfsd_readcnt);
755 printf(" %s:", pfield(NULL, 0));
756 pval(snndp->nfsd_writecnt, snndc->nfsd_writecnt);
757 printf(" %s:", pfield(NULL, 0));
758 pval(snndp->nfsd_accesscnt, snndc->nfsd_accesscnt);
759 printf(" %s:", pfield(NULL, 0));
760 pval(snndp->nfsd_getattcnt, snndc->nfsd_getattcnt);
765 ***************************************************************************
766 * Display network socket statistics in raw format.
769 * @a Activity structure with statistics.
770 * @timestr Time for current statistics sample.
771 * @curr Index in array for current sample statistics.
772 ***************************************************************************
774 __print_funct_t raw_print_net_sock_stats(struct activity *a, char *timestr, int curr)
776 struct stats_net_sock
777 *snsc = (struct stats_net_sock *) a->buf[curr];
779 printf("%s %s:%u", timestr, pfield(a->hdr_line, FIRST), snsc->sock_inuse);
780 printf(" %s:%u", pfield(NULL, 0), snsc->tcp_inuse);
781 printf(" %s:%u", pfield(NULL, 0), snsc->udp_inuse);
782 printf(" %s:%u", pfield(NULL, 0), snsc->raw_inuse);
783 printf(" %s:%u", pfield(NULL, 0), snsc->frag_inuse);
784 printf(" %s:%u", pfield(NULL, 0), snsc->tcp_tw);
789 ***************************************************************************
790 * Display IP network statistics in raw format.
793 * @a Activity structure with statistics.
794 * @timestr Time for current statistics sample.
795 * @curr Index in array for current sample statistics.
796 ***************************************************************************
798 __print_funct_t raw_print_net_ip_stats(struct activity *a, char *timestr, int curr)
801 *snic = (struct stats_net_ip *) a->buf[curr],
802 *snip = (struct stats_net_ip *) a->buf[!curr];
804 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
805 pval(snip->InReceives, snic->InReceives);
806 printf(" %s:", pfield(NULL, 0));
807 pval(snip->ForwDatagrams, snic->ForwDatagrams);
808 printf(" %s:", pfield(NULL, 0));
809 pval(snip->InDelivers, snic->InDelivers);
810 printf(" %s:", pfield(NULL, 0));
811 pval(snip->OutRequests, snic->OutRequests);
812 printf(" %s:", pfield(NULL, 0));
813 pval(snip->ReasmReqds, snic->ReasmReqds);
814 printf(" %s:", pfield(NULL, 0));
815 pval(snip->ReasmOKs, snic->ReasmOKs);
816 printf(" %s:", pfield(NULL, 0));
817 pval(snip->FragOKs, snic->FragOKs);
818 printf(" %s:", pfield(NULL, 0));
819 pval(snip->FragCreates, snic->FragCreates);
824 ***************************************************************************
825 * Display IP network errors statistics in raw format.
828 * @a Activity structure with statistics.
829 * @timestr Time for current statistics sample.
830 * @curr Index in array for current sample statistics.
831 ***************************************************************************
833 __print_funct_t raw_print_net_eip_stats(struct activity *a, char *timestr, int curr)
836 *sneic = (struct stats_net_eip *) a->buf[curr],
837 *sneip = (struct stats_net_eip *) a->buf[!curr];
839 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
840 pval(sneip->InHdrErrors, sneic->InHdrErrors);
841 printf(" %s:", pfield(NULL, 0));
842 pval(sneip->InAddrErrors, sneic->InAddrErrors);
843 printf(" %s:", pfield(NULL, 0));
844 pval(sneip->InUnknownProtos, sneic->InUnknownProtos);
845 printf(" %s:", pfield(NULL, 0));
846 pval(sneip->InDiscards, sneic->InDiscards);
847 printf(" %s:", pfield(NULL, 0));
848 pval(sneip->OutDiscards, sneic->OutDiscards);
849 printf(" %s:", pfield(NULL, 0));
850 pval(sneip->OutNoRoutes, sneic->OutNoRoutes);
851 printf(" %s:", pfield(NULL, 0));
852 pval(sneip->ReasmFails, sneic->ReasmFails);
853 printf(" %s:", pfield(NULL, 0));
854 pval(sneip->FragFails, sneic->FragFails);
859 ***************************************************************************
860 * Display ICMP network statistics in raw format.
863 * @a Activity structure with statistics.
864 * @timestr Time for current statistics sample.
865 * @curr Index in array for current sample statistics.
866 ***************************************************************************
868 __print_funct_t raw_print_net_icmp_stats(struct activity *a, char *timestr, int curr)
870 struct stats_net_icmp
871 *snic = (struct stats_net_icmp *) a->buf[curr],
872 *snip = (struct stats_net_icmp *) a->buf[!curr];
874 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
875 pval((unsigned long long) snip->InMsgs, (unsigned long long) snic->InMsgs);
876 printf(" %s:", pfield(NULL, 0));
877 pval((unsigned long long) snip->OutMsgs, (unsigned long long) snic->OutMsgs);
878 printf(" %s:", pfield(NULL, 0));
879 pval((unsigned long long) snip->InEchos, (unsigned long long) snic->InEchos);
880 printf(" %s:", pfield(NULL, 0));
881 pval((unsigned long long) snip->InEchoReps, (unsigned long long) snic->InEchoReps);
882 printf(" %s:", pfield(NULL, 0));
883 pval((unsigned long long) snip->OutEchos, (unsigned long long) snic->OutEchos);
884 printf(" %s:", pfield(NULL, 0));
885 pval((unsigned long long) snip->OutEchoReps, (unsigned long long) snic->OutEchoReps);
886 printf(" %s:", pfield(NULL, 0));
887 pval((unsigned long long) snip->InTimestamps, (unsigned long long) snic->InTimestamps);
888 printf(" %s:", pfield(NULL, 0));
889 pval((unsigned long long) snip->InTimestampReps, (unsigned long long) snic->InTimestampReps);
890 printf(" %s:", pfield(NULL, 0));
891 pval((unsigned long long) snip->OutTimestamps, (unsigned long long) snic->OutTimestamps);
892 printf(" %s:", pfield(NULL, 0));
893 pval((unsigned long long) snip->OutTimestampReps, (unsigned long long) snic->OutTimestampReps);
894 printf(" %s:", pfield(NULL, 0));
895 pval((unsigned long long) snip->InAddrMasks, (unsigned long long) snic->InAddrMasks);
896 printf(" %s:", pfield(NULL, 0));
897 pval((unsigned long long) snip->InAddrMaskReps, (unsigned long long) snic->InAddrMaskReps);
898 printf(" %s:", pfield(NULL, 0));
899 pval((unsigned long long) snip->OutAddrMasks, (unsigned long long) snic->OutAddrMasks);
900 printf(" %s:", pfield(NULL, 0));
901 pval((unsigned long long) snip->OutAddrMaskReps, (unsigned long long) snic->OutAddrMaskReps);
906 ***************************************************************************
907 * Display ICMP errors message statistics in raw format.
910 * @a Activity structure with statistics.
911 * @timestr Time for current statistics sample.
912 * @curr Index in array for current sample statistics.
913 ***************************************************************************
915 __print_funct_t raw_print_net_eicmp_stats(struct activity *a, char *timestr, int curr)
917 struct stats_net_eicmp
918 *sneic = (struct stats_net_eicmp *) a->buf[curr],
919 *sneip = (struct stats_net_eicmp *) a->buf[!curr];
921 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
922 pval((unsigned long long) sneip->InErrors, (unsigned long long) sneic->InErrors);
923 printf(" %s:", pfield(NULL, 0));
924 pval((unsigned long long) sneip->OutErrors, (unsigned long long) sneic->OutErrors);
925 printf(" %s:", pfield(NULL, 0));
926 pval((unsigned long long) sneip->InDestUnreachs, (unsigned long long) sneic->InDestUnreachs);
927 printf(" %s:", pfield(NULL, 0));
928 pval((unsigned long long) sneip->OutDestUnreachs, (unsigned long long) sneic->OutDestUnreachs);
929 printf(" %s:", pfield(NULL, 0));
930 pval((unsigned long long) sneip->InTimeExcds, (unsigned long long) sneic->InTimeExcds);
931 printf(" %s:", pfield(NULL, 0));
932 pval((unsigned long long) sneip->OutTimeExcds, (unsigned long long) sneic->OutTimeExcds);
933 printf(" %s:", pfield(NULL, 0));
934 pval((unsigned long long) sneip->InParmProbs, (unsigned long long) sneic->InParmProbs);
935 printf(" %s:", pfield(NULL, 0));
936 pval((unsigned long long) sneip->OutParmProbs, (unsigned long long) sneic->OutParmProbs);
937 printf(" %s:", pfield(NULL, 0));
938 pval((unsigned long long) sneip->InSrcQuenchs, (unsigned long long) sneic->InSrcQuenchs);
939 printf(" %s:", pfield(NULL, 0));
940 pval((unsigned long long) sneip->OutSrcQuenchs, (unsigned long long) sneic->OutSrcQuenchs);
941 printf(" %s:", pfield(NULL, 0));
942 pval((unsigned long long) sneip->InRedirects, (unsigned long long) sneic->InRedirects);
943 printf(" %s:", pfield(NULL, 0));
944 pval((unsigned long long) sneip->OutRedirects, (unsigned long long) sneic->OutRedirects);
949 ***************************************************************************
950 * Display TCP network statistics in raw format.
953 * @a Activity structure with statistics.
954 * @timestr Time for current statistics sample.
955 * @curr Index in array for current sample statistics.
956 ***************************************************************************
958 __print_funct_t raw_print_net_tcp_stats(struct activity *a, char *timestr, int curr)
961 *sntc = (struct stats_net_tcp *) a->buf[curr],
962 *sntp = (struct stats_net_tcp *) a->buf[!curr];
964 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
965 pval((unsigned long long) sntp->ActiveOpens, (unsigned long long) sntc->ActiveOpens);
966 printf(" %s:", pfield(NULL, 0));
967 pval((unsigned long long) sntp->PassiveOpens, (unsigned long long) sntc->PassiveOpens);
968 printf(" %s:", pfield(NULL, 0));
969 pval((unsigned long long) sntp->InSegs, (unsigned long long) sntc->InSegs);
970 printf(" %s:", pfield(NULL, 0));
971 pval((unsigned long long) sntp->OutSegs, (unsigned long long) sntc->OutSegs);
976 ***************************************************************************
977 * Display TCP network errors statistics in raw format.
980 * @a Activity structure with statistics.
981 * @timestr Time for current statistics sample.
982 * @curr Index in array for current sample statistics.
983 ***************************************************************************
985 __print_funct_t raw_print_net_etcp_stats(struct activity *a, char *timestr, int curr)
987 struct stats_net_etcp
988 *snetc = (struct stats_net_etcp *) a->buf[curr],
989 *snetp = (struct stats_net_etcp *) a->buf[!curr];
991 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
992 pval((unsigned long long) snetp->AttemptFails, (unsigned long long) snetc->AttemptFails);
993 printf(" %s:", pfield(NULL, 0));
994 pval((unsigned long long) snetp->EstabResets, (unsigned long long) snetc->EstabResets);
995 printf(" %s:", pfield(NULL, 0));
996 pval((unsigned long long) snetp->RetransSegs, (unsigned long long) snetc->RetransSegs);
997 printf(" %s:", pfield(NULL, 0));
998 pval((unsigned long long) snetp->InErrs, (unsigned long long) snetc->InErrs);
999 printf(" %s:", pfield(NULL, 0));
1000 pval((unsigned long long) snetp->OutRsts, (unsigned long long) snetc->OutRsts);
1005 ***************************************************************************
1006 * Display UDP network statistics in raw format.
1009 * @a Activity structure with statistics.
1010 * @timestr Time for current statistics sample.
1011 * @curr Index in array for current sample statistics.
1012 ***************************************************************************
1014 __print_funct_t raw_print_net_udp_stats(struct activity *a, char *timestr, int curr)
1016 struct stats_net_udp
1017 *snuc = (struct stats_net_udp *) a->buf[curr],
1018 *snup = (struct stats_net_udp *) a->buf[!curr];
1020 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
1021 pval((unsigned long long) snup->InDatagrams, (unsigned long long) snuc->InDatagrams);
1022 printf(" %s:", pfield(NULL, 0));
1023 pval((unsigned long long) snup->OutDatagrams, (unsigned long long) snuc->OutDatagrams);
1024 printf(" %s:", pfield(NULL, 0));
1025 pval((unsigned long long) snup->NoPorts, (unsigned long long) snuc->NoPorts);
1026 printf(" %s:", pfield(NULL, 0));
1027 pval((unsigned long long) snup->InErrors, (unsigned long long) snuc->InErrors);
1032 ***************************************************************************
1033 * Display IPv6 network socket statistics in raw format.
1036 * @a Activity structure with statistics.
1037 * @timestr Time for current statistics sample.
1038 * @curr Index in array for current sample statistics.
1039 ***************************************************************************
1041 __print_funct_t raw_print_net_sock6_stats(struct activity *a, char *timestr, int curr)
1043 struct stats_net_sock6
1044 *snsc = (struct stats_net_sock6 *) a->buf[curr];
1046 printf("%s %s:%u", timestr, pfield(a->hdr_line, FIRST), snsc->tcp6_inuse);
1047 printf(" %s:%u", pfield(NULL, 0), snsc->udp6_inuse);
1048 printf(" %s:%u", pfield(NULL, 0), snsc->raw6_inuse);
1049 printf(" %s:%u", pfield(NULL, 0), snsc->frag6_inuse);
1054 ***************************************************************************
1055 * Display IPv6 network statistics in raw format.
1058 * @a Activity structure with statistics.
1059 * @timestr Time for current statistics sample.
1060 * @curr Index in array for current sample statistics.
1061 ***************************************************************************
1063 __print_funct_t raw_print_net_ip6_stats(struct activity *a, char *timestr, int curr)
1065 struct stats_net_ip6
1066 *snic = (struct stats_net_ip6 *) a->buf[curr],
1067 *snip = (struct stats_net_ip6 *) a->buf[!curr];
1069 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
1070 pval(snip->InReceives6, snic->InReceives6);
1071 printf(" %s:", pfield(NULL, 0));
1072 pval(snip->OutForwDatagrams6, snic->OutForwDatagrams6);
1073 printf(" %s:", pfield(NULL, 0));
1074 pval(snip->InDelivers6, snic->InDelivers6);
1075 printf(" %s:", pfield(NULL, 0));
1076 pval(snip->OutRequests6, snic->OutRequests6);
1077 printf(" %s:", pfield(NULL, 0));
1078 pval(snip->ReasmReqds6, snic->ReasmReqds6);
1079 printf(" %s:", pfield(NULL, 0));
1080 pval(snip->ReasmOKs6, snic->ReasmOKs6);
1081 printf(" %s:", pfield(NULL, 0));
1082 pval(snip->InMcastPkts6, snic->InMcastPkts6);
1083 printf(" %s:", pfield(NULL, 0));
1084 pval(snip->OutMcastPkts6, snic->OutMcastPkts6);
1085 printf(" %s:", pfield(NULL, 0));
1086 pval(snip->FragOKs6, snic->FragOKs6);
1087 printf(" %s:", pfield(NULL, 0));
1088 pval(snip->FragCreates6, snic->FragCreates6);
1093 ***************************************************************************
1094 * Display IPv6 network errors statistics in raw format.
1097 * @a Activity structure with statistics.
1098 * @timestr Time for current statistics sample.
1099 * @curr Index in array for current sample statistics.
1100 ***************************************************************************
1102 __print_funct_t raw_print_net_eip6_stats(struct activity *a, char *timestr, int curr)
1104 struct stats_net_eip6
1105 *sneic = (struct stats_net_eip6 *) a->buf[curr],
1106 *sneip = (struct stats_net_eip6 *) a->buf[!curr];
1108 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
1109 pval(sneip->InHdrErrors6, sneic->InHdrErrors6);
1110 printf(" %s:", pfield(NULL, 0));
1111 pval(sneip->InAddrErrors6, sneic->InAddrErrors6);
1112 printf(" %s:", pfield(NULL, 0));
1113 pval(sneip->InUnknownProtos6, sneic->InUnknownProtos6);
1114 printf(" %s:", pfield(NULL, 0));
1115 pval(sneip->InTooBigErrors6, sneic->InTooBigErrors6);
1116 printf(" %s:", pfield(NULL, 0));
1117 pval(sneip->InDiscards6, sneic->InDiscards6);
1118 printf(" %s:", pfield(NULL, 0));
1119 pval(sneip->OutDiscards6, sneic->OutDiscards6);
1120 printf(" %s:", pfield(NULL, 0));
1121 pval(sneip->InNoRoutes6, sneic->InNoRoutes6);
1122 printf(" %s:", pfield(NULL, 0));
1123 pval(sneip->OutNoRoutes6, sneic->OutNoRoutes6);
1124 printf(" %s:", pfield(NULL, 0));
1125 pval(sneip->ReasmFails6, sneic->ReasmFails6);
1126 printf(" %s:", pfield(NULL, 0));
1127 pval(sneip->FragFails6, sneic->FragFails6);
1128 printf(" %s:", pfield(NULL, 0));
1129 pval(sneip->InTruncatedPkts6, sneic->InTruncatedPkts6);
1134 ***************************************************************************
1135 * Display ICMPv6 network statistics in raw format.
1138 * @a Activity structure with statistics.
1139 * @timestr Time for current statistics sample.
1140 * @curr Index in array for current sample statistics.
1141 ***************************************************************************
1143 __print_funct_t raw_print_net_icmp6_stats(struct activity *a, char *timestr, int curr)
1145 struct stats_net_icmp6
1146 *snic = (struct stats_net_icmp6 *) a->buf[curr],
1147 *snip = (struct stats_net_icmp6 *) a->buf[!curr];
1149 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
1150 pval((unsigned long long) snip->InMsgs6,
1151 (unsigned long long) snic->InMsgs6);
1152 printf(" %s:", pfield(NULL, 0));
1153 pval((unsigned long long) snip->OutMsgs6,
1154 (unsigned long long) snic->OutMsgs6);
1155 printf(" %s:", pfield(NULL, 0));
1156 pval((unsigned long long) snip->InEchos6,
1157 (unsigned long long) snic->InEchos6);
1158 printf(" %s:", pfield(NULL, 0));
1159 pval((unsigned long long) snip->InEchoReplies6,
1160 (unsigned long long) snic->InEchoReplies6);
1161 printf(" %s:", pfield(NULL, 0));
1162 pval((unsigned long long) snip->OutEchoReplies6,
1163 (unsigned long long) snic->OutEchoReplies6);
1164 printf(" %s:", pfield(NULL, 0));
1165 pval((unsigned long long) snip->InGroupMembQueries6,
1166 (unsigned long long) snic->InGroupMembQueries6);
1167 printf(" %s:", pfield(NULL, 0));
1168 pval((unsigned long long) snip->InGroupMembResponses6,
1169 (unsigned long long) snic->InGroupMembResponses6);
1170 printf(" %s:", pfield(NULL, 0));
1171 pval((unsigned long long) snip->OutGroupMembResponses6,
1172 (unsigned long long) snic->OutGroupMembResponses6);
1173 printf(" %s:", pfield(NULL, 0));
1174 pval((unsigned long long) snip->InGroupMembReductions6,
1175 (unsigned long long) snic->InGroupMembReductions6);
1176 printf(" %s:", pfield(NULL, 0));
1177 pval((unsigned long long) snip->OutGroupMembReductions6,
1178 (unsigned long long) snic->OutGroupMembReductions6);
1179 printf(" %s:", pfield(NULL, 0));
1180 pval((unsigned long long) snip->InRouterSolicits6,
1181 (unsigned long long) snic->InRouterSolicits6);
1182 printf(" %s:", pfield(NULL, 0));
1183 pval((unsigned long long) snip->OutRouterSolicits6,
1184 (unsigned long long) snic->OutRouterSolicits6);
1185 printf(" %s:", pfield(NULL, 0));
1186 pval((unsigned long long) snip->InRouterAdvertisements6,
1187 (unsigned long long) snic->InRouterAdvertisements6);
1188 printf(" %s:", pfield(NULL, 0));
1189 pval((unsigned long long) snip->InNeighborSolicits6,
1190 (unsigned long long) snic->InNeighborSolicits6);
1191 printf(" %s:", pfield(NULL, 0));
1192 pval((unsigned long long) snip->OutNeighborSolicits6,
1193 (unsigned long long) snic->OutNeighborSolicits6);
1194 printf(" %s:", pfield(NULL, 0));
1195 pval((unsigned long long) snip->InNeighborAdvertisements6,
1196 (unsigned long long) snic->InNeighborAdvertisements6);
1197 printf(" %s:", pfield(NULL, 0));
1198 pval((unsigned long long) snip->OutNeighborAdvertisements6,
1199 (unsigned long long) snic->OutNeighborAdvertisements6);
1204 ***************************************************************************
1205 * Display ICMPv6 error messages statistics in rw format.
1208 * @a Activity structure with statistics.
1209 * @timestr Time for current statistics sample.
1210 * @curr Index in array for current sample statistics.
1211 ***************************************************************************
1213 __print_funct_t raw_print_net_eicmp6_stats(struct activity *a, char *timestr, int curr)
1215 struct stats_net_eicmp6
1216 *sneic = (struct stats_net_eicmp6 *) a->buf[curr],
1217 *sneip = (struct stats_net_eicmp6 *) a->buf[!curr];
1219 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
1220 pval((unsigned long long) sneip->InErrors6, (unsigned long long) sneic->InErrors6);
1221 printf(" %s:", pfield(NULL, 0));
1222 pval((unsigned long long) sneip->InDestUnreachs6, (unsigned long long) sneic->InDestUnreachs6);
1223 printf(" %s:", pfield(NULL, 0));
1224 pval((unsigned long long) sneip->OutDestUnreachs6, (unsigned long long) sneic->OutDestUnreachs6);
1225 printf(" %s:", pfield(NULL, 0));
1226 pval((unsigned long long) sneip->InTimeExcds6, (unsigned long long) sneic->InTimeExcds6);
1227 printf(" %s:", pfield(NULL, 0));
1228 pval((unsigned long long) sneip->OutTimeExcds6, (unsigned long long) sneic->OutTimeExcds6);
1229 printf(" %s:", pfield(NULL, 0));
1230 pval((unsigned long long) sneip->InParmProblems6, (unsigned long long) sneic->InParmProblems6);
1231 printf(" %s:", pfield(NULL, 0));
1232 pval((unsigned long long) sneip->OutParmProblems6, (unsigned long long) sneic->OutParmProblems6);
1233 printf(" %s:", pfield(NULL, 0));
1234 pval((unsigned long long) sneip->InRedirects6, (unsigned long long) sneic->InRedirects6);
1235 printf(" %s:", pfield(NULL, 0));
1236 pval((unsigned long long) sneip->OutRedirects6, (unsigned long long) sneic->OutRedirects6);
1237 printf(" %s:", pfield(NULL, 0));
1238 pval((unsigned long long) sneip->InPktTooBigs6, (unsigned long long) sneic->InPktTooBigs6);
1239 printf(" %s:", pfield(NULL, 0));
1240 pval((unsigned long long) sneip->OutPktTooBigs6, (unsigned long long) sneic->OutPktTooBigs6);
1245 ***************************************************************************
1246 * Display UDPv6 network statistics in raw format.
1249 * @a Activity structure with statistics.
1250 * @timestr Time for current statistics sample.
1251 * @curr Index in array for current sample statistics.
1252 ***************************************************************************
1254 __print_funct_t raw_print_net_udp6_stats(struct activity *a, char *timestr, int curr)
1256 struct stats_net_udp6
1257 *snuc = (struct stats_net_udp6 *) a->buf[curr],
1258 *snup = (struct stats_net_udp6 *) a->buf[!curr];
1260 printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
1261 pval((unsigned long long) snup->InDatagrams6, (unsigned long long) snuc->InDatagrams6);
1262 printf(" %s:", pfield(NULL, 0));
1263 pval((unsigned long long) snup->OutDatagrams6, (unsigned long long) snuc->OutDatagrams6);
1264 printf(" %s:", pfield(NULL, 0));
1265 pval((unsigned long long) snup->NoPorts6, (unsigned long long) snuc->NoPorts6);
1266 printf(" %s:", pfield(NULL, 0));
1267 pval((unsigned long long) snup->InErrors6, (unsigned long long) snuc->InErrors6);
1272 ***************************************************************************
1273 * Display CPU frequency statistics in raw format.
1276 * @a Activity structure with statistics.
1277 * @timestr Time for current statistics sample.
1278 * @curr Index in array for current sample statistics.
1279 ***************************************************************************
1281 __print_funct_t raw_print_pwr_cpufreq_stats(struct activity *a, char *timestr, int curr)
1284 struct stats_pwr_cpufreq *spc;
1286 for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
1288 spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize);
1290 /* Should current CPU (including CPU "all") be displayed? */
1291 if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
1292 /* Yes: Display it */
1293 printf("%s %s:%d", timestr, pfield(a->hdr_line, FIRST), i - 1);
1294 printf(" %s:%lu\n", pfield(NULL, 0), spc->cpufreq);
1300 ***************************************************************************
1301 * Display fan statistics in raw format.
1304 * @a Activity structure with statistics.
1305 * @timestr Time for current statistics sample.
1306 * @curr Index in array for current sample statistics.
1307 ***************************************************************************
1309 __print_funct_t raw_print_pwr_fan_stats(struct activity *a, char *timestr, int curr)
1312 struct stats_pwr_fan *spc;
1314 for (i = 0; i < a->nr; i++) {
1315 spc = (struct stats_pwr_fan *) ((char *) a->buf[curr] + i * a->msize);
1317 printf("%s %s:%d", timestr, pfield(a->hdr_line, FIRST), i + 1);
1318 printf(" %s:%s", pfield(NULL, 0), spc->device);
1319 printf(" %s:%f", pfield(NULL, 0), spc->rpm);
1320 printf(" rpm_min:%f\n", spc->rpm_min);
1325 ***************************************************************************
1326 * Display temperature statistics in raw format.
1329 * @a Activity structure with statistics.
1330 * @timestr Time for current statistics sample.
1331 * @curr Index in array for current sample statistics.
1332 ***************************************************************************
1334 __print_funct_t raw_print_pwr_temp_stats(struct activity *a, char *timestr, int curr)
1337 struct stats_pwr_temp *spc;
1339 for (i = 0; i < a->nr; i++) {
1340 spc = (struct stats_pwr_temp *) ((char *) a->buf[curr] + i * a->msize);
1342 printf("%s %s:%d", timestr, pfield(a->hdr_line, FIRST), i + 1);
1343 printf(" %s:%s", pfield(NULL, 0), spc->device);
1344 printf(" %s:%f", pfield(NULL, 0), spc->temp);
1345 printf(" temp_min:%f", spc->temp_min);
1346 printf(" temp_max:%f\n", spc->temp_max);
1351 ***************************************************************************
1352 * Display voltage inputs statistics in raw format.
1355 * @a Activity structure with statistics.
1356 * @timestr Time for current statistics sample.
1357 * @curr Index in array for current sample statistics.
1358 ***************************************************************************
1360 __print_funct_t raw_print_pwr_in_stats(struct activity *a, char *timestr, int curr)
1363 struct stats_pwr_in *spc;
1365 for (i = 0; i < a->nr; i++) {
1366 spc = (struct stats_pwr_in *) ((char *) a->buf[curr] + i * a->msize);
1368 printf("%s %s:%d", timestr, pfield(a->hdr_line, FIRST), i);
1369 printf(" %s:%s", pfield(NULL, 0), spc->device);
1370 printf(" %s:%f", pfield(NULL, 0), spc->in);
1371 printf(" in_min:%f", spc->in_min);
1372 printf(" in_max:%f\n", spc->in_max);