]> granicus.if.org Git - sysstat/blob - activity.c
sar: Update statistics structures
[sysstat] / activity.c
1 /*
2  * activity.c: Define system activities available for sar/sadc.
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 "sa.h"
23
24 #ifdef SOURCE_SADC
25 #include "rd_stats.h"
26 #include "rd_sensors.h"
27 #endif
28
29 #ifdef SOURCE_SAR
30 #include "pr_stats.h"
31 #endif
32
33 #ifdef SOURCE_SADF
34 #include "rndr_stats.h"
35 #include "xml_stats.h"
36 #include "json_stats.h"
37 #include "svg_stats.h"
38 #include "raw_stats.h"
39 #endif
40
41 /*
42  ***************************************************************************
43  * Definitions of system activities.
44  * See sa.h file for activity structure definition.
45  * Activity structure doesn't matter for daily data files.
46  ***************************************************************************
47  */
48
49 /*
50  * Bitmaps needed by activities.
51  * Remember to allocate them before use!
52  */
53
54 /* CPU bitmap */
55 struct act_bitmap cpu_bitmap = {
56         .b_array        = NULL,
57         .b_size         = NR_CPUS
58 };
59
60 /* Interrupts bitmap */
61 struct act_bitmap irq_bitmap = {
62         .b_array        = NULL,
63         .b_size         = NR_IRQS
64 };
65
66
67 /*
68  * CPU statistics.
69  * This is the only activity which *must* be collected by sadc
70  * so that uptime can be filled.
71  */
72 struct activity cpu_act = {
73         .id             = A_CPU,
74         .options        = AO_COLLECTED + AO_COUNTED + AO_PERSISTENT +
75                           AO_MULTIPLE_OUTPUTS + AO_GRAPH_PER_ITEM,
76         .magic          = ACTIVITY_MAGIC_BASE,
77         .group          = G_DEFAULT,
78 #ifdef SOURCE_SADC
79         .f_count_index  = 0,    /* wrap_get_cpu_nr() */
80         .f_count2       = NULL,
81         .f_read         = wrap_read_stat_cpu,
82 #endif
83 #ifdef SOURCE_SAR
84         .f_print        = print_cpu_stats,
85         .f_print_avg    = print_cpu_stats,
86 #endif
87 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
88         .hdr_line       = "CPU;%user;%nice;%system;%iowait;%steal;%idle|"
89                           "CPU;%usr;%nice;%sys;%iowait;%steal;%irq;%soft;%guest;%gnice;%idle",
90 #endif
91         .gtypes_nr      = {STATS_CPU_ULL, STATS_CPU_UL, STATS_CPU_U},
92         .ftypes_nr      = {0, 0, 0},
93 #ifdef SOURCE_SADF
94         .f_render       = render_cpu_stats,
95         .f_xml_print    = xml_print_cpu_stats,
96         .f_json_print   = json_print_cpu_stats,
97         .f_svg_print    = svg_print_cpu_stats,
98         .f_raw_print    = raw_print_cpu_stats,
99         .name           = "A_CPU",
100         .g_nr           = 1,
101 #endif
102         .nr_ini         = -1,
103         .nr2            = 1,
104         .nr_max         = NR_CPUS + 1,
105         .nr             = {-1, -1, -1},
106         .nr_allocated   = 0,
107         .fsize          = STATS_CPU_SIZE,
108         .msize          = STATS_CPU_SIZE,
109         .opt_flags      = AO_F_CPU_DEF,
110         .buf            = {NULL, NULL, NULL},
111         .bitmap         = &cpu_bitmap
112 };
113
114 /* Process (task) creation and context switch activity */
115 struct activity pcsw_act = {
116         .id             = A_PCSW,
117         .options        = AO_COLLECTED,
118         .magic          = ACTIVITY_MAGIC_BASE,
119         .group          = G_DEFAULT,
120 #ifdef SOURCE_SADC
121         .f_count_index  = -1,
122         .f_count2       = NULL,
123         .f_read         = wrap_read_stat_pcsw,
124 #endif
125 #ifdef SOURCE_SAR
126         .f_print        = print_pcsw_stats,
127         .f_print_avg    = print_pcsw_stats,
128 #endif
129 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
130         .hdr_line       = "proc/s;cswch/s",
131 #endif
132         .gtypes_nr      = {STATS_PCSW_ULL, STATS_PCSW_UL, STATS_PCSW_U},
133         .ftypes_nr      = {0, 0, 0},
134 #ifdef SOURCE_SADF
135         .f_render       = render_pcsw_stats,
136         .f_xml_print    = xml_print_pcsw_stats,
137         .f_json_print   = json_print_pcsw_stats,
138         .f_svg_print    = svg_print_pcsw_stats,
139         .f_raw_print    = raw_print_pcsw_stats,
140         .name           = "A_PCSW",
141         .g_nr           = 2,
142 #endif
143         .nr_ini         = 1,
144         .nr2            = 1,
145         .nr_max         = 1,
146         .nr             = {1, 1, 1},
147         .nr_allocated   = 0,
148         .fsize          = STATS_PCSW_SIZE,
149         .msize          = STATS_PCSW_SIZE,
150         .opt_flags      = 0,
151         .buf            = {NULL, NULL, NULL},
152         .bitmap         = NULL
153 };
154
155 /* Interrupts statistics */
156 struct activity irq_act = {
157         .id             = A_IRQ,
158         .options        = AO_COUNTED,
159         .magic          = ACTIVITY_MAGIC_BASE,
160         .group          = G_INT,
161 #ifdef SOURCE_SADC
162         .f_count_index  = 1,    /* wrap_get_irq_nr() */
163         .f_count2       = NULL,
164         .f_read         = wrap_read_stat_irq,
165 #endif
166 #ifdef SOURCE_SAR
167         .f_print        = print_irq_stats,
168         .f_print_avg    = print_irq_stats,
169 #endif
170 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
171         .hdr_line       = "INTR;intr/s",
172 #endif
173         .gtypes_nr      = {STATS_IRQ_ULL, STATS_IRQ_UL, STATS_IRQ_U},
174         .ftypes_nr      = {0, 0, 0},
175 #ifdef SOURCE_SADF
176         .f_render       = render_irq_stats,
177         .f_xml_print    = xml_print_irq_stats,
178         .f_json_print   = json_print_irq_stats,
179         .f_svg_print    = NULL,
180         .f_raw_print    = raw_print_irq_stats,
181         .name           = "A_IRQ",
182         .g_nr           = 0,
183 #endif
184         .nr_ini         = -1,
185         .nr2            = 1,
186         .nr_max         = NR_IRQS + 1,
187         .nr             = {-1, -1, -1},
188         .nr_allocated   = 0,
189         .fsize          = STATS_IRQ_SIZE,
190         .msize          = STATS_IRQ_SIZE,
191         .opt_flags      = 0,
192         .buf            = {NULL, NULL, NULL},
193         .bitmap         = &irq_bitmap
194 };
195
196 /* Swapping activity */
197 struct activity swap_act = {
198         .id             = A_SWAP,
199         .options        = AO_COLLECTED,
200         .magic          = ACTIVITY_MAGIC_BASE,
201         .group          = G_DEFAULT,
202 #ifdef SOURCE_SADC
203         .f_count_index  = -1,
204         .f_count2       = NULL,
205         .f_read         = wrap_read_swap,
206 #endif
207 #ifdef SOURCE_SAR
208         .f_print        = print_swap_stats,
209         .f_print_avg    = print_swap_stats,
210 #endif
211 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
212         .hdr_line       = "pswpin/s;pswpout/s",
213 #endif
214         .gtypes_nr      = {STATS_SWAP_ULL, STATS_SWAP_UL, STATS_SWAP_U},
215         .ftypes_nr      = {0, 0, 0},
216 #ifdef SOURCE_SADF
217         .f_render       = render_swap_stats,
218         .f_xml_print    = xml_print_swap_stats,
219         .f_json_print   = json_print_swap_stats,
220         .f_svg_print    = svg_print_swap_stats,
221         .f_raw_print    = raw_print_swap_stats,
222         .name           = "A_SWAP",
223         .g_nr           = 1,
224 #endif
225         .nr_ini         = 1,
226         .nr2            = 1,
227         .nr_max         = 1,
228         .nr             = {1, 1, 1},
229         .nr_allocated   = 0,
230         .fsize          = STATS_SWAP_SIZE,
231         .msize          = STATS_SWAP_SIZE,
232         .opt_flags      = 0,
233         .buf            = {NULL, NULL, NULL},
234         .bitmap         = NULL
235 };
236
237 /* Paging activity */
238 struct activity paging_act = {
239         .id             = A_PAGE,
240         .options        = AO_COLLECTED,
241         .magic          = ACTIVITY_MAGIC_BASE,
242         .group          = G_DEFAULT,
243 #ifdef SOURCE_SADC
244         .f_count_index  = -1,
245         .f_count2       = NULL,
246         .f_read         = wrap_read_paging,
247 #endif
248 #ifdef SOURCE_SAR
249         .f_print        = print_paging_stats,
250         .f_print_avg    = print_paging_stats,
251 #endif
252 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
253         .hdr_line       = "pgpgin/s;pgpgout/s;fault/s;majflt/s;"
254                           "pgfree/s;pgscank/s;pgscand/s;pgsteal/s;%vmeff",
255 #endif
256         .gtypes_nr      = {STATS_PAGING_ULL, STATS_PAGING_UL, STATS_PAGING_U},
257         .ftypes_nr      = {0, 0, 0},
258 #ifdef SOURCE_SADF
259         .f_render       = render_paging_stats,
260         .f_xml_print    = xml_print_paging_stats,
261         .f_json_print   = json_print_paging_stats,
262         .f_svg_print    = svg_print_paging_stats,
263         .f_raw_print    = raw_print_paging_stats,
264         .name           = "A_PAGE",
265         .g_nr           = 3,
266 #endif
267         .nr_ini         = 1,
268         .nr2            = 1,
269         .nr_max         = 1,
270         .nr             = {1, 1, 1},
271         .nr_allocated   = 0,
272         .fsize          = STATS_PAGING_SIZE,
273         .msize          = STATS_PAGING_SIZE,
274         .opt_flags      = 0,
275         .buf            = {NULL, NULL, NULL},
276         .bitmap         = NULL
277 };
278
279 /* I/O and transfer rate activity */
280 struct activity io_act = {
281         .id             = A_IO,
282         .options        = AO_COLLECTED,
283         .magic          = ACTIVITY_MAGIC_BASE + 1,
284         .group          = G_DEFAULT,
285 #ifdef SOURCE_SADC
286         .f_count_index  = -1,
287         .f_count2       = NULL,
288         .f_read         = wrap_read_io,
289 #endif
290 #ifdef SOURCE_SAR
291         .f_print        = print_io_stats,
292         .f_print_avg    = print_io_stats,
293 #endif
294 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
295         .hdr_line       = "tps;rtps;wtps;bread/s;bwrtn/s",
296 #endif
297         .gtypes_nr      = {STATS_IO_ULL, STATS_IO_UL, STATS_IO_U},
298         .ftypes_nr      = {0, 0, 0},
299 #ifdef SOURCE_SADF
300         .f_render       = render_io_stats,
301         .f_xml_print    = xml_print_io_stats,
302         .f_json_print   = json_print_io_stats,
303         .f_svg_print    = svg_print_io_stats,
304         .f_raw_print    = raw_print_io_stats,
305         .name           = "A_IO",
306         .g_nr           = 2,
307 #endif
308         .nr_ini         = 1,
309         .nr2            = 1,
310         .nr_max         = 1,
311         .nr             = {1, 1, 1},
312         .nr_allocated   = 0,
313         .fsize          = STATS_IO_SIZE,
314         .msize          = STATS_IO_SIZE,
315         .opt_flags      = 0,
316         .buf            = {NULL, NULL, NULL},
317         .bitmap         = NULL
318 };
319
320 /* Memory and swap space utilization activity */
321 struct activity memory_act = {
322         .id             = A_MEMORY,
323         .options        = AO_COLLECTED + AO_MULTIPLE_OUTPUTS,
324         .magic          = ACTIVITY_MAGIC_BASE,
325         .group          = G_DEFAULT,
326 #ifdef SOURCE_SADC
327         .f_count_index  = -1,
328         .f_count2       = NULL,
329         .f_read         = wrap_read_meminfo,
330 #endif
331 #ifdef SOURCE_SAR
332         .f_print        = print_memory_stats,
333         .f_print_avg    = print_avg_memory_stats,
334 #endif
335 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
336         .hdr_line       = "kbmemfree;kbavail;kbmemused;%memused;kbbuffers;kbcached;kbcommit;%commit;kbactive;kbinact;kbdirty&kbanonpg;kbslab;kbkstack;kbpgtbl;kbvmused|"
337                           "kbswpfree;kbswpused;%swpused;kbswpcad;%swpcad",
338 #endif
339         .gtypes_nr      = {STATS_MEMORY_ULL, STATS_MEMORY_UL, STATS_MEMORY_U},
340         .ftypes_nr      = {0, 0, 0},
341 #ifdef SOURCE_SADF
342         .f_render       = render_memory_stats,
343         .f_xml_print    = xml_print_memory_stats,
344         .f_json_print   = json_print_memory_stats,
345         .f_svg_print    = svg_print_memory_stats,
346         .f_raw_print    = raw_print_memory_stats,
347         .name           = "A_MEMORY",
348         .g_nr           = 9,
349 #endif
350         .nr_ini         = 1,
351         .nr2            = 1,
352         .nr_max         = 1,
353         .nr             = {1, 1, 1},
354         .nr_allocated   = 0,
355         .fsize          = STATS_MEMORY_SIZE,
356         .msize          = STATS_MEMORY_SIZE,
357         .opt_flags      = 0,
358         .buf            = {NULL, NULL, NULL},
359         .bitmap         = NULL
360 };
361
362 /* Kernel tables activity */
363 struct activity ktables_act = {
364         .id             = A_KTABLES,
365         .options        = AO_COLLECTED,
366         .magic          = ACTIVITY_MAGIC_BASE,
367         .group          = G_DEFAULT,
368 #ifdef SOURCE_SADC
369         .f_count_index  = -1,
370         .f_count2       = NULL,
371         .f_read         = wrap_read_kernel_tables,
372 #endif
373 #ifdef SOURCE_SAR
374         .f_print        = print_ktables_stats,
375         .f_print_avg    = print_avg_ktables_stats,
376 #endif
377 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
378         .hdr_line       = "dentunusd;file-nr;inode-nr;pty-nr",
379 #endif
380         .gtypes_nr      = {STATS_KTABLES_ULL, STATS_KTABLES_UL, STATS_KTABLES_U},
381         .ftypes_nr      = {0, 0, 0},
382 #ifdef SOURCE_SADF
383         .f_render       = render_ktables_stats,
384         .f_xml_print    = xml_print_ktables_stats,
385         .f_json_print   = json_print_ktables_stats,
386         .f_svg_print    = svg_print_ktables_stats,
387         .f_raw_print    = raw_print_ktables_stats,
388         .name           = "A_KTABLES",
389         .g_nr           = 2,
390 #endif
391         .nr_ini         = 1,
392         .nr2            = 1,
393         .nr_max         = 1,
394         .nr             = {1, 1, 1},
395         .nr_allocated   = 0,
396         .fsize          = STATS_KTABLES_SIZE,
397         .msize          = STATS_KTABLES_SIZE,
398         .opt_flags      = 0,
399         .buf            = {NULL, NULL, NULL},
400         .bitmap         = NULL
401 };
402
403 /* Queue and load activity */
404 struct activity queue_act = {
405         .id             = A_QUEUE,
406         .options        = AO_COLLECTED,
407         .magic          = ACTIVITY_MAGIC_BASE + 1,
408         .group          = G_DEFAULT,
409 #ifdef SOURCE_SADC
410         .f_count_index  = -1,
411         .f_count2       = NULL,
412         .f_read         = wrap_read_loadavg,
413 #endif
414 #ifdef SOURCE_SAR
415         .f_print        = print_queue_stats,
416         .f_print_avg    = print_avg_queue_stats,
417 #endif
418 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
419         .hdr_line       = "runq-sz;plist-sz;ldavg-1;ldavg-5;ldavg-15;blocked",
420 #endif
421         .gtypes_nr      = {STATS_QUEUE_ULL, STATS_QUEUE_UL, STATS_QUEUE_U},
422         .ftypes_nr      = {0, 0, 0},
423 #ifdef SOURCE_SADF
424         .f_render       = render_queue_stats,
425         .f_xml_print    = xml_print_queue_stats,
426         .f_json_print   = json_print_queue_stats,
427         .f_svg_print    = svg_print_queue_stats,
428         .f_raw_print    = raw_print_queue_stats,
429         .name           = "A_QUEUE",
430         .g_nr           = 3,
431 #endif
432         .nr_ini         = 1,
433         .nr2            = 1,
434         .nr_max         = 1,
435         .nr             = {1, 1, 1},
436         .nr_allocated   = 0,
437         .fsize          = STATS_QUEUE_SIZE,
438         .msize          = STATS_QUEUE_SIZE,
439         .opt_flags      = 0,
440         .buf            = {NULL, NULL, NULL},
441         .bitmap         = NULL
442 };
443
444 /* Serial lines activity */
445 struct activity serial_act = {
446         .id             = A_SERIAL,
447         .options        = AO_COLLECTED + AO_COUNTED,
448         .magic          = ACTIVITY_MAGIC_BASE,
449         .group          = G_DEFAULT,
450 #ifdef SOURCE_SADC
451         .f_count_index  = 2,    /* wrap_get_serial_nr() */
452         .f_count2       = NULL,
453         .f_read         = wrap_read_tty_driver_serial,
454 #endif
455 #ifdef SOURCE_SAR
456         .f_print        = print_serial_stats,
457         .f_print_avg    = print_serial_stats,
458 #endif
459 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
460         .hdr_line       = "TTY;rcvin/s;txmtin/s;framerr/s;prtyerr/s;brk/s;ovrun/s",
461 #endif
462         .gtypes_nr      = {STATS_SERIAL_ULL, STATS_SERIAL_UL, STATS_SERIAL_U},
463         .ftypes_nr      = {0, 0, 0},
464 #ifdef SOURCE_SADF
465         .f_render       = render_serial_stats,
466         .f_xml_print    = xml_print_serial_stats,
467         .f_json_print   = json_print_serial_stats,
468         .f_svg_print    = NULL,
469         .f_raw_print    = raw_print_serial_stats,
470         .name           = "A_SERIAL",
471         .g_nr           = 0,
472 #endif
473         .nr_ini         = -1,
474         .nr2            = 1,
475         .nr_max         = MAX_NR_SERIAL_LINES,
476         .nr             = {-1, -1, -1},
477         .nr_allocated   = 0,
478         .fsize          = STATS_SERIAL_SIZE,
479         .msize          = STATS_SERIAL_SIZE,
480         .opt_flags      = 0,
481         .buf            = {NULL, NULL, NULL},
482         .bitmap         = NULL
483 };
484
485 /* Block devices activity */
486 struct activity disk_act = {
487         .id             = A_DISK,
488         .options        = AO_COUNTED + AO_GRAPH_PER_ITEM,
489         .magic          = ACTIVITY_MAGIC_BASE + 1,
490         .group          = G_DISK,
491 #ifdef SOURCE_SADC
492         .f_count_index  = 3,    /* wrap_get_disk_nr() */
493         .f_count2       = NULL,
494         .f_read         = wrap_read_disk,
495 #endif
496 #ifdef SOURCE_SAR
497         .f_print        = print_disk_stats,
498         .f_print_avg    = print_disk_stats,
499 #endif
500 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
501         .hdr_line       = "DEV;tps;rkB/s;wkB/s;areq-sz;aqu-sz;await;svctm;%util",
502 #endif
503         .gtypes_nr      = {STATS_DISK_ULL, STATS_DISK_UL, STATS_DISK_U},
504         .ftypes_nr      = {0, 0, 0},
505 #ifdef SOURCE_SADF
506         .f_render       = render_disk_stats,
507         .f_xml_print    = xml_print_disk_stats,
508         .f_json_print   = json_print_disk_stats,
509         .f_svg_print    = svg_print_disk_stats,
510         .f_raw_print    = raw_print_disk_stats,
511         .name           = "A_DISK",
512         .g_nr           = 5,
513 #endif
514         .nr_ini         = -1,
515         .nr2            = 1,
516         .nr_max         = MAX_NR_DISKS,
517         .nr             = {-1, -1, -1},
518         .nr_allocated   = 0,
519         .fsize          = STATS_DISK_SIZE,
520         .msize          = STATS_DISK_SIZE,
521         .opt_flags      = 0,
522         .buf            = {NULL, NULL, NULL},
523         .bitmap         = NULL
524 };
525
526 /* Network interfaces activity */
527 struct activity net_dev_act = {
528         .id             = A_NET_DEV,
529         .options        = AO_COLLECTED + AO_COUNTED + AO_GRAPH_PER_ITEM,
530         .magic          = ACTIVITY_MAGIC_BASE + 2,
531         .group          = G_DEFAULT,
532 #ifdef SOURCE_SADC
533         .f_count_index  = 4,    /* wrap_get_iface_nr() */
534         .f_count2       = NULL,
535         .f_read         = wrap_read_net_dev,
536 #endif
537 #ifdef SOURCE_SAR
538         .f_print        = print_net_dev_stats,
539         .f_print_avg    = print_net_dev_stats,
540 #endif
541 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
542         .hdr_line       = "IFACE;rxpck/s;txpck/s;rxkB/s;txkB/s;rxcmp/s;txcmp/s;rxmcst/s;%ifutil",
543 #endif
544         .gtypes_nr      = {STATS_NET_DEV_ULL, STATS_NET_DEV_UL, STATS_NET_DEV_U},
545         .ftypes_nr      = {0, 0, 0},
546 #ifdef SOURCE_SADF
547         .f_render       = render_net_dev_stats,
548         .f_xml_print    = xml_print_net_dev_stats,
549         .f_json_print   = json_print_net_dev_stats,
550         .f_svg_print    = svg_print_net_dev_stats,
551         .f_raw_print    = raw_print_net_dev_stats,
552         .name           = "A_NET_DEV",
553         .g_nr           = 4,
554 #endif
555         .nr_ini         = -1,
556         .nr2            = 1,
557         .nr_max         = MAX_NR_IFACES,
558         .nr             = {-1, -1, -1},
559         .nr_allocated   = 0,
560         .fsize          = STATS_NET_DEV_SIZE,
561         .msize          = STATS_NET_DEV_SIZE,
562         .opt_flags      = 0,
563         .buf            = {NULL, NULL, NULL},
564         .bitmap         = NULL
565 };
566
567 /* Network interfaces (errors) activity */
568 struct activity net_edev_act = {
569         .id             = A_NET_EDEV,
570         .options        = AO_COLLECTED + AO_COUNTED + AO_GRAPH_PER_ITEM,
571         .magic          = ACTIVITY_MAGIC_BASE + 1,
572         .group          = G_DEFAULT,
573 #ifdef SOURCE_SADC
574         .f_count_index  = 4,    /* wrap_get_iface_nr() */
575         .f_count2       = NULL,
576         .f_read         = wrap_read_net_edev,
577 #endif
578 #ifdef SOURCE_SAR
579         .f_print        = print_net_edev_stats,
580         .f_print_avg    = print_net_edev_stats,
581 #endif
582 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
583         .hdr_line       = "IFACE;rxerr/s;txerr/s;coll/s;rxdrop/s;txdrop/s;"
584                           "txcarr/s;rxfram/s;rxfifo/s;txfifo/s",
585 #endif
586         .gtypes_nr      = {STATS_NET_EDEV_ULL, STATS_NET_EDEV_UL, STATS_NET_EDEV_U},
587         .ftypes_nr      = {0, 0, 0},
588 #ifdef SOURCE_SADF
589         .f_render       = render_net_edev_stats,
590         .f_xml_print    = xml_print_net_edev_stats,
591         .f_json_print   = json_print_net_edev_stats,
592         .f_svg_print    = svg_print_net_edev_stats,
593         .f_raw_print    = raw_print_net_edev_stats,
594         .name           = "A_NET_EDEV",
595         .g_nr           = 4,
596 #endif
597         .nr_ini         = -1,
598         .nr2            = 1,
599         .nr_max         = MAX_NR_IFACES,
600         .nr             = {-1, -1, -1},
601         .nr_allocated   = 0,
602         .fsize          = STATS_NET_EDEV_SIZE,
603         .msize          = STATS_NET_EDEV_SIZE,
604         .opt_flags      = 0,
605         .buf            = {NULL, NULL, NULL},
606         .bitmap         = NULL
607 };
608
609 /* NFS client activity */
610 struct activity net_nfs_act = {
611         .id             = A_NET_NFS,
612         .options        = AO_COLLECTED,
613         .magic          = ACTIVITY_MAGIC_BASE,
614         .group          = G_DEFAULT,
615 #ifdef SOURCE_SADC
616         .f_count_index  = -1,
617         .f_count2       = NULL,
618         .f_read         = wrap_read_net_nfs,
619 #endif
620 #ifdef SOURCE_SAR
621         .f_print        = print_net_nfs_stats,
622         .f_print_avg    = print_net_nfs_stats,
623 #endif
624 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
625         .hdr_line       = "call/s;retrans/s;read/s;write/s;access/s;getatt/s",
626 #endif
627         .gtypes_nr      = {STATS_NET_NFS_ULL, STATS_NET_NFS_UL, STATS_NET_NFS_U},
628         .ftypes_nr      = {0, 0, 0},
629 #ifdef SOURCE_SADF
630         .f_render       = render_net_nfs_stats,
631         .f_xml_print    = xml_print_net_nfs_stats,
632         .f_json_print   = json_print_net_nfs_stats,
633         .f_svg_print    = svg_print_net_nfs_stats,
634         .f_raw_print    = raw_print_net_nfs_stats,
635         .name           = "A_NET_NFS",
636         .g_nr           = 3,
637 #endif
638         .nr_ini         = 1,
639         .nr2            = 1,
640         .nr_max         = 1,
641         .nr             = {1, 1, 1},
642         .nr_allocated   = 0,
643         .fsize          = STATS_NET_NFS_SIZE,
644         .msize          = STATS_NET_NFS_SIZE,
645         .opt_flags      = 0,
646         .buf            = {NULL, NULL, NULL},
647         .bitmap         = NULL
648 };
649
650 /* NFS server activity */
651 struct activity net_nfsd_act = {
652         .id             = A_NET_NFSD,
653         .options        = AO_COLLECTED,
654         .magic          = ACTIVITY_MAGIC_BASE,
655         .group          = G_DEFAULT,
656 #ifdef SOURCE_SADC
657         .f_count_index  = -1,
658         .f_count2       = NULL,
659         .f_read         = wrap_read_net_nfsd,
660 #endif
661 #ifdef SOURCE_SAR
662         .f_print        = print_net_nfsd_stats,
663         .f_print_avg    = print_net_nfsd_stats,
664 #endif
665 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
666         .hdr_line       = "scall/s;badcall/s;packet/s;udp/s;tcp/s;hit/s;miss/s;"
667                           "sread/s;swrite/s;saccess/s;sgetatt/s",
668 #endif
669         .gtypes_nr      = {STATS_NET_NFSD_ULL, STATS_NET_NFSD_UL, STATS_NET_NFSD_U},
670         .ftypes_nr      = {0, 0, 0},
671 #ifdef SOURCE_SADF
672         .f_render       = render_net_nfsd_stats,
673         .f_xml_print    = xml_print_net_nfsd_stats,
674         .f_json_print   = json_print_net_nfsd_stats,
675         .f_svg_print    = svg_print_net_nfsd_stats,
676         .f_raw_print    = raw_print_net_nfsd_stats,
677         .name           = "A_NET_NFSD",
678         .g_nr           = 5,
679 #endif
680         .nr_ini         = 1,
681         .nr2            = 1,
682         .nr_max         = 1,
683         .nr             = {1, 1, 1},
684         .nr_allocated   = 0,
685         .fsize          = STATS_NET_NFSD_SIZE,
686         .msize          = STATS_NET_NFSD_SIZE,
687         .opt_flags      = 0,
688         .buf            = {NULL, NULL, NULL},
689         .bitmap         = NULL
690 };
691
692 /* Network sockets activity */
693 struct activity net_sock_act = {
694         .id             = A_NET_SOCK,
695         .options        = AO_COLLECTED,
696         .magic          = ACTIVITY_MAGIC_BASE,
697         .group          = G_DEFAULT,
698 #ifdef SOURCE_SADC
699         .f_count_index  = -1,
700         .f_count2       = NULL,
701         .f_read         = wrap_read_net_sock,
702 #endif
703 #ifdef SOURCE_SAR
704         .f_print        = print_net_sock_stats,
705         .f_print_avg    = print_avg_net_sock_stats,
706 #endif
707 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
708         .hdr_line       = "totsck;tcpsck;udpsck;rawsck;ip-frag;tcp-tw",
709 #endif
710         .gtypes_nr      = {STATS_NET_SOCK_ULL, STATS_NET_SOCK_UL, STATS_NET_SOCK_U},
711         .ftypes_nr      = {0, 0, 0},
712 #ifdef SOURCE_SADF
713         .f_render       = render_net_sock_stats,
714         .f_xml_print    = xml_print_net_sock_stats,
715         .f_json_print   = json_print_net_sock_stats,
716         .f_svg_print    = svg_print_net_sock_stats,
717         .f_raw_print    = raw_print_net_sock_stats,
718         .name           = "A_NET_SOCK",
719         .g_nr           = 2,
720 #endif
721         .nr_ini         = 1,
722         .nr2            = 1,
723         .nr_max         = 1,
724         .nr             = {1, 1, 1},
725         .nr_allocated   = 0,
726         .fsize          = STATS_NET_SOCK_SIZE,
727         .msize          = STATS_NET_SOCK_SIZE,
728         .opt_flags      = 0,
729         .buf            = {NULL, NULL, NULL},
730         .bitmap         = NULL
731 };
732
733 /* IP network traffic activity */
734 struct activity net_ip_act = {
735         .id             = A_NET_IP,
736         .options        = AO_NULL,
737         .magic          = ACTIVITY_MAGIC_BASE + 1,
738         .group          = G_SNMP,
739 #ifdef SOURCE_SADC
740         .f_count_index  = -1,
741         .f_count2       = NULL,
742         .f_read         = wrap_read_net_ip,
743 #endif
744 #ifdef SOURCE_SAR
745         .f_print        = print_net_ip_stats,
746         .f_print_avg    = print_net_ip_stats,
747 #endif
748 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
749         .hdr_line       = "irec/s;fwddgm/s;idel/s;orq/s;asmrq/s;asmok/s;fragok/s;fragcrt/s",
750 #endif
751         .gtypes_nr      = {STATS_NET_IP_ULL, STATS_NET_IP_UL, STATS_NET_IP_U},
752         .ftypes_nr      = {0, 0, 0},
753 #ifdef SOURCE_SADF
754         .f_render       = render_net_ip_stats,
755         .f_xml_print    = xml_print_net_ip_stats,
756         .f_json_print   = json_print_net_ip_stats,
757         .f_svg_print    = svg_print_net_ip_stats,
758         .f_raw_print    = raw_print_net_ip_stats,
759         .name           = "A_NET_IP",
760         .g_nr           = 3,
761 #endif
762         .nr_ini         = 1,
763         .nr2            = 1,
764         .nr_max         = 1,
765         .nr             = {1, 1, 1},
766         .nr_allocated   = 0,
767         .fsize          = STATS_NET_IP_SIZE,
768         .msize          = STATS_NET_IP_SIZE,
769         .opt_flags      = 0,
770         .buf            = {NULL, NULL, NULL},
771         .bitmap         = NULL
772 };
773
774 /* IP network traffic (errors) activity */
775 struct activity net_eip_act = {
776         .id             = A_NET_EIP,
777         .options        = AO_NULL,
778         .magic          = ACTIVITY_MAGIC_BASE + 1,
779         .group          = G_SNMP,
780 #ifdef SOURCE_SADC
781         .f_count_index  = -1,
782         .f_count2       = NULL,
783         .f_read         = wrap_read_net_eip,
784 #endif
785 #ifdef SOURCE_SAR
786         .f_print        = print_net_eip_stats,
787         .f_print_avg    = print_net_eip_stats,
788 #endif
789 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
790         .hdr_line       = "ihdrerr/s;iadrerr/s;iukwnpr/s;idisc/s;odisc/s;onort/s;asmf/s;fragf/s",
791 #endif
792         .gtypes_nr      = {STATS_NET_EIP_ULL, STATS_NET_EIP_UL, STATS_NET_EIP_U},
793         .ftypes_nr      = {0, 0, 0},
794 #ifdef SOURCE_SADF
795         .f_render       = render_net_eip_stats,
796         .f_xml_print    = xml_print_net_eip_stats,
797         .f_json_print   = json_print_net_eip_stats,
798         .f_svg_print    = svg_print_net_eip_stats,
799         .f_raw_print    = raw_print_net_eip_stats,
800         .name           = "A_NET_EIP",
801         .g_nr           = 3,
802 #endif
803         .nr_ini         = 1,
804         .nr2            = 1,
805         .nr_max         = 1,
806         .nr             = {1, 1, 1},
807         .nr_allocated   = 0,
808         .fsize          = STATS_NET_EIP_SIZE,
809         .msize          = STATS_NET_EIP_SIZE,
810         .opt_flags      = 0,
811         .buf            = {NULL, NULL, NULL},
812         .bitmap         = NULL
813 };
814
815 /* ICMP network traffic activity */
816 struct activity net_icmp_act = {
817         .id             = A_NET_ICMP,
818         .options        = AO_NULL,
819         .magic          = ACTIVITY_MAGIC_BASE,
820         .group          = G_SNMP,
821 #ifdef SOURCE_SADC
822         .f_count_index  = -1,
823         .f_count2       = NULL,
824         .f_read         = wrap_read_net_icmp,
825 #endif
826 #ifdef SOURCE_SAR
827         .f_print        = print_net_icmp_stats,
828         .f_print_avg    = print_net_icmp_stats,
829 #endif
830 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
831         .hdr_line       = "imsg/s;omsg/s;iech/s;iechr/s;oech/s;oechr/s;itm/s;itmr/s;otm/s;"
832                           "otmr/s;iadrmk/s;iadrmkr/s;oadrmk/s;oadrmkr/s",
833 #endif
834         .gtypes_nr      = {STATS_NET_ICMP_ULL, STATS_NET_ICMP_UL, STATS_NET_ICMP_U},
835         .ftypes_nr      = {0, 0, 0},
836 #ifdef SOURCE_SADF
837         .f_render       = render_net_icmp_stats,
838         .f_xml_print    = xml_print_net_icmp_stats,
839         .f_json_print   = json_print_net_icmp_stats,
840         .f_svg_print    = svg_print_net_icmp_stats,
841         .f_raw_print    = raw_print_net_icmp_stats,
842         .name           = "A_NET_ICMP",
843         .g_nr           = 4,
844 #endif
845         .nr_ini         = 1,
846         .nr2            = 1,
847         .nr_max         = 1,
848         .nr             = {1, 1, 1},
849         .nr_allocated   = 0,
850         .fsize          = STATS_NET_ICMP_SIZE,
851         .msize          = STATS_NET_ICMP_SIZE,
852         .opt_flags      = 0,
853         .buf            = {NULL, NULL, NULL},
854         .bitmap         = NULL
855 };
856
857 /* ICMP network traffic (errors) activity */
858 struct activity net_eicmp_act = {
859         .id             = A_NET_EICMP,
860         .options        = AO_NULL,
861         .magic          = ACTIVITY_MAGIC_BASE,
862         .group          = G_SNMP,
863 #ifdef SOURCE_SADC
864         .f_count_index  = -1,
865         .f_count2       = NULL,
866         .f_read         = wrap_read_net_eicmp,
867 #endif
868 #ifdef SOURCE_SAR
869         .f_print        = print_net_eicmp_stats,
870         .f_print_avg    = print_net_eicmp_stats,
871 #endif
872 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
873         .hdr_line       = "ierr/s;oerr/s;idstunr/s;odstunr/s;itmex/s;otmex/s;"
874                           "iparmpb/s;oparmpb/s;isrcq/s;osrcq/s;iredir/s;oredir/s",
875 #endif
876         .gtypes_nr      = {STATS_NET_EICMP_ULL, STATS_NET_EICMP_UL, STATS_NET_EICMP_U},
877         .ftypes_nr      = {0, 0, 0},
878 #ifdef SOURCE_SADF
879         .f_render       = render_net_eicmp_stats,
880         .f_xml_print    = xml_print_net_eicmp_stats,
881         .f_json_print   = json_print_net_eicmp_stats,
882         .f_svg_print    = svg_print_net_eicmp_stats,
883         .f_raw_print    = raw_print_net_eicmp_stats,
884         .name           = "A_NET_EICMP",
885         .g_nr           = 6,
886 #endif
887         .nr_ini         = 1,
888         .nr2            = 1,
889         .nr_max         = 1,
890         .nr             = {1, 1, 1},
891         .nr_allocated   = 0,
892         .fsize          = STATS_NET_EICMP_SIZE,
893         .msize          = STATS_NET_EICMP_SIZE,
894         .opt_flags      = 0,
895         .buf            = {NULL, NULL, NULL},
896         .bitmap         = NULL
897 };
898
899 /* TCP network traffic activity */
900 struct activity net_tcp_act = {
901         .id             = A_NET_TCP,
902         .options        = AO_NULL,
903         .magic          = ACTIVITY_MAGIC_BASE,
904         .group          = G_SNMP,
905 #ifdef SOURCE_SADC
906         .f_count_index  = -1,
907         .f_count2       = NULL,
908         .f_read         = wrap_read_net_tcp,
909 #endif
910 #ifdef SOURCE_SAR
911         .f_print        = print_net_tcp_stats,
912         .f_print_avg    = print_net_tcp_stats,
913 #endif
914 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
915         .hdr_line       = "active/s;passive/s;iseg/s;oseg/s",
916 #endif
917         .gtypes_nr      = {STATS_NET_TCP_ULL, STATS_NET_TCP_UL, STATS_NET_TCP_U},
918         .ftypes_nr      = {0, 0, 0},
919 #ifdef SOURCE_SADF
920         .f_render       = render_net_tcp_stats,
921         .f_xml_print    = xml_print_net_tcp_stats,
922         .f_json_print   = json_print_net_tcp_stats,
923         .f_svg_print    = svg_print_net_tcp_stats,
924         .f_raw_print    = raw_print_net_tcp_stats,
925         .name           = "A_NET_TCP",
926         .g_nr           = 2,
927 #endif
928         .nr_ini         = 1,
929         .nr2            = 1,
930         .nr_max         = 1,
931         .nr             = {1, 1, 1},
932         .nr_allocated   = 0,
933         .fsize          = STATS_NET_TCP_SIZE,
934         .msize          = STATS_NET_TCP_SIZE,
935         .opt_flags      = 0,
936         .buf            = {NULL, NULL, NULL},
937         .bitmap         = NULL
938 };
939
940 /* TCP network traffic (errors) activity */
941 struct activity net_etcp_act = {
942         .id             = A_NET_ETCP,
943         .options        = AO_NULL,
944         .magic          = ACTIVITY_MAGIC_BASE,
945         .group          = G_SNMP,
946 #ifdef SOURCE_SADC
947         .f_count_index  = -1,
948         .f_count2       = NULL,
949         .f_read         = wrap_read_net_etcp,
950 #endif
951 #ifdef SOURCE_SAR
952         .f_print        = print_net_etcp_stats,
953         .f_print_avg    = print_net_etcp_stats,
954 #endif
955 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
956         .hdr_line       = "atmptf/s;estres/s;retrans/s;isegerr/s;orsts/s",
957 #endif
958         .gtypes_nr      = {STATS_NET_ETCP_ULL, STATS_NET_ETCP_UL, STATS_NET_ETCP_U},
959         .ftypes_nr      = {0, 0, 0},
960 #ifdef SOURCE_SADF
961         .f_render       = render_net_etcp_stats,
962         .f_xml_print    = xml_print_net_etcp_stats,
963         .f_json_print   = json_print_net_etcp_stats,
964         .f_svg_print    = svg_print_net_etcp_stats,
965         .f_raw_print    = raw_print_net_etcp_stats,
966         .name           = "A_NET_ETCP",
967         .g_nr           = 2,
968 #endif
969         .nr_ini         = 1,
970         .nr2            = 1,
971         .nr_max         = 1,
972         .nr             = {1, 1, 1},
973         .nr_allocated   = 0,
974         .fsize          = STATS_NET_ETCP_SIZE,
975         .msize          = STATS_NET_ETCP_SIZE,
976         .opt_flags      = 0,
977         .buf            = {NULL, NULL, NULL},
978         .bitmap         = NULL
979 };
980
981 /* UDP network traffic activity */
982 struct activity net_udp_act = {
983         .id             = A_NET_UDP,
984         .options        = AO_NULL,
985         .magic          = ACTIVITY_MAGIC_BASE,
986         .group          = G_SNMP,
987 #ifdef SOURCE_SADC
988         .f_count_index  = -1,
989         .f_count2       = NULL,
990         .f_read         = wrap_read_net_udp,
991 #endif
992 #ifdef SOURCE_SAR
993         .f_print        = print_net_udp_stats,
994         .f_print_avg    = print_net_udp_stats,
995 #endif
996 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
997         .hdr_line       = "idgm/s;odgm/s;noport/s;idgmerr/s",
998 #endif
999         .gtypes_nr      = {STATS_NET_UDP_ULL, STATS_NET_UDP_UL, STATS_NET_UDP_U},
1000         .ftypes_nr      = {0, 0, 0},
1001 #ifdef SOURCE_SADF
1002         .f_render       = render_net_udp_stats,
1003         .f_xml_print    = xml_print_net_udp_stats,
1004         .f_json_print   = json_print_net_udp_stats,
1005         .f_svg_print    = svg_print_net_udp_stats,
1006         .f_raw_print    = raw_print_net_udp_stats,
1007         .name           = "A_NET_UDP",
1008         .g_nr           = 2,
1009 #endif
1010         .nr_ini         = 1,
1011         .nr2            = 1,
1012         .nr_max         = 1,
1013         .nr             = {1, 1, 1},
1014         .nr_allocated   = 0,
1015         .fsize          = STATS_NET_UDP_SIZE,
1016         .msize          = STATS_NET_UDP_SIZE,
1017         .opt_flags      = 0,
1018         .buf            = {NULL, NULL, NULL},
1019         .bitmap         = NULL
1020 };
1021
1022 /* IPv6 sockets activity */
1023 struct activity net_sock6_act = {
1024         .id             = A_NET_SOCK6,
1025         .options        = AO_NULL,
1026         .magic          = ACTIVITY_MAGIC_BASE,
1027         .group          = G_IPV6,
1028 #ifdef SOURCE_SADC
1029         .f_count_index  = -1,
1030         .f_count2       = NULL,
1031         .f_read         = wrap_read_net_sock6,
1032 #endif
1033 #ifdef SOURCE_SAR
1034         .f_print        = print_net_sock6_stats,
1035         .f_print_avg    = print_avg_net_sock6_stats,
1036 #endif
1037 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1038         .hdr_line       = "tcp6sck;udp6sck;raw6sck;ip6-frag",
1039 #endif
1040         .gtypes_nr      = {STATS_NET_SOCK6_ULL, STATS_NET_SOCK6_UL, STATS_NET_SOCK6_U},
1041         .ftypes_nr      = {0, 0, 0},
1042 #ifdef SOURCE_SADF
1043         .f_render       = render_net_sock6_stats,
1044         .f_xml_print    = xml_print_net_sock6_stats,
1045         .f_json_print   = json_print_net_sock6_stats,
1046         .f_svg_print    = svg_print_net_sock6_stats,
1047         .f_raw_print    = raw_print_net_sock6_stats,
1048         .name           = "A_NET_SOCK6",
1049         .g_nr           = 1,
1050 #endif
1051         .nr_ini         = 1,
1052         .nr2            = 1,
1053         .nr_max         = 1,
1054         .nr             = {1, 1, 1},
1055         .nr_allocated   = 0,
1056         .fsize          = STATS_NET_SOCK6_SIZE,
1057         .msize          = STATS_NET_SOCK6_SIZE,
1058         .opt_flags      = 0,
1059         .buf            = {NULL, NULL, NULL},
1060         .bitmap         = NULL
1061 };
1062
1063 /* IPv6 network traffic activity */
1064 struct activity net_ip6_act = {
1065         .id             = A_NET_IP6,
1066         .options        = AO_NULL,
1067         .magic          = ACTIVITY_MAGIC_BASE + 1,
1068         .group          = G_IPV6,
1069 #ifdef SOURCE_SADC
1070         .f_count_index  = -1,
1071         .f_count2       = NULL,
1072         .f_read         = wrap_read_net_ip6,
1073 #endif
1074 #ifdef SOURCE_SAR
1075         .f_print        = print_net_ip6_stats,
1076         .f_print_avg    = print_net_ip6_stats,
1077 #endif
1078 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1079         .hdr_line       = "irec6/s;fwddgm6/s;idel6/s;orq6/s;asmrq6/s;asmok6/s;"
1080                           "imcpck6/s;omcpck6/s;fragok6/s;fragcr6/s",
1081 #endif
1082         .gtypes_nr      = {STATS_NET_IP6_ULL, STATS_NET_IP6_UL, STATS_NET_IP6_U},
1083         .ftypes_nr      = {0, 0, 0},
1084 #ifdef SOURCE_SADF
1085         .f_render       = render_net_ip6_stats,
1086         .f_xml_print    = xml_print_net_ip6_stats,
1087         .f_json_print   = json_print_net_ip6_stats,
1088         .f_svg_print    = svg_print_net_ip6_stats,
1089         .f_raw_print    = raw_print_net_ip6_stats,
1090         .name           = "A_NET_IP6",
1091         .g_nr           = 4,
1092 #endif
1093         .nr_ini         = 1,
1094         .nr2            = 1,
1095         .nr_max         = 1,
1096         .nr             = {1, 1, 1},
1097         .nr_allocated   = 0,
1098         .fsize          = STATS_NET_IP6_SIZE,
1099         .msize          = STATS_NET_IP6_SIZE,
1100         .opt_flags      = 0,
1101         .buf            = {NULL, NULL, NULL},
1102         .bitmap         = NULL
1103 };
1104
1105 /* IPv6 network traffic (errors) activity */
1106 struct activity net_eip6_act = {
1107         .id             = A_NET_EIP6,
1108         .options        = AO_NULL,
1109         .magic          = ACTIVITY_MAGIC_BASE + 1,
1110         .group          = G_IPV6,
1111 #ifdef SOURCE_SADC
1112         .f_count_index  = -1,
1113         .f_count2       = NULL,
1114         .f_read         = wrap_read_net_eip6,
1115 #endif
1116 #ifdef SOURCE_SAR
1117         .f_print        = print_net_eip6_stats,
1118         .f_print_avg    = print_net_eip6_stats,
1119 #endif
1120 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1121         .hdr_line       = "ihdrer6/s;iadrer6/s;iukwnp6/s;i2big6/s;idisc6/s;odisc6/s;"
1122                           "inort6/s;onort6/s;asmf6/s;fragf6/s;itrpck6/s",
1123 #endif
1124         .gtypes_nr      = {STATS_NET_EIP6_ULL, STATS_NET_EIP6_UL, STATS_NET_EIP6_U},
1125         .ftypes_nr      = {0, 0, 0},
1126 #ifdef SOURCE_SADF
1127         .f_render       = render_net_eip6_stats,
1128         .f_xml_print    = xml_print_net_eip6_stats,
1129         .f_json_print   = json_print_net_eip6_stats,
1130         .f_svg_print    = svg_print_net_eip6_stats,
1131         .f_raw_print    = raw_print_net_eip6_stats,
1132         .name           = "A_NET_EIP6",
1133         .g_nr           = 4,
1134 #endif
1135         .nr_ini         = 1,
1136         .nr2            = 1,
1137         .nr_max         = 1,
1138         .nr             = {1, 1, 1},
1139         .nr_allocated   = 0,
1140         .fsize          = STATS_NET_EIP6_SIZE,
1141         .msize          = STATS_NET_EIP6_SIZE,
1142         .opt_flags      = 0,
1143         .buf            = {NULL, NULL, NULL},
1144         .bitmap         = NULL
1145 };
1146
1147 /* ICMPv6 network traffic activity */
1148 struct activity net_icmp6_act = {
1149         .id             = A_NET_ICMP6,
1150         .options        = AO_NULL,
1151         .magic          = ACTIVITY_MAGIC_BASE,
1152         .group          = G_IPV6,
1153 #ifdef SOURCE_SADC
1154         .f_count_index  = -1,
1155         .f_count2       = NULL,
1156         .f_read         = wrap_read_net_icmp6,
1157 #endif
1158 #ifdef SOURCE_SAR
1159         .f_print        = print_net_icmp6_stats,
1160         .f_print_avg    = print_net_icmp6_stats,
1161 #endif
1162 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1163         .hdr_line       = "imsg6/s;omsg6/s;iech6/s;iechr6/s;oechr6/s;igmbq6/s;igmbr6/s;ogmbr6/s;"
1164                           "igmbrd6/s;ogmbrd6/s;irtsol6/s;ortsol6/s;irtad6/s;inbsol6/s;onbsol6/s;"
1165                           "inbad6/s;onbad6/s",
1166 #endif
1167         .gtypes_nr      = {STATS_NET_ICMP6_ULL, STATS_NET_ICMP6_UL, STATS_NET_ICMP6_U},
1168         .ftypes_nr      = {0, 0, 0},
1169 #ifdef SOURCE_SADF
1170         .f_render       = render_net_icmp6_stats,
1171         .f_xml_print    = xml_print_net_icmp6_stats,
1172         .f_json_print   = json_print_net_icmp6_stats,
1173         .f_svg_print    = svg_print_net_icmp6_stats,
1174         .f_raw_print    = raw_print_net_icmp6_stats,
1175         .name           = "A_NET_ICMP6",
1176         .g_nr           = 5,
1177 #endif
1178         .nr_ini         = 1,
1179         .nr2            = 1,
1180         .nr_max         = 1,
1181         .nr             = {1, 1, 1},
1182         .nr_allocated   = 0,
1183         .fsize          = STATS_NET_ICMP6_SIZE,
1184         .msize          = STATS_NET_ICMP6_SIZE,
1185         .opt_flags      = 0,
1186         .buf            = {NULL, NULL, NULL},
1187         .bitmap         = NULL
1188 };
1189
1190 /* ICMPv6 network traffic (errors) activity */
1191 struct activity net_eicmp6_act = {
1192         .id             = A_NET_EICMP6,
1193         .options        = AO_NULL,
1194         .magic          = ACTIVITY_MAGIC_BASE,
1195         .group          = G_IPV6,
1196 #ifdef SOURCE_SADC
1197         .f_count_index  = -1,
1198         .f_count2       = NULL,
1199         .f_read         = wrap_read_net_eicmp6,
1200 #endif
1201 #ifdef SOURCE_SAR
1202         .f_print        = print_net_eicmp6_stats,
1203         .f_print_avg    = print_net_eicmp6_stats,
1204 #endif
1205 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1206         .hdr_line       = "ierr6/s;idtunr6/s;odtunr6/s;itmex6/s;otmex6/s;"
1207                           "iprmpb6/s;oprmpb6/s;iredir6/s;oredir6/s;ipck2b6/s;opck2b6/s",
1208 #endif
1209         .gtypes_nr      = {STATS_NET_EICMP6_ULL, STATS_NET_EICMP6_UL, STATS_NET_EICMP6_U},
1210         .ftypes_nr      = {0, 0, 0},
1211 #ifdef SOURCE_SADF
1212         .f_render       = render_net_eicmp6_stats,
1213         .f_xml_print    = xml_print_net_eicmp6_stats,
1214         .f_json_print   = json_print_net_eicmp6_stats,
1215         .f_svg_print    = svg_print_net_eicmp6_stats,
1216         .f_raw_print    = raw_print_net_eicmp6_stats,
1217         .name           = "A_NET_EICMP6",
1218         .g_nr           = 6,
1219 #endif
1220         .nr_ini         = 1,
1221         .nr2            = 1,
1222         .nr_max         = 1,
1223         .nr             = {1, 1, 1},
1224         .nr_allocated   = 0,
1225         .fsize          = STATS_NET_EICMP6_SIZE,
1226         .msize          = STATS_NET_EICMP6_SIZE,
1227         .opt_flags      = 0,
1228         .buf            = {NULL, NULL, NULL},
1229         .bitmap         = NULL
1230 };
1231
1232 /* UDPv6 network traffic activity */
1233 struct activity net_udp6_act = {
1234         .id             = A_NET_UDP6,
1235         .options        = AO_NULL,
1236         .magic          = ACTIVITY_MAGIC_BASE,
1237         .group          = G_IPV6,
1238 #ifdef SOURCE_SADC
1239         .f_count_index  = -1,
1240         .f_count2       = NULL,
1241         .f_read         = wrap_read_net_udp6,
1242 #endif
1243 #ifdef SOURCE_SAR
1244         .f_print        = print_net_udp6_stats,
1245         .f_print_avg    = print_net_udp6_stats,
1246 #endif
1247 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1248         .hdr_line       = "idgm6/s;odgm6/s;noport6/s;idgmer6/s",
1249 #endif
1250         .gtypes_nr      = {STATS_NET_UDP6_ULL, STATS_NET_UDP6_UL, STATS_NET_UDP6_U},
1251         .ftypes_nr      = {0, 0, 0},
1252 #ifdef SOURCE_SADF
1253         .f_render       = render_net_udp6_stats,
1254         .f_xml_print    = xml_print_net_udp6_stats,
1255         .f_json_print   = json_print_net_udp6_stats,
1256         .f_svg_print    = svg_print_net_udp6_stats,
1257         .f_raw_print    = raw_print_net_udp6_stats,
1258         .name           = "A_NET_UDP6",
1259         .g_nr           = 2,
1260 #endif
1261         .nr_ini         = 1,
1262         .nr2            = 1,
1263         .nr_max         = 1,
1264         .nr             = {1, 1, 1},
1265         .nr_allocated   = 0,
1266         .fsize          = STATS_NET_UDP6_SIZE,
1267         .msize          = STATS_NET_UDP6_SIZE,
1268         .opt_flags      = 0,
1269         .buf            = {NULL, NULL, NULL},
1270         .bitmap         = NULL
1271 };
1272
1273 /* CPU frequency */
1274 struct activity pwr_cpufreq_act = {
1275         .id             = A_PWR_CPUFREQ,
1276         .options        = AO_COUNTED + AO_GRAPH_PER_ITEM,
1277         .magic          = ACTIVITY_MAGIC_BASE,
1278         .group          = G_POWER,
1279 #ifdef SOURCE_SADC
1280         .f_count_index  = 0,    /* wrap_get_cpu_nr() */
1281         .f_count2       = NULL,
1282         .f_read         = wrap_read_cpuinfo,
1283 #endif
1284 #ifdef SOURCE_SAR
1285         .f_print        = print_pwr_cpufreq_stats,
1286         .f_print_avg    = print_avg_pwr_cpufreq_stats,
1287 #endif
1288 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1289         .hdr_line       = "CPU;MHz",
1290 #endif
1291         .gtypes_nr      = {STATS_PWR_CPUFREQ_ULL, STATS_PWR_CPUFREQ_UL, STATS_PWR_CPUFREQ_U},
1292         .ftypes_nr      = {0, 0, 0},
1293 #ifdef SOURCE_SADF
1294         .f_render       = render_pwr_cpufreq_stats,
1295         .f_xml_print    = xml_print_pwr_cpufreq_stats,
1296         .f_json_print   = json_print_pwr_cpufreq_stats,
1297         .f_svg_print    = svg_print_pwr_cpufreq_stats,
1298         .f_raw_print    = raw_print_pwr_cpufreq_stats,
1299         .name           = "A_PWR_CPUFREQ",
1300         .g_nr           = 1,
1301 #endif
1302         .nr_ini         = -1,
1303         .nr2            = 1,
1304         .nr_max         = NR_CPUS + 1,
1305         .nr             = {-1, -1, -1},
1306         .nr_allocated   = 0,
1307         .fsize          = STATS_PWR_CPUFREQ_SIZE,
1308         .msize          = STATS_PWR_CPUFREQ_SIZE,
1309         .opt_flags      = 0,
1310         .buf            = {NULL, NULL, NULL},
1311         .bitmap         = &cpu_bitmap
1312 };
1313
1314 /* Fan */
1315 struct activity pwr_fan_act = {
1316         .id             = A_PWR_FAN,
1317         .options        = AO_COUNTED + AO_GRAPH_PER_ITEM,
1318         .magic          = ACTIVITY_MAGIC_BASE,
1319         .group          = G_POWER,
1320 #ifdef SOURCE_SADC
1321         .f_count_index  = 5,    /* wrap_get_fan_nr() */
1322         .f_count2       = NULL,
1323         .f_read         = wrap_read_fan,
1324 #endif
1325 #ifdef SOURCE_SAR
1326         .f_print        = print_pwr_fan_stats,
1327         .f_print_avg    = print_avg_pwr_fan_stats,
1328 #endif
1329 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1330         .hdr_line       = "FAN;DEVICE;rpm;drpm",
1331 #endif
1332         .gtypes_nr      = {STATS_PWR_FAN_ULL, STATS_PWR_FAN_UL, STATS_PWR_FAN_U},
1333         .ftypes_nr      = {0, 0, 0},
1334 #ifdef SOURCE_SADF
1335         .f_render       = render_pwr_fan_stats,
1336         .f_xml_print    = xml_print_pwr_fan_stats,
1337         .f_json_print   = json_print_pwr_fan_stats,
1338         .f_svg_print    = svg_print_pwr_fan_stats,
1339         .f_raw_print    = raw_print_pwr_fan_stats,
1340         .name           = "A_PWR_FAN",
1341         .g_nr           = 1,
1342 #endif
1343         .nr_ini         = -1,
1344         .nr2            = 1,
1345         .nr_max         = MAX_NR_FANS,
1346         .nr             = {-1, -1, -1},
1347         .nr_allocated   = 0,
1348         .fsize          = STATS_PWR_FAN_SIZE,
1349         .msize          = STATS_PWR_FAN_SIZE,
1350         .opt_flags      = 0,
1351         .buf            = {NULL, NULL, NULL},
1352         .bitmap         = NULL
1353 };
1354
1355 /* Temperature */
1356 struct activity pwr_temp_act = {
1357         .id             = A_PWR_TEMP,
1358         .options        = AO_COUNTED + AO_GRAPH_PER_ITEM,
1359         .magic          = ACTIVITY_MAGIC_BASE,
1360         .group          = G_POWER,
1361 #ifdef SOURCE_SADC
1362         .f_count_index  = 6,    /* wrap_get_temp_nr() */
1363         .f_count2       = NULL,
1364         .f_read         = wrap_read_temp,
1365 #endif
1366 #ifdef SOURCE_SAR
1367         .f_print        = print_pwr_temp_stats,
1368         .f_print_avg    = print_avg_pwr_temp_stats,
1369 #endif
1370 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1371         .hdr_line       = "TEMP;DEVICE;degC;%temp",
1372 #endif
1373         .gtypes_nr      = {STATS_PWR_TEMP_ULL, STATS_PWR_TEMP_UL, STATS_PWR_TEMP_U},
1374         .ftypes_nr      = {0, 0, 0},
1375 #ifdef SOURCE_SADF
1376         .f_render       = render_pwr_temp_stats,
1377         .f_xml_print    = xml_print_pwr_temp_stats,
1378         .f_json_print   = json_print_pwr_temp_stats,
1379         .f_svg_print    = svg_print_pwr_temp_stats,
1380         .f_raw_print    = raw_print_pwr_temp_stats,
1381         .name           = "A_PWR_TEMP",
1382         .g_nr           = 2,
1383 #endif
1384         .nr_ini         = -1,
1385         .nr2            = 1,
1386         .nr_max         = MAX_NR_TEMP_SENSORS,
1387         .nr             = {-1, -1, -1},
1388         .nr_allocated   = 0,
1389         .fsize          = STATS_PWR_TEMP_SIZE,
1390         .msize          = STATS_PWR_TEMP_SIZE,
1391         .opt_flags      = 0,
1392         .buf            = {NULL, NULL, NULL},
1393         .bitmap         = NULL
1394 };
1395
1396 /* Voltage inputs */
1397 struct activity pwr_in_act = {
1398         .id             = A_PWR_IN,
1399         .options        = AO_COUNTED + AO_GRAPH_PER_ITEM,
1400         .magic          = ACTIVITY_MAGIC_BASE,
1401         .group          = G_POWER,
1402 #ifdef SOURCE_SADC
1403         .f_count_index  = 7,    /* wrap_get_in_nr() */
1404         .f_count2       = NULL,
1405         .f_read         = wrap_read_in,
1406 #endif
1407 #ifdef SOURCE_SAR
1408         .f_print        = print_pwr_in_stats,
1409         .f_print_avg    = print_avg_pwr_in_stats,
1410 #endif
1411 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1412         .hdr_line       = "IN;DEVICE;inV;%in",
1413 #endif
1414         .gtypes_nr      = {STATS_PWR_IN_ULL, STATS_PWR_IN_UL, STATS_PWR_IN_U},
1415         .ftypes_nr      = {0, 0, 0},
1416 #ifdef SOURCE_SADF
1417         .f_render       = render_pwr_in_stats,
1418         .f_xml_print    = xml_print_pwr_in_stats,
1419         .f_json_print   = json_print_pwr_in_stats,
1420         .f_svg_print    = svg_print_pwr_in_stats,
1421         .f_raw_print    = raw_print_pwr_in_stats,
1422         .name           = "A_PWR_IN",
1423         .g_nr           = 2,
1424 #endif
1425         .nr_ini         = -1,
1426         .nr2            = 1,
1427         .nr_max         = MAX_NR_IN_SENSORS,
1428         .nr             = {-1, -1, -1},
1429         .nr_allocated   = 0,
1430         .fsize          = STATS_PWR_IN_SIZE,
1431         .msize          = STATS_PWR_IN_SIZE,
1432         .opt_flags      = 0,
1433         .buf            = {NULL, NULL, NULL},
1434         .bitmap         = NULL
1435 };
1436
1437 /* Hugepages activity */
1438 struct activity huge_act = {
1439         .id             = A_HUGE,
1440         .options        = AO_COLLECTED,
1441         .magic          = ACTIVITY_MAGIC_BASE,
1442         .group          = G_DEFAULT,
1443 #ifdef SOURCE_SADC
1444         .f_count_index  = -1,
1445         .f_count2       = NULL,
1446         .f_read         = wrap_read_meminfo_huge,
1447 #endif
1448 #ifdef SOURCE_SAR
1449         .f_print        = print_huge_stats,
1450         .f_print_avg    = print_avg_huge_stats,
1451 #endif
1452 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1453         .hdr_line       = "kbhugfree;kbhugused;%hugused",
1454 #endif
1455         .gtypes_nr      = {STATS_HUGE_ULL, STATS_HUGE_UL, STATS_HUGE_U},
1456         .ftypes_nr      = {0, 0, 0},
1457 #ifdef SOURCE_SADF
1458         .f_render       = render_huge_stats,
1459         .f_xml_print    = xml_print_huge_stats,
1460         .f_json_print   = json_print_huge_stats,
1461         .f_svg_print    = svg_print_huge_stats,
1462         .f_raw_print    = raw_print_huge_stats,
1463         .name           = "A_HUGE",
1464         .g_nr           = 2,
1465 #endif
1466         .nr_ini         = 1,
1467         .nr2            = 1,
1468         .nr_max         = 1,
1469         .nr             = {1, 1, 1},
1470         .nr_allocated   = 0,
1471         .fsize          = STATS_HUGE_SIZE,
1472         .msize          = STATS_HUGE_SIZE,
1473         .opt_flags      = 0,
1474         .buf            = {NULL, NULL, NULL},
1475         .bitmap         = NULL
1476 };
1477
1478 /* CPU weighted frequency */
1479 struct activity pwr_wghfreq_act = {
1480         .id             = A_PWR_WGHFREQ,
1481         .options        = AO_COUNTED + AO_MATRIX,
1482         .magic          = ACTIVITY_MAGIC_BASE,
1483         .group          = G_POWER,
1484 #ifdef SOURCE_SADC
1485         .f_count_index  = 0,    /* wrap_get_cpu_nr() */
1486         .f_count2       = wrap_get_freq_nr,
1487         .f_read         = wrap_read_cpu_wghfreq,
1488 #endif
1489 #ifdef SOURCE_SAR
1490         .f_print        = print_pwr_wghfreq_stats,
1491         .f_print_avg    = print_pwr_wghfreq_stats,
1492 #endif
1493 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1494         .hdr_line       = "CPU;wghMHz",
1495 #endif
1496         .gtypes_nr      = {STATS_PWR_WGHFREQ_ULL, STATS_PWR_WGHFREQ_UL, STATS_PWR_WGHFREQ_U},
1497         .ftypes_nr      = {0, 0, 0},
1498 #ifdef SOURCE_SADF
1499         .f_render       = render_pwr_wghfreq_stats,
1500         .f_xml_print    = xml_print_pwr_wghfreq_stats,
1501         .f_json_print   = json_print_pwr_wghfreq_stats,
1502         .f_svg_print    = NULL,
1503         .f_raw_print    = raw_print_pwr_wghfreq_stats,
1504         .name           = "A_PWR_WGHFREQ",
1505         .g_nr           = 0,
1506 #endif
1507         .nr_ini         = -1,
1508         .nr2            = -1,
1509         .nr_max         = NR_CPUS + 1,
1510         .nr             = {-1, -1, -1},
1511         .nr_allocated   = 0,
1512         .fsize          = STATS_PWR_WGHFREQ_SIZE,
1513         .msize          = STATS_PWR_WGHFREQ_SIZE,
1514         .opt_flags      = 0,
1515         .buf            = {NULL, NULL, NULL},
1516         .bitmap         = &cpu_bitmap
1517 };
1518
1519 /* USB devices plugged into the system */
1520 struct activity pwr_usb_act = {
1521         .id             = A_PWR_USB,
1522         .options        = AO_COUNTED + AO_CLOSE_MARKUP,
1523         .magic          = ACTIVITY_MAGIC_BASE,
1524         .group          = G_POWER,
1525 #ifdef SOURCE_SADC
1526         .f_count_index  = 8,    /* wrap_get_usb_nr() */
1527         .f_count2       = NULL,
1528         .f_read         = wrap_read_bus_usb_dev,
1529 #endif
1530 #ifdef SOURCE_SAR
1531         .f_print        = print_pwr_usb_stats,
1532         .f_print_avg    = print_avg_pwr_usb_stats,
1533 #endif
1534 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1535         .hdr_line       = "manufact;product;BUS;idvendor;idprod;maxpower",
1536 #endif
1537         .gtypes_nr      = {STATS_PWR_USB_ULL, STATS_PWR_USB_UL, STATS_PWR_USB_U},
1538         .ftypes_nr      = {0, 0, 0},
1539 #ifdef SOURCE_SADF
1540         .f_render       = render_pwr_usb_stats,
1541         .f_xml_print    = xml_print_pwr_usb_stats,
1542         .f_json_print   = json_print_pwr_usb_stats,
1543         .f_svg_print    = NULL,
1544         .f_raw_print    = raw_print_pwr_usb_stats,
1545         .name           = "A_PWR_USB",
1546         .g_nr           = 0,
1547 #endif
1548         .nr_ini         = -1,
1549         .nr2            = 1,
1550         .nr_max         = MAX_NR_USB,
1551         .nr             = {-1, -1, -1},
1552         .nr_allocated   = 0,
1553         .fsize          = STATS_PWR_USB_SIZE,
1554         .msize          = STATS_PWR_USB_SIZE,
1555         .opt_flags      = 0,
1556         .buf            = {NULL, NULL, NULL},
1557         .bitmap         = NULL
1558 };
1559
1560 /* Filesystem usage activity */
1561 struct activity filesystem_act = {
1562         .id             = A_FILESYSTEM,
1563         .options        = AO_COUNTED + AO_GRAPH_PER_ITEM + AO_MULTIPLE_OUTPUTS,
1564         .magic          = ACTIVITY_MAGIC_BASE,
1565         .group          = G_XDISK,
1566 #ifdef SOURCE_SADC
1567         .f_count_index  = 9,    /* wrap_get_filesystem_nr() */
1568         .f_count2       = NULL,
1569         .f_read         = wrap_read_filesystem,
1570 #endif
1571 #ifdef SOURCE_SAR
1572         .f_print        = print_filesystem_stats,
1573         .f_print_avg    = print_avg_filesystem_stats,
1574 #endif
1575 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1576         .hdr_line       = "FILESYSTEM;MBfsfree;MBfsused;%fsused;%ufsused;Ifree;Iused;%Iused|"
1577                           "MOUNTPOINT;MBfsfree;MBfsused;%fsused;%ufsused;Ifree;Iused;%Iused",
1578 #endif
1579         .gtypes_nr      = {STATS_FILESYSTEM_ULL, STATS_FILESYSTEM_UL, STATS_FILESYSTEM_U},
1580         .ftypes_nr      = {0, 0, 0},
1581 #ifdef SOURCE_SADF
1582         .f_render       = render_filesystem_stats,
1583         .f_xml_print    = xml_print_filesystem_stats,
1584         .f_json_print   = json_print_filesystem_stats,
1585         .f_svg_print    = svg_print_filesystem_stats,
1586         .f_raw_print    = raw_print_filesystem_stats,
1587         .name           = "A_FILESYSTEM",
1588         .g_nr           = 4,
1589 #endif
1590         .nr_ini         = -1,
1591         .nr2            = 1,
1592         .nr_max         = MAX_NR_FS,
1593         .nr             = {-1, -1, -1},
1594         .nr_allocated   = 0,
1595         .fsize          = STATS_FILESYSTEM_SIZE,
1596         .msize          = STATS_FILESYSTEM_SIZE,
1597         .opt_flags      = 0,
1598         .buf            = {NULL, NULL, NULL},
1599         .bitmap         = NULL
1600 };
1601
1602 /* Fibre Channel HBA usage activity */
1603 struct activity fchost_act = {
1604         .id             = A_NET_FC,
1605         .options        = AO_COUNTED + AO_GRAPH_PER_ITEM,
1606         .magic          = ACTIVITY_MAGIC_BASE,
1607         .group          = G_DISK,
1608 #ifdef SOURCE_SADC
1609         .f_count_index  = 10,   /* wrap_get_fchost_nr() */
1610         .f_count2       = NULL,
1611         .f_read         = wrap_read_fchost,
1612 #endif
1613 #ifdef SOURCE_SAR
1614         .f_print        = print_fchost_stats,
1615         .f_print_avg    = print_fchost_stats,
1616 #endif
1617 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1618         .hdr_line       = "FCHOST;fch_rxf/s;fch_txf/s;fch_rxw/s;fch_txw/s",
1619 #endif
1620         .gtypes_nr      = {STATS_FCHOST_ULL, STATS_FCHOST_UL, STATS_FCHOST_U},
1621         .ftypes_nr      = {0, 0, 0},
1622 #ifdef SOURCE_SADF
1623         .f_render       = render_fchost_stats,
1624         .f_xml_print    = xml_print_fchost_stats,
1625         .f_json_print   = json_print_fchost_stats,
1626         .f_svg_print    = svg_print_fchost_stats,
1627         .f_raw_print    = raw_print_fchost_stats,
1628         .name           = "A_FCHOST",
1629         .g_nr           = 2,
1630 #endif
1631         .nr_ini         = -1,
1632         .nr2            = 1,
1633         .nr_max         = MAX_NR_FCHOSTS,
1634         .nr             = {-1, -1, -1},
1635         .nr_allocated   = 0,
1636         .fsize          = STATS_FCHOST_SIZE,
1637         .msize          = STATS_FCHOST_SIZE,
1638         .opt_flags      = 0,
1639         .buf            = {NULL, NULL, NULL},
1640         .bitmap         = NULL
1641 };
1642
1643 /* Softnet activity */
1644 struct activity softnet_act = {
1645         .id             = A_NET_SOFT,
1646         .options        = AO_COLLECTED + AO_COUNTED + AO_CLOSE_MARKUP +
1647                           AO_GRAPH_PER_ITEM,
1648         .magic          = ACTIVITY_MAGIC_BASE,
1649         .group          = G_DEFAULT,
1650 #ifdef SOURCE_SADC
1651         .f_count_index  = 0,    /* wrap_get_cpu_nr() */
1652         .f_count2       = NULL,
1653         .f_read         = wrap_read_softnet,
1654 #endif
1655 #ifdef SOURCE_SAR
1656         .f_print        = print_softnet_stats,
1657         .f_print_avg    = print_softnet_stats,
1658 #endif
1659 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
1660         .hdr_line       = "CPU;total/s;dropd/s;squeezd/s;rx_rps/s;flw_lim/s",
1661 #endif
1662         .gtypes_nr      = {STATS_SOFTNET_ULL, STATS_SOFTNET_UL, STATS_SOFTNET_U},
1663         .ftypes_nr      = {0, 0, 0},
1664 #ifdef SOURCE_SADF
1665         .f_render       = render_softnet_stats,
1666         .f_xml_print    = xml_print_softnet_stats,
1667         .f_json_print   = json_print_softnet_stats,
1668         .f_svg_print    = svg_print_softnet_stats,
1669         .f_raw_print    = raw_print_softnet_stats,
1670         .name           = "A_NET_SOFT",
1671         .g_nr           = 2,
1672 #endif
1673         .nr_ini         = -1,
1674         .nr2            = 1,
1675         .nr_max         = NR_CPUS + 1,
1676         .nr             = {-1, -1, -1},
1677         .nr_allocated   = 0,
1678         .fsize          = STATS_SOFTNET_SIZE,
1679         .msize          = STATS_SOFTNET_SIZE,
1680         .opt_flags      = 0,
1681         .buf            = {NULL, NULL, NULL},
1682         .bitmap         = &cpu_bitmap
1683 };
1684
1685 #ifdef SOURCE_SADC
1686 /*
1687  * Array of functions used to count number of items.
1688  */
1689 __nr_t (*f_count[NR_F_COUNT]) (struct activity *) = {
1690         wrap_get_cpu_nr,
1691         wrap_get_irq_nr,
1692         wrap_get_serial_nr,
1693         wrap_get_disk_nr,
1694         wrap_get_iface_nr,
1695         wrap_get_fan_nr,
1696         wrap_get_temp_nr,
1697         wrap_get_in_nr,
1698         wrap_get_usb_nr,
1699         wrap_get_filesystem_nr,
1700         wrap_get_fchost_nr
1701 };
1702 #endif
1703
1704 /*
1705  * Array of activities.
1706  * (Order of activities doesn't matter for daily data files).
1707  */
1708 struct activity *act[NR_ACT] = {
1709         &cpu_act,
1710         &pcsw_act,
1711         &irq_act,
1712         &swap_act,
1713         &paging_act,
1714         &io_act,
1715         &memory_act,
1716         &huge_act,
1717         &ktables_act,
1718         &queue_act,
1719         &serial_act,
1720         &disk_act,
1721         /* <network> */
1722         &net_dev_act,
1723         &net_edev_act,
1724         &net_nfs_act,
1725         &net_nfsd_act,
1726         &net_sock_act,
1727         &net_ip_act,
1728         &net_eip_act,
1729         &net_icmp_act,
1730         &net_eicmp_act,
1731         &net_tcp_act,
1732         &net_etcp_act,
1733         &net_udp_act,
1734         &net_sock6_act,
1735         &net_ip6_act,
1736         &net_eip6_act,
1737         &net_icmp6_act,
1738         &net_eicmp6_act,
1739         &net_udp6_act,
1740         &fchost_act,
1741         &softnet_act,   /* AO_CLOSE_MARKUP */
1742         /* </network> */
1743         /* <power-management> */
1744         &pwr_cpufreq_act,
1745         &pwr_fan_act,
1746         &pwr_temp_act,
1747         &pwr_in_act,
1748         &pwr_wghfreq_act,
1749         &pwr_usb_act,           /* AO_CLOSE_MARKUP */
1750         /* </power-management> */
1751         &filesystem_act
1752 };