]> granicus.if.org Git - sysstat/blob - raw_stats.c
sadf: RAW: Display activity name when showhints option used
[sysstat] / raw_stats.c
1 /*
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)
4  *
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.                                              *
10  *                                                                         *
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 *
14  * for more details.                                                       *
15  *                                                                         *
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  ***************************************************************************
20  */
21
22 #include <stdio.h>
23 #include <string.h>
24 #include <stdarg.h>
25 #include <stdlib.h>
26
27 #include "sa.h"
28 #include "ioconf.h"
29 #include "raw_stats.h"
30
31 extern unsigned int flags;
32 extern unsigned int dm_major;
33
34 /*
35  ***************************************************************************
36  * Display current field name.
37  *
38  * IN:
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).
43  *
44  * RETURNS:
45  * Pointer on string containing field name.
46  ***************************************************************************
47  */
48 char *pfield(char *hdr_line, int pos)
49 {
50         char hline[HEADER_LINE_LEN] = "";
51         static char field[HEADER_LINE_LEN] = "";
52         static int idx = 0;
53         char *hl;
54         int i, j = 0;
55
56         if (hdr_line) {
57                 strncpy(hline, hdr_line, HEADER_LINE_LEN - 1);
58                 hline[HEADER_LINE_LEN - 1] = '\0';
59                 idx = 0;
60
61                 for (hl = strtok(hline, "|"); hl && (pos > 0); hl = strtok(NULL, "|"), pos--);
62                 if (!hl) {
63                         /* Bad @pos arg given to function */
64                         strcpy(field, "");
65                         return field;
66                 }
67                 if (strchr(hl, '&')) {
68                         j = strcspn(hl, "&");
69                         *(hl + j) = ';';
70                 }
71                 strncpy(field, hl, HEADER_LINE_LEN);
72                 field[HEADER_LINE_LEN - 1] = '\0';
73         }
74
75         /* Display current field */
76         if (strchr(field + idx, ';')) {
77                 j = strcspn(field + idx, ";");
78                 *(field + idx + j) = '\0';
79         }
80         i = idx;
81         idx += j + 1;
82
83         return field + i;
84 }
85
86 /*
87  ***************************************************************************
88  * Display field values.
89  *
90  * IN:
91  * @valp        Field's value from previous statistics sample.
92  * @valc        Field's value from current statistics sample.
93  ***************************************************************************
94  */
95 void pval(unsigned long long valp, unsigned long long valc)
96 {
97         printf("%llu>%llu", valp, valc);
98         if (DISPLAY_HINTS(flags)) {
99                 if (valc < valp) {
100                         /* Field's value has decreased */
101                         printf(" [DEC]");
102                 }
103         }
104 }
105
106 /*
107  ***************************************************************************
108  * Display CPU statistics in raw format.
109  *
110  * IN:
111  * @a           Activity structure with statistics.
112  * @timestr     Time for current statistics sample.
113  * @curr        Index in array for current statistics sample.
114  ***************************************************************************
115  */
116 __print_funct_t raw_print_cpu_stats(struct activity *a, char *timestr, int curr)
117 {
118         int i;
119         struct stats_cpu *scc, *scp;
120
121         /* @nr[curr] cannot normally be greater than @nr_ini */
122         if (a->nr[curr] > a->nr_ini) {
123                 a->nr_ini = a->nr[curr];
124         }
125
126         for (i = 0; (i < a->nr_ini) && (i < a->bitmap->b_size + 1); i++) {
127
128                 /*
129                  * The size of a->buf[...] CPU structure may be different from the default
130                  * sizeof(struct stats_cpu) value if data have been read from a file!
131                  * That's why we don't use a syntax like:
132                  * scc = (struct stats_cpu *) a->buf[...] + i;
133                  */
134                 scc = (struct stats_cpu *) ((char *) a->buf[curr] + i * a->msize);
135                 scp = (struct stats_cpu *) ((char *) a->buf[!curr] + i * a->msize);
136
137                 /* Should current CPU (including CPU "all") be displayed? */
138                 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))))
139                         /* No */
140                         continue;
141
142                 /* Yes: Display it */
143                 printf("%s %s:%d", timestr,
144                        pfield(a->hdr_line, DISPLAY_CPU_ALL(a->opt_flags)), i - 1);
145
146                 if (DISPLAY_HINTS(flags) && i) {
147                         if ((scc->cpu_user + scc->cpu_nice + scc->cpu_sys +
148                              scc->cpu_iowait + scc->cpu_idle + scc->cpu_steal +
149                              scc->cpu_hardirq + scc->cpu_softirq) == 0) {
150                                 /* CPU is offline */
151                                 printf(" [OFF]");
152                         }
153                         else {
154                                 if (!get_per_cpu_interval(scc, scp)) {
155                                         /* CPU is tickless */
156                                         printf(" [TLS]");
157                                 }
158                         }
159                 }
160
161                 if (DISPLAY_CPU_DEF(a->opt_flags)) {
162                         printf(" %s:", pfield(NULL, 0));
163                         pval(scp->cpu_user, scc->cpu_user);
164                         printf(" %s:", pfield(NULL, 0));
165                         pval(scp->cpu_nice, scc->cpu_nice);
166                         printf(" %s:", pfield(NULL, 0));
167                         pval(scp->cpu_sys + scp->cpu_hardirq + scp->cpu_softirq,
168                              scc->cpu_sys + scc->cpu_hardirq + scc->cpu_softirq);
169                         printf(" %s:", pfield(NULL, 0));
170                         pval(scp->cpu_iowait, scc->cpu_iowait);
171                         printf(" %s:", pfield(NULL, 0));
172                         pval(scp->cpu_steal, scc->cpu_steal);
173                         printf(" %s:", pfield(NULL, 0));
174                         pval(scp->cpu_idle, scc->cpu_idle);
175                 }
176                 else if (DISPLAY_CPU_ALL(a->opt_flags)) {
177                         printf(" %s:", pfield(NULL, 0));
178                         pval(scp->cpu_user - scp->cpu_guest, scc->cpu_user - scc->cpu_guest);
179                         printf(" %s:", pfield(NULL, 0));
180                         pval(scp->cpu_nice - scp->cpu_guest_nice, scc->cpu_nice - scc->cpu_guest_nice);
181                         printf(" %s:", pfield(NULL, 0));
182                         pval(scp->cpu_sys, scc->cpu_sys);
183                         printf(" %s:", pfield(NULL, 0));
184                         pval(scp->cpu_iowait, scc->cpu_iowait);
185                         printf(" %s:", pfield(NULL, 0));
186                         pval(scp->cpu_steal, scc->cpu_steal);
187                         printf(" %s:", pfield(NULL, 0));
188                         pval(scp->cpu_hardirq, scc->cpu_hardirq);
189                         printf(" %s:", pfield(NULL, 0));
190                         pval(scp->cpu_softirq, scc->cpu_softirq);
191                         printf(" %s:", pfield(NULL, 0));
192                         pval(scp->cpu_guest, scc->cpu_guest);
193                         printf(" %s:", pfield(NULL, 0));
194                         pval(scp->cpu_guest_nice, scc->cpu_guest_nice);
195                         printf(" %s:", pfield(NULL, 0));
196                         pval(scp->cpu_idle, scc->cpu_idle);
197                 }
198                 printf("\n");
199         }
200 }
201
202 /*
203  ***************************************************************************
204  * Display tasks creation and context switches statistics in raw format.
205  *
206  * IN:
207  * @a           Activity structure with statistics.
208  * @timestr     Time for current statistics sample.
209  * @curr        Index in array for current sample statistics.
210  ***************************************************************************
211  */
212 __print_funct_t raw_print_pcsw_stats(struct activity *a, char *timestr, int curr)
213 {
214         struct stats_pcsw
215                 *spc = (struct stats_pcsw *) a->buf[curr],
216                 *spp = (struct stats_pcsw *) a->buf[!curr];
217
218         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
219         pval((unsigned long long) spp->processes, (unsigned long long) spc->processes);
220         printf(" %s:", pfield(NULL, 0));
221         pval(spp->context_switch, spc->context_switch);
222         printf("\n");
223 }
224
225 /*
226  ***************************************************************************
227  * Display interrupts statistics in raw format.
228  *
229  * IN:
230  * @a           Activity structure with statistics.
231  * @timestr     Time for current statistics sample.
232  * @curr        Index in array for current sample statistics.
233  ***************************************************************************
234  */
235 __print_funct_t raw_print_irq_stats(struct activity *a, char *timestr, int curr)
236 {
237         int i;
238         struct stats_irq *sic, *sip;
239
240         for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) {
241
242                 sic = (struct stats_irq *) ((char *) a->buf[curr]  + i * a->msize);
243                 sip = (struct stats_irq *) ((char *) a->buf[!curr] + i * a->msize);
244
245                 /* Should current interrupt (including int "sum") be displayed? */
246                 if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
247
248                         /* Yes: Display it */
249                         printf("%s %s:%d", timestr,
250                                pfield(a->hdr_line, FIRST), i - 1);
251                         printf(" %s:", pfield(NULL, 0));
252                         pval(sip->irq_nr, sic->irq_nr);
253                         printf("\n");
254                 }
255         }
256 }
257
258 /*
259  ***************************************************************************
260  * Display swapping statistics in raw format.
261  *
262  * IN:
263  * @a           Activity structure with statistics.
264  * @timestr     Time for current statistics sample.
265  * @curr        Index in array for current sample statistics.
266  ***************************************************************************
267  */
268 __print_funct_t raw_print_swap_stats(struct activity *a, char *timestr, int curr)
269 {
270         struct stats_swap
271                 *ssc = (struct stats_swap *) a->buf[curr],
272                 *ssp = (struct stats_swap *) a->buf[!curr];
273
274         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
275         pval((unsigned long long) ssp->pswpin, (unsigned long long) ssc->pswpin);
276         printf(" %s:", pfield(NULL, 0));
277         pval((unsigned long long) ssp->pswpout, (unsigned long long) ssc->pswpout);
278         printf("\n");
279 }
280
281 /*
282  ***************************************************************************
283  * Display paging statistics in raw format.
284  *
285  * IN:
286  * @a           Activity structure with statistics.
287  * @timestr     Time for current statistics sample.
288  * @curr        Index in array for current sample statistics.
289  ***************************************************************************
290  */
291 __print_funct_t raw_print_paging_stats(struct activity *a, char *timestr, int curr)
292 {
293         struct stats_paging
294                 *spc = (struct stats_paging *) a->buf[curr],
295                 *spp = (struct stats_paging *) a->buf[!curr];
296
297         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
298         pval((unsigned long long) spp->pgpgin, (unsigned long long) spc->pgpgin);
299         printf(" %s:", pfield(NULL, 0));
300         pval((unsigned long long) spp->pgpgout, (unsigned long long) spc->pgpgout);
301         printf(" %s:", pfield(NULL, 0));
302         pval((unsigned long long) spp->pgfault, (unsigned long long) spc->pgfault);
303         printf(" %s:", pfield(NULL, 0));
304         pval((unsigned long long) spp->pgmajfault, (unsigned long long) spc->pgmajfault);
305         printf(" %s:", pfield(NULL, 0));
306         pval((unsigned long long) spp->pgfree, (unsigned long long) spc->pgfree);
307         printf(" %s:", pfield(NULL, 0));
308         pval((unsigned long long) spp->pgscan_kswapd, (unsigned long long) spc->pgscan_kswapd);
309         printf(" %s:", pfield(NULL, 0));
310         pval((unsigned long long) spp->pgscan_direct, (unsigned long long) spc->pgscan_direct);
311         printf(" %s:", pfield(NULL, 0));
312         pval((unsigned long long) spp->pgsteal, (unsigned long long) spc->pgsteal);
313         printf("\n");
314 }
315
316 /*
317  ***************************************************************************
318  * Display I/O and transfer rate statistics in raw format.
319  *
320  * IN:
321  * @a           Activity structure with statistics.
322  * @timestr     Time for current statistics sample.
323  * @curr        Index in array for current sample statistics.
324  ***************************************************************************
325  */
326 __print_funct_t raw_print_io_stats(struct activity *a, char *timestr, int curr)
327 {
328         struct stats_io
329                 *sic = (struct stats_io *) a->buf[curr],
330                 *sip = (struct stats_io *) a->buf[!curr];
331
332         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
333         pval(sip->dk_drive, sic->dk_drive);
334         printf(" %s:", pfield(NULL, 0));
335         pval(sip->dk_drive_rio, sic->dk_drive_rio);
336         printf(" %s:", pfield(NULL, 0));
337         pval(sip->dk_drive_wio, sic->dk_drive_wio);
338         printf(" %s:", pfield(NULL, 0));
339         pval(sip->dk_drive_rblk, sic->dk_drive_rblk);
340         printf(" %s:", pfield(NULL, 0));
341         pval(sip->dk_drive_wblk, sic->dk_drive_wblk);
342         printf("\n");
343 }
344
345 /*
346  ***************************************************************************
347  * Display memory statistics in raw format.
348  *
349  * IN:
350  * @a           Activity structure with statistics.
351  * @timestr     Time for current statistics sample.
352  * @curr        Index in array for current sample statistics.
353  ***************************************************************************
354  */
355 __print_funct_t raw_print_memory_stats(struct activity *a, char *timestr, int curr)
356 {
357         struct stats_memory
358                 *smc = (struct stats_memory *) a->buf[curr];
359
360         if (DISPLAY_MEMORY(a->opt_flags)) {
361                 printf("%s %s:%llu", timestr, pfield(a->hdr_line, FIRST), smc->frmkb);
362                 printf(" %s:%llu", pfield(NULL, 0), smc->availablekb);
363                 printf(" kbttlmem:%llu", smc->tlmkb);
364                 pfield(NULL, 0); /* Skip kbmemused */
365                 pfield(NULL, 0); /* Skip %memused */
366                 printf(" %s:%llu", pfield(NULL, 0), smc->bufkb);
367                 printf(" %s:%llu", pfield(NULL, 0), smc->camkb);
368                 printf(" %s:%llu", pfield(NULL, 0), smc->comkb);
369                 pfield(NULL, 0); /* Skip %commit */
370                 printf(" %s:%llu", pfield(NULL, 0), smc->activekb);
371                 printf(" %s:%llu", pfield(NULL, 0), smc->inactkb);
372                 printf(" %s:%llu", pfield(NULL, 0), smc->dirtykb);
373
374                 if (DISPLAY_MEM_ALL(a->opt_flags)) {
375                         printf(" %s:%llu", pfield(NULL, 0), smc->anonpgkb);
376                         printf(" %s:%llu", pfield(NULL, 0), smc->slabkb);
377                         printf(" %s:%llu", pfield(NULL, 0), smc->kstackkb);
378                         printf(" %s:%llu", pfield(NULL, 0), smc->pgtblkb);
379                         printf(" %s:%llu", pfield(NULL, 0), smc->vmusedkb);
380                 }
381                 printf("\n");
382         }
383
384         if (DISPLAY_SWAP(a->opt_flags)) {
385                 printf("%s %s:%llu", timestr, pfield(a->hdr_line, SECOND), smc->frskb);
386                 printf(" kbttlswp:%llu", smc->tlskb);
387                 pfield(NULL, 0); /* Skip kbswpused */
388                 pfield(NULL, 0); /* Skip %swpused */
389                 printf(" %s:%llu", pfield(NULL, 0), smc->caskb);
390                 printf("\n");
391         }
392 }
393
394 /*
395  ***************************************************************************
396  * Display kernel tables statistics in raw format.
397  *
398  * IN:
399  * @a           Activity structure with statistics.
400  * @timestr     Time for current statistics sample.
401  * @curr        Index in array for current sample statistics.
402  ***************************************************************************
403  */
404 __print_funct_t raw_print_ktables_stats(struct activity *a, char *timestr, int curr)
405 {
406         struct stats_ktables
407                 *skc = (struct stats_ktables *) a->buf[curr];
408
409         printf("%s %s:%llu", timestr, pfield(a->hdr_line, FIRST), skc->dentry_stat);
410         printf(" %s:%llu", pfield(NULL, 0), skc->file_used);
411         printf(" %s:%llu", pfield(NULL, 0), skc->inode_used);
412         printf(" %s:%llu", pfield(NULL, 0), skc->pty_nr);
413         printf("\n");
414 }
415
416 /*
417  ***************************************************************************
418  * Display queue and load statistics in raw format.
419  *
420  * IN:
421  * @a           Activity structure with statistics.
422  * @timestr     Time for current statistics sample.
423  * @curr        Index in array for current sample statistics.
424  ***************************************************************************
425  */
426 __print_funct_t raw_print_queue_stats(struct activity *a, char *timestr, int curr)
427 {
428         struct stats_queue
429                 *sqc = (struct stats_queue *) a->buf[curr];
430
431         printf("%s %s:%llu", timestr, pfield(a->hdr_line, FIRST), sqc->nr_running);
432         printf(" %s:%llu", pfield(NULL, 0), sqc->nr_threads);
433         printf(" %s:%u", pfield(NULL, 0), sqc->load_avg_1);
434         printf(" %s:%u", pfield(NULL, 0), sqc->load_avg_5);
435         printf(" %s:%u", pfield(NULL, 0), sqc->load_avg_15);
436         printf(" %s:%llu", pfield(NULL, 0), sqc->procs_blocked);
437         printf("\n");
438 }
439
440 /*
441  ***************************************************************************
442  * Display serial lines statistics in raw format.
443  *
444  * IN:
445  * @a           Activity structure with statistics.
446  * @timestr     Time for current statistics sample.
447  * @curr        Index in array for current sample statistics.
448  ***************************************************************************
449  */
450 __print_funct_t raw_print_serial_stats(struct activity *a, char *timestr, int curr)
451 {
452         int i, j, j0, found;
453         struct stats_serial *ssc, *ssp;
454
455         for (i = 0; i < a->nr[curr]; i++) {
456
457                 found = FALSE;
458                 ssc = (struct stats_serial *) ((char *) a->buf[curr]  + i * a->msize);
459
460                 if (a->nr[!curr] > 0) {
461
462                         /* Look for corresponding serial line in previous iteration */
463                         j = i;
464
465                         if (j >= a->nr[!curr]) {
466                                 j = a->nr[!curr] - 1;
467                         }
468
469                         j0 = j;
470
471                         do {
472                                 ssp = (struct stats_serial *) ((char *) a->buf[!curr] + j * a->msize);
473                                 if (ssc->line == ssp->line) {
474                                         found = TRUE;
475                                         break;
476                                 }
477                                 if (++j >= a->nr[!curr]) {
478                                         j = 0;
479                                 }
480                         }
481                         while (j != j0);
482                 }
483
484                 printf("%s %s: %u", timestr, pfield(a->hdr_line, FIRST), ssc->line);
485
486                 if (!found) {
487                         if (DISPLAY_HINTS(flags)) {
488                                 printf(" [NEW]");
489                         }
490                         printf("\n");
491                         continue;
492                 }
493
494                 printf(" %s:", pfield(NULL, 0));
495                 pval((unsigned long long) ssp->rx, (unsigned long long)ssc->rx);
496                 printf(" %s:", pfield(NULL, 0));
497                 pval((unsigned long long) ssp->tx, (unsigned long long) ssc->tx);
498                 printf(" %s:", pfield(NULL, 0));
499                 pval((unsigned long long) ssp->frame, (unsigned long long) ssc->frame);
500                 printf(" %s:", pfield(NULL, 0));
501                 pval((unsigned long long) ssp->parity, (unsigned long long) ssc->parity);
502                 printf(" %s:", pfield(NULL, 0));
503                 pval((unsigned long long) ssp->brk, (unsigned long long) ssc->brk);
504                 printf(" %s:", pfield(NULL, 0));
505                 pval((unsigned long long) ssp->overrun, (unsigned long long) ssc->overrun);
506                 printf("\n");
507         }
508 }
509
510 /*
511  ***************************************************************************
512  * Display disks statistics in raw format.
513  *
514  * IN:
515  * @a           Activity structure with statistics.
516  * @timestr     Time for current statistics sample.
517  * @curr        Index in array for current sample statistics.
518  ***************************************************************************
519  */
520 __print_funct_t raw_print_disk_stats(struct activity *a, char *timestr, int curr)
521 {
522         int i, j;
523         struct stats_disk *sdc, *sdp, sdpzero;
524         char *dev_name, *persist_dev_name;
525
526         memset(&sdpzero, 0, STATS_DISK_SIZE);
527
528         for (i = 0; i < a->nr[curr]; i++) {
529
530                 sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize);
531
532                 printf("%s major:%u minor:%u", timestr, sdc->major, sdc->minor);
533
534                 j = check_disk_reg(a, curr, !curr, i);
535                 if (j < 0) {
536                         /* This is a newly registered interface. Previous stats are zero */
537                         sdp = &sdpzero;
538                         if (DISPLAY_HINTS(flags)) {
539                                 printf(" [NEW]");
540                         }
541                 }
542                 else {
543                         sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
544                 }
545
546                 dev_name = NULL;
547                 persist_dev_name = NULL;
548
549                 if (DISPLAY_PERSIST_NAME_S(flags)) {
550                         persist_dev_name = get_persistent_name_from_pretty(get_devname(sdc->major, sdc->minor, TRUE));
551                 }
552
553                 if (persist_dev_name) {
554                         dev_name = persist_dev_name;
555                 }
556                 else {
557                         /* Always use pretty option (-p) */
558                         if (sdc->major == dm_major) {
559                                 dev_name = transform_devmapname(sdc->major, sdc->minor);
560                         }
561
562                         if (!dev_name) {
563                                 dev_name = get_devname(sdc->major, sdc->minor, TRUE);
564                         }
565                 }
566
567                 printf(" %s:%s", pfield(a->hdr_line, FIRST), dev_name);
568                 printf(" %s:", pfield(NULL, 0));
569                 pval(sdp->nr_ios, sdc->nr_ios);
570                 printf(" %s:", pfield(NULL, 0));
571                 pval((unsigned long long) sdp->rd_sect, (unsigned long long) sdc->rd_sect);
572                 printf(" %s:", pfield(NULL, 0));
573                 pval((unsigned long long) sdp->wr_sect, (unsigned long long) sdc->wr_sect);
574                 printf(" tot_ticks:");
575                 pval((unsigned long long) sdp->tot_ticks, (unsigned long long) sdc->tot_ticks);
576                 pfield(NULL, 0); /* Skip areq-sz */
577                 printf(" %s:", pfield(NULL, 0));
578                 pval((unsigned long long) sdp->rq_ticks, (unsigned long long) sdc->rq_ticks);
579                 printf("\n");
580         }
581 }
582
583 /*
584  ***************************************************************************
585  * Display network interfaces statistics in raw format.
586  *
587  * IN:
588  * @a           Activity structure with statistics.
589  * @timestr     Time for current statistics sample.
590  * @curr        Index in array for current sample statistics.
591  ***************************************************************************
592  */
593 __print_funct_t raw_print_net_dev_stats(struct activity *a, char *timestr, int curr)
594 {
595         int i, j;
596         struct stats_net_dev *sndc, *sndp, sndzero;
597
598         memset(&sndzero, 0, STATS_NET_DEV_SIZE);
599
600         for (i = 0; i < a->nr[curr]; i++) {
601
602                 sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize);
603
604                 printf("%s %s:%s", timestr, pfield(a->hdr_line, FIRST), sndc->interface);
605
606                 j = check_net_dev_reg(a, curr, !curr, i);
607                 if (j < 0) {
608                         /* This is a newly registered interface. Previous stats are zero */
609                         sndp = &sndzero;
610                         if (DISPLAY_HINTS(flags)) {
611                                 printf(" [NEW]");
612                         }
613                 }
614                 else {
615                         sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize);
616                 }
617
618                 printf(" %s:", pfield(NULL, 0));
619                 pval(sndp->rx_packets, sndc->rx_packets);
620                 printf(" %s:", pfield(NULL, 0));
621                 pval(sndp->tx_packets, sndc->tx_packets);
622                 printf(" %s:", pfield(NULL, 0));
623                 pval(sndp->rx_bytes, sndc->rx_bytes);
624                 printf(" %s:", pfield(NULL, 0));
625                 pval(sndp->tx_bytes, sndc->tx_bytes);
626                 printf(" %s:", pfield(NULL, 0));
627                 pval(sndp->rx_compressed, sndc->rx_compressed);
628                 printf(" %s:", pfield(NULL, 0));
629                 pval(sndp->tx_compressed, sndc->tx_compressed);
630                 printf(" %s:", pfield(NULL, 0));
631                 pval(sndp->multicast, sndc->multicast);
632                 printf(" speed:%u duplex:%u\n", sndc->speed, sndc->duplex);
633         }
634 }
635
636 /*
637  ***************************************************************************
638  * Display network interfaces errors statistics in raw format.
639  *
640  * IN:
641  * @a           Activity structure with statistics.
642  * @timestr     Time for current statistics sample.
643  * @curr        Index in array for current sample statistics.
644  ***************************************************************************
645  */
646 __print_funct_t raw_print_net_edev_stats(struct activity *a, char *timestr, int curr)
647 {
648         int i, j;
649         struct stats_net_edev *snedc, *snedp, snedzero;
650
651         memset(&snedzero, 0, STATS_NET_EDEV_SIZE);
652
653         for (i = 0; i < a->nr[curr]; i++) {
654
655                 snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize);
656
657                 printf("%s %s:%s", timestr, pfield(a->hdr_line, FIRST), snedc->interface);
658
659                 j = check_net_edev_reg(a, curr, !curr, i);
660                 if (j < 0) {
661                         /* This is a newly registered interface. Previous stats are zero */
662                         snedp = &snedzero;
663                         if (DISPLAY_HINTS(flags)) {
664                                 printf(" [NEW]");
665                         }
666                 }
667                 else {
668                         snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize);
669                 }
670
671                 printf(" %s:", pfield(NULL, 0));
672                 pval(snedp->rx_errors, snedc->rx_errors);
673                 printf(" %s:", pfield(NULL, 0));
674                 pval(snedp->tx_errors, snedc->tx_errors);
675                 printf(" %s:", pfield(NULL, 0));
676                 pval(snedp->collisions, snedc->collisions);
677                 printf(" %s:", pfield(NULL, 0));
678                 pval(snedp->rx_dropped, snedc->rx_dropped);
679                 printf(" %s:", pfield(NULL, 0));
680                 pval(snedp->tx_dropped, snedc->tx_dropped);
681                 printf(" %s:", pfield(NULL, 0));
682                 pval(snedp->tx_carrier_errors, snedc->tx_carrier_errors);
683                 printf(" %s:", pfield(NULL, 0));
684                 pval(snedp->rx_frame_errors, snedc->rx_frame_errors);
685                 printf(" %s:", pfield(NULL, 0));
686                 pval(snedp->rx_fifo_errors, snedc->rx_fifo_errors);
687                 printf(" %s:", pfield(NULL, 0));
688                 pval(snedp->tx_fifo_errors, snedc->tx_fifo_errors);
689                 printf("\n");
690         }
691 }
692
693 /*
694  ***************************************************************************
695  * Display NFS client statistics in raw format.
696  *
697  * IN:
698  * @a           Activity structure with statistics.
699  * @timestr     Time for current statistics sample.
700  * @curr        Index in array for current sample statistics.
701  ***************************************************************************
702  */
703 __print_funct_t raw_print_net_nfs_stats(struct activity *a, char *timestr, int curr)
704 {
705         struct stats_net_nfs
706                 *snnc = (struct stats_net_nfs *) a->buf[curr],
707                 *snnp = (struct stats_net_nfs *) a->buf[!curr];
708
709         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
710         pval((unsigned long long) snnp->nfs_rpccnt, (unsigned long long) snnc->nfs_rpccnt);
711         printf(" %s:", pfield(NULL, 0));
712         pval((unsigned long long) snnp->nfs_rpcretrans, (unsigned long long) snnc->nfs_rpcretrans);
713         printf(" %s:", pfield(NULL, 0));
714         pval((unsigned long long) snnp->nfs_readcnt, (unsigned long long) snnc->nfs_readcnt);
715         printf(" %s:", pfield(NULL, 0));
716         pval((unsigned long long) snnp->nfs_writecnt, (unsigned long long) snnc->nfs_writecnt);
717         printf(" %s:", pfield(NULL, 0));
718         pval((unsigned long long) snnp->nfs_accesscnt, (unsigned long long) snnc->nfs_accesscnt);
719         printf(" %s:", pfield(NULL, 0));
720         pval((unsigned long long) snnp->nfs_getattcnt, (unsigned long long) snnc->nfs_getattcnt);
721         printf("\n");
722 }
723
724 /*
725  ***************************************************************************
726  * Display NFS server statistics in raw format.
727  *
728  * IN:
729  * @a           Activity structure with statistics.
730  * @timestr     Time for current statistics sample.
731  * @curr        Index in array for current sample statistics.
732  ***************************************************************************
733  */
734 __print_funct_t raw_print_net_nfsd_stats(struct activity *a, char *timestr, int curr)
735 {
736         struct stats_net_nfsd
737                 *snndc = (struct stats_net_nfsd *) a->buf[curr],
738                 *snndp = (struct stats_net_nfsd *) a->buf[!curr];
739
740         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
741         pval((unsigned long long) snndp->nfsd_rpccnt, (unsigned long long) snndc->nfsd_rpccnt);
742         printf(" %s:", pfield(NULL, 0));
743         pval((unsigned long long) snndp->nfsd_rpcbad, (unsigned long long) snndc->nfsd_rpcbad);
744         printf(" %s:", pfield(NULL, 0));
745         pval((unsigned long long) snndp->nfsd_netcnt, (unsigned long long) snndc->nfsd_netcnt);
746         printf(" %s:", pfield(NULL, 0));
747         pval((unsigned long long) snndp->nfsd_netudpcnt, (unsigned long long) snndc->nfsd_netudpcnt);
748         printf(" %s:", pfield(NULL, 0));
749         pval((unsigned long long) snndp->nfsd_nettcpcnt, (unsigned long long) snndc->nfsd_nettcpcnt);
750         printf(" %s:", pfield(NULL, 0));
751         pval((unsigned long long) snndp->nfsd_rchits, (unsigned long long) snndc->nfsd_rchits);
752         printf(" %s:", pfield(NULL, 0));
753         pval((unsigned long long) snndp->nfsd_rcmisses, (unsigned long long) snndc->nfsd_rcmisses);
754         printf(" %s:", pfield(NULL, 0));
755         pval((unsigned long long) snndp->nfsd_readcnt, (unsigned long long) snndc->nfsd_readcnt);
756         printf(" %s:", pfield(NULL, 0));
757         pval((unsigned long long) snndp->nfsd_writecnt, (unsigned long long) snndc->nfsd_writecnt);
758         printf(" %s:", pfield(NULL, 0));
759         pval((unsigned long long) snndp->nfsd_accesscnt, (unsigned long long) snndc->nfsd_accesscnt);
760         printf(" %s:", pfield(NULL, 0));
761         pval((unsigned long long) snndp->nfsd_getattcnt, (unsigned long long) snndc->nfsd_getattcnt);
762         printf("\n");
763 }
764
765 /*
766  ***************************************************************************
767  * Display network socket statistics in raw format.
768  *
769  * IN:
770  * @a           Activity structure with statistics.
771  * @timestr     Time for current statistics sample.
772  * @curr        Index in array for current sample statistics.
773  ***************************************************************************
774  */
775 __print_funct_t raw_print_net_sock_stats(struct activity *a, char *timestr, int curr)
776 {
777         struct stats_net_sock
778                 *snsc = (struct stats_net_sock *) a->buf[curr];
779
780         printf("%s %s:%u", timestr, pfield(a->hdr_line, FIRST), snsc->sock_inuse);
781         printf(" %s:%u", pfield(NULL, 0), snsc->tcp_inuse);
782         printf(" %s:%u", pfield(NULL, 0), snsc->udp_inuse);
783         printf(" %s:%u", pfield(NULL, 0), snsc->raw_inuse);
784         printf(" %s:%u", pfield(NULL, 0), snsc->frag_inuse);
785         printf(" %s:%u", pfield(NULL, 0), snsc->tcp_tw);
786         printf("\n");
787 }
788
789 /*
790  ***************************************************************************
791  * Display IP network statistics in raw format.
792  *
793  * IN:
794  * @a           Activity structure with statistics.
795  * @timestr     Time for current statistics sample.
796  * @curr        Index in array for current sample statistics.
797  ***************************************************************************
798  */
799 __print_funct_t raw_print_net_ip_stats(struct activity *a, char *timestr, int curr)
800 {
801         struct stats_net_ip
802                 *snic = (struct stats_net_ip *) a->buf[curr],
803                 *snip = (struct stats_net_ip *) a->buf[!curr];
804
805         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
806         pval(snip->InReceives, snic->InReceives);
807         printf(" %s:", pfield(NULL, 0));
808         pval(snip->ForwDatagrams, snic->ForwDatagrams);
809         printf(" %s:", pfield(NULL, 0));
810         pval(snip->InDelivers, snic->InDelivers);
811         printf(" %s:", pfield(NULL, 0));
812         pval(snip->OutRequests, snic->OutRequests);
813         printf(" %s:", pfield(NULL, 0));
814         pval(snip->ReasmReqds, snic->ReasmReqds);
815         printf(" %s:", pfield(NULL, 0));
816         pval(snip->ReasmOKs, snic->ReasmOKs);
817         printf(" %s:", pfield(NULL, 0));
818         pval(snip->FragOKs, snic->FragOKs);
819         printf(" %s:", pfield(NULL, 0));
820         pval(snip->FragCreates, snic->FragCreates);
821         printf("\n");
822 }
823
824 /*
825  ***************************************************************************
826  * Display IP network errors statistics in raw format.
827  *
828  * IN:
829  * @a           Activity structure with statistics.
830  * @timestr     Time for current statistics sample.
831  * @curr        Index in array for current sample statistics.
832  ***************************************************************************
833  */
834 __print_funct_t raw_print_net_eip_stats(struct activity *a, char *timestr, int curr)
835 {
836         struct stats_net_eip
837                 *sneic = (struct stats_net_eip *) a->buf[curr],
838                 *sneip = (struct stats_net_eip *) a->buf[!curr];
839
840         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
841         pval(sneip->InHdrErrors, sneic->InHdrErrors);
842         printf(" %s:", pfield(NULL, 0));
843         pval(sneip->InAddrErrors, sneic->InAddrErrors);
844         printf(" %s:", pfield(NULL, 0));
845         pval(sneip->InUnknownProtos, sneic->InUnknownProtos);
846         printf(" %s:", pfield(NULL, 0));
847         pval(sneip->InDiscards, sneic->InDiscards);
848         printf(" %s:", pfield(NULL, 0));
849         pval(sneip->OutDiscards, sneic->OutDiscards);
850         printf(" %s:", pfield(NULL, 0));
851         pval(sneip->OutNoRoutes, sneic->OutNoRoutes);
852         printf(" %s:", pfield(NULL, 0));
853         pval(sneip->ReasmFails, sneic->ReasmFails);
854         printf(" %s:", pfield(NULL, 0));
855         pval(sneip->FragFails, sneic->FragFails);
856         printf("\n");
857 }
858
859 /*
860  ***************************************************************************
861  * Display ICMP network statistics in raw format.
862  *
863  * IN:
864  * @a           Activity structure with statistics.
865  * @timestr     Time for current statistics sample.
866  * @curr        Index in array for current sample statistics.
867  ***************************************************************************
868  */
869 __print_funct_t raw_print_net_icmp_stats(struct activity *a, char *timestr, int curr)
870 {
871         struct stats_net_icmp
872                 *snic = (struct stats_net_icmp *) a->buf[curr],
873                 *snip = (struct stats_net_icmp *) a->buf[!curr];
874
875         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
876         pval((unsigned long long) snip->InMsgs, (unsigned long long) snic->InMsgs);
877         printf(" %s:", pfield(NULL, 0));
878         pval((unsigned long long) snip->OutMsgs, (unsigned long long) snic->OutMsgs);
879         printf(" %s:", pfield(NULL, 0));
880         pval((unsigned long long) snip->InEchos, (unsigned long long) snic->InEchos);
881         printf(" %s:", pfield(NULL, 0));
882         pval((unsigned long long) snip->InEchoReps, (unsigned long long) snic->InEchoReps);
883         printf(" %s:", pfield(NULL, 0));
884         pval((unsigned long long) snip->OutEchos, (unsigned long long) snic->OutEchos);
885         printf(" %s:", pfield(NULL, 0));
886         pval((unsigned long long) snip->OutEchoReps, (unsigned long long) snic->OutEchoReps);
887         printf(" %s:", pfield(NULL, 0));
888         pval((unsigned long long) snip->InTimestamps, (unsigned long long) snic->InTimestamps);
889         printf(" %s:", pfield(NULL, 0));
890         pval((unsigned long long) snip->InTimestampReps, (unsigned long long) snic->InTimestampReps);
891         printf(" %s:", pfield(NULL, 0));
892         pval((unsigned long long) snip->OutTimestamps, (unsigned long long) snic->OutTimestamps);
893         printf(" %s:", pfield(NULL, 0));
894         pval((unsigned long long) snip->OutTimestampReps, (unsigned long long) snic->OutTimestampReps);
895         printf(" %s:", pfield(NULL, 0));
896         pval((unsigned long long) snip->InAddrMasks, (unsigned long long) snic->InAddrMasks);
897         printf(" %s:", pfield(NULL, 0));
898         pval((unsigned long long) snip->InAddrMaskReps, (unsigned long long) snic->InAddrMaskReps);
899         printf(" %s:", pfield(NULL, 0));
900         pval((unsigned long long) snip->OutAddrMasks, (unsigned long long) snic->OutAddrMasks);
901         printf(" %s:", pfield(NULL, 0));
902         pval((unsigned long long) snip->OutAddrMaskReps, (unsigned long long) snic->OutAddrMaskReps);
903         printf("\n");
904 }
905
906 /*
907  ***************************************************************************
908  * Display ICMP errors message statistics in raw format.
909  *
910  * IN:
911  * @a           Activity structure with statistics.
912  * @timestr     Time for current statistics sample.
913  * @curr        Index in array for current sample statistics.
914  ***************************************************************************
915  */
916 __print_funct_t raw_print_net_eicmp_stats(struct activity *a, char *timestr, int curr)
917 {
918         struct stats_net_eicmp
919                 *sneic = (struct stats_net_eicmp *) a->buf[curr],
920                 *sneip = (struct stats_net_eicmp *) a->buf[!curr];
921
922         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
923         pval((unsigned long long) sneip->InErrors, (unsigned long long) sneic->InErrors);
924         printf(" %s:", pfield(NULL, 0));
925         pval((unsigned long long) sneip->OutErrors, (unsigned long long) sneic->OutErrors);
926         printf(" %s:", pfield(NULL, 0));
927         pval((unsigned long long) sneip->InDestUnreachs, (unsigned long long) sneic->InDestUnreachs);
928         printf(" %s:", pfield(NULL, 0));
929         pval((unsigned long long) sneip->OutDestUnreachs, (unsigned long long) sneic->OutDestUnreachs);
930         printf(" %s:", pfield(NULL, 0));
931         pval((unsigned long long) sneip->InTimeExcds, (unsigned long long) sneic->InTimeExcds);
932         printf(" %s:", pfield(NULL, 0));
933         pval((unsigned long long) sneip->OutTimeExcds, (unsigned long long) sneic->OutTimeExcds);
934         printf(" %s:", pfield(NULL, 0));
935         pval((unsigned long long) sneip->InParmProbs, (unsigned long long) sneic->InParmProbs);
936         printf(" %s:", pfield(NULL, 0));
937         pval((unsigned long long) sneip->OutParmProbs, (unsigned long long) sneic->OutParmProbs);
938         printf(" %s:", pfield(NULL, 0));
939         pval((unsigned long long) sneip->InSrcQuenchs, (unsigned long long) sneic->InSrcQuenchs);
940         printf(" %s:", pfield(NULL, 0));
941         pval((unsigned long long) sneip->OutSrcQuenchs, (unsigned long long) sneic->OutSrcQuenchs);
942         printf(" %s:", pfield(NULL, 0));
943         pval((unsigned long long) sneip->InRedirects, (unsigned long long) sneic->InRedirects);
944         printf(" %s:", pfield(NULL, 0));
945         pval((unsigned long long) sneip->OutRedirects, (unsigned long long) sneic->OutRedirects);
946         printf("\n");
947 }
948
949 /*
950  ***************************************************************************
951  * Display TCP network statistics in raw format.
952  *
953  * IN:
954  * @a           Activity structure with statistics.
955  * @timestr     Time for current statistics sample.
956  * @curr        Index in array for current sample statistics.
957  ***************************************************************************
958  */
959 __print_funct_t raw_print_net_tcp_stats(struct activity *a, char *timestr, int curr)
960 {
961         struct stats_net_tcp
962                 *sntc = (struct stats_net_tcp *) a->buf[curr],
963                 *sntp = (struct stats_net_tcp *) a->buf[!curr];
964
965         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
966         pval((unsigned long long) sntp->ActiveOpens, (unsigned long long) sntc->ActiveOpens);
967         printf(" %s:", pfield(NULL, 0));
968         pval((unsigned long long) sntp->PassiveOpens, (unsigned long long) sntc->PassiveOpens);
969         printf(" %s:", pfield(NULL, 0));
970         pval((unsigned long long) sntp->InSegs, (unsigned long long) sntc->InSegs);
971         printf(" %s:", pfield(NULL, 0));
972         pval((unsigned long long) sntp->OutSegs, (unsigned long long) sntc->OutSegs);
973         printf("\n");
974 }
975
976 /*
977  ***************************************************************************
978  * Display TCP network errors statistics in raw format.
979  *
980  * IN:
981  * @a           Activity structure with statistics.
982  * @timestr     Time for current statistics sample.
983  * @curr        Index in array for current sample statistics.
984  ***************************************************************************
985  */
986 __print_funct_t raw_print_net_etcp_stats(struct activity *a, char *timestr, int curr)
987 {
988         struct stats_net_etcp
989                 *snetc = (struct stats_net_etcp *) a->buf[curr],
990                 *snetp = (struct stats_net_etcp *) a->buf[!curr];
991
992         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
993         pval((unsigned long long) snetp->AttemptFails, (unsigned long long) snetc->AttemptFails);
994         printf(" %s:", pfield(NULL, 0));
995         pval((unsigned long long) snetp->EstabResets, (unsigned long long) snetc->EstabResets);
996         printf(" %s:", pfield(NULL, 0));
997         pval((unsigned long long) snetp->RetransSegs, (unsigned long long) snetc->RetransSegs);
998         printf(" %s:", pfield(NULL, 0));
999         pval((unsigned long long) snetp->InErrs, (unsigned long long) snetc->InErrs);
1000         printf(" %s:", pfield(NULL, 0));
1001         pval((unsigned long long) snetp->OutRsts, (unsigned long long) snetc->OutRsts);
1002         printf("\n");
1003 }
1004
1005 /*
1006  ***************************************************************************
1007  * Display UDP network statistics in raw format.
1008  *
1009  * IN:
1010  * @a           Activity structure with statistics.
1011  * @timestr     Time for current statistics sample.
1012  * @curr        Index in array for current sample statistics.
1013  ***************************************************************************
1014  */
1015 __print_funct_t raw_print_net_udp_stats(struct activity *a, char *timestr, int curr)
1016 {
1017         struct stats_net_udp
1018                 *snuc = (struct stats_net_udp *) a->buf[curr],
1019                 *snup = (struct stats_net_udp *) a->buf[!curr];
1020
1021         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
1022         pval((unsigned long long) snup->InDatagrams, (unsigned long long) snuc->InDatagrams);
1023         printf(" %s:", pfield(NULL, 0));
1024         pval((unsigned long long) snup->OutDatagrams, (unsigned long long) snuc->OutDatagrams);
1025         printf(" %s:", pfield(NULL, 0));
1026         pval((unsigned long long) snup->NoPorts, (unsigned long long) snuc->NoPorts);
1027         printf(" %s:", pfield(NULL, 0));
1028         pval((unsigned long long) snup->InErrors, (unsigned long long) snuc->InErrors);
1029         printf("\n");
1030 }
1031
1032 /*
1033  ***************************************************************************
1034  * Display IPv6 network socket statistics in raw format.
1035  *
1036  * IN:
1037  * @a           Activity structure with statistics.
1038  * @timestr     Time for current statistics sample.
1039  * @curr        Index in array for current sample statistics.
1040  ***************************************************************************
1041  */
1042 __print_funct_t raw_print_net_sock6_stats(struct activity *a, char *timestr, int curr)
1043 {
1044         struct stats_net_sock6
1045                 *snsc = (struct stats_net_sock6 *) a->buf[curr];
1046
1047         printf("%s %s:%u", timestr, pfield(a->hdr_line, FIRST), snsc->tcp6_inuse);
1048         printf(" %s:%u", pfield(NULL, 0), snsc->udp6_inuse);
1049         printf(" %s:%u", pfield(NULL, 0), snsc->raw6_inuse);
1050         printf(" %s:%u", pfield(NULL, 0), snsc->frag6_inuse);
1051         printf("\n");
1052 }
1053
1054 /*
1055  ***************************************************************************
1056  * Display IPv6 network statistics in raw format.
1057  *
1058  * IN:
1059  * @a           Activity structure with statistics.
1060  * @timestr     Time for current statistics sample.
1061  * @curr        Index in array for current sample statistics.
1062  ***************************************************************************
1063  */
1064 __print_funct_t raw_print_net_ip6_stats(struct activity *a, char *timestr, int curr)
1065 {
1066         struct stats_net_ip6
1067                 *snic = (struct stats_net_ip6 *) a->buf[curr],
1068                 *snip = (struct stats_net_ip6 *) a->buf[!curr];
1069
1070         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
1071         pval(snip->InReceives6, snic->InReceives6);
1072         printf(" %s:", pfield(NULL, 0));
1073         pval(snip->OutForwDatagrams6, snic->OutForwDatagrams6);
1074         printf(" %s:", pfield(NULL, 0));
1075         pval(snip->InDelivers6, snic->InDelivers6);
1076         printf(" %s:", pfield(NULL, 0));
1077         pval(snip->OutRequests6, snic->OutRequests6);
1078         printf(" %s:", pfield(NULL, 0));
1079         pval(snip->ReasmReqds6, snic->ReasmReqds6);
1080         printf(" %s:", pfield(NULL, 0));
1081         pval(snip->ReasmOKs6, snic->ReasmOKs6);
1082         printf(" %s:", pfield(NULL, 0));
1083         pval(snip->InMcastPkts6, snic->InMcastPkts6);
1084         printf(" %s:", pfield(NULL, 0));
1085         pval(snip->OutMcastPkts6, snic->OutMcastPkts6);
1086         printf(" %s:", pfield(NULL, 0));
1087         pval(snip->FragOKs6, snic->FragOKs6);
1088         printf(" %s:", pfield(NULL, 0));
1089         pval(snip->FragCreates6, snic->FragCreates6);
1090         printf("\n");
1091 }
1092
1093 /*
1094  ***************************************************************************
1095  * Display IPv6 network errors statistics in raw format.
1096  *
1097  * IN:
1098  * @a           Activity structure with statistics.
1099  * @timestr     Time for current statistics sample.
1100  * @curr        Index in array for current sample statistics.
1101  ***************************************************************************
1102  */
1103 __print_funct_t raw_print_net_eip6_stats(struct activity *a, char *timestr, int curr)
1104 {
1105         struct stats_net_eip6
1106                 *sneic = (struct stats_net_eip6 *) a->buf[curr],
1107                 *sneip = (struct stats_net_eip6 *) a->buf[!curr];
1108
1109         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
1110         pval(sneip->InHdrErrors6, sneic->InHdrErrors6);
1111         printf(" %s:", pfield(NULL, 0));
1112         pval(sneip->InAddrErrors6, sneic->InAddrErrors6);
1113         printf(" %s:", pfield(NULL, 0));
1114         pval(sneip->InUnknownProtos6, sneic->InUnknownProtos6);
1115         printf(" %s:", pfield(NULL, 0));
1116         pval(sneip->InTooBigErrors6, sneic->InTooBigErrors6);
1117         printf(" %s:", pfield(NULL, 0));
1118         pval(sneip->InDiscards6, sneic->InDiscards6);
1119         printf(" %s:", pfield(NULL, 0));
1120         pval(sneip->OutDiscards6, sneic->OutDiscards6);
1121         printf(" %s:", pfield(NULL, 0));
1122         pval(sneip->InNoRoutes6, sneic->InNoRoutes6);
1123         printf(" %s:", pfield(NULL, 0));
1124         pval(sneip->OutNoRoutes6, sneic->OutNoRoutes6);
1125         printf(" %s:", pfield(NULL, 0));
1126         pval(sneip->ReasmFails6, sneic->ReasmFails6);
1127         printf(" %s:", pfield(NULL, 0));
1128         pval(sneip->FragFails6, sneic->FragFails6);
1129         printf(" %s:", pfield(NULL, 0));
1130         pval(sneip->InTruncatedPkts6, sneic->InTruncatedPkts6);
1131         printf("\n");
1132 }
1133
1134 /*
1135  ***************************************************************************
1136  * Display ICMPv6 network statistics in raw format.
1137  *
1138  * IN:
1139  * @a           Activity structure with statistics.
1140  * @timestr     Time for current statistics sample.
1141  * @curr        Index in array for current sample statistics.
1142  ***************************************************************************
1143  */
1144 __print_funct_t raw_print_net_icmp6_stats(struct activity *a, char *timestr, int curr)
1145 {
1146         struct stats_net_icmp6
1147                 *snic = (struct stats_net_icmp6 *) a->buf[curr],
1148                 *snip = (struct stats_net_icmp6 *) a->buf[!curr];
1149
1150         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
1151         pval((unsigned long long) snip->InMsgs6,
1152              (unsigned long long) snic->InMsgs6);
1153         printf(" %s:", pfield(NULL, 0));
1154         pval((unsigned long long) snip->OutMsgs6,
1155              (unsigned long long) snic->OutMsgs6);
1156         printf(" %s:", pfield(NULL, 0));
1157         pval((unsigned long long) snip->InEchos6,
1158              (unsigned long long) snic->InEchos6);
1159         printf(" %s:", pfield(NULL, 0));
1160         pval((unsigned long long) snip->InEchoReplies6,
1161              (unsigned long long) snic->InEchoReplies6);
1162         printf(" %s:", pfield(NULL, 0));
1163         pval((unsigned long long) snip->OutEchoReplies6,
1164              (unsigned long long) snic->OutEchoReplies6);
1165         printf(" %s:", pfield(NULL, 0));
1166         pval((unsigned long long) snip->InGroupMembQueries6,
1167              (unsigned long long) snic->InGroupMembQueries6);
1168         printf(" %s:", pfield(NULL, 0));
1169         pval((unsigned long long) snip->InGroupMembResponses6,
1170              (unsigned long long) snic->InGroupMembResponses6);
1171         printf(" %s:", pfield(NULL, 0));
1172         pval((unsigned long long) snip->OutGroupMembResponses6,
1173              (unsigned long long) snic->OutGroupMembResponses6);
1174         printf(" %s:", pfield(NULL, 0));
1175         pval((unsigned long long) snip->InGroupMembReductions6,
1176              (unsigned long long) snic->InGroupMembReductions6);
1177         printf(" %s:", pfield(NULL, 0));
1178         pval((unsigned long long) snip->OutGroupMembReductions6,
1179              (unsigned long long) snic->OutGroupMembReductions6);
1180         printf(" %s:", pfield(NULL, 0));
1181         pval((unsigned long long) snip->InRouterSolicits6,
1182              (unsigned long long) snic->InRouterSolicits6);
1183         printf(" %s:", pfield(NULL, 0));
1184         pval((unsigned long long) snip->OutRouterSolicits6,
1185              (unsigned long long) snic->OutRouterSolicits6);
1186         printf(" %s:", pfield(NULL, 0));
1187         pval((unsigned long long) snip->InRouterAdvertisements6,
1188              (unsigned long long) snic->InRouterAdvertisements6);
1189         printf(" %s:", pfield(NULL, 0));
1190         pval((unsigned long long) snip->InNeighborSolicits6,
1191              (unsigned long long) snic->InNeighborSolicits6);
1192         printf(" %s:", pfield(NULL, 0));
1193         pval((unsigned long long) snip->OutNeighborSolicits6,
1194              (unsigned long long) snic->OutNeighborSolicits6);
1195         printf(" %s:", pfield(NULL, 0));
1196         pval((unsigned long long) snip->InNeighborAdvertisements6,
1197              (unsigned long long) snic->InNeighborAdvertisements6);
1198         printf(" %s:", pfield(NULL, 0));
1199         pval((unsigned long long) snip->OutNeighborAdvertisements6,
1200              (unsigned long long) snic->OutNeighborAdvertisements6);
1201         printf("\n");
1202 }
1203
1204 /*
1205  ***************************************************************************
1206  * Display ICMPv6 error messages statistics in rw format.
1207  *
1208  * IN:
1209  * @a           Activity structure with statistics.
1210  * @timestr     Time for current statistics sample.
1211  * @curr        Index in array for current sample statistics.
1212  ***************************************************************************
1213  */
1214 __print_funct_t raw_print_net_eicmp6_stats(struct activity *a, char *timestr, int curr)
1215 {
1216         struct stats_net_eicmp6
1217                 *sneic = (struct stats_net_eicmp6 *) a->buf[curr],
1218                 *sneip = (struct stats_net_eicmp6 *) a->buf[!curr];
1219
1220         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
1221         pval((unsigned long long) sneip->InErrors6, (unsigned long long) sneic->InErrors6);
1222         printf(" %s:", pfield(NULL, 0));
1223         pval((unsigned long long) sneip->InDestUnreachs6, (unsigned long long) sneic->InDestUnreachs6);
1224         printf(" %s:", pfield(NULL, 0));
1225         pval((unsigned long long) sneip->OutDestUnreachs6, (unsigned long long) sneic->OutDestUnreachs6);
1226         printf(" %s:", pfield(NULL, 0));
1227         pval((unsigned long long) sneip->InTimeExcds6, (unsigned long long) sneic->InTimeExcds6);
1228         printf(" %s:", pfield(NULL, 0));
1229         pval((unsigned long long) sneip->OutTimeExcds6, (unsigned long long) sneic->OutTimeExcds6);
1230         printf(" %s:", pfield(NULL, 0));
1231         pval((unsigned long long) sneip->InParmProblems6, (unsigned long long) sneic->InParmProblems6);
1232         printf(" %s:", pfield(NULL, 0));
1233         pval((unsigned long long) sneip->OutParmProblems6, (unsigned long long) sneic->OutParmProblems6);
1234         printf(" %s:", pfield(NULL, 0));
1235         pval((unsigned long long) sneip->InRedirects6, (unsigned long long) sneic->InRedirects6);
1236         printf(" %s:", pfield(NULL, 0));
1237         pval((unsigned long long) sneip->OutRedirects6, (unsigned long long) sneic->OutRedirects6);
1238         printf(" %s:", pfield(NULL, 0));
1239         pval((unsigned long long) sneip->InPktTooBigs6, (unsigned long long) sneic->InPktTooBigs6);
1240         printf(" %s:", pfield(NULL, 0));
1241         pval((unsigned long long) sneip->OutPktTooBigs6, (unsigned long long) sneic->OutPktTooBigs6);
1242         printf("\n");
1243 }
1244
1245 /*
1246  ***************************************************************************
1247  * Display UDPv6 network statistics in raw format.
1248  *
1249  * IN:
1250  * @a           Activity structure with statistics.
1251  * @timestr     Time for current statistics sample.
1252  * @curr        Index in array for current sample statistics.
1253  ***************************************************************************
1254  */
1255 __print_funct_t raw_print_net_udp6_stats(struct activity *a, char *timestr, int curr)
1256 {
1257         struct stats_net_udp6
1258                 *snuc = (struct stats_net_udp6 *) a->buf[curr],
1259                 *snup = (struct stats_net_udp6 *) a->buf[!curr];
1260
1261         printf("%s %s:", timestr, pfield(a->hdr_line, FIRST));
1262         pval((unsigned long long) snup->InDatagrams6, (unsigned long long) snuc->InDatagrams6);
1263         printf(" %s:", pfield(NULL, 0));
1264         pval((unsigned long long) snup->OutDatagrams6, (unsigned long long) snuc->OutDatagrams6);
1265         printf(" %s:", pfield(NULL, 0));
1266         pval((unsigned long long) snup->NoPorts6, (unsigned long long) snuc->NoPorts6);
1267         printf(" %s:", pfield(NULL, 0));
1268         pval((unsigned long long) snup->InErrors6, (unsigned long long) snuc->InErrors6);
1269         printf("\n");
1270 }
1271
1272 /*
1273  ***************************************************************************
1274  * Display CPU frequency statistics in raw format.
1275  *
1276  * IN:
1277  * @a           Activity structure with statistics.
1278  * @timestr     Time for current statistics sample.
1279  * @curr        Index in array for current sample statistics.
1280  ***************************************************************************
1281  */
1282 __print_funct_t raw_print_pwr_cpufreq_stats(struct activity *a, char *timestr, int curr)
1283 {
1284         int i;
1285         struct stats_pwr_cpufreq *spc;
1286
1287         for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) {
1288
1289                 spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize);
1290
1291                 /* Should current CPU (including CPU "all") be displayed? */
1292                 if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
1293                         /* Yes: Display it */
1294                         printf("%s %s:%d", timestr, pfield(a->hdr_line, FIRST), i - 1);
1295                         printf(" %s:%lu\n", pfield(NULL, 0), spc->cpufreq);
1296                 }
1297         }
1298 }
1299
1300 /*
1301  ***************************************************************************
1302  * Display fan statistics in raw format.
1303  *
1304  * IN:
1305  * @a           Activity structure with statistics.
1306  * @timestr     Time for current statistics sample.
1307  * @curr        Index in array for current sample statistics.
1308  ***************************************************************************
1309  */
1310 __print_funct_t raw_print_pwr_fan_stats(struct activity *a, char *timestr, int curr)
1311 {
1312         int i;
1313         struct stats_pwr_fan *spc;
1314
1315         for (i = 0; i < a->nr[curr]; i++) {
1316                 spc = (struct stats_pwr_fan *) ((char *) a->buf[curr] + i * a->msize);
1317
1318                 printf("%s %s:%d", timestr, pfield(a->hdr_line, FIRST), i + 1);
1319                 printf(" %s:%s", pfield(NULL, 0), spc->device);
1320                 printf(" %s:%f", pfield(NULL, 0), spc->rpm);
1321                 printf(" rpm_min:%f\n", spc->rpm_min);
1322         }
1323 }
1324
1325 /*
1326  ***************************************************************************
1327  * Display temperature statistics in raw format.
1328  *
1329  * IN:
1330  * @a           Activity structure with statistics.
1331  * @timestr     Time for current statistics sample.
1332  * @curr        Index in array for current sample statistics.
1333  ***************************************************************************
1334  */
1335 __print_funct_t raw_print_pwr_temp_stats(struct activity *a, char *timestr, int curr)
1336 {
1337         int i;
1338         struct stats_pwr_temp *spc;
1339
1340         for (i = 0; i < a->nr[curr]; i++) {
1341                 spc = (struct stats_pwr_temp *) ((char *) a->buf[curr] + i * a->msize);
1342
1343                 printf("%s %s:%d", timestr, pfield(a->hdr_line, FIRST), i + 1);
1344                 printf(" %s:%s", pfield(NULL, 0), spc->device);
1345                 printf(" %s:%f", pfield(NULL, 0), spc->temp);
1346                 printf(" temp_min:%f", spc->temp_min);
1347                 printf(" temp_max:%f\n", spc->temp_max);
1348         }
1349 }
1350
1351 /*
1352  ***************************************************************************
1353  * Display voltage inputs statistics in raw format.
1354  *
1355  * IN:
1356  * @a           Activity structure with statistics.
1357  * @timestr     Time for current statistics sample.
1358  * @curr        Index in array for current sample statistics.
1359  ***************************************************************************
1360  */
1361 __print_funct_t raw_print_pwr_in_stats(struct activity *a, char *timestr, int curr)
1362 {
1363         int i;
1364         struct stats_pwr_in *spc;
1365
1366         for (i = 0; i < a->nr[curr]; i++) {
1367                 spc = (struct stats_pwr_in *) ((char *) a->buf[curr] + i * a->msize);
1368
1369                 printf("%s %s:%d", timestr, pfield(a->hdr_line, FIRST), i);
1370                 printf(" %s:%s", pfield(NULL, 0), spc->device);
1371                 printf(" %s:%f", pfield(NULL, 0), spc->in);
1372                 printf(" in_min:%f", spc->in_min);
1373                 printf(" in_max:%f\n", spc->in_max);
1374         }
1375 }
1376
1377 /*
1378  ***************************************************************************
1379  * Display huge pages statistics in raw format.
1380  *
1381  * IN:
1382  * @a           Activity structure with statistics.
1383  * @timestr     Time for current statistics sample.
1384  * @curr        Index in array for current sample statistics.
1385  ***************************************************************************
1386  */
1387 __print_funct_t raw_print_huge_stats(struct activity *a, char *timestr, int curr)
1388 {
1389         struct stats_huge
1390                 *smc = (struct stats_huge *) a->buf[curr];
1391
1392         printf("%s %s:%llu", timestr, pfield(a->hdr_line, FIRST), smc->frhkb);
1393         printf(" hugtotal:%llu\n", smc->tlhkb);
1394 }
1395
1396 /*
1397  ***************************************************************************
1398  * Display weighted CPU frequency statistics in raw format.
1399  *
1400  * IN:
1401  * @a           Activity structure with statistics.
1402  * @timestr     Time for current statistics sample.
1403  * @curr        Index in array for current sample statistics.
1404  ***************************************************************************
1405  */
1406 __print_funct_t raw_print_pwr_wghfreq_stats(struct activity *a, char *timestr, int curr)
1407 {
1408         int i, k;
1409         struct stats_pwr_wghfreq *spc, *spp, *spc_k, *spp_k;
1410
1411         for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) {
1412
1413                 spc = (struct stats_pwr_wghfreq *) ((char *) a->buf[curr]  + i * a->msize * a->nr2);
1414                 spp = (struct stats_pwr_wghfreq *) ((char *) a->buf[!curr] + i * a->msize * a->nr2);
1415
1416                 /* Should current CPU (including CPU "all") be displayed? */
1417                 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))))
1418                         /* No */
1419                         continue;
1420
1421                 printf("%s %s:%d", timestr, pfield(a->hdr_line, FIRST), i - 1);
1422
1423                 for (k = 0; k < a->nr2; k++) {
1424
1425                         spc_k = (struct stats_pwr_wghfreq *) ((char *) spc + k * a->msize);
1426                         if (!spc_k->freq)
1427                                 break;
1428                         spp_k = (struct stats_pwr_wghfreq *) ((char *) spp + k * a->msize);
1429
1430                         printf(" freq: %lu", spc_k->freq);
1431                         printf(" tminst:");
1432                         pval(spp_k->time_in_state, spc_k->time_in_state);
1433                 }
1434                 printf("\n");
1435         }
1436 }
1437
1438 /*
1439  ***************************************************************************
1440  * Display USB devices statistics in raw format.
1441  *
1442  * IN:
1443  * @a           Activity structure with statistics.
1444  * @timestr     Time for current statistics sample.
1445  * @curr        Index in array for current sample statistics.
1446  ***************************************************************************
1447  */
1448 __print_funct_t raw_print_pwr_usb_stats(struct activity *a, char *timestr, int curr)
1449 {
1450         int i;
1451         struct stats_pwr_usb *suc;
1452
1453         for (i = 0; i < a->nr[curr]; i++) {
1454                 suc = (struct stats_pwr_usb *) ((char *) a->buf[curr] + i * a->msize);
1455
1456                 printf("%s %s:\"%s\"", timestr, pfield(a->hdr_line, FIRST), suc->manufacturer);
1457                 printf(" %s:\"%s\"", pfield(NULL, 0), suc->product);
1458                 printf(" %s:%d", pfield(NULL, 0), suc->bus_nr);
1459                 printf(" %s:%x", pfield(NULL, 0), suc->vendor_id);
1460                 printf(" %s:%x", pfield(NULL, 0), suc->product_id);
1461                 printf(" %s:%u\n", pfield(NULL, 0), suc->bmaxpower);
1462         }
1463 }
1464
1465 /*
1466  ***************************************************************************
1467  * Display filesystems statistics in raw format.
1468  *
1469  * IN:
1470  * @a           Activity structure with statistics.
1471  * @timestr     Time for current statistics sample.
1472  * @curr        Index in array for current sample statistics.
1473  ***************************************************************************
1474  */
1475 __print_funct_t raw_print_filesystem_stats(struct activity *a, char *timestr, int curr)
1476 {
1477         int i;
1478         struct stats_filesystem *sfc;
1479
1480         for (i = 0; i < a->nr[curr]; i++) {
1481                 sfc = (struct stats_filesystem *) ((char *) a->buf[curr] + i * a->msize);
1482
1483                 printf("%s %s:\"%s\"", timestr, pfield(a->hdr_line, FIRST + DISPLAY_MOUNT(a->opt_flags)),
1484                        DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name);
1485                 printf(" f_bfree:%llu", sfc->f_bfree);
1486                 printf(" f_blocks:%llu", sfc->f_blocks);
1487                 printf(" f_bavail:%llu", sfc->f_bavail);
1488                 pfield(NULL, 0); /* Skip MBfsfree */
1489                 pfield(NULL, 0); /* Skip MBfsused */
1490                 pfield(NULL, 0); /* Skip %fsused */
1491                 pfield(NULL, 0); /* Skip %ufsused */
1492                 printf(" %s:%llu", pfield(NULL, 0), sfc->f_ffree);
1493                 printf(" f_files:%llu\n", sfc->f_files);
1494
1495         }
1496 }
1497
1498 /*
1499  ***************************************************************************
1500  * Display Fibre Channel HBA statistics in raw format.
1501  *
1502  * IN:
1503  * @a           Activity structure with statistics.
1504  * @timestr     Time for current statistics sample.
1505  * @curr        Index in array for current sample statistics.
1506  ***************************************************************************
1507  */
1508 __print_funct_t raw_print_fchost_stats(struct activity *a, char *timestr, int curr)
1509 {
1510         int i, j, j0, found;
1511         struct stats_fchost *sfcc, *sfcp;
1512
1513         for (i = 0; i < a->nr[curr]; i++) {
1514
1515                 found = FALSE;
1516
1517                 if (a->nr[!curr] > 0) {
1518                         sfcc = (struct stats_fchost *) ((char *) a->buf[curr] + i * a->msize);
1519
1520                         /* Look for corresponding structure in previous iteration */
1521                         j = i;
1522
1523                         if (j >= a->nr[!curr]) {
1524                                 j = a->nr[!curr] - 1;
1525                         }
1526
1527                         j0 = j;
1528
1529                         do {
1530                                 sfcp = (struct stats_fchost *) ((char *) a->buf[!curr] + j * a->msize);
1531                                 if (!strcmp(sfcc->fchost_name, sfcp->fchost_name)) {
1532                                         found = TRUE;
1533                                         break;
1534                                 }
1535                                 if (++j >= a->nr[!curr]) {
1536                                         j = 0;
1537                                 }
1538                         }
1539                         while (j != j0);
1540                 }
1541
1542                 if (!found)
1543                         continue;
1544
1545                 printf(" %s:%s", pfield(a->hdr_line, FIRST), sfcc->fchost_name);
1546                 printf(" %s:", pfield(NULL, 0));
1547                 pval((unsigned long long) sfcp->f_rxframes, (unsigned long long) sfcc->f_rxframes);
1548                 printf(" %s:", pfield(NULL, 0));
1549                 pval((unsigned long long) sfcp->f_txframes, (unsigned long long) sfcc->f_txframes);
1550                 printf(" %s:", pfield(NULL, 0));
1551                 pval((unsigned long long) sfcp->f_rxwords, (unsigned long long) sfcc->f_rxwords);
1552                 printf(" %s:", pfield(NULL, 0));
1553                 pval((unsigned long long) sfcp->f_txwords, (unsigned long long) sfcc->f_txwords);
1554                 printf("\n");
1555         }
1556 }
1557
1558 /*
1559  ***************************************************************************
1560  * Display softnet statistics in raw format.
1561  *
1562  * IN:
1563  * @a           Activity structure with statistics.
1564  * @timestr     Time for current statistics sample.
1565  * @curr        Index in array for current sample statistics.
1566  ***************************************************************************
1567  */
1568 __print_funct_t raw_print_softnet_stats(struct activity *a, char *timestr, int curr)
1569 {
1570         int i;
1571         struct stats_softnet *ssnc, *ssnp;
1572
1573         for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) {
1574
1575                 /*
1576                  * The size of a->buf[...] CPU structure may be different from the default
1577                  * sizeof(struct stats_pwr_cpufreq) value if data have been read from a file!
1578                  * That's why we don't use a syntax like:
1579                  * ssnc = (struct stats_softnet *) a->buf[...] + i;
1580                  */
1581                 ssnc = (struct stats_softnet *) ((char *) a->buf[curr]  + i * a->msize);
1582                 ssnp = (struct stats_softnet *) ((char *) a->buf[!curr] + i * a->msize);
1583
1584                 /*
1585                  * Note: a->nr is in [1, NR_CPUS + 1].
1586                  * Bitmap size is provided for (NR_CPUS + 1) CPUs.
1587                  * Anyway, NR_CPUS may vary between the version of sysstat
1588                  * used by sadc to create a file, and the version of sysstat
1589                  * used by sar to read it...
1590                  */
1591
1592                 /* Should current CPU (including CPU "all") be displayed? */
1593                 if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))))
1594                         /* No */
1595                         continue;
1596
1597                 /* Yes: Display current CPU stats */
1598                 printf("%s %s:%d", timestr, pfield(a->hdr_line, FIRST), i - 1);
1599                 printf(" %s:", pfield(NULL, 0));
1600                 pval((unsigned long long) ssnp->processed, (unsigned long long) ssnc->processed);
1601                 printf(" %s:", pfield(NULL, 0));
1602                 pval((unsigned long long) ssnp->dropped, (unsigned long long) ssnc->dropped);
1603                 printf(" %s:", pfield(NULL, 0));
1604                 pval((unsigned long long) ssnp->time_squeeze, (unsigned long long) ssnc->time_squeeze);
1605                 printf(" %s:", pfield(NULL, 0));
1606                 pval((unsigned long long) ssnp->received_rps, (unsigned long long) ssnc->received_rps);
1607                 printf(" %s:", pfield(NULL, 0));
1608                 pval((unsigned long long) ssnp->flow_limit, (unsigned long long) ssnc->flow_limit);
1609                 printf("\n");
1610         }
1611 }