g_object_unref(tss);
lttv_iattribute_remove_by_name(LTTV_IATTRIBUTE(l_attribute),
LTTV_COMPUTATION_TRACESET_CONTEXT);
- lttv_traceset_destroy(ts);
lttv_iattribute_remove_by_name(LTTV_IATTRIBUTE(l_attribute),
LTTV_COMPUTATION_TRACESET);
+ /* Destroy the traceset and the trace also */
+ lttv_traceset_destroy(ts);
/* finally, remove the global attribute */
lttv_attribute_remove(attribute, i);
/* Background processing helper functions */
void lttvwindowtraces_add_computation_hooks(LttvAttributeName module_name,
- LttvTracesetContext *tsc)
+ LttvTracesetContext *tsc,
+ LttvHooks *hook_adder)
{
LttvAttribute *g_attribute = lttv_global_attributes();
LttvAttribute *module_attribute;
LTTV_HOOK_ADDER,
&value);
if(type == LTTV_POINTER) {
- lttv_hooks_call((LttvHooks*)*(value.v_pointer), (gpointer)tss);
+ //lttv_hooks_call((LttvHooks*)*(value.v_pointer), (gpointer)tss);
+ if(hook_adder != NULL)
+ lttv_hooks_add_list(hook_adder, (LttvHooks*)*(value.v_pointer));
}
}
void lttvwindowtraces_remove_computation_hooks(LttvAttributeName module_name,
- LttvTracesetContext *tsc)
+ LttvTracesetContext *tsc,
+ LttvHooks *hook_remover)
{
LttvAttribute *g_attribute = lttv_global_attributes();
LttvAttribute *module_attribute;
LTTV_HOOK_REMOVER,
&value);
if(type == LTTV_POINTER) {
- lttv_hooks_call((LttvHooks*)*(value.v_pointer), (gpointer)tss);
+ //lttv_hooks_call((LttvHooks*)*(value.v_pointer), (gpointer)tss);
+ if(hook_remover != NULL)
+ lttv_hooks_add_list(hook_remover, (LttvHooks*)*(value.v_pointer));
}
}
{
GSList *iter = *list_in;
+ LttvHooks *hook_adder = lttv_hooks_new();
/* - for each request in list_in */
while(iter != NULL) {
/*- Call before chunk hooks for list_in*/
/*- add hooks to context*/
lttvwindowtraces_add_computation_hooks(bg_req->module_name,
- tsc);
+ tsc,
+ hook_adder);
iter = g_slist_next(iter);
}
+ lttv_hooks_call(hook_adder,tsc);
+ lttv_hooks_destroy(hook_adder);
}
}
/* 2. call process traceset middle for a chunk */
{
/*(assert list_in is not empty! : should not even be called in that case)*/
- LttTime end = { G_MAXUINT, G_MAXUINT };
+ LttTime end = ltt_time_infinite;
g_assert(g_slist_length(*list_in) != 0);
lttv_process_traceset_middle(tsc, end, CHUNK_NUM_EVENTS, NULL);
/* 3.1 call after_chunk hooks for list_in */
{
GSList *iter = *list_in;
+ LttvHooks *hook_remover = lttv_hooks_new();
/* - for each request in list_in */
while(iter != NULL) {
/* - Call after chunk hooks for list_in */
/* - remove hooks from context */
lttvwindowtraces_remove_computation_hooks(bg_req->module_name,
- tsc);
+ tsc,
+ hook_remover);
iter = g_slist_next(iter);
}
+ lttv_hooks_call(hook_remover,tsc);
+ lttv_hooks_destroy(hook_remover);
}
/* 3.2 for each notify_in */
}
}
}
+ {
+ /* - reset the context */
+ LTTV_TRACESET_CONTEXT_GET_CLASS(tsc)->fini(tsc);
+ LTTV_TRACESET_CONTEXT_GET_CLASS(tsc)->init(tsc,ts);
+ }
/* - if list_out is empty */
if(g_slist_length(*list_out) == 0) {
/* - return FALSE (scheduler stopped) */