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