From: compudj Date: Tue, 3 Apr 2007 18:29:02 +0000 (+0000) Subject: ok with new tracer X-Git-Tag: v0.12.20~1023 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f63ebe5196f36fcf40385d29cfc37288c4d70817;p=lttv.git ok with new tracer git-svn-id: http://ltt.polymtl.ca/svn@2466 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index 044ae470..8ac4b506 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -2217,7 +2217,13 @@ no_offset: /* Event size too big to fit in the event size field */ tf->event.event_size = tf->event.data_size; } - g_assert(tf->event.data_size == tf->event.event_size); + if (tf->event.data_size != tf->event.event_size) { + g_error("Kernel/LTTV event size differs for event %s.%s: kernel %u, LTTV %u", + g_quark_to_string(f->name), g_quark_to_string(event_type->name), + tf->event.event_size, tf->event.data_size); + exit(-1); + } + //g_assert(tf->event.data_size == tf->event.event_size); return; diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index a9cc924f..00c37cb8 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -81,13 +81,14 @@ GQuark LTT_FIELD_TRAP_ID, LTT_FIELD_IRQ_ID, LTT_FIELD_SOFT_IRQ_ID, - LTT_FIELD_OUT, - LTT_FIELD_IN, - LTT_FIELD_OUT_STATE, + LTT_FIELD_PREV_PID, + LTT_FIELD_NEXT_PID, + LTT_FIELD_PREV_STATE, LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID, LTT_FIELD_PID, LTT_FIELD_TGID, + LTT_FIELD_CHILD_TGID, LTT_FIELD_FILENAME, LTT_FIELD_NAME, LTT_FIELD_TYPE, @@ -2365,6 +2366,7 @@ static gboolean process_exec(void *hook_data, void *call_data) guint cpu = s->cpu; LttvProcessState *process = ts->running_process[cpu]; +#if 0//how to use a sequence that must be transformed in a string /* PID of the process to release */ guint64 name_len = ltt_event_field_element_number(e, thf->f1); //name = ltt_event_get_string(e, thf->f1); @@ -2374,10 +2376,12 @@ static gboolean process_exec(void *hook_data, void *call_data) gchar *null_term_name = g_new(gchar, name_len+1); memcpy(null_term_name, name_begin, name_len); null_term_name[name_len] = '\0'; - process->name = g_quark_from_string(null_term_name); +#endif //0 + + process->name = ltt_event_get_string(e, thf->f1); process->brand = LTTV_STATE_UNBRANDED; - g_free(null_term_name); + //g_free(null_term_name); return FALSE; } @@ -2722,13 +2726,13 @@ void lttv_state_add_event_hooks(LttvTracesetState *self) ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_SCHED_SCHEDULE, - LTT_FIELD_OUT, LTT_FIELD_IN, LTT_FIELD_OUT_STATE, + LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE, schedchange, NULL, &g_array_index(hooks, LttvTraceHook, hn++)); if(ret) hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_PROCESS_FORK, - LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID, LTT_FIELD_TGID, + LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID, LTT_FIELD_CHILD_TGID, process_fork, NULL, &g_array_index(hooks, LttvTraceHook, hn++)); if(ret) hn--; @@ -3478,7 +3482,7 @@ static void module_init() LTT_EVENT_PROCESS_FORK = g_quark_from_string("process_fork"); LTT_EVENT_KTHREAD_CREATE = g_quark_from_string("kthread_create"); LTT_EVENT_PROCESS_EXIT = g_quark_from_string("process_exit"); - LTT_EVENT_PROCESS_FREE = g_quark_from_string("procesS_free"); + LTT_EVENT_PROCESS_FREE = g_quark_from_string("process_free"); LTT_EVENT_EXEC = g_quark_from_string("exec"); LTT_EVENT_PROCESS_STATE = g_quark_from_string("process_state"); LTT_EVENT_STATEDUMP_END = g_quark_from_string("statedump_end"); @@ -3491,13 +3495,14 @@ static void module_init() LTT_FIELD_TRAP_ID = g_quark_from_string("trap_id"); LTT_FIELD_IRQ_ID = g_quark_from_string("irq_id"); LTT_FIELD_SOFT_IRQ_ID = g_quark_from_string("softirq_id"); - LTT_FIELD_OUT = g_quark_from_string("out"); - LTT_FIELD_IN = g_quark_from_string("in"); - LTT_FIELD_OUT_STATE = g_quark_from_string("out_state"); + LTT_FIELD_PREV_PID = g_quark_from_string("prev_pid"); + LTT_FIELD_NEXT_PID = g_quark_from_string("next_pid"); + LTT_FIELD_PREV_STATE = g_quark_from_string("prev_state"); LTT_FIELD_PARENT_PID = g_quark_from_string("parent_pid"); LTT_FIELD_CHILD_PID = g_quark_from_string("child_pid"); LTT_FIELD_PID = g_quark_from_string("pid"); LTT_FIELD_TGID = g_quark_from_string("tgid"); + LTT_FIELD_CHILD_TGID = g_quark_from_string("child_tgid"); LTT_FIELD_FILENAME = g_quark_from_string("filename"); LTT_FIELD_NAME = g_quark_from_string("name"); LTT_FIELD_TYPE = g_quark_from_string("type"); diff --git a/ltt/branches/poly/lttv/lttv/state.h b/ltt/branches/poly/lttv/lttv/state.h index 7884ff2f..68c6eb25 100644 --- a/ltt/branches/poly/lttv/lttv/state.h +++ b/ltt/branches/poly/lttv/lttv/state.h @@ -92,9 +92,9 @@ extern GQuark LTT_FIELD_TRAP_ID, LTT_FIELD_IRQ_ID, LTT_FIELD_SOFT_IRQ_ID, - LTT_FIELD_OUT, - LTT_FIELD_IN, - LTT_FIELD_OUT_STATE, + LTT_FIELD_PREV_PID, + LTT_FIELD_NEXT_PID, + LTT_FIELD_PREV_STATE, LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID, LTT_FIELD_PID, diff --git a/ltt/branches/poly/lttv/lttv/stats.c b/ltt/branches/poly/lttv/lttv/stats.c index 179fde3f..0fd94a00 100644 --- a/ltt/branches/poly/lttv/lttv/stats.c +++ b/ltt/branches/poly/lttv/lttv/stats.c @@ -1145,7 +1145,7 @@ void lttv_stats_add_event_hooks(LttvTracesetStats *self) ret = lttv_trace_find_hook(ts->parent.parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_SCHED_SCHEDULE, - LTT_FIELD_OUT, LTT_FIELD_IN, LTT_FIELD_OUT_STATE, + LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE, before_schedchange, NULL, &g_array_index(hooks, LttvTraceHook, hn++)); if(ret) hn--; @@ -1238,7 +1238,7 @@ void lttv_stats_add_event_hooks(LttvTracesetStats *self) ret = lttv_trace_find_hook(ts->parent.parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_SCHED_SCHEDULE, - LTT_FIELD_OUT, LTT_FIELD_IN, LTT_FIELD_OUT_STATE, + LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE, after_schedchange, NULL, &g_array_index(hooks, LttvTraceHook, hn++)); if(ret) hn--; diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index 1886d39f..5ecdae22 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -955,11 +955,18 @@ gboolean lttv_process_traceset_seek_position(LttvTracesetContext *self, static LttField * find_field(LttEventType *et, const GQuark field) { - GQuark name; + LttField *f; if(field == 0) return NULL; - return ltt_eventtype_field_by_name(et, field); + f = ltt_eventtype_field_by_name(et, field); + if (!f) { + g_warning("Cannot find field %s in event %s.%s", g_quark_to_string(field), + g_quark_to_string(ltt_facility_name(ltt_eventtype_facility(et))), + g_quark_to_string(ltt_eventtype_name(et))); + } + + return f; } LttvTraceHookByFacility *lttv_trace_hook_get_fac(LttvTraceHook *th, diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c index 37d083b5..e0b92aa3 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c @@ -242,7 +242,7 @@ void drawing_data_request(Drawing_t *drawing, if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_KERNEL, LTT_EVENT_TRAP_ENTRY, + LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_TRAP_ENTRY, LTT_FIELD_TRAP_ID, 0, 0, before_execmode_hook, events_request, @@ -250,7 +250,7 @@ void drawing_data_request(Drawing_t *drawing, if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_KERNEL, LTT_EVENT_TRAP_EXIT, + LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_TRAP_EXIT, 0, 0, 0, before_execmode_hook, events_request, @@ -292,7 +292,7 @@ void drawing_data_request(Drawing_t *drawing, ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_SCHED_SCHEDULE, - LTT_FIELD_OUT, LTT_FIELD_IN, LTT_FIELD_OUT_STATE, + LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE, before_schedchange_hook, events_request, &g_array_index(hooks, LttvTraceHook, before_hn++)); @@ -375,7 +375,7 @@ void drawing_data_request(Drawing_t *drawing, ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_SCHED_SCHEDULE, - LTT_FIELD_OUT, LTT_FIELD_IN, LTT_FIELD_OUT_STATE, + LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE, after_schedchange_hook, events_request, &g_array_index(hooks, LttvTraceHook, after_hn++));