/* Structure for SVG specific parameters */
struct svg_parm {
- unsigned long dt; /* Interval of time for current sample */
- unsigned long ust_time_ref; /* X axis start time in seconds since the epoch */
- unsigned long ust_time_end; /* X axis end time in seconds since the epoch */
- 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 */
+ unsigned long long dt; /* Interval of time for current sample */
+ unsigned long long ust_time_ref; /* X axis start time in seconds since the epoch */
+ unsigned long long ust_time_end; /* X axis end time in seconds since the epoch */
+ unsigned long 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 */
/*
* Timestamp in seconds since the epoch.
*/
- unsigned long sa_ust_time __attribute__ ((aligned (8)));
+ unsigned long long sa_ust_time;
/*
* Number of CPU items (1 .. CPU_NR + 1) for the last sample in file.
*/
- unsigned int sa_last_cpu_nr __attribute__ ((aligned (8)));
+ unsigned int sa_last_cpu_nr;
/*
* Number of activities saved in file.
*/
* No need to save DST (Daylight Saving Time) flag, since it is not taken
* into account by the strftime() function used to print the timestamp.
*/
+ int sa_year;
unsigned char sa_day;
unsigned char sa_month;
- unsigned char sa_year;
/*
* Size of a long integer. Useful to know the architecture on which
* the datafile was created.
};
#define FILE_HEADER_SIZE (sizeof(struct file_header))
-#define FILE_HEADER_ULL_NR 0 /* Nr of unsigned long long in file_header structure */
-#define FILE_HEADER_UL_NR 1 /* Nr of unsigned long in file_header structure */
-#define FILE_HEADER_U_NR 3 /* Nr of unsigned int in file_header structure */
+#define FILE_HEADER_ULL_NR 1 /* Nr of unsigned long long in file_header structure */
+#define FILE_HEADER_UL_NR 0 /* Nr of unsigned long in file_header structure */
+#define FILE_HEADER_U_NR 4 /* Nr of [unsigned] int in file_header structure */
/* The values below are used for sanity check */
#define MIN_FILE_HEADER_SIZE 0
#define MAX_FILE_HEADER_SIZE 8192
/*
* Timestamp (number of seconds since the epoch).
*/
- unsigned long ust_time __attribute__ ((aligned (8)));
+ unsigned long long ust_time;
/*
* Record type: R_STATS, R_RESTART,...
*/
- unsigned char record_type __attribute__ ((aligned (8)));
+ unsigned char record_type;
/*
* Timestamp: Hour (0-23), minute (0-59) and second (0-59).
* Used to determine TRUE time (immutable, non locale dependent time).
};
#define RECORD_HEADER_SIZE (sizeof(struct record_header))
-#define RECORD_HEADER_ULL_NR 2 /* Nr of unsigned long long in record_header structure */
-#define RECORD_HEADER_UL_NR 1 /* Nr of unsigned long in record_header structure */
+#define RECORD_HEADER_ULL_NR 3 /* Nr of unsigned long long in record_header structure */
+#define RECORD_HEADER_UL_NR 0 /* Nr of unsigned long in record_header structure */
#define RECORD_HEADER_U_NR 0 /* Nr of unsigned int in record_header structure */
memset(&file_hdr, 0, FILE_HEADER_SIZE);
/* Then get current date */
- file_hdr.sa_ust_time = get_time(&rectime, 0);
+ file_hdr.sa_ust_time = (unsigned long long) get_time(&rectime, 0);
/* OK, now fill the header */
file_hdr.sa_act_nr = get_activity_nr(act, AO_COLLECTED, COUNT_ACTIVITIES);
record_hdr.record_type = rtype;
/* Save time */
- record_hdr.ust_time = get_time(&rectime, 0);
+ record_hdr.ust_time = (unsigned long long) get_time(&rectime, 0);
record_hdr.hour = rectime.tm_hour;
record_hdr.minute = rectime.tm_min;
reset_stats();
/* Save time */
- record_hdr.ust_time = get_time(&rectime, 0);
+ record_hdr.ust_time = (unsigned long long) get_time(&rectime, 0);
record_hdr.hour = rectime.tm_hour;
record_hdr.minute = rectime.tm_min;
record_hdr.second = rectime.tm_sec;
* element in array of chars.
***************************************************************************
*/
-void lnappend(unsigned long timetag, double value, char **out, int *outsize, int restart)
+void lnappend(unsigned long long timetag, double value, char **out, int *outsize,
+ int restart)
{
char data[128];
/* Prepare additional graph definition data */
- snprintf(data, 128, " %c%lu,%.2f", restart ? 'M' : 'L', timetag, value);
+ snprintf(data, 128, " %c%llu,%.2f", restart ? 'M' : 'L', timetag, value);
data[127] = '\0';
save_svg_data(data, out, outsize);
* element in array of chars.
***************************************************************************
*/
-void lniappend(unsigned long timetag, unsigned long value, char **out, int *outsize,
- int restart)
+void lniappend(unsigned long long timetag, unsigned long value, char **out,
+ int *outsize, int restart)
{
char data[128];
/* Prepare additional graph definition data */
- snprintf(data, 128, " %c%lu,%lu", restart ? 'M' : 'L', timetag, value);
+ snprintf(data, 128, " %c%llu,%lu", restart ? 'M' : 'L', timetag, value);
data[127] = '\0';
save_svg_data(data, out, outsize);
* element in array of chars.
***************************************************************************
*/
-void brappend(unsigned long timetag, double offset, double value, char **out, int *outsize,
- unsigned long dt)
+void brappend(unsigned long long timetag, double offset, double value, char **out,
+ int *outsize, unsigned long long dt)
{
char data[128];
/* Dont draw a flat rectangle! */
return;
- snprintf(data, 128, "<rect x=\"%lu\" y=\"%.2f\" height=\"%.2f\" width=\"%lu\"/>",
+ snprintf(data, 128, "<rect x=\"%llu\" y=\"%.2f\" height=\"%.2f\" width=\"%llu\"/>",
timetag - dt, MINIMUM(offset, 100.0), MINIMUM(value, (100.0 - offset)), dt);
data[127] = '\0';
* element in array of chars.
***************************************************************************
*/
-void cpuappend(unsigned long timetag, double *offset, double value, char **out, int *outsize,
- unsigned long dt, double *spmin, double *spmax)
+void cpuappend(unsigned long long timetag, double *offset, double value, char **out,
+ int *outsize, unsigned long long dt, double *spmin, double *spmax)
{
/* Save min and max values */
if (value < *spmin) {
* @spmax Max value for this metric.
***************************************************************************
*/
-void recappend(unsigned long timetag, double p_value, double value, char **out, int *outsize,
- int restart, unsigned long dt, double *spmin, double *spmax)
+void recappend(unsigned long long timetag, double p_value, double value, char **out,
+ int *outsize, int restart, unsigned long long dt,
+ double *spmin, double *spmax)
{
char data[128], data1[128], data2[128];
}
/* Prepare additional graph definition data */
if (restart) {
- snprintf(data1, 128, " M%lu,%.2f", timetag - dt, p_value);
+ snprintf(data1, 128, " M%llu,%.2f", timetag - dt, p_value);
data1[127] = '\0';
}
if (p_value != value) {
- snprintf(data2, 128, " L%lu,%.2f", timetag, value);
+ snprintf(data2, 128, " L%llu,%.2f", timetag, value);
data2[127] = '\0';
}
- snprintf(data, 128, "%s L%lu,%.2f%s", restart ? data1 : "", timetag, p_value,
+ snprintf(data, 128, "%s L%llu,%.2f%s", restart ? data1 : "", timetag, p_value,
p_value != value ? data2 : "");
data[127] = '\0';