From: compudj Date: Fri, 23 Jul 2004 23:31:19 +0000 (+0000) Subject: position ok with processing X-Git-Tag: v0.12.20~2858 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8b0bbe19ccf2d978bb68b3c78f5d08b0b6899c8d;p=lttv.git position ok with processing git-svn-id: http://ltt.polymtl.ca/svn@631 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/lttv/lttv/module.c b/ltt/branches/poly/lttv/lttv/module.c index 18cc24e0..3ebd3a33 100644 --- a/ltt/branches/poly/lttv/lttv/module.c +++ b/ltt/branches/poly/lttv/lttv/module.c @@ -189,7 +189,7 @@ static LttvLibrary *library_load(char *name, GError **error) module_chain = NULL; module_next = &module_chain; gm = g_module_open(pathname,0); - g_free(pathname); + g_free(pathname); if(gm != NULL) break; @@ -226,8 +226,8 @@ static LttvLibrary *library_load(char *name, GError **error) 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; } diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index 40643126..bdd3bdc7 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -576,6 +576,44 @@ gboolean get_first(gpointer key, gpointer value, gpointer user_data) { } +/* 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, @@ -638,8 +676,8 @@ guint lttv_process_traceset_middle(LttvTracesetContext *self, 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; @@ -849,7 +887,7 @@ lttv_trace_find_hook(LttTrace *t, char *facility, char *event_type, } -LttvTracesetContextPosition *ltt_traceset_context_position_new() +LttvTracesetContextPosition *lttv_traceset_context_position_new() { return g_new(LttvTracesetContextPosition,1); } diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.h b/ltt/branches/poly/lttv/lttv/tracecontext.h index 3a3f5f61..2c273902 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.h +++ b/ltt/branches/poly/lttv/lttv/tracecontext.h @@ -180,6 +180,12 @@ GType lttv_tracefile_context_get_type (void); 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 @@ -278,11 +284,11 @@ typedef struct _LttvTraceHook { 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); @@ -293,14 +299,14 @@ void lttv_traceset_context_position_copy(LttvTracesetContextPosition *dest, 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