* whole period.
* @id Current activity id.
* @xid Current activity extra id number.
+ *
+ * RETURNS:
+ * TRUE if at least one graph has been displayed.
***************************************************************************
*/
-void draw_activity_graphs(int g_nr, int g_type[], char *title[], char *g_title[], char *item_name,
- int group[], double *spmin, double *spmax, char **out, int *outsize,
- struct svg_parm *svg_p, struct record_header *record_hdr, int skip_void,
- unsigned int id, unsigned int xid)
+int draw_activity_graphs(int g_nr, int g_type[], char *title[], char *g_title[], char *item_name,
+ int group[], double *spmin, double *spmax, char **out, int *outsize,
+ struct svg_parm *svg_p, struct record_header *record_hdr, int skip_void,
+ unsigned int id, unsigned int xid)
{
char *out_p;
int i, j, dp, pos = 0, views_nr = 0, displayed = FALSE;
/* For next row of views */
(svg_p->graph_no) += PACK_VIEWS(flags) ? 1 : views_nr;
+
+ return displayed;
}
/*
}
if (action & F_END) {
+ int xid = 0, displayed;
+
if (DISPLAY_IDLE(flags)) {
/* Include additional %idle field */
group1[0]++;
}
if (DISPLAY_CPU_DEF(a->opt_flags)) {
- draw_activity_graphs(a->g_nr, g_type,
- title, g_title1, item_name, group1,
- spmin + pos, spmax + pos, out + pos, outsize + pos,
- svg_p, record_hdr, i, a->id, i);
+ displayed = draw_activity_graphs(a->g_nr, g_type,
+ title, g_title1, item_name, group1,
+ spmin + pos, spmax + pos, out + pos, outsize + pos,
+ svg_p, record_hdr, i, a->id, xid);
}
else {
- draw_activity_graphs(a->g_nr, g_type,
- title, g_title2, item_name, group2,
- spmin + pos, spmax + pos, out + pos, outsize + pos,
- svg_p, record_hdr, i, a->id, i);
+ displayed = draw_activity_graphs(a->g_nr, g_type,
+ title, g_title2, item_name, group2,
+ spmin + pos, spmax + pos, out + pos, outsize + pos,
+ svg_p, record_hdr, i, a->id, xid);
+ }
+ if (displayed) {
+ xid++;
}
}
}
if (action & F_END) {
+ int xid = 0;
+
for (i = 0; i < svg_p->nr_max; i++) {
/* Check if there is something to display */
pos = i * 9;
/* Get device name */
item_name = get_sa_devname(*(spmax + pos + 8), *(spmin + pos + 8), flags);
- draw_activity_graphs(a->g_nr, g_type,
- title, g_title, item_name, group,
- spmin + pos, spmax + pos, out + pos, outsize + pos,
- svg_p, record_hdr, FALSE, a->id, i);
+ if (draw_activity_graphs(a->g_nr, g_type,
+ title, g_title, item_name, group,
+ spmin + pos, spmax + pos, out + pos, outsize + pos,
+ svg_p, record_hdr, FALSE, a->id, xid)) {
+ xid++;
+ }
}
/* Free remaining structures */
}
if (action & F_END) {
+ int xid = 0;
+
for (i = 0; i < svg_p->nr_max; i++) {
/*
* Check if there is something to display.
*(spmax + pos + 3) /= 1024;
item_name = *(out + pos + 8);
- draw_activity_graphs(a->g_nr, g_type,
- title, g_title, item_name, group,
- spmin + pos, spmax + pos, out + pos, outsize + pos,
- svg_p, record_hdr, FALSE, a->id, i);
+ if (draw_activity_graphs(a->g_nr, g_type,
+ title, g_title, item_name, group,
+ spmin + pos, spmax + pos, out + pos, outsize + pos,
+ svg_p, record_hdr, FALSE, a->id, xid)) {
+ xid++;
+ }
}
/* Free remaining structures */
}
if (action & F_END) {
+ int xid = 0;
+
for (i = 0; i < svg_p->nr_max; i++) {
/*
* Check if there is something to display.
continue;
item_name = *(out + pos + 9);
- draw_activity_graphs(a->g_nr, g_type,
- title, g_title, item_name, group,
- spmin + pos, spmax + pos, out + pos, outsize + pos,
- svg_p, record_hdr, FALSE, a->id, i);
+ if (draw_activity_graphs(a->g_nr, g_type,
+ title, g_title, item_name, group,
+ spmin + pos, spmax + pos, out + pos, outsize + pos,
+ svg_p, record_hdr, FALSE, a->id, xid)) {
+ xid++;
+ }
}
/* Free remaining structures */
}
if (action & F_END) {
+ int xid = 0;
+
for (i = 0; (i < svg_p->nr_max) && (i < a->bitmap->b_size + 1); i++) {
/* Should current CPU (including CPU "all") be displayed? */
sprintf(item_name, "%d", i - 1);
}
- draw_activity_graphs(a->g_nr, g_type,
- title, g_title, item_name, group,
- spmin + i, spmax + i, out + i, outsize + i,
- svg_p, record_hdr, i, a->id, i);
+ if (draw_activity_graphs(a->g_nr, g_type,
+ title, g_title, item_name, group,
+ spmin + i, spmax + i, out + i, outsize + i,
+ svg_p, record_hdr, i, a->id, xid)) {
+ xid++;
+ }
}
/* Free remaining structures */
}
if (action & F_END) {
+ int xid = 0;
+
for (i = 0; i < svg_p->nr_max; i++) {
spc = (struct stats_pwr_fan *) ((char *) a->buf[curr] + i * a->msize);
snprintf(item_name, MAX_SENSORS_DEV_LEN + 8, "%d: %s", i + 1, spc->device);
item_name[MAX_SENSORS_DEV_LEN + 7] = '\0';
- draw_activity_graphs(a->g_nr, g_type,
- title, g_title, item_name, group,
- spmin + i, spmax + i, out + i, outsize + i,
- svg_p, record_hdr, FALSE, a->id, i);
+ if (draw_activity_graphs(a->g_nr, g_type,
+ title, g_title, item_name, group,
+ spmin + i, spmax + i, out + i, outsize + i,
+ svg_p, record_hdr, FALSE, a->id, xid)) {
+ xid++;
+ }
}
/* Free remaining structures */
}
if (action & F_END) {
+ int xid = 0;
+
for (i = 0; i < svg_p->nr_max; i++) {
spc = (struct stats_pwr_temp *) ((char *) a->buf[curr] + i * a->msize);
snprintf(item_name, MAX_SENSORS_DEV_LEN + 8, "%d: %s", i + 1, spc->device);
item_name[MAX_SENSORS_DEV_LEN + 7] = '\0';
- draw_activity_graphs(a->g_nr, g_type,
- title, g_title, item_name, group,
- spmin + 2 * i, spmax + 2 * i, out + 2 * i, outsize + 2 * i,
- svg_p, record_hdr, FALSE, a->id, i);
+ if (draw_activity_graphs(a->g_nr, g_type,
+ title, g_title, item_name, group,
+ spmin + 2 * i, spmax + 2 * i, out + 2 * i, outsize + 2 * i,
+ svg_p, record_hdr, FALSE, a->id, xid)) {
+ xid++;
+ }
}
/* Free remaining structures */
}
if (action & F_END) {
+ int xid = 0;
+
for (i = 0; i < svg_p->nr_max; i++) {
spc = (struct stats_pwr_in *) ((char *) a->buf[curr] + i * a->msize);
snprintf(item_name, MAX_SENSORS_DEV_LEN + 8, "%d: %s", i + 1, spc->device);
item_name[MAX_SENSORS_DEV_LEN + 7] = '\0';
- draw_activity_graphs(a->g_nr, g_type,
- title, g_title, item_name, group,
- spmin + 2 * i, spmax + 2 * i, out + 2 * i, outsize + 2 * i,
- svg_p, record_hdr, FALSE, a->id, i);
+ if (draw_activity_graphs(a->g_nr, g_type,
+ title, g_title, item_name, group,
+ spmin + 2 * i, spmax + 2 * i, out + 2 * i, outsize + 2 * i,
+ svg_p, record_hdr, FALSE, a->id, xid)) {
+ xid++;
+ }
}
/* Free remaining structures */
}
if (action & F_END) {
+ int xid = 0;
for (i = 0; i < svg_p->nr_max; i++) {
item_name = *(out + pos + 7);
}
- draw_activity_graphs(a->g_nr, g_type, title, g_title, item_name, group,
- spmin + pos, spmax + pos, out + pos, outsize + pos,
- svg_p, record_hdr, FALSE, a->id, i);
+ if (draw_activity_graphs(a->g_nr, g_type, title, g_title, item_name, group,
+ spmin + pos, spmax + pos, out + pos, outsize + pos,
+ svg_p, record_hdr, FALSE, a->id, xid)) {
+ xid++;
+ }
}
/* Free remaining structures */