module_chain = NULL;
module_next = &module_chain;
gm = g_module_open(pathname,0);
- g_free(pathname);
+ g_free(pathname);
if(gm != NULL) break;
LttvLibrary *lttv_library_load(char *name, GError **error)
{
- LttvLibrary *l = library_load(name, error);
- l->info.load_count++;
+ LttvLibrary *l = library_load(name, error);
+ if(l != NULL) l->info.load_count++;
return l;
}
}
+/* Put all the tracefiles at the tracefile context position */
+void lttv_process_traceset_synchronize_tracefiles(LttvTracesetContext *self)
+{
+ guint iter_trace, nb_trace;
+
+ LttvTraceContext *tc;
+
+ nb_trace = lttv_traceset_number(self->ts);
+
+ for(iter_trace = 0 ; iter_trace < nb_trace ; iter_trace++) {
+ tc = self->traces[iter_trace];
+ {
+ /* each trace */
+ guint iter_tf, nb_tracefile;
+
+ LttvTracefileContext *tfc;
+
+ nb_tracefile = ltt_trace_control_tracefile_number(tc->t) +
+ ltt_trace_per_cpu_tracefile_number(tc->t);
+
+ for(iter_tf = 0 ; iter_tf < nb_tracefile ; iter_tf++) {
+ tfc = tc->tracefiles[iter_tf];
+ {
+ /* each tracefile */
+ //ltt_tracefile_copy(tfc->tf_sync_data, tfc->tf);
+ LttEventPosition *ep = ltt_event_position_new();
+
+ ltt_event_position(tfc->e, ep);
+
+ ltt_tracefile_seek_position(tfc->tf, ep);
+ g_free(ep);
+ }
+ }
+ }
+ }
+}
+
+
void lttv_process_traceset_begin(LttvTracesetContext *self,
LttvHooks *before_traceset,
if(last_ret == TRUE ||
count >= nb_events ||
- ((end_position==NULL)?FALSE:(lttv_traceset_context_ctx_pos_compare(self,
- end_position) >= 0))||
+ (end_position!=NULL&<tv_traceset_context_ctx_pos_compare(self,
+ end_position) == 0)||
ltt_time_compare(tfc->timestamp, end) >= 0)
{
return count;
}
-LttvTracesetContextPosition *ltt_traceset_context_position_new()
+LttvTracesetContextPosition *lttv_traceset_context_position_new()
{
return g_new(LttvTracesetContextPosition,1);
}
void lttv_process_traceset(LttvTracesetContext *self, LttTime end,
unsigned nb_events);
+/* Save the complete tracefile information in the context */
+//void lttv_process_traceset_get_sync_data(LttvTracesetContext *self);
+
+/* Put all the tracefiles at the tracefile context position */
+void lttv_process_traceset_synchronize_tracefiles(LttvTracesetContext *self);
+
/* Process traceset can also be done in smaller pieces calling begin,
* then seek and middle repeatedly, and end. The middle function return the
* number of events processed. It will be smaller than nb_events if the end time
void lttv_trace_find_hook(LttTrace *t, char *facility, char *event_type,
char *field1, char *field2, char *field3, LttvHook h, LttvTraceHook *th);
-
LttvTracefileContext *lttv_traceset_context_get_current_tfc(
LttvTracesetContext *self);
-LttvTracesetContextPosition *ltt_traceset_context_position_new();
+
+LttvTracesetContextPosition *lttv_traceset_context_position_new();
void lttv_traceset_context_position_save(const LttvTracesetContext *self,
LttvTracesetContextPosition *pos);
const LttvTracesetContextPosition *src);
gint lttv_traceset_context_pos_pos_compare(
- const LttvTracesetContextPosition *pos1,
- const LttvTracesetContextPosition *pos2);
+ const LttvTracesetContextPosition *pos1,
+ const LttvTracesetContextPosition *pos2);
gint lttv_traceset_context_ctx_pos_compare(const LttvTracesetContext *self,
- const LttvTracesetContextPosition *pos);
+ const LttvTracesetContextPosition *pos2);
-gint lttv_traceset_context_pos_pos_compare(const LttvTracesetContextPosition *a,
- const LttvTracesetContextPosition *b);
LttTime lttv_traceset_context_position_get_time(
- const LttvTracesetContextPosition *pos);
+ const LttvTracesetContextPosition *pos);
+
+
#endif // PROCESSTRACE_H