From 79257ba540581e198c9d9b047fe0738a25c324ff Mon Sep 17 00:00:00 2001 From: compudj Date: Tue, 23 Aug 2005 20:46:55 +0000 Subject: [PATCH] float word order git-svn-id: http://ltt.polymtl.ca/svn@1065 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ltt/ltt-private.h | 1 + ltt/branches/poly/ltt/tracefile.c | 3 ++ ltt/branches/poly/lttv/lttv/tracecontext.c | 8 ++--- ltt/branches/poly/lttv/lttv/tracecontext.h | 8 ++--- .../gui/lttvwindow/lttvwindow/init_module.c | 3 ++ .../lttvwindow/lttvwindow/lttvwindowtraces.c | 34 +++++++++++++++++-- .../lttvwindow/lttvwindow/lttvwindowtraces.h | 1 + 7 files changed, 48 insertions(+), 10 deletions(-) diff --git a/ltt/branches/poly/ltt/ltt-private.h b/ltt/branches/poly/ltt/ltt-private.h index 25f2d824..bcd745ca 100644 --- a/ltt/branches/poly/ltt/ltt-private.h +++ b/ltt/branches/poly/ltt/ltt-private.h @@ -141,6 +141,7 @@ struct ltt_trace_header { uint32_t magic_number; uint32_t arch_type; uint32_t arch_variant; + uint32_t float_word_order; uint8_t arch_size; //uint32_t system_type; uint8_t major_version; diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index 9da89781..20ba35de 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -248,6 +248,9 @@ gint ltt_tracefile_open(LttTrace *t, gchar * fileName, LttTracefile *tf) tf->reverse_bo = 1; else /* invalid magic number, bad tracefile ! */ goto unmap_file; + /* Get float byte order : might be different from int byte order + * (or is set to 0 if the trace has no float (kernel trace)) */ + tf->float_word_order = header->trace.float_word_order; //store the size of the file tf->file_size = lTDFStat.st_size; diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index 98d91a69..5c2a17cb 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -178,7 +178,7 @@ init(LttvTracesetContext *self, LttvTraceset *ts) self->traces = g_new(LttvTraceContext *, nb_trace); self->a = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL); self->ts_a = lttv_traceset_attribute(ts); - self->sync_position = lttv_traceset_context_position_new(); + // self->sync_position = lttv_traceset_context_position_new(); for(i = 0 ; i < nb_trace ; i++) { tc = LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_trace_context(self); self->traces[i] = tc; @@ -250,7 +250,7 @@ void fini(LttvTracesetContext *self) g_tree_destroy(self->pqueue); g_object_unref(self->a); - lttv_traceset_context_position_destroy(self->sync_position); + // lttv_traceset_context_position_destroy(self->sync_position); nb_trace = lttv_traceset_number(ts); @@ -1184,7 +1184,7 @@ LttvTracefileContext *lttv_traceset_context_get_current_tfc(LttvTracesetContext return tfc; } - +#if 0 /* lttv_process_traceset_synchronize_tracefiles * * Use the sync_position field of the trace set context to synchronize each @@ -1205,5 +1205,5 @@ void lttv_process_traceset_get_sync_data(LttvTracesetContext *tsc) lttv_traceset_context_position_save(tsc, tsc->sync_position); } - +#endif //0 diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.h b/ltt/branches/poly/lttv/lttv/tracecontext.h index 429a9016..4be8be70 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.h +++ b/ltt/branches/poly/lttv/lttv/tracecontext.h @@ -94,8 +94,8 @@ struct _LttvTracesetContext { TimeInterval time_span; GTree *pqueue; - LttvTracesetContextPosition *sync_position; /* position at which to sync the - trace context */ + // LttvTracesetContextPosition *sync_position; /* position at which to sync the + // trace context */ }; struct _LttvTracesetContextClass { @@ -331,8 +331,8 @@ gint compare_tracefile(gconstpointer a, gconstpointer b); /* Synchronisation helpers : save/restore synchronization between ltt traces and * a traceset context. */ -void lttv_process_traceset_synchronize_tracefiles(LttvTracesetContext *tsc); +//void lttv_process_traceset_synchronize_tracefiles(LttvTracesetContext *tsc); -void lttv_process_traceset_get_sync_data(LttvTracesetContext *tsc); +//void lttv_process_traceset_get_sync_data(LttvTracesetContext *tsc); #endif // PROCESSTRACE_H diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c index 42489de7..c9f55de6 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c @@ -57,6 +57,7 @@ LttvTraceInfo LTTV_TRACES, LTTV_NOTIFY_CURRENT, LTTV_COMPUTATION_TRACESET, LTTV_COMPUTATION_TRACESET_CONTEXT, + LTTV_COMPUTATION_SYNC_POSITION, LTTV_BEFORE_CHUNK_TRACESET, LTTV_BEFORE_CHUNK_TRACE, LTTV_BEFORE_CHUNK_TRACEFILE, @@ -153,6 +154,8 @@ static void init() { LTTV_COMPUTATION_TRACESET = g_quark_from_string("computation_traceset"); LTTV_COMPUTATION_TRACESET_CONTEXT = g_quark_from_string("computation_traceset_context"); + LTTV_COMPUTATION_SYNC_POSITION = + g_quark_from_string("computation_sync_position"); LTTV_BEFORE_CHUNK_TRACESET = g_quark_from_string("before_chunk_traceset"); LTTV_BEFORE_CHUNK_TRACE = g_quark_from_string("before_chunk_trace"); LTTV_BEFORE_CHUNK_TRACEFILE = g_quark_from_string("before_chunk_tracefile"); diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c index a37d1e39..56bf076d 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c @@ -161,6 +161,7 @@ void lttvwindowtraces_add_trace(LttvTrace *trace) /* create new traceset and tracesetcontext */ LttvTraceset *ts; LttvTracesetStats *tss; + LttvTracesetContextPosition *sync_position; attribute = lttv_trace_attribute(trace); g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), @@ -181,6 +182,14 @@ void lttvwindowtraces_add_trace(LttvTrace *trace) lttv_context_init(LTTV_TRACESET_CONTEXT(tss), ts); + g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + LTTV_COMPUTATION_SYNC_POSITION, + LTTV_POINTER, + &value)); + + sync_position = lttv_traceset_context_position_new(); + *(value.v_pointer) = sync_position; + value = lttv_attribute_add(attribute, LTTV_REQUESTS_QUEUE, LTTV_POINTER); @@ -227,6 +236,7 @@ void lttvwindowtraces_remove_trace(LttvTrace *trace) /* destroy traceset and tracesetcontext */ LttvTraceset *ts; LttvTracesetStats *tss; + LttvTracesetContextPosition *sync_position; l_attribute = lttv_trace_attribute(trace); @@ -249,6 +259,17 @@ void lttvwindowtraces_remove_trace(LttvTrace *trace) &value)); ts = (LttvTraceset*)*(value.v_pointer); + g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(l_attribute), + LTTV_COMPUTATION_SYNC_POSITION, + LTTV_POINTER, + &value)); + sync_position = (LttvTracesetContextPosition*)*(value.v_pointer); + + lttv_traceset_context_position_destroy(sync_position); + + lttv_iattribute_remove_by_name(LTTV_IATTRIBUTE(l_attribute), + LTTV_COMPUTATION_SYNC_POSITION); + g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(l_attribute), LTTV_COMPUTATION_TRACESET_CONTEXT, LTTV_POINTER, @@ -827,6 +848,7 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) LttvTracesetContext *tsc; LttvTracesetStats *tss; LttvTraceset *ts; + LttvTracesetContextPosition *sync_position; LttvAttribute *attribute; LttvAttribute *g_attribute = lttv_global_attributes(); GSList **list_out, **list_in, **notify_in, **notify_out; @@ -877,6 +899,12 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) tss = (LttvTracesetStats*)*(value.v_pointer); g_assert(LTTV_IS_TRACESET_CONTEXT(tsc)); g_assert(LTTV_IS_TRACESET_STATS(tss)); + + type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(attribute), + LTTV_COMPUTATION_SYNC_POSITION, + &value); + g_assert(type == LTTV_POINTER); + sync_position = (LttvTracesetContextPosition*)*(value.v_pointer); /* There is no events requests pending : we should never have been called! */ g_assert(g_slist_length(*list_out) != 0 || g_slist_length(*list_in) != 0); @@ -895,7 +923,8 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) } } /* 0.2 Sync tracefiles */ - lttv_process_traceset_synchronize_tracefiles(tsc); + g_assert(lttv_process_traceset_seek_position(tsc, sync_position) == 0); + // lttv_process_traceset_synchronize_tracefiles(tsc); /* 1. Before processing */ { /* if list_in is empty */ @@ -1214,7 +1243,8 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) } /* 4. Unlock traces */ { - lttv_process_traceset_get_sync_data(tsc); + // lttv_process_traceset_get_sync_data(tsc); + lttv_traceset_context_position_save(tsc, sync_position); guint iter_trace; for(iter_trace=0; diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.h b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.h index fffb3025..8de3ba35 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.h +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.h @@ -81,6 +81,7 @@ extern LttvTraceInfo LTTV_TRACES, LTTV_NOTIFY_CURRENT, LTTV_COMPUTATION_TRACESET, LTTV_COMPUTATION_TRACESET_CONTEXT, + LTTV_COMPUTATION_SYNC_POSITION, LTTV_BEFORE_CHUNK_TRACESET, LTTV_BEFORE_CHUNK_TRACE, LTTV_BEFORE_CHUNK_TRACEFILE, -- 2.34.1