/* 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;
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,
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);
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;
}
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--;
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");
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");
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,
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--;
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--;
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,
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,
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,
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++));
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++));