hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 1);
if(!lttv_trace_find_hook(tcs->parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
LTT_EVENT_SYSCALL_ENTRY,
FIELD_ARRAY(LTT_FIELD_SYSCALL_ID),
NULL, NULL, &hooks)) {
lttv_trace_hook_remove_all(&hooks);
if(!lttv_trace_find_hook(tcs->parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
LTT_EVENT_TRAP_ENTRY,
FIELD_ARRAY(LTT_FIELD_TRAP_ID),
NULL, NULL, &hooks)) {
lttv_trace_hook_remove_all(&hooks);
if(!lttv_trace_find_hook(tcs->parent.t,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_IRQ_ID),
NULL, NULL, &hooks)) {
//hn = 0;
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
LTT_EVENT_SYSCALL_ENTRY,
FIELD_ARRAY(LTT_FIELD_SYSCALL_ID),
syscall_entry, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
LTT_EVENT_SYSCALL_EXIT,
NULL,
syscall_exit, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
LTT_EVENT_TRAP_ENTRY,
FIELD_ARRAY(LTT_FIELD_TRAP_ID),
trap_entry, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
LTT_EVENT_TRAP_EXIT,
NULL,
trap_exit, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_IRQ_ID),
irq_entry, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_IRQ_EXIT,
NULL,
irq_exit, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_SOFT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_SOFT_IRQ_ID),
soft_irq_entry, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_SOFT_IRQ_EXIT,
NULL,
soft_irq_exit, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_SCHED_SCHEDULE,
FIELD_ARRAY(LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID,
LTT_FIELD_PREV_STATE),
schedchange, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_PROCESS_FORK,
FIELD_ARRAY(LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID,
LTT_FIELD_CHILD_TGID),
process_fork, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
LTT_EVENT_KTHREAD_CREATE,
FIELD_ARRAY(LTT_FIELD_PID),
process_kernel_thread, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_PROCESS_EXIT,
FIELD_ARRAY(LTT_FIELD_PID),
process_exit, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_PROCESS_FREE,
FIELD_ARRAY(LTT_FIELD_PID),
process_free, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_EXEC,
FIELD_ARRAY(LTT_FIELD_FILENAME),
process_exec, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_USER_GENERIC,
LTT_EVENT_THREAD_BRAND,
FIELD_ARRAY(LTT_FIELD_NAME),
thread_brand, NULL, &hooks);
/* statedump-related hooks */
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_LIST,
LTT_EVENT_PROCESS_STATE,
FIELD_ARRAY(LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME,
LTT_FIELD_TYPE, LTT_FIELD_MODE, LTT_FIELD_SUBMODE,
enum_process_state, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_LIST,
LTT_EVENT_STATEDUMP_END,
NULL,
statedump_end, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_LIST,
LTT_EVENT_LIST_INTERRUPT,
FIELD_ARRAY(LTT_FIELD_ACTION, LTT_FIELD_NUM),
enum_interrupt, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_BLOCK,
LTT_EVENT_REQUEST_ISSUE,
FIELD_ARRAY(LTT_FIELD_MAJOR, LTT_FIELD_MINOR, LTT_FIELD_OPERATION),
bdev_request_issue, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_BLOCK,
LTT_EVENT_REQUEST_COMPLETE,
FIELD_ARRAY(LTT_FIELD_MAJOR, LTT_FIELD_MINOR, LTT_FIELD_OPERATION),
bdev_request_complete, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_USER_GENERIC,
LTT_EVENT_FUNCTION_ENTRY,
FIELD_ARRAY(LTT_FIELD_THIS_FN, LTT_FIELD_CALL_SITE),
function_entry, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_USER_GENERIC,
LTT_EVENT_FUNCTION_EXIT,
FIELD_ARRAY(LTT_FIELD_THIS_FN, LTT_FIELD_CALL_SITE),
function_exit, NULL, &hooks);
hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 12);
lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
LTT_EVENT_SYSCALL_ENTRY,
FIELD_ARRAY(LTT_FIELD_SYSCALL_ID),
before_syscall_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
LTT_EVENT_SYSCALL_EXIT,
NULL,
before_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),
before_trap_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL_ARCH,
LTT_EVENT_TRAP_EXIT,
NULL,
before_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),
before_irq_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_IRQ_EXIT,
NULL,
before_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),
before_soft_irq_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_SOFT_IRQ_EXIT,
NULL,
before_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),
before_schedchange, 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),
before_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),
before_function_exit, NULL,
/* 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),
before_enum_process_state, NULL,
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,
/* 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,
return marker_get_info_from_id(t, th->id);
}
+static inline GQuark lttv_merge_facility_event_name(GQuark fac, GQuark ev)
+{
+ char *tmp;
+ const char *sfac, *sev;
+ GQuark ret;
+
+ sfac = g_quark_to_string(fac);
+ sev = g_quark_to_string(ev);
+ tmp = g_new(char, strlen(sfac) + strlen(sev) + 3); /* 3: _ \0 \0 */
+ strcpy(tmp, sfac);
+ strcat(tmp, "_");
+ strcat(tmp, sev);
+ ret = g_quark_from_string(tmp);
+ g_free(tmp);
+ return ret;
+}
-int lttv_trace_find_hook(LttTrace *t, GQuark marker_name,
+int lttv_trace_find_hook(LttTrace *t, GQuark facility_name, GQuark event_name,
GQuark fields[], LttvHook h, gpointer hook_data, GArray **trace_hooks)
{
struct marker_info *info;
guint16 marker_id;
int init_array_size;
+ GQuark marker_name;
+
+ marker_name = lttv_merge_facility_event_name(facility_name, event_name);
info = marker_get_info_from_name(t, marker_name);
if(unlikely(info == NULL)) {
Adds the hooks to the trace_hooks array.
*/
-int lttv_trace_find_hook(LttTrace *t, GQuark marker_name,
+int lttv_trace_find_hook(LttTrace *t, GQuark facility_name, GQuark event_name,
GQuark fields[], LttvHook h, gpointer hook_data, GArray **trace_hooks);
static inline struct marker_field *