/*
- * svg_stats.c: Funtions used by sadf to display statistics in SVG format.
- * (C) 2016-2020 by Sebastien GODARD (sysstat <at> orange.fr)
+ * svg_stats.c: Functions used by sadf to display statistics in SVG format.
+ * (C) 2016-2021 by Sebastien GODARD (sysstat <at> orange.fr)
*
***************************************************************************
* This program is free software; you can redistribute it and/or modify it *
#define _(string) (string)
#endif
-extern unsigned int flags;
+extern uint64_t flags;
extern int palette;
unsigned int svg_colors[SVG_COL_PALETTE_NR][SVG_COL_PALETTE_SIZE] =
* the fields in the statistics structure.
*
* OUT:
- * @spmin Array containg the possible new min values for current activity.
- * @spmax Array containg the possible new max values for current activity.
+ * @spmin Array containing the possible new min values for current activity.
+ * @spmax Array containing the possible new max values for current activity.
***************************************************************************
*/
void save_extrema(unsigned int types_nr[], void *cs, void *ps, unsigned long long itv,
for (j = 0; (j <= (2 * v_gridnr)) && (stamp.ust_time <= svg_p->ust_time_end); j++) {
/* Display vertical lines */
- sa_get_record_timestamp_struct(flags, &stamp, &rectime);
+ if (sa_get_record_timestamp_struct(flags, &stamp, &rectime)) {
+#ifdef DEBUG
+ fprintf(stderr, "%s: ust_time: %llu\n", __FUNCTION__, stamp.ust_time);
+#endif
+ exit(1);
+ }
set_record_timestamp_string(flags, &stamp, NULL, cur_time, TIMESTAMP_LEN, &rectime);
printf("<polyline points=\"%ld,0 %ld,%d\" style=\"vector-effect: non-scaling-stroke; "
"stroke: #%06x\" transform=\"scale(%f,1)\"/>\n",
if (action & F_MAIN) {
memset(&sdpzero, 0, STATS_DISK_SIZE);
- restart = svg_p->restart;
/*
* Mark previously registered devices as now
* possibly unregistered for all graphs.
/* For each device structure */
for (i = 0; i < a->nr[curr]; i++) {
sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize);
+ restart = svg_p->restart;
/* Get device name */
dev_name = get_device_name(sdc->major, sdc->minor, sdc->wwn, sdc->part_nr,
if (j < 0) {
/* This is a newly registered interface. Previous stats are zero */
sdp = &sdpzero;
+ restart = TRUE;
}
else {
sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
if (action & F_MAIN) {
memset(&sndzero, 0, STATS_NET_DEV_SIZE);
- restart = svg_p->restart;
/*
* Mark previously registered interfaces as now
* possibly unregistered for all graphs.
/* For each network interfaces structure */
for (i = 0; i < a->nr[curr]; i++) {
sndc = (struct stats_net_dev *) ((char *) a->buf[curr] + i * a->msize);
+ restart = svg_p->restart;
if (a->item_list != NULL) {
/* A list of devices has been entered on the command line */
if (j < 0) {
/* This is a newly registered interface. Previous stats are zero */
sndp = &sndzero;
+ restart = TRUE;
}
else {
sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize);
if (action & F_MAIN) {
memset(&snedzero, 0, STATS_NET_EDEV_SIZE);
- restart = svg_p->restart;
/*
* Mark previously registered interfaces as now
* possibly unregistered for all graphs.
/* For each network interfaces structure */
for (i = 0; i < a->nr[curr]; i++) {
snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize);
- if (!strcmp(snedc->interface, ""))
- /* Empty structure: This is the end of the list */
- break;
+ restart = svg_p->restart;
if (a->item_list != NULL) {
/* A list of devices has been entered on the command line */
if (j < 0) {
/* This is a newly registered interface. Previous stats are zero */
snedp = &snedzero;
+ restart = TRUE;
}
else {
snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize);
if (action & F_MAIN) {
memset(&sfczero, 0, sizeof(struct stats_fchost));
- restart = svg_p->restart;
/*
* Mark previously registered interfaces as now
* possibly unregistered for all graphs.
found = FALSE;
sfcc = (struct stats_fchost *) ((char *) a->buf[curr] + i * a->msize);
+ restart = svg_p->restart;
/* Look for corresponding graph */
for (k = 0; k < a->item_list_sz; k++) {
if (!found) {
/* This is a newly registered host */
sfcp = &sfczero;
+ restart = TRUE;
}
/*