-#ifdef BABEL_CLEANUP
- ts = (LttvTraceState *)tsc->traces[i];
-
- /* Find the eventtype id for the following events and register the
- associated by id hooks. */
-
- hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 18);
-
- /* before hooks */
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_SYSCALL_ENTRY,
- FIELD_ARRAY(LTT_FIELD_SYSCALL_ID),
- before_execmode_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_SCHED_TRY_WAKEUP,
- FIELD_ARRAY(LTT_FIELD_PID, LTT_FIELD_CPU_ID, LTT_FIELD_STATE),
- before_trywakeup_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_SYSCALL_EXIT,
- NULL,
- before_execmode_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_TRAP_ENTRY,
- FIELD_ARRAY(LTT_FIELD_TRAP_ID),
- before_execmode_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_TRAP_EXIT,
- NULL,
- before_execmode_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_PAGE_FAULT_ENTRY,
- FIELD_ARRAY(LTT_FIELD_TRAP_ID),
- before_execmode_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_PAGE_FAULT_EXIT,
- NULL,
- before_execmode_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_PAGE_FAULT_NOSEM_ENTRY,
- FIELD_ARRAY(LTT_FIELD_TRAP_ID),
- before_execmode_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_PAGE_FAULT_NOSEM_EXIT,
- NULL,
- before_execmode_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_IRQ_ENTRY,
- FIELD_ARRAY(LTT_FIELD_IRQ_ID),
- before_execmode_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_IRQ_EXIT,
- NULL,
- before_execmode_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_SOFT_IRQ_ENTRY,
- FIELD_ARRAY(LTT_FIELD_SOFT_IRQ_ID),
- before_execmode_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_SOFT_IRQ_EXIT,
- NULL,
- before_execmode_hook,
- events_request,
- &hooks);
-
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_SCHED_SCHEDULE,
- FIELD_ARRAY(LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE),
- before_schedchange_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_PROCESS_EXIT,
- FIELD_ARRAY(LTT_FIELD_PID),
- before_process_exit_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_PROCESS_FREE,
- FIELD_ARRAY(LTT_FIELD_PID),
- before_process_release_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_GLOBAL_STATE,
- LTT_EVENT_STATEDUMP_END,
- NULL,
- before_statedump_end,
- events_request,
- &hooks);
-
- /* After hooks */
- first_after = hooks->len;
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_SCHED_SCHEDULE,
- FIELD_ARRAY(LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE),
- after_schedchange_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_PROCESS_FORK,
- FIELD_ARRAY(LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID),
- after_process_fork_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_KERNEL,
- LTT_EVENT_PROCESS_EXIT,
- FIELD_ARRAY(LTT_FIELD_PID),
- after_process_exit_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_FS,
- LTT_EVENT_EXEC,
- NULL,
- after_fs_exec_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_USERSPACE,
- LTT_EVENT_THREAD_BRAND,
- FIELD_ARRAY(LTT_FIELD_NAME),
- after_user_generic_thread_brand_hook,
- events_request,
- &hooks);
-
- lttv_trace_find_hook(ts->parent.t,
- LTT_CHANNEL_TASK_STATE,
- LTT_EVENT_PROCESS_STATE,
- FIELD_ARRAY(LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME),
- after_event_enum_process_hook,
- events_request,
- &hooks);
-
-
- /* Add these hooks to each event_by_id_channel hooks list */
- /* add before */
- for(k = 0 ; k < first_after ; k++) {
- th = &g_array_index(hooks, LttvTraceHook, k);
- lttv_hooks_add(lttv_hooks_by_id_channel_find(event_by_id_channel,
- th->channel, th->id),
- th->h,
- th,
- LTTV_PRIO_STATE-5);
- }
-
- /* add after */
- for(k = first_after ; k < hooks->len ; k++) {
- th = &g_array_index(hooks, LttvTraceHook, k);
- lttv_hooks_add(lttv_hooks_by_id_channel_find(event_by_id_channel,
- th->channel, th->id),
- th->h,
- th,
- LTTV_PRIO_STATE+5);
- }
-
- events_request->hooks = hooks;
-#endif //babel_cleanup