- hooks = g_array_new(FALSE, FALSE, sizeof(LttvTraceHook));
- g_array_set_size(hooks, 8);
-
- lttv_trace_find_hook(ts->parent.parent.t, "core","syscall_entry",
- "syscall_id", NULL, NULL, after_syscall_entry,
- &g_array_index(hooks, LttvTraceHook, 0));
-
- lttv_trace_find_hook(ts->parent.parent.t, "core", "syscall_exit", NULL,
- NULL, NULL, after_syscall_exit,
- &g_array_index(hooks, LttvTraceHook, 1));
-
- lttv_trace_find_hook(ts->parent.parent.t, "core", "trap_entry", "trap_id",
- NULL, NULL, after_trap_entry, &g_array_index(hooks, LttvTraceHook, 2));
-
- lttv_trace_find_hook(ts->parent.parent.t, "core", "trap_exit", NULL, NULL,
- NULL, after_trap_exit, &g_array_index(hooks, LttvTraceHook, 3));
-
- lttv_trace_find_hook(ts->parent.parent.t, "core", "irq_entry", "irq_id",
- NULL, NULL, after_irq_entry, &g_array_index(hooks, LttvTraceHook, 4));
-
- lttv_trace_find_hook(ts->parent.parent.t, "core", "irq_exit", NULL, NULL,
- NULL, after_irq_exit, &g_array_index(hooks, LttvTraceHook, 5));
-
- lttv_trace_find_hook(ts->parent.parent.t, "core", "process_fork",
- "child_pid", NULL, NULL, process_fork,
- &g_array_index(hooks, LttvTraceHook, 6));
-
- lttv_trace_find_hook(ts->parent.parent.t, "core", "process_exit", NULL,
- NULL, NULL, process_exit, &g_array_index(hooks, LttvTraceHook, 7));
+ hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 16);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
+ LTT_EVENT_SYSCALL_ENTRY,
+ FIELD_ARRAY(LTT_FIELD_SYSCALL_ID),
+ after_syscall_entry, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
+ LTT_EVENT_SYSCALL_EXIT,
+ NULL,
+ after_syscall_exit, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
+ LTT_EVENT_TRAP_ENTRY,
+ FIELD_ARRAY(LTT_FIELD_TRAP_ID),
+ after_trap_entry, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
+ LTT_EVENT_TRAP_EXIT,
+ NULL,
+ after_trap_exit, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL,
+ LTT_EVENT_IRQ_ENTRY,
+ FIELD_ARRAY(LTT_FIELD_IRQ_ID),
+ after_irq_entry, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL,
+ LTT_EVENT_IRQ_EXIT,
+ NULL,
+ after_irq_exit, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL,
+ LTT_EVENT_SOFT_IRQ_ENTRY,
+ FIELD_ARRAY(LTT_FIELD_SOFT_IRQ_ID),
+ after_soft_irq_entry, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL,
+ LTT_EVENT_SOFT_IRQ_EXIT,
+ NULL,
+ after_soft_irq_exit, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL,
+ LTT_EVENT_SCHED_SCHEDULE,
+ FIELD_ARRAY(LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE),
+ after_schedchange, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL,
+ LTT_EVENT_PROCESS_FORK,
+ FIELD_ARRAY(LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID),
+ process_fork, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL,
+ LTT_EVENT_PROCESS_EXIT,
+ FIELD_ARRAY(LTT_FIELD_PID),
+ process_exit, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL,
+ LTT_EVENT_PROCESS_FREE,
+ FIELD_ARRAY(LTT_FIELD_PID),
+ process_free, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_USER_GENERIC,
+ LTT_EVENT_FUNCTION_ENTRY,
+ FIELD_ARRAY(LTT_FIELD_THIS_FN, LTT_FIELD_CALL_SITE),
+ after_function_entry, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_USER_GENERIC,
+ LTT_EVENT_FUNCTION_EXIT,
+ FIELD_ARRAY(LTT_FIELD_THIS_FN, LTT_FIELD_CALL_SITE),
+ after_function_exit, NULL,
+ &hooks);
+
+ /* statedump-related hooks */
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_LIST,
+ LTT_EVENT_PROCESS_STATE,
+ FIELD_ARRAY(LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME),
+ after_enum_process_state, NULL,
+ &hooks);
+
+ lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_LIST,
+ LTT_EVENT_STATEDUMP_END,
+ NULL,
+ after_statedump_end, NULL,
+ &hooks);