.f_json_print = json_print_cpu_stats,
.f_svg_print = svg_print_cpu_stats,
.f_raw_print = raw_print_cpu_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "CPU utilization",
#endif
.name = "A_CPU",
.f_json_print = json_print_pcsw_stats,
.f_svg_print = svg_print_pcsw_stats,
.f_raw_print = raw_print_pcsw_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "Task creation and switching activity",
#endif
.name = "A_PCSW",
.f_json_print = json_print_irq_stats,
.f_svg_print = NULL,
.f_raw_print = raw_print_irq_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "Interrupts statistics",
#endif
.name = "A_IRQ",
.f_json_print = json_print_swap_stats,
.f_svg_print = svg_print_swap_stats,
.f_raw_print = raw_print_swap_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "Swap activity",
#endif
.name = "A_SWAP",
.f_json_print = json_print_paging_stats,
.f_svg_print = svg_print_paging_stats,
.f_raw_print = raw_print_paging_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "Paging activity",
#endif
.name = "A_PAGE",
.f_json_print = json_print_io_stats,
.f_svg_print = svg_print_io_stats,
.f_raw_print = raw_print_io_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "I/O and transfer rate statistics",
#endif
.name = "A_IO",
.f_json_print = json_print_memory_stats,
.f_svg_print = svg_print_memory_stats,
.f_raw_print = raw_print_memory_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "Memory and/or swap utilization",
#endif
.name = "A_MEMORY",
.f_json_print = json_print_ktables_stats,
.f_svg_print = svg_print_ktables_stats,
.f_raw_print = raw_print_ktables_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "Kernel tables statistics",
#endif
.name = "A_KTABLES",
.f_json_print = json_print_queue_stats,
.f_svg_print = svg_print_queue_stats,
.f_raw_print = raw_print_queue_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "Queue length and load average statistics",
#endif
.name = "A_QUEUE",
.f_json_print = json_print_serial_stats,
.f_svg_print = NULL,
.f_raw_print = raw_print_serial_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "TTY devices statistics",
#endif
.name = "A_SERIAL",
.f_json_print = json_print_disk_stats,
.f_svg_print = svg_print_disk_stats,
.f_raw_print = raw_print_disk_stats,
+ .f_count_new = count_new_disk,
+ .item_list = NULL,
.desc = "Block devices statistics",
#endif
.name = "A_DISK",
.f_json_print = json_print_net_dev_stats,
.f_svg_print = svg_print_net_dev_stats,
.f_raw_print = raw_print_net_dev_stats,
+ .f_count_new = count_new_net_dev,
+ .item_list = NULL,
.desc = "Network interfaces statistics",
#endif
.name = "A_NET_DEV",
.f_json_print = json_print_net_edev_stats,
.f_svg_print = svg_print_net_edev_stats,
.f_raw_print = raw_print_net_edev_stats,
+ .f_count_new = count_new_net_edev,
+ .item_list = NULL,
.desc = "Network interfaces errors statistics",
#endif
.name = "A_NET_EDEV",
.f_json_print = json_print_net_nfs_stats,
.f_svg_print = svg_print_net_nfs_stats,
.f_raw_print = raw_print_net_nfs_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "NFS client statistics",
#endif
.name = "A_NET_NFS",
.f_json_print = json_print_net_nfsd_stats,
.f_svg_print = svg_print_net_nfsd_stats,
.f_raw_print = raw_print_net_nfsd_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "NFS server statistics",
#endif
.name = "A_NET_NFSD",
.f_json_print = json_print_net_sock_stats,
.f_svg_print = svg_print_net_sock_stats,
.f_raw_print = raw_print_net_sock_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "IPv4 sockets statistics",
#endif
.name = "A_NET_SOCK",
.f_json_print = json_print_net_ip_stats,
.f_svg_print = svg_print_net_ip_stats,
.f_raw_print = raw_print_net_ip_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "IPv4 traffic statistics",
#endif
.name = "A_NET_IP",
.f_json_print = json_print_net_eip_stats,
.f_svg_print = svg_print_net_eip_stats,
.f_raw_print = raw_print_net_eip_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "IPv4 traffic errors statistics",
#endif
.name = "A_NET_EIP",
.f_json_print = json_print_net_icmp_stats,
.f_svg_print = svg_print_net_icmp_stats,
.f_raw_print = raw_print_net_icmp_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "ICMPv4 traffic statistics",
#endif
.name = "A_NET_ICMP",
.f_json_print = json_print_net_eicmp_stats,
.f_svg_print = svg_print_net_eicmp_stats,
.f_raw_print = raw_print_net_eicmp_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "ICMPv4 traffic errors statistics",
#endif
.name = "A_NET_EICMP",
.f_json_print = json_print_net_tcp_stats,
.f_svg_print = svg_print_net_tcp_stats,
.f_raw_print = raw_print_net_tcp_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "TCPv4 traffic statistics",
#endif
.name = "A_NET_TCP",
.f_json_print = json_print_net_etcp_stats,
.f_svg_print = svg_print_net_etcp_stats,
.f_raw_print = raw_print_net_etcp_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "TCPv4 traffic errors statistics",
#endif
.name = "A_NET_ETCP",
.f_json_print = json_print_net_udp_stats,
.f_svg_print = svg_print_net_udp_stats,
.f_raw_print = raw_print_net_udp_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "UDPv4 traffic statistics",
#endif
.name = "A_NET_UDP",
.f_json_print = json_print_net_sock6_stats,
.f_svg_print = svg_print_net_sock6_stats,
.f_raw_print = raw_print_net_sock6_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "IPv6 sockets statistics",
#endif
.name = "A_NET_SOCK6",
.f_json_print = json_print_net_ip6_stats,
.f_svg_print = svg_print_net_ip6_stats,
.f_raw_print = raw_print_net_ip6_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "IPv6 traffic statistics",
#endif
.name = "A_NET_IP6",
.f_json_print = json_print_net_eip6_stats,
.f_svg_print = svg_print_net_eip6_stats,
.f_raw_print = raw_print_net_eip6_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "IPv6 traffic errors statistics",
#endif
.name = "A_NET_EIP6",
.f_json_print = json_print_net_icmp6_stats,
.f_svg_print = svg_print_net_icmp6_stats,
.f_raw_print = raw_print_net_icmp6_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "ICMPv6 traffic statistics",
#endif
.name = "A_NET_ICMP6",
.f_json_print = json_print_net_eicmp6_stats,
.f_svg_print = svg_print_net_eicmp6_stats,
.f_raw_print = raw_print_net_eicmp6_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "ICMPv6 traffic errors statistics",
#endif
.name = "A_NET_EICMP6",
.f_json_print = json_print_net_udp6_stats,
.f_svg_print = svg_print_net_udp6_stats,
.f_raw_print = raw_print_net_udp6_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "UDPv6 traffic statistics",
#endif
.name = "A_NET_UDP6",
.f_json_print = json_print_pwr_cpufreq_stats,
.f_svg_print = svg_print_pwr_cpufreq_stats,
.f_raw_print = raw_print_pwr_cpufreq_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "CPU clock frequency",
#endif
.name = "A_PWR_CPU",
.f_json_print = json_print_pwr_fan_stats,
.f_svg_print = svg_print_pwr_fan_stats,
.f_raw_print = raw_print_pwr_fan_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "Fans speed",
#endif
.name = "A_PWR_FAN",
.f_json_print = json_print_pwr_temp_stats,
.f_svg_print = svg_print_pwr_temp_stats,
.f_raw_print = raw_print_pwr_temp_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "Devices temperature",
#endif
.name = "A_PWR_TEMP",
.f_json_print = json_print_pwr_in_stats,
.f_svg_print = svg_print_pwr_in_stats,
.f_raw_print = raw_print_pwr_in_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "Voltage inputs statistics",
#endif
.name = "A_PWR_IN",
.f_json_print = json_print_huge_stats,
.f_svg_print = svg_print_huge_stats,
.f_raw_print = raw_print_huge_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "Huge pages utilization",
#endif
.name = "A_HUGE",
.f_json_print = json_print_pwr_wghfreq_stats,
.f_svg_print = NULL,
.f_raw_print = raw_print_pwr_wghfreq_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "CPU weighted frequency",
#endif
.name = "A_PWR_FREQ",
.f_json_print = json_print_pwr_usb_stats,
.f_svg_print = NULL,
.f_raw_print = raw_print_pwr_usb_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "USB devices",
#endif
.name = "A_PWR_USB",
.f_json_print = json_print_filesystem_stats,
.f_svg_print = svg_print_filesystem_stats,
.f_raw_print = raw_print_filesystem_stats,
+ .f_count_new = count_new_filesystem,
+ .item_list = NULL,
.desc = "Filesystems statistics",
#endif
.name = "A_FS",
.f_json_print = json_print_fchost_stats,
.f_svg_print = svg_print_fchost_stats,
.f_raw_print = raw_print_fchost_stats,
+ .f_count_new = count_new_fchost,
+ .item_list = NULL,
.desc = "Fibre Channel HBA statistics",
#endif
.name = "A_NET_FC",
.f_json_print = json_print_softnet_stats,
.f_svg_print = svg_print_softnet_stats,
.f_raw_print = raw_print_softnet_stats,
+ .f_count_new = NULL,
+ .item_list = NULL,
.desc = "Software-based network processing statistics",
#endif
.name = "A_NET_SOFT",
printf("</svg>\n");
}
}
+
+/*
+ ***************************************************************************
+ * Count the number of new network interfaces in current sample. If a new
+ * interface is found then add it to the linked list starting at
+ * @a->item_list.
+ *
+ * IN:
+ * @a Activity structure with statistics.
+ * @curr Index in array for current sample statistics.
+ *
+ * RETURNS:
+ * Number of new interfaces identified in current sample that were not
+ * previously in the list.
+ ***************************************************************************
+ */
+__nr_t count_new_net_dev(struct activity *a, int curr)
+{
+ int i, nr = 0;
+ void **p;
+ struct interface_lst *e;
+ struct stats_net_dev *sndc;
+
+ for (i = 0; i < a->nr[curr]; i++) {
+ sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize);
+ p = &(a->item_list);
+
+ while (*p != NULL) {
+ e = *p;
+ if (!strcmp(e->name, sndc->interface))
+ break; /* Item found */
+ p = &(e->next);
+ }
+ if (*p == NULL) {
+ /*
+ * Item not found: Increment total number
+ * of new items found and add it to the list.
+ */
+ nr++;
+ SREALLOC(*p, struct interface_lst, sizeof(struct interface_lst));
+ e = *p;
+ strcpy(e->name, sndc->interface);
+ }
+ }
+
+ return nr;
+}
+
+/*
+ ***************************************************************************
+ * Count the number of new network interfaces in current sample. If a new
+ * interface is found then add it to the linked list starting at
+ * @a->item_list.
+ *
+ * IN:
+ * @a Activity structure with statistics.
+ * @curr Index in array for current sample statistics.
+ *
+ * RETURNS:
+ * Number of new interfaces identified in current sample that were not
+ * previously in the list.
+ ***************************************************************************
+ */
+__nr_t count_new_net_edev(struct activity *a, int curr)
+{
+ int i, nr = 0;
+ void **p;
+ struct interface_lst *e;
+ struct stats_net_edev *snedc;
+
+ for (i = 0; i < a->nr[curr]; i++) {
+ snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize);
+ p = &(a->item_list);
+
+ while (*p != NULL) {
+ e = *p;
+ if (!strcmp(e->name, snedc->interface))
+ break; /* Item found */
+ p = &(e->next);
+ }
+ if (*p == NULL) {
+ /*
+ * Item not found: Increment total number
+ * of new items found and add it to the list.
+ */
+ nr++;
+ SREALLOC(*p, struct interface_lst, sizeof(struct interface_lst));
+ e = *p;
+ strcpy(e->name, snedc->interface);
+ }
+ }
+
+ return nr;
+}
+
+/*
+ ***************************************************************************
+ * Count the number of new filesystems in current sample. If a new
+ * filesystem is found then add it to the linked list starting at
+ * @a->item_list.
+ *
+ * IN:
+ * @a Activity structure with statistics.
+ * @curr Index in array for current sample statistics.
+ *
+ * RETURNS:
+ * Number of new filesystems identified in current sample that were not
+ * previously in the list.
+ ***************************************************************************
+ */
+__nr_t count_new_filesystem(struct activity *a, int curr)
+{
+ int i, nr = 0;
+ void **p;
+ struct filesystem_lst *e;
+ struct stats_filesystem *sfc;
+
+ for (i = 0; i < a->nr[curr]; i++) {
+ sfc = (struct stats_filesystem *) ((char *) a->buf[curr] + i * a->msize);
+ p = &(a->item_list);
+
+ while (*p != NULL) {
+ e = *p;
+ if (!strcmp(e->name, sfc->fs_name))
+ break; /* Item found */
+ p = &(e->next);
+ }
+ if (*p == NULL) {
+ /*
+ * Item not found: Increment total number
+ * of new items found and add it to the list.
+ */
+ nr++;
+ SREALLOC(*p, struct filesystem_lst, sizeof(struct filesystem_lst));
+ e = *p;
+ strcpy(e->name, sfc->fs_name);
+ }
+ }
+
+ return nr;
+}
+
+/*
+ ***************************************************************************
+ * Count the number of new fchosts in current sample. If a new
+ * fchost is found then add it to the linked list starting at
+ * @a->item_list.
+ *
+ * IN:
+ * @a Activity structure with statistics.
+ * @curr Index in array for current sample statistics.
+ *
+ * RETURNS:
+ * Number of new fchosts identified in current sample that were not
+ * previously in the list.
+ ***************************************************************************
+ */
+__nr_t count_new_fchost(struct activity *a, int curr)
+{
+ int i, nr = 0;
+ void **p;
+ struct fchost_lst *e;
+ struct stats_fchost *sfcc;
+
+ for (i = 0; i < a->nr[curr]; i++) {
+ sfcc = (struct stats_fchost *) ((char *) a->buf[curr] + i * a->msize);
+ p = &(a->item_list);
+
+ while (*p != NULL) {
+ e = *p;
+ if (!strcmp(e->name, sfcc->fchost_name))
+ break; /* Item found */
+ p = &(e->next);
+ }
+ if (*p == NULL) {
+ /*
+ * Item not found: Increment total number
+ * of new items found and add it to the list.
+ */
+ nr++;
+ SREALLOC(*p, struct fchost_lst, sizeof(struct fchost_lst));
+ e = *p;
+ strcpy(e->name, sfcc->fchost_name);
+ }
+ }
+
+ return nr;
+}
+
+/*
+ ***************************************************************************
+ * Count the number of new block devices in current sample. If a new
+ * block device is found then add it to the linked list starting at
+ * @a->item_list.
+ *
+ * IN:
+ * @a Activity structure with statistics.
+ * @curr Index in array for current sample statistics.
+ *
+ * RETURNS:
+ * Number of new block devices identified in current sample that were not
+ * previously in the list.
+ ***************************************************************************
+ */
+__nr_t count_new_disk(struct activity *a, int curr)
+{
+ int i, nr = 0;
+ void **p;
+ struct disk_lst *e;
+ struct stats_disk *sdc;
+
+ for (i = 0; i < a->nr[curr]; i++) {
+ sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize);
+ p = &(a->item_list);
+
+ while (*p != NULL) {
+ e = *p;
+ if ((e->major == sdc->major) && (e->minor == sdc->minor))
+ break; /* Item found */
+ p = &(e->next);
+ }
+ if (*p == NULL) {
+ /*
+ * Item not found: Increment total number
+ * of new items found and add it to the list.
+ */
+ nr++;
+ SREALLOC(*p, struct disk_lst, sizeof(struct disk_lst));
+ e = *p;
+ e->major = sdc->major;
+ e->minor = sdc->minor;
+ }
+ }
+
+ return nr;
+}