X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttv%2Fmodules%2Fgui%2Flttvwindow%2Flttvwindow%2Flttvwindowtraces.c;h=f20cc45dd949b3c7eeeac9118c61cdaa48530de6;hb=b22f4f42754d465f62489045f99b1066275ae59b;hp=05ab4b436e758444496cb3b49a2401fb5b4203f7;hpb=e865422cc50d00cb57ec05ed07bba4cbe160904e;p=lttv.git diff --git a/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c b/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c index 05ab4b43..f20cc45d 100644 --- a/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c +++ b/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c @@ -30,13 +30,10 @@ #include #include -#include -#include #include #include #include #include -#include #include #include // for CHUNK_NUM_EVENTS #include /* for main window structure */ @@ -56,7 +53,7 @@ typedef struct _BackgroundNotify { gpointer owner; LttvTrace *trace; /* trace */ LttTime notify_time; - LttvTracesetContextPosition *notify_position; + LttvTracesetPosition *notify_position; LttvHooks *notify; /* Hook to call when the notify is passed, or at the end of trace */ } BackgroundNotify; @@ -75,6 +72,7 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace); __EXPORT LttvTrace *lttvwindowtraces_get_trace_by_name(gchar *path) { +#ifdef BABEL_CLEANUP guint i; for(i=0;itraceset->filename); gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(widget)); g_signal_connect_swapped (dialog, "response", G_CALLBACK (destroy_dialog), @@ -501,9 +502,10 @@ __EXPORT void lttvwindowtraces_background_notify_queue (gpointer owner, LttvTrace *trace, LttTime notify_time, - const LttvTracesetContextPosition *notify_position, + const LttvTracesetPosition *notify_position, const LttvHooks *notify) { + #ifdef BABEL_CLEANUP BackgroundNotify *bg_notify; LttvAttribute *attribute = lttv_trace_attribute(trace); LttvAttributeValue value; @@ -524,7 +526,7 @@ __EXPORT void lttvwindowtraces_background_notify_queue &value); g_assert(result); - LttvTracesetContext *tsc = (LttvTracesetContext*)(value.v_pointer); + LttvTraceset *ts = (LttvTraceset)(value.v_pointer); bg_notify = g_new(BackgroundNotify,1); @@ -543,6 +545,7 @@ __EXPORT void lttvwindowtraces_background_notify_queue lttv_hooks_add_list(bg_notify->notify, notify); *slist = g_slist_append(*slist, bg_notify); +#endif /* BABEL_CLEANUP*/ } /** @@ -560,9 +563,10 @@ __EXPORT void lttvwindowtraces_background_notify_current (gpointer owner, LttvTrace *trace, LttTime notify_time, - const LttvTracesetContextPosition *notify_position, + const LttvTracesetPosition *notify_position, const LttvHooks *notify) { + #ifdef BABEL_CLEANUP BackgroundNotify *bg_notify; LttvAttribute *attribute = lttv_trace_attribute(trace); LttvAttributeValue value; @@ -602,11 +606,13 @@ __EXPORT void lttvwindowtraces_background_notify_current lttv_hooks_add_list(bg_notify->notify, notify); *slist = g_slist_append(*slist, bg_notify); + #endif /* BABEL_CLEANUP */ } static void notify_request_free(BackgroundNotify *notify_req) { + #ifdef BABEL_CLEANUP if(notify_req == NULL) return; if(notify_req->notify_position != NULL) @@ -614,6 +620,7 @@ static void notify_request_free(BackgroundNotify *notify_req) if(notify_req->notify != NULL) lttv_hooks_destroy(notify_req->notify); g_free(notify_req); + #endif /* BABEL_CLEANUP */ } /** @@ -688,9 +695,10 @@ __EXPORT void lttvwindowtraces_background_notify_remove(gpointer owner) /* Background processing helper functions */ void lttvwindowtraces_add_computation_hooks(LttvAttributeName module_name, - LttvTracesetContext *tsc, + LttvTraceset *ts, LttvHooks *hook_adder) { + #ifdef BABEL_CLEANUP LttvAttribute *g_attribute = lttv_global_attributes(); LttvAttribute *module_attribute; LttvAttributeType type; @@ -717,12 +725,14 @@ void lttvwindowtraces_add_computation_hooks(LttvAttributeName module_name, if(hook_adder != NULL) lttv_hooks_add_list(hook_adder, (LttvHooks*)*(value.v_pointer)); } +#endif /* BABEL_CLEANUP */ } void lttvwindowtraces_remove_computation_hooks(LttvAttributeName module_name, - LttvTracesetContext *tsc, + LttvTraceset *ts, LttvHooks *hook_remover) { + #ifdef BABEL_CLEANUP LttvAttribute *g_attribute = lttv_global_attributes(); LttvAttribute *module_attribute; LttvAttributeType type; @@ -748,11 +758,13 @@ void lttvwindowtraces_remove_computation_hooks(LttvAttributeName module_name, if(hook_remover != NULL) lttv_hooks_add_list(hook_remover, (LttvHooks*)*(value.v_pointer)); } + #endif /* BABEL_CLEANUP */ } void lttvwindowtraces_call_before_chunk(LttvAttributeName module_name, - LttvTracesetContext *tsc) + LttvTraceset *ts) { + #ifdef BABEL_CLEANUP LttvAttribute *g_attribute = lttv_global_attributes(); LttvAttribute *module_attribute; LttvAttributeType type; @@ -816,13 +828,16 @@ void lttvwindowtraces_call_before_chunk(LttvAttributeName module_name, before_chunk_tracefile, event_hook, event_hook_by_id_channel); +#endif /* BABEL_CLEANUP */ } void lttvwindowtraces_call_after_chunk(LttvAttributeName module_name, - LttvTracesetContext *tsc) + LttvTraceset *ts) { +#warning "lttvwindowtraces_call_after_chunk does nothing" +#ifdef BABEL_CLEANUP LttvAttribute *g_attribute = lttv_global_attributes(); LttvAttribute *module_attribute; LttvAttributeType type; @@ -831,7 +846,6 @@ void lttvwindowtraces_call_after_chunk(LttvAttributeName module_name, LttvHooks *after_chunk_trace=NULL; LttvHooks *after_chunk_tracefile=NULL; LttvHooks *event_hook=NULL; - LttvHooksByIdChannelArray *event_hook_by_id_channel=NULL; module_attribute = LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(g_attribute), @@ -875,16 +889,12 @@ void lttvwindowtraces_call_after_chunk(LttvAttributeName module_name, type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(module_attribute), LTTV_EVENT_HOOK_BY_ID_CHANNEL, &value); - if(type == LTTV_POINTER) { - event_hook_by_id_channel = (LttvHooksByIdChannelArray*)*(value.v_pointer); - } - lttv_process_traceset_end(tsc, after_chunk_traceset, after_chunk_trace, after_chunk_tracefile, - event_hook, - event_hook_by_id_channel); + event_hook); +#endif /* BABEL_CLEANUP*/ } @@ -994,13 +1004,13 @@ __EXPORT gboolean lttvwindowtraces_get_ready(LttvAttributeName module_name, else return TRUE; } - +#ifdef BABEL_CLEANUP static gint find_window_widget(MainWindow *a, GtkWidget *b) { if(a->mwindow == b) return 0; else return -1; } - +#endif /* lttvwindowtraces_process_pending_requests * @@ -1014,16 +1024,14 @@ static gint find_window_widget(MainWindow *a, GtkWidget *b) gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) { - LttvTracesetContext *tsc; - LttvTracesetStats *tss; - LttvTraceset *ts; - //LttvTracesetContextPosition *sync_position; + gboolean ret_val = FALSE; +#ifdef BABEL_CLEANUP LttvAttribute *attribute; LttvAttribute *g_attribute = lttv_global_attributes(); GSList **list_out, **list_in, **notify_in, **notify_out; LttvAttributeValue value; LttvAttributeType type; - gboolean ret_val; + if(trace == NULL) return FALSE; @@ -1060,16 +1068,9 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) LTTV_COMPUTATION_TRACESET, &value); g_assert(type == LTTV_POINTER); +#ifdef BABEL_CLEANUP ts = (LttvTraceset*)*(value.v_pointer); - - type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(attribute), - LTTV_COMPUTATION_TRACESET_CONTEXT, - &value); - g_assert(type == LTTV_POINTER); - tsc = (LttvTracesetContext*)*(value.v_pointer); - tss = (LttvTracesetStats*)*(value.v_pointer); - g_assert(LTTV_IS_TRACESET_CONTEXT(tsc)); - g_assert(LTTV_IS_TRACESET_STATS(tss)); +#endif #if 0 type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(attribute), LTTV_COMPUTATION_SYNC_POSITION, @@ -1077,6 +1078,7 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) g_assert(type == LTTV_POINTER); sync_position = (LttvTracesetContextPosition*)*(value.v_pointer); #endif //0 +//#ifdef BABEL_CLEANUP moved at the beginning of the function /* 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); /* 0.1 Lock traces */ @@ -1084,9 +1086,9 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) guint iter_trace=0; for(iter_trace=0; - iter_tracets); + iter_tracets); iter_trace++) { - LttvTrace *trace_v = lttv_traceset_get(tsc->ts,iter_trace); + LttvTrace *trace_v = lttv_traceset_get(ts->ts,iter_trace); if(lttvwindowtraces_lock(trace_v) != 0) return TRUE; /* Cannot get trace lock, try later */ @@ -1487,6 +1489,7 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) lttvwindowtraces_unlock(trace_v); } } + #endif /* BABEL_CLEANUP */ return ret_val; } @@ -1509,7 +1512,6 @@ void lttvwindowtraces_register_computation_hooks(LttvAttributeName module_name, LttvHooks *before_request, LttvHooks *after_request, LttvHooks *event_hook, - LttvHooksById *event_hook_by_id_channel, LttvHooks *hook_adder, LttvHooks *hook_remover) { @@ -1592,13 +1594,6 @@ void lttvwindowtraces_register_computation_hooks(LttvAttributeName module_name, g_assert(result); *(value.v_pointer) = event_hook; - result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), - LTTV_EVENT_HOOK_BY_ID_CHANNEL, - LTTV_POINTER, - &value); - g_assert(result); - *(value.v_pointer) = event_hook_by_id_channel; - result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_HOOK_ADDER, LTTV_POINTER, @@ -1832,10 +1827,6 @@ void lttvwindowtraces_unregister_computation_hooks &value); g_assert(result); - LttvHooksByIdChannelArray *event_hook_by_id_channel = (LttvHooksByIdChannelArray*)*(value.v_pointer); - if(event_hook_by_id_channel != NULL) - lttv_hooks_by_id_channel_destroy(event_hook_by_id_channel); - result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_HOOK_ADDER, LTTV_POINTER,