sanitize_name(mod_name);
+ g_warning("test %s test", g_quark_to_string(ltt_tracefile_name(tracefile)));
g_string_printf(filename, "%s.%s.%u.trace", a_dump_tracefiles,
mod_name, ltt_tracefile_num(tracefile));
fp = fopen(filename->str, "w");
g_quark_to_string(ltt_tracefile_name(tracefile)));
if(ltt_time_compare(time, previous_time) < 0) {
- g_warning("Time decreasing trace %s tracefile %s position %u/%u",
+ g_warning("Time decreasing trace %s tracefile %s cpu %u position %u/%u",
g_quark_to_string(ltt_trace_name(ltt_tracefile_get_trace(tracefile))),
- g_quark_to_string(ltt_tracefile_name(tracefile)), nb_block, offset);
+ g_quark_to_string(ltt_tracefile_name(tracefile)),
+ ltt_tracefile_num(tracefile), nb_block, offset);
+ g_warning("last time %lu.%lu vs current %lu.%lu",
+ previous_time.tv_sec, previous_time.tv_nsec,
+ time.tv_sec, time.tv_nsec);
}
#if 0 //FIXME
GArray *array;
} LttvHooksById;
+/* macro to calculate the hook ID of a facility/event pair. */
+#define GET_HOOK_ID(fac_id, ev_id) \
+ ( (guint)fac_id | ((guint)ev_id << (8*sizeof(NUM_FACILITIES))) )
/* Create and destroy a hooks by id list */
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
- LttvTraceHookByFacility *thf =
- lttv_trace_hook_get_fac((LttvTraceHook *)hook_data,
- ltt_event_facility_id(e));
+ LttvTraceHookByFacility *thf = (LttvTraceHookByFacility *)hook_data;
LttField *f = thf->f1;
LttvExecutionSubmode submode;
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
- LttvTraceHookByFacility *thf =
- lttv_trace_hook_get_fac((LttvTraceHook *)hook_data,
- ltt_event_facility_id(e));
+ LttvTraceHookByFacility *thf = (LttvTraceHookByFacility *)hook_data;
LttField *f = thf->f1;
LttvExecutionSubmode submode;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
guint8 fac_id = ltt_event_facility_id(e);
guint8 ev_id = ltt_event_eventtype_id(e);
- LttvTraceHookByFacility *thf =
- lttv_trace_hook_get_fac((LttvTraceHook *)hook_data,
- ltt_event_facility_id(e));
+ LttvTraceHookByFacility *thf = (LttvTraceHookByFacility *)hook_data;
// g_assert(lttv_trace_hook_get_first((LttvTraceHook *)hook_data)->f1 != NULL);
g_assert(thf->f1 != NULL);
// g_assert(thf == lttv_trace_hook_get_first((LttvTraceHook *)hook_data));
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
- LttvTraceHookByFacility *thf =
- lttv_trace_hook_get_fac((LttvTraceHook *)hook_data,
- ltt_event_facility_id(e));
+ LttvTraceHookByFacility *thf = (LttvTraceHookByFacility *)hook_data;
guint pid_in, pid_out, state_out;
pid_out = ltt_event_get_unsigned(e, thf->f1);
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
- LttvTraceHookByFacility *thf =
- lttv_trace_hook_get_fac((LttvTraceHook *)hook_data,
- ltt_event_facility_id(e));
+ LttvTraceHookByFacility *thf = (LttvTraceHookByFacility *)hook_data;
LttField *f;
guint parent_pid;
guint child_pid;
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
- LttvTraceHookByFacility *thf =
- lttv_trace_hook_get_fac((LttvTraceHook *)hook_data,
- ltt_event_facility_id(e));
+ LttvTraceHookByFacility *thf = (LttvTraceHookByFacility *)hook_data;
LttField *f;
guint pid;
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
- LttvTraceHookByFacility *thf =
- lttv_trace_hook_get_fac((LttvTraceHook *)hook_data,
- ltt_event_facility_id(e));
+ LttvTraceHookByFacility *thf = (LttvTraceHookByFacility *)hook_data;
guint release_pid;
LttvProcessState *process;
lttv_hooks_add(
lttv_hooks_by_id_find(tfs->parent.event_by_id, thf->id),
thf->h,
- hook,
+ thf,
LTTV_PRIO_STATE);
}
}
lttv_hooks_remove_data(
lttv_hooks_by_id_find(tfs->parent.event_by_id, thf->id),
thf->h,
- &g_array_index(hooks, LttvTraceHook, k));
+ thf);
}
lttv_trace_hook_destroy(&g_array_index(hooks, LttvTraceHook, k));
}
LttEvent *e = ltt_tracefile_get_event(tfcs->parent.parent.tf);
- LttvTraceHookByFacility *thf =
- lttv_trace_hook_get_fac((LttvTraceHook *)hook_data,
- ltt_event_facility_id(e));
+ LttvTraceHookByFacility *thf = (LttvTraceHookByFacility *)hook_data;
guint pid_in, pid_out, state_out;
lttv_hooks_add(
lttv_hooks_by_id_find(tfs->parent.parent.event_by_id, thf->id),
thf->h,
- &g_array_index(before_hooks, LttvTraceHook, k),
+ thf,
LTTV_PRIO_STATS_BEFORE_STATE);
}
}
lttv_hooks_add(
lttv_hooks_by_id_find(tfs->parent.parent.event_by_id, thf->id),
thf->h,
- &g_array_index(after_hooks, LttvTraceHook, k),
+ thf,
LTTV_PRIO_STATS_AFTER_STATE);
}
}
lttv_hooks_remove_data(
lttv_hooks_by_id_find(tfs->parent.parent.event_by_id, thf->id),
thf->h,
- &g_array_index(before_hooks, LttvTraceHook, k));
+ thf);
}
}
for(k = 0 ; k < after_hooks->len ; k++) {
lttv_hooks_remove_data(
lttv_hooks_by_id_find(tfs->parent.parent.event_by_id, thf->id),
thf->h,
- &g_array_index(after_hooks, LttvTraceHook, k));
+ thf);
}
}
}
*/
if(unlikely(last_ret == TRUE ||
- count >= nb_events ||
+ ((count >= nb_events) && (nb_events != G_MAXULONG)) ||
(end_position!=NULL&<tv_traceset_context_ctx_pos_compare(self,
end_position) == 0)||
ltt_time_compare(end, tfc->timestamp) <= 0))
GArray *facilities;
- guint i, fac_id;
+ guint i, fac_id, ev_id;
LttvTraceHookByFacility *thf, *first_thf;
g_array_index(th->fac_list, LttvTraceHookByFacility*, 0)
= thf;
+ ev_id = ltt_eventtype_id(et);
+
thf->h = h;
- thf->id = ltt_eventtype_id(et);
+ thf->id = GET_HOOK_ID(fac_id, ev_id);
thf->f1 = find_field(et, field1);
thf->f2 = find_field(et, field2);
thf->f3 = find_field(et, field3);
thf = &g_array_index(th->fac_index, LttvTraceHookByFacility, fac_id);
g_array_index(th->fac_list, LttvTraceHookByFacility*, i)
= thf;
+ ev_id = ltt_eventtype_id(et);
thf->h = h;
- thf->id = ltt_eventtype_id(et);
+ thf->id = GET_HOOK_ID(fac_id, ev_id);
thf->f1 = find_field(et, field1);
if(check_fields_compatibility(first_et, et,
first_thf->f1, thf->f1))