#define S_F_UNIT 0x00100000
#define S_F_SVG_HEIGHT 0x00200000
#define S_F_SVG_PACKED 0x00400000
+#define S_F_SVG_SHOW_INFO 0x00800000
#define WANT_SINCE_BOOT(m) (((m) & S_F_SINCE_BOOT) == S_F_SINCE_BOOT)
#define WANT_SA_ROTAT(m) (((m) & S_F_SA_ROTAT) == S_F_SA_ROTAT)
#define AUTOSCALE_ON(m) (((m) & S_F_SVG_AUTOSCALE) == S_F_SVG_AUTOSCALE)
#define DISPLAY_ONE_DAY(m) (((m) & S_F_SVG_ONE_DAY) == S_F_SVG_ONE_DAY)
#define DISPLAY_IDLE(m) (((m) & S_F_SVG_SHOW_IDLE) == S_F_SVG_SHOW_IDLE)
+#define DISPLAY_INFO(m) (((m) & S_F_SVG_SHOW_INFO) == S_F_SVG_SHOW_INFO)
#define DISPLAY_UNIT(m) (((m) & S_F_UNIT) == S_F_UNIT)
#define SET_CANVAS_HEIGHT(m) (((m) & S_F_SVG_HEIGHT) == S_F_SVG_HEIGHT)
#define PACK_VIEWS(m) (((m) & S_F_SVG_PACKED) == S_F_SVG_PACKED)
#define K_AUTOSCALE "autoscale"
#define K_ONEDAY "oneday"
#define K_SHOWIDLE "showidle"
+#define K_SHOWINFO "showinfo"
#define K_SHOWHINTS "showhints"
#define K_HEIGHT "height="
#define K_PACKED "packed"
unsigned long ust_time_first; /* Time (in seconds since the epoch) for first sample */
int graph_no; /* Total number of views already displayed */
int restart; /* TRUE if we have just met a RESTART record */
+ struct file_header *file_hdr; /* Pointer on file header structure */
};
/* Structure used when displaying SVG header */
parm.ust_time_ref = get_time_ref();
parm.ust_time_first = record_hdr[2].ust_time;
parm.restart = TRUE;
+ parm.file_hdr = &file_hdr;
*cnt = count;
reset_cd = 1;
else if (!strcmp(t, K_SHOWIDLE)) {
flags |= S_F_SVG_SHOW_IDLE;
}
+ else if (!strcmp(t, K_SHOWINFO)) {
+ flags |= S_F_SVG_SHOW_INFO;
+ }
else if (!strcmp(t, K_SHOWHINTS)) {
flags |= S_F_RAW_SHOW_HINTS;
}
unsigned int asfactor[16];
long int xpos;
double lmax, xfactor, yfactor, ypos, gmin, gmax;
- char val[32];
+ char val[32], cur_date[TIMESTAMP_LEN];
/* Translate to proper position for current activity */
printf("<g id=\"g%d\" transform=\"translate(0,%d)\">\n",
!dp * 2, *(spmax + pos + j) * asfactor[j]);
}
+ if (DISPLAY_INFO(flags)) {
+ /* Display additional info (hostname, date) */
+ printf("<text x=\"%d\" y=\"%d\" "
+ "style=\"fill: yellow; text-anchor: end; stroke: none; font-size: 14px\">"
+ "%s\n",
+ xv + SVG_V_XSIZE - 5, yv + SVG_M_YSIZE + SVG_G_YSIZE,
+ svg_p->file_hdr->sa_nodename);
+
+ /* Get report date */
+ set_report_date(localtime((const time_t *) &(svg_p->file_hdr->sa_ust_time)),
+ cur_date, sizeof(cur_date));
+ printf("<tspan x=\"%d\" y=\"%d\" "
+ "style=\"fill: yellow; text-anchor: end; stroke: none; font-size: 14px\">"
+ "%s</tspan>\n</text>\n",
+ xv + SVG_V_XSIZE - 5, yv + SVG_M_YSIZE + SVG_G_YSIZE + 14,
+ cur_date);
+ }
+
/* Translate to proper position for current graph within current activity */
printf("<g transform=\"translate(%d,%d)\">\n",
xv + SVG_M_XSIZE, yv + SVG_M_YSIZE + SVG_G_YSIZE);