2 * activity.c: Define system activities available for sar/sadc.
3 * (C) 1999-2016 by Sebastien GODARD (sysstat <at> orange.fr)
5 ***************************************************************************
6 * This program is free software; you can redistribute it and/or modify it *
7 * under the terms of the GNU General Public License as published by the *
8 * Free Software Foundation; either version 2 of the License, or (at your *
9 * option) any later version. *
11 * This program is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY *
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
16 * You should have received a copy of the GNU General Public License along *
17 * with this program; if not, write to the Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA *
19 ***************************************************************************
26 #include "rd_sensors.h"
34 #include "rndr_stats.h"
35 #include "xml_stats.h"
36 #include "json_stats.h"
37 #include "svg_stats.h"
41 ***************************************************************************
42 * Definitions of system activities.
43 * See sa.h file for activity structure definition.
44 * Activity structure doesn't matter for daily data files.
45 ***************************************************************************
49 * Bitmaps needed by activities.
50 * Remember to allocate them before use!
54 struct act_bitmap cpu_bitmap = {
59 /* Interrupts bitmap */
60 struct act_bitmap irq_bitmap = {
68 * This is the only activity which *must* be collected by sadc
69 * so that uptime can be filled.
71 struct activity cpu_act = {
73 .options = AO_COLLECTED + AO_VOLATILE + AO_GLOBAL_ITV + AO_MULTIPLE_OUTPUTS +
75 .magic = ACTIVITY_MAGIC_BASE,
78 .f_count_index = 0, /* wrap_get_cpu_nr() */
80 .f_read = wrap_read_stat_cpu,
83 .f_print = print_cpu_stats,
84 .f_print_avg = print_cpu_stats,
87 .f_render = render_cpu_stats,
88 .f_xml_print = xml_print_cpu_stats,
89 .f_json_print = json_print_cpu_stats,
90 .f_svg_print = svg_print_cpu_stats,
91 .hdr_line = "CPU;%user;%nice;%system;%iowait;%steal;%idle|"
92 "CPU;%usr;%nice;%sys;%iowait;%steal;%irq;%soft;%guest;%gnice;%idle",
98 .nr_max = NR_CPUS + 1,
99 .fsize = STATS_CPU_SIZE,
100 .msize = STATS_CPU_SIZE,
101 .opt_flags = AO_F_CPU_DEF,
102 .buf = {NULL, NULL, NULL},
103 .bitmap = &cpu_bitmap
106 /* Process (task) creation and context switch activity */
107 struct activity pcsw_act = {
109 .options = AO_COLLECTED,
110 .magic = ACTIVITY_MAGIC_BASE,
115 .f_read = wrap_read_stat_pcsw,
118 .f_print = print_pcsw_stats,
119 .f_print_avg = print_pcsw_stats,
122 .f_render = render_pcsw_stats,
123 .f_xml_print = xml_print_pcsw_stats,
124 .f_json_print = json_print_pcsw_stats,
125 .f_svg_print = svg_print_pcsw_stats,
126 .hdr_line = "proc/s;cswch/s",
133 .fsize = STATS_PCSW_SIZE,
134 .msize = STATS_PCSW_SIZE,
136 .buf = {NULL, NULL, NULL},
140 /* Interrupts statistics */
141 struct activity irq_act = {
144 .magic = ACTIVITY_MAGIC_BASE,
147 .f_count_index = 1, /* wrap_get_irq_nr() */
149 .f_read = wrap_read_stat_irq,
152 .f_print = print_irq_stats,
153 .f_print_avg = print_irq_stats,
156 .f_render = render_irq_stats,
157 .f_xml_print = xml_print_irq_stats,
158 .f_json_print = json_print_irq_stats,
159 .hdr_line = "INTR;intr/s",
165 .nr_max = NR_IRQS + 1,
166 .fsize = STATS_IRQ_SIZE,
167 .msize = STATS_IRQ_SIZE,
169 .buf = {NULL, NULL, NULL},
170 .bitmap = &irq_bitmap
173 /* Swapping activity */
174 struct activity swap_act = {
176 .options = AO_COLLECTED,
177 .magic = ACTIVITY_MAGIC_BASE,
182 .f_read = wrap_read_swap,
185 .f_print = print_swap_stats,
186 .f_print_avg = print_swap_stats,
189 .f_render = render_swap_stats,
190 .f_xml_print = xml_print_swap_stats,
191 .f_json_print = json_print_swap_stats,
192 .f_svg_print = svg_print_swap_stats,
193 .hdr_line = "pswpin/s;pswpout/s",
200 .fsize = STATS_SWAP_SIZE,
201 .msize = STATS_SWAP_SIZE,
203 .buf = {NULL, NULL, NULL},
207 /* Paging activity */
208 struct activity paging_act = {
210 .options = AO_COLLECTED,
211 .magic = ACTIVITY_MAGIC_BASE,
216 .f_read = wrap_read_paging,
219 .f_print = print_paging_stats,
220 .f_print_avg = print_paging_stats,
223 .f_render = render_paging_stats,
224 .f_xml_print = xml_print_paging_stats,
225 .f_json_print = json_print_paging_stats,
226 .f_svg_print = svg_print_paging_stats,
227 .hdr_line = "pgpgin/s;pgpgout/s;fault/s;majflt/s;"
228 "pgfree/s;pgscank/s;pgscand/s;pgsteal/s;%vmeff",
235 .fsize = STATS_PAGING_SIZE,
236 .msize = STATS_PAGING_SIZE,
238 .buf = {NULL, NULL, NULL},
242 /* I/O and transfer rate activity */
243 struct activity io_act = {
245 .options = AO_COLLECTED,
246 .magic = ACTIVITY_MAGIC_BASE + 1,
251 .f_read = wrap_read_io,
254 .f_print = print_io_stats,
255 .f_print_avg = print_io_stats,
258 .f_render = render_io_stats,
259 .f_xml_print = xml_print_io_stats,
260 .f_json_print = json_print_io_stats,
261 .f_svg_print = svg_print_io_stats,
262 .hdr_line = "tps;rtps;wtps;bread/s;bwrtn/s",
269 .fsize = STATS_IO_SIZE,
270 .msize = STATS_IO_SIZE,
272 .buf = {NULL, NULL, NULL},
276 /* Memory and swap space utilization activity */
277 struct activity memory_act = {
279 .options = AO_COLLECTED + AO_MULTIPLE_OUTPUTS,
280 .magic = ACTIVITY_MAGIC_BASE,
285 .f_read = wrap_read_meminfo,
288 .f_print = print_memory_stats,
289 .f_print_avg = print_avg_memory_stats,
292 .f_render = render_memory_stats,
293 .f_xml_print = xml_print_memory_stats,
294 .f_json_print = json_print_memory_stats,
295 .f_svg_print = svg_print_memory_stats,
296 .hdr_line = "frmpg/s;bufpg/s;campg/s|"
297 "kbmemfree;kbmemused;%memused;kbbuffers;kbcached;kbcommit;%commit;kbactive;kbinact;kbdirty&kbanonpg;kbslab;kbkstack;kbpgtbl;kbvmused|"
298 "kbswpfree;kbswpused;%swpused;kbswpcad;%swpcad",
305 .fsize = STATS_MEMORY_SIZE,
306 .msize = STATS_MEMORY_SIZE,
308 .buf = {NULL, NULL, NULL},
312 /* Kernel tables activity */
313 struct activity ktables_act = {
315 .options = AO_COLLECTED,
316 .magic = ACTIVITY_MAGIC_BASE,
321 .f_read = wrap_read_kernel_tables,
324 .f_print = print_ktables_stats,
325 .f_print_avg = print_avg_ktables_stats,
328 .f_render = render_ktables_stats,
329 .f_xml_print = xml_print_ktables_stats,
330 .f_json_print = json_print_ktables_stats,
331 .f_svg_print = svg_print_ktables_stats,
332 .hdr_line = "dentunusd;file-nr;inode-nr;pty-nr",
339 .fsize = STATS_KTABLES_SIZE,
340 .msize = STATS_KTABLES_SIZE,
342 .buf = {NULL, NULL, NULL},
346 /* Queue and load activity */
347 struct activity queue_act = {
349 .options = AO_COLLECTED,
350 .magic = ACTIVITY_MAGIC_BASE + 1,
355 .f_read = wrap_read_loadavg,
358 .f_print = print_queue_stats,
359 .f_print_avg = print_avg_queue_stats,
362 .f_render = render_queue_stats,
363 .f_xml_print = xml_print_queue_stats,
364 .f_json_print = json_print_queue_stats,
365 .f_svg_print = svg_print_queue_stats,
366 .hdr_line = "runq-sz;plist-sz;ldavg-1;ldavg-5;ldavg-15;blocked",
373 .fsize = STATS_QUEUE_SIZE,
374 .msize = STATS_QUEUE_SIZE,
376 .buf = {NULL, NULL, NULL},
380 /* Serial lines activity */
381 struct activity serial_act = {
383 .options = AO_COLLECTED,
384 .magic = ACTIVITY_MAGIC_BASE,
387 .f_count_index = 2, /* wrap_get_serial_nr() */
389 .f_read = wrap_read_tty_driver_serial,
392 .f_print = print_serial_stats,
393 .f_print_avg = print_serial_stats,
396 .f_render = render_serial_stats,
397 .f_xml_print = xml_print_serial_stats,
398 .f_json_print = json_print_serial_stats,
399 .hdr_line = "TTY;rcvin/s;txmtin/s;framerr/s;prtyerr/s;brk/s;ovrun/s",
405 .nr_max = MAX_NR_SERIAL_LINES,
406 .fsize = STATS_SERIAL_SIZE,
407 .msize = STATS_SERIAL_SIZE,
409 .buf = {NULL, NULL, NULL},
413 /* Block devices activity */
414 struct activity disk_act = {
417 .magic = ACTIVITY_MAGIC_BASE + 1,
420 .f_count_index = 3, /* wrap_get_disk_nr() */
422 .f_read = wrap_read_disk,
425 .f_print = print_disk_stats,
426 .f_print_avg = print_disk_stats,
429 .f_render = render_disk_stats,
430 .f_xml_print = xml_print_disk_stats,
431 .f_json_print = json_print_disk_stats,
432 .hdr_line = "DEV;tps;rd_sec/s;wr_sec/s;avgrq-sz;avgqu-sz;await;svctm;%util",
438 .nr_max = MAX_NR_DISKS,
439 .fsize = STATS_DISK_SIZE,
440 .msize = STATS_DISK_SIZE,
442 .buf = {NULL, NULL, NULL},
446 /* Network interfaces activity */
447 struct activity net_dev_act = {
449 .options = AO_COLLECTED + AO_GRAPH_PER_ITEM,
450 .magic = ACTIVITY_MAGIC_BASE + 2,
453 .f_count_index = 4, /* wrap_get_iface_nr() */
455 .f_read = wrap_read_net_dev,
458 .f_print = print_net_dev_stats,
459 .f_print_avg = print_net_dev_stats,
462 .f_render = render_net_dev_stats,
463 .f_xml_print = xml_print_net_dev_stats,
464 .f_json_print = json_print_net_dev_stats,
465 .f_svg_print = svg_print_net_dev_stats,
466 .hdr_line = "IFACE;rxpck/s;txpck/s;rxkB/s;txkB/s;rxcmp/s;txcmp/s;rxmcst/s;%ifutil",
472 .nr_max = MAX_NR_IFACES,
473 .fsize = STATS_NET_DEV_SIZE,
474 .msize = STATS_NET_DEV_SIZE,
476 .buf = {NULL, NULL, NULL},
480 /* Network interfaces activity */
481 struct activity net_edev_act = {
483 .options = AO_COLLECTED,
484 .magic = ACTIVITY_MAGIC_BASE + 1,
487 .f_count_index = 4, /* wrap_get_iface_nr() */
489 .f_read = wrap_read_net_edev,
492 .f_print = print_net_edev_stats,
493 .f_print_avg = print_net_edev_stats,
496 .f_render = render_net_edev_stats,
497 .f_xml_print = xml_print_net_edev_stats,
498 .f_json_print = json_print_net_edev_stats,
499 .hdr_line = "IFACE;rxerr/s;txerr/s;coll/s;rxdrop/s;txdrop/s;"
500 "txcarr/s;rxfram/s;rxfifo/s;txfifo/s",
501 .name = "A_NET_EDEV",
506 .nr_max = MAX_NR_IFACES,
507 .fsize = STATS_NET_EDEV_SIZE,
508 .msize = STATS_NET_EDEV_SIZE,
510 .buf = {NULL, NULL, NULL},
514 /* NFS client activity */
515 struct activity net_nfs_act = {
517 .options = AO_COLLECTED,
518 .magic = ACTIVITY_MAGIC_BASE,
523 .f_read = wrap_read_net_nfs,
526 .f_print = print_net_nfs_stats,
527 .f_print_avg = print_net_nfs_stats,
530 .f_render = render_net_nfs_stats,
531 .f_xml_print = xml_print_net_nfs_stats,
532 .f_json_print = json_print_net_nfs_stats,
533 .hdr_line = "call/s;retrans/s;read/s;write/s;access/s;getatt/s",
540 .fsize = STATS_NET_NFS_SIZE,
541 .msize = STATS_NET_NFS_SIZE,
543 .buf = {NULL, NULL, NULL},
547 /* NFS server activity */
548 struct activity net_nfsd_act = {
550 .options = AO_COLLECTED,
551 .magic = ACTIVITY_MAGIC_BASE,
556 .f_read = wrap_read_net_nfsd,
559 .f_print = print_net_nfsd_stats,
560 .f_print_avg = print_net_nfsd_stats,
563 .f_render = render_net_nfsd_stats,
564 .f_xml_print = xml_print_net_nfsd_stats,
565 .f_json_print = json_print_net_nfsd_stats,
566 .hdr_line = "scall/s;badcall/s;packet/s;udp/s;tcp/s;hit/s;miss/s;"
567 "sread/s;swrite/s;saccess/s;sgetatt/s",
568 .name = "A_NET_NFSD",
574 .fsize = STATS_NET_NFSD_SIZE,
575 .msize = STATS_NET_NFSD_SIZE,
577 .buf = {NULL, NULL, NULL},
581 /* Network sockets activity */
582 struct activity net_sock_act = {
584 .options = AO_COLLECTED,
585 .magic = ACTIVITY_MAGIC_BASE,
590 .f_read = wrap_read_net_sock,
593 .f_print = print_net_sock_stats,
594 .f_print_avg = print_avg_net_sock_stats,
597 .f_render = render_net_sock_stats,
598 .f_xml_print = xml_print_net_sock_stats,
599 .f_json_print = json_print_net_sock_stats,
600 .f_svg_print = svg_print_net_sock_stats,
601 .hdr_line = "totsck;tcpsck;udpsck;rawsck;ip-frag;tcp-tw",
602 .name = "A_NET_SOCK",
608 .fsize = STATS_NET_SOCK_SIZE,
609 .msize = STATS_NET_SOCK_SIZE,
611 .buf = {NULL, NULL, NULL},
615 /* IP network traffic activity */
616 struct activity net_ip_act = {
619 .magic = ACTIVITY_MAGIC_BASE + 1,
624 .f_read = wrap_read_net_ip,
627 .f_print = print_net_ip_stats,
628 .f_print_avg = print_net_ip_stats,
631 .f_render = render_net_ip_stats,
632 .f_xml_print = xml_print_net_ip_stats,
633 .f_json_print = json_print_net_ip_stats,
634 .f_svg_print = svg_print_net_ip_stats,
635 .hdr_line = "irec/s;fwddgm/s;idel/s;orq/s;asmrq/s;asmok/s;fragok/s;fragcrt/s",
642 .fsize = STATS_NET_IP_SIZE,
643 .msize = STATS_NET_IP_SIZE,
645 .buf = {NULL, NULL, NULL},
649 /* IP network traffic (errors) activity */
650 struct activity net_eip_act = {
653 .magic = ACTIVITY_MAGIC_BASE + 1,
658 .f_read = wrap_read_net_eip,
661 .f_print = print_net_eip_stats,
662 .f_print_avg = print_net_eip_stats,
665 .f_render = render_net_eip_stats,
666 .f_xml_print = xml_print_net_eip_stats,
667 .f_json_print = json_print_net_eip_stats,
668 .hdr_line = "ihdrerr/s;iadrerr/s;iukwnpr/s;idisc/s;odisc/s;onort/s;asmf/s;fragf/s",
675 .fsize = STATS_NET_EIP_SIZE,
676 .msize = STATS_NET_EIP_SIZE,
678 .buf = {NULL, NULL, NULL},
682 /* ICMP network traffic activity */
683 struct activity net_icmp_act = {
686 .magic = ACTIVITY_MAGIC_BASE,
691 .f_read = wrap_read_net_icmp,
694 .f_print = print_net_icmp_stats,
695 .f_print_avg = print_net_icmp_stats,
698 .f_render = render_net_icmp_stats,
699 .f_xml_print = xml_print_net_icmp_stats,
700 .f_json_print = json_print_net_icmp_stats,
701 .hdr_line = "imsg/s;omsg/s;iech/s;iechr/s;oech/s;oechr/s;itm/s;itmr/s;otm/s;"
702 "otmr/s;iadrmk/s;iadrmkr/s;oadrmk/s;oadrmkr/s",
703 .name = "A_NET_ICMP",
709 .fsize = STATS_NET_ICMP_SIZE,
710 .msize = STATS_NET_ICMP_SIZE,
712 .buf = {NULL, NULL, NULL},
716 /* ICMP network traffic (errors) activity */
717 struct activity net_eicmp_act = {
720 .magic = ACTIVITY_MAGIC_BASE,
725 .f_read = wrap_read_net_eicmp,
728 .f_print = print_net_eicmp_stats,
729 .f_print_avg = print_net_eicmp_stats,
732 .f_render = render_net_eicmp_stats,
733 .f_xml_print = xml_print_net_eicmp_stats,
734 .f_json_print = json_print_net_eicmp_stats,
735 .hdr_line = "ierr/s;oerr/s;idstunr/s;odstunr/s;itmex/s;otmex/s;"
736 "iparmpb/s;oparmpb/s;isrcq/s;osrcq/s;iredir/s;oredir/s",
737 .name = "A_NET_EICMP",
743 .fsize = STATS_NET_EICMP_SIZE,
744 .msize = STATS_NET_EICMP_SIZE,
746 .buf = {NULL, NULL, NULL},
750 /* TCP network traffic activity */
751 struct activity net_tcp_act = {
754 .magic = ACTIVITY_MAGIC_BASE,
759 .f_read = wrap_read_net_tcp,
762 .f_print = print_net_tcp_stats,
763 .f_print_avg = print_net_tcp_stats,
766 .f_render = render_net_tcp_stats,
767 .f_xml_print = xml_print_net_tcp_stats,
768 .f_json_print = json_print_net_tcp_stats,
769 .f_svg_print = svg_print_net_tcp_stats,
770 .hdr_line = "active/s;passive/s;iseg/s;oseg/s",
777 .fsize = STATS_NET_TCP_SIZE,
778 .msize = STATS_NET_TCP_SIZE,
780 .buf = {NULL, NULL, NULL},
784 /* TCP network traffic (errors) activity */
785 struct activity net_etcp_act = {
788 .magic = ACTIVITY_MAGIC_BASE,
793 .f_read = wrap_read_net_etcp,
796 .f_print = print_net_etcp_stats,
797 .f_print_avg = print_net_etcp_stats,
800 .f_render = render_net_etcp_stats,
801 .f_xml_print = xml_print_net_etcp_stats,
802 .f_json_print = json_print_net_etcp_stats,
803 .hdr_line = "atmptf/s;estres/s;retrans/s;isegerr/s;orsts/s",
804 .name = "A_NET_ETCP",
810 .fsize = STATS_NET_ETCP_SIZE,
811 .msize = STATS_NET_ETCP_SIZE,
813 .buf = {NULL, NULL, NULL},
817 /* UDP network traffic activity */
818 struct activity net_udp_act = {
821 .magic = ACTIVITY_MAGIC_BASE,
826 .f_read = wrap_read_net_udp,
829 .f_print = print_net_udp_stats,
830 .f_print_avg = print_net_udp_stats,
833 .f_render = render_net_udp_stats,
834 .f_xml_print = xml_print_net_udp_stats,
835 .f_json_print = json_print_net_udp_stats,
836 .f_svg_print = svg_print_net_udp_stats,
837 .hdr_line = "idgm/s;odgm/s;noport/s;idgmerr/s",
844 .fsize = STATS_NET_UDP_SIZE,
845 .msize = STATS_NET_UDP_SIZE,
847 .buf = {NULL, NULL, NULL},
851 /* IPv6 sockets activity */
852 struct activity net_sock6_act = {
855 .magic = ACTIVITY_MAGIC_BASE,
860 .f_read = wrap_read_net_sock6,
863 .f_print = print_net_sock6_stats,
864 .f_print_avg = print_avg_net_sock6_stats,
867 .f_render = render_net_sock6_stats,
868 .f_xml_print = xml_print_net_sock6_stats,
869 .f_json_print = json_print_net_sock6_stats,
870 .f_svg_print = svg_print_net_sock6_stats,
871 .hdr_line = "tcp6sck;udp6sck;raw6sck;ip6-frag",
872 .name = "A_NET_SOCK6",
878 .fsize = STATS_NET_SOCK6_SIZE,
879 .msize = STATS_NET_SOCK6_SIZE,
881 .buf = {NULL, NULL, NULL},
885 /* IPv6 network traffic activity */
886 struct activity net_ip6_act = {
889 .magic = ACTIVITY_MAGIC_BASE + 1,
894 .f_read = wrap_read_net_ip6,
897 .f_print = print_net_ip6_stats,
898 .f_print_avg = print_net_ip6_stats,
901 .f_render = render_net_ip6_stats,
902 .f_xml_print = xml_print_net_ip6_stats,
903 .f_json_print = json_print_net_ip6_stats,
904 .hdr_line = "irec6/s;fwddgm6/s;idel6/s;orq6/s;asmrq6/s;asmok6/s;"
905 "imcpck6/s;omcpck6/s;fragok6/s;fragcr6/s",
912 .fsize = STATS_NET_IP6_SIZE,
913 .msize = STATS_NET_IP6_SIZE,
915 .buf = {NULL, NULL, NULL},
919 /* IPv6 network traffic (errors) activity */
920 struct activity net_eip6_act = {
923 .magic = ACTIVITY_MAGIC_BASE + 1,
928 .f_read = wrap_read_net_eip6,
931 .f_print = print_net_eip6_stats,
932 .f_print_avg = print_net_eip6_stats,
935 .f_render = render_net_eip6_stats,
936 .f_xml_print = xml_print_net_eip6_stats,
937 .f_json_print = json_print_net_eip6_stats,
938 .hdr_line = "ihdrer6/s;iadrer6/s;iukwnp6/s;i2big6/s;idisc6/s;odisc6/s;"
939 "inort6/s;onort6/s;asmf6/s;fragf6/s;itrpck6/s",
940 .name = "A_NET_EIP6",
946 .fsize = STATS_NET_EIP6_SIZE,
947 .msize = STATS_NET_EIP6_SIZE,
949 .buf = {NULL, NULL, NULL},
953 /* ICMPv6 network traffic activity */
954 struct activity net_icmp6_act = {
957 .magic = ACTIVITY_MAGIC_BASE,
962 .f_read = wrap_read_net_icmp6,
965 .f_print = print_net_icmp6_stats,
966 .f_print_avg = print_net_icmp6_stats,
969 .f_render = render_net_icmp6_stats,
970 .f_xml_print = xml_print_net_icmp6_stats,
971 .f_json_print = json_print_net_icmp6_stats,
972 .hdr_line = "imsg6/s;omsg6/s;iech6/s;iechr6/s;oechr6/s;igmbq6/s;igmbr6/s;ogmbr6/s;"
973 "igmbrd6/s;ogmbrd6/s;irtsol6/s;ortsol6/s;irtad6/s;inbsol6/s;onbsol6/s;"
975 .name = "A_NET_ICMP6",
981 .fsize = STATS_NET_ICMP6_SIZE,
982 .msize = STATS_NET_ICMP6_SIZE,
984 .buf = {NULL, NULL, NULL},
988 /* ICMPv6 network traffic (errors) activity */
989 struct activity net_eicmp6_act = {
992 .magic = ACTIVITY_MAGIC_BASE,
997 .f_read = wrap_read_net_eicmp6,
1000 .f_print = print_net_eicmp6_stats,
1001 .f_print_avg = print_net_eicmp6_stats,
1004 .f_render = render_net_eicmp6_stats,
1005 .f_xml_print = xml_print_net_eicmp6_stats,
1006 .f_json_print = json_print_net_eicmp6_stats,
1007 .hdr_line = "ierr6/s;idtunr6/s;odtunr6/s;itmex6/s;otmex6/s;"
1008 "iprmpb6/s;oprmpb6/s;iredir6/s;oredir6/s;ipck2b6/s;opck2b6/s",
1009 .name = "A_NET_EICMP6",
1015 .fsize = STATS_NET_EICMP6_SIZE,
1016 .msize = STATS_NET_EICMP6_SIZE,
1018 .buf = {NULL, NULL, NULL},
1022 /* UDPv6 network traffic activity */
1023 struct activity net_udp6_act = {
1026 .magic = ACTIVITY_MAGIC_BASE,
1029 .f_count_index = -1,
1031 .f_read = wrap_read_net_udp6,
1034 .f_print = print_net_udp6_stats,
1035 .f_print_avg = print_net_udp6_stats,
1038 .f_render = render_net_udp6_stats,
1039 .f_xml_print = xml_print_net_udp6_stats,
1040 .f_json_print = json_print_net_udp6_stats,
1041 .hdr_line = "idgm6/s;odgm6/s;noport6/s;idgmer6/s",
1042 .name = "A_NET_UDP6",
1048 .fsize = STATS_NET_UDP6_SIZE,
1049 .msize = STATS_NET_UDP6_SIZE,
1051 .buf = {NULL, NULL, NULL},
1056 struct activity pwr_cpufreq_act = {
1057 .id = A_PWR_CPUFREQ,
1058 .options = AO_VOLATILE + AO_GRAPH_PER_ITEM,
1059 .magic = ACTIVITY_MAGIC_BASE,
1062 .f_count_index = 0, /* wrap_get_cpu_nr() */
1064 .f_read = wrap_read_cpuinfo,
1067 .f_print = print_pwr_cpufreq_stats,
1068 .f_print_avg = print_avg_pwr_cpufreq_stats,
1071 .f_render = render_pwr_cpufreq_stats,
1072 .f_xml_print = xml_print_pwr_cpufreq_stats,
1073 .f_json_print = json_print_pwr_cpufreq_stats,
1074 .f_svg_print = svg_print_pwr_cpufreq_stats,
1075 .hdr_line = "CPU;MHz",
1076 .name = "A_PWR_CPUFREQ",
1081 .nr_max = NR_CPUS + 1,
1082 .fsize = STATS_PWR_CPUFREQ_SIZE,
1083 .msize = STATS_PWR_CPUFREQ_SIZE,
1085 .buf = {NULL, NULL, NULL},
1086 .bitmap = &cpu_bitmap
1090 struct activity pwr_fan_act = {
1092 .options = AO_GRAPH_PER_ITEM,
1093 .magic = ACTIVITY_MAGIC_BASE,
1096 .f_count_index = 5, /* wrap_get_fan_nr() */
1098 .f_read = wrap_read_fan,
1101 .f_print = print_pwr_fan_stats,
1102 .f_print_avg = print_avg_pwr_fan_stats,
1105 .f_render = render_pwr_fan_stats,
1106 .f_xml_print = xml_print_pwr_fan_stats,
1107 .f_json_print = json_print_pwr_fan_stats,
1108 .f_svg_print = svg_print_pwr_fan_stats,
1109 .hdr_line = "FAN;DEVICE;rpm;drpm",
1110 .name = "A_PWR_FAN",
1115 .nr_max = MAX_NR_FANS,
1116 .fsize = STATS_PWR_FAN_SIZE,
1117 .msize = STATS_PWR_FAN_SIZE,
1119 .buf = {NULL, NULL, NULL},
1124 struct activity pwr_temp_act = {
1126 .options = AO_GRAPH_PER_ITEM,
1127 .magic = ACTIVITY_MAGIC_BASE,
1130 .f_count_index = 6, /* wrap_get_temp_nr() */
1132 .f_read = wrap_read_temp,
1135 .f_print = print_pwr_temp_stats,
1136 .f_print_avg = print_avg_pwr_temp_stats,
1139 .f_render = render_pwr_temp_stats,
1140 .f_xml_print = xml_print_pwr_temp_stats,
1141 .f_json_print = json_print_pwr_temp_stats,
1142 .f_svg_print = svg_print_pwr_temp_stats,
1143 .hdr_line = "TEMP;DEVICE;degC;%temp",
1144 .name = "A_PWR_TEMP",
1149 .nr_max = MAX_NR_TEMP_SENSORS,
1150 .fsize = STATS_PWR_TEMP_SIZE,
1151 .msize = STATS_PWR_TEMP_SIZE,
1153 .buf = {NULL, NULL, NULL},
1157 /* Voltage inputs */
1158 struct activity pwr_in_act = {
1161 .magic = ACTIVITY_MAGIC_BASE,
1164 .f_count_index = 7, /* wrap_get_in_nr() */
1166 .f_read = wrap_read_in,
1169 .f_print = print_pwr_in_stats,
1170 .f_print_avg = print_avg_pwr_in_stats,
1173 .f_render = render_pwr_in_stats,
1174 .f_xml_print = xml_print_pwr_in_stats,
1175 .f_json_print = json_print_pwr_in_stats,
1176 .hdr_line = "IN;DEVICE;inV;%in",
1182 .nr_max = MAX_NR_IN_SENSORS,
1183 .fsize = STATS_PWR_IN_SIZE,
1184 .msize = STATS_PWR_IN_SIZE,
1186 .buf = {NULL, NULL, NULL},
1190 /* Hugepages activity */
1191 struct activity huge_act = {
1193 .options = AO_COLLECTED,
1194 .magic = ACTIVITY_MAGIC_BASE,
1197 .f_count_index = -1,
1199 .f_read = wrap_read_meminfo_huge,
1202 .f_print = print_huge_stats,
1203 .f_print_avg = print_avg_huge_stats,
1206 .f_render = render_huge_stats,
1207 .f_xml_print = xml_print_huge_stats,
1208 .f_json_print = json_print_huge_stats,
1209 .f_svg_print = svg_print_huge_stats,
1210 .hdr_line = "kbhugfree;kbhugused;%hugused",
1217 .fsize = STATS_HUGE_SIZE,
1218 .msize = STATS_HUGE_SIZE,
1220 .buf = {NULL, NULL, NULL},
1224 /* CPU weighted frequency */
1225 struct activity pwr_wghfreq_act = {
1226 .id = A_PWR_WGHFREQ,
1227 .options = AO_VOLATILE,
1228 .magic = ACTIVITY_MAGIC_BASE,
1231 .f_count_index = 0, /* wrap_get_cpu_nr() */
1232 .f_count2 = wrap_get_freq_nr,
1233 .f_read = wrap_read_time_in_state,
1236 .f_print = print_pwr_wghfreq_stats,
1237 .f_print_avg = print_pwr_wghfreq_stats,
1240 .f_render = render_pwr_wghfreq_stats,
1241 .f_xml_print = xml_print_pwr_wghfreq_stats,
1242 .f_json_print = json_print_pwr_wghfreq_stats,
1243 .hdr_line = "CPU;wghMHz",
1244 .name = "A_PWR_WGHFREQ",
1249 .nr_max = NR_CPUS + 1,
1250 .fsize = STATS_PWR_WGHFREQ_SIZE,
1251 .msize = STATS_PWR_WGHFREQ_SIZE,
1253 .buf = {NULL, NULL, NULL},
1254 .bitmap = &cpu_bitmap
1257 /* USB devices plugged into the system */
1258 struct activity pwr_usb_act = {
1260 .options = AO_CLOSE_MARKUP,
1261 .magic = ACTIVITY_MAGIC_BASE,
1264 .f_count_index = 8, /* wrap_get_usb_nr() */
1266 .f_read = wrap_read_bus_usb_dev,
1269 .f_print = print_pwr_usb_stats,
1270 .f_print_avg = print_avg_pwr_usb_stats,
1273 .f_render = render_pwr_usb_stats,
1274 .f_xml_print = xml_print_pwr_usb_stats,
1275 .f_json_print = json_print_pwr_usb_stats,
1276 .hdr_line = "manufact;product;BUS;idvendor;idprod;maxpower",
1277 .name = "A_PWR_USB",
1282 .nr_max = MAX_NR_USB,
1283 .fsize = STATS_PWR_USB_SIZE,
1284 .msize = STATS_PWR_USB_SIZE,
1286 .buf = {NULL, NULL, NULL},
1290 /* Filesystem usage activity */
1291 struct activity filesystem_act = {
1294 .magic = ACTIVITY_MAGIC_BASE,
1297 .f_count_index = 9, /* wrap_get_filesystem_nr() */
1299 .f_read = wrap_read_filesystem,
1302 .f_print = print_filesystem_stats,
1303 .f_print_avg = print_avg_filesystem_stats,
1306 .f_render = render_filesystem_stats,
1307 .f_xml_print = xml_print_filesystem_stats,
1308 .f_json_print = json_print_filesystem_stats,
1309 .hdr_line = "FILESYSTEM;MBfsfree;MBfsused;%fsused;%ufsused;Ifree;Iused;%Iused",
1310 .name = "A_FILESYSTEM",
1315 .nr_max = MAX_NR_FS,
1316 .fsize = STATS_FILESYSTEM_SIZE,
1317 .msize = STATS_FILESYSTEM_SIZE,
1319 .buf = {NULL, NULL, NULL},
1323 /* Fibre Channel HBA usage activity */
1324 struct activity fchost_act = {
1326 .options = AO_CLOSE_MARKUP,
1327 .magic = ACTIVITY_MAGIC_BASE,
1330 .f_count_index = 10, /* wrap_get_fchost_nr() */
1332 .f_read = wrap_read_fchost,
1335 .f_print = print_fchost_stats,
1336 .f_print_avg = print_fchost_stats,
1339 .f_render = render_fchost_stats,
1340 .f_xml_print = xml_print_fchost_stats,
1341 .f_json_print = json_print_fchost_stats,
1342 .hdr_line = "FCHOST;fch_rxf/s;fch_txf/s;fch_rxw/s;fch_txw/s",
1348 .nr_max = MAX_NR_FCHOSTS,
1349 .fsize = STATS_FCHOST_SIZE,
1350 .msize = STATS_FCHOST_SIZE,
1352 .buf = {NULL, NULL, NULL},
1358 * Array of functions used to count number of items.
1360 __nr_t (*f_count[NR_F_COUNT]) (struct activity *) = {
1370 wrap_get_filesystem_nr,
1376 * Array of activities.
1377 * (Order of activities doesn't matter for daily data files).
1379 struct activity *act[NR_ACT] = {
1411 &fchost_act, /* AO_CLOSE_MARKUP */
1413 /* <power-management> */
1419 &pwr_usb_act, /* AO_CLOSE_MARKUP */
1420 /* </power-management> */