int page_size = getpagesize();
//open the file
- tf->name = g_quark_from_string(fileName);
+ tf->long_name = g_quark_from_string(fileName);
tf->trace = t;
tf->fd = open(fileName, O_RDONLY);
if(tf->fd < 0){
return -1;
}
+LttTrace *ltt_tracefile_get_trace(LttTracefile *tf)
+{
+ return tf->trace;
+}
+
#if 0
/*****************************************************************************
*Open control and per cpu tracefiles
tmp_tf.cpu_online = 1;
tmp_tf.cpu_num = num;
+ tmp_tf.name = name;
group = g_datalist_id_get_data(&trace->tracefiles, name);
if(group == NULL) {
return tf->name;
}
+
+guint ltt_tracefile_num(LttTracefile *tf)
+{
+ return tf->cpu_num;
+}
+
/*****************************************************************************
* Get the number of blocks in the tracefile
****************************************************************************/
}
+static void sanitize_name(gchar *name)
+{
+ while(*name != '\0') {
+ if(*name == '/') *name = '_';
+ name++;
+ }
+
+}
+
static void compute_tracefile(LttTracefile *tracefile, void *hook_data)
{
GString *filename;
- guint i, j, nb_equal, nb_block, offset;
+ guint nb_equal, nb_block, offset;
guint64 tsc;
FILE *fp;
LttTime time, previous_time;
LttFacility *facility;
LttEventType *event_type;
int err;
+ gchar mod_name[PATH_MAX];
/* start_count is always initialized in this function _if_ there is always
* a block_start before a block_end.
filename = g_string_new("");
- g_string_printf(filename, "%s.%u.%u.trace", a_dump_tracefiles, i, j);
+ strcpy(mod_name, g_quark_to_string(ltt_tracefile_name(tracefile)));
+
+ sanitize_name(mod_name);
+
+ g_string_printf(filename, "%s.%s.%u.trace", a_dump_tracefiles,
+ mod_name, ltt_tracefile_num(tracefile));
fp = fopen(filename->str, "w");
if(fp == NULL) g_error("Cannot open %s", filename->str);
g_string_free(filename, TRUE);
g_quark_to_string(ltt_tracefile_name(tracefile)));
if(ltt_time_compare(time, previous_time) < 0) {
- g_warning("Time decreasing trace %d tracefile %d position %u/%u",
- i, j, nb_block, offset);
+ g_warning("Time decreasing trace %s tracefile %s position %u/%u",
+ g_quark_to_string(ltt_trace_name(ltt_tracefile_get_trace(tracefile))),
+ g_quark_to_string(ltt_tracefile_name(tracefile)), nb_block, offset);
}
#if 0 //FIXME