From 4858a3ed6e270481195fedffbd94225292a61224 Mon Sep 17 00:00:00 2001 From: compudj Date: Thu, 29 Jan 2009 09:44:05 +0000 Subject: [PATCH] kprobe names half done git-svn-id: http://ltt.polymtl.ca/svn@3299 04897980-b3bd-0310-b5e0-8ef037075253 --- trunk/lttv/lttv/lttv/print.c | 32 +++++++++++++++++++------------- trunk/lttv/lttv/lttv/state.c | 8 ++++++-- trunk/lttv/lttv/lttv/state.h | 6 ++++-- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/trunk/lttv/lttv/lttv/print.c b/trunk/lttv/lttv/lttv/print.c index 79023acf..95c09ead 100644 --- a/trunk/lttv/lttv/lttv/print.c +++ b/trunk/lttv/lttv/lttv/print.c @@ -51,20 +51,26 @@ static inline void print_enum_events(LttEvent *e, struct marker_field *f, struct marker_info *info = marker_get_info_from_id(tf->mdata, e->event_id); LttvTraceState *ts = (LttvTraceState*)(tfs->parent.t_context); - if (tf->name == LTT_CHANNEL_KERNEL && - info->name == LTT_EVENT_SYSCALL_ENTRY && - f->name == LTT_FIELD_SYSCALL_ID) { - g_string_append_printf(s, " [%s]", - g_quark_to_string(ts->syscall_names[value])); - } else if ((tf->name == LTT_CHANNEL_KERNEL && - (info->name == LTT_EVENT_SOFT_IRQ_ENTRY - || info->name == LTT_EVENT_SOFT_IRQ_EXIT - || info->name == LTT_EVENT_SOFT_IRQ_RAISE)) && - f->name == LTT_FIELD_SOFT_IRQ_ID) { - g_string_append_printf(s, " [%s]", - g_quark_to_string(ts->soft_irq_names[value])); + if (tf->name == LTT_CHANNEL_KERNEL) { + if (info->name == LTT_EVENT_SYSCALL_ENTRY + && f->name == LTT_FIELD_SYSCALL_ID) { + g_string_append_printf(s, " [%s]", + g_quark_to_string(ts->syscall_names[value])); + } else if ((info->name == LTT_EVENT_SOFT_IRQ_ENTRY + || info->name == LTT_EVENT_SOFT_IRQ_EXIT + || info->name == LTT_EVENT_SOFT_IRQ_RAISE) + && f->name == LTT_FIELD_SOFT_IRQ_ID) { + g_string_append_printf(s, " [%s]", + g_quark_to_string(ts->soft_irq_names[value])); + } +/* TODO : implement hash table. + else if (info->name == LTT_EVENT_KPROBE + && f->name = LTT_FIELD_IP) { + g_string_append_printf(s, " [%s]", + g_quark_to_string(ts->kprobe_symbols[value])); + } +*/ } - } void lttv_print_field(LttEvent *e, struct marker_field *f, GString *s, diff --git a/trunk/lttv/lttv/lttv/state.c b/trunk/lttv/lttv/lttv/state.c index 8f975507..3574868a 100644 --- a/trunk/lttv/lttv/lttv/state.c +++ b/trunk/lttv/lttv/lttv/state.c @@ -96,7 +96,8 @@ GQuark LTT_EVENT_REQUEST_COMPLETE, LTT_EVENT_LIST_INTERRUPT, LTT_EVENT_SYS_CALL_TABLE, - LTT_EVENT_SOFTIRQ_VEC; + LTT_EVENT_SOFTIRQ_VEC, + LTT_EVENT_KPROBE_TABLE; /* Fields Quarks */ @@ -127,7 +128,8 @@ GQuark LTT_FIELD_ACTION, LTT_FIELD_ID, LTT_FIELD_ADDRESS, - LTT_FIELD_SYMBOL; + LTT_FIELD_SYMBOL, + LTT_FIELD_IP; LttvExecutionMode LTTV_STATE_MODE_UNKNOWN, @@ -4283,6 +4285,7 @@ static void module_init() LTT_EVENT_LIST_INTERRUPT = g_quark_from_string("interrupt"); LTT_EVENT_SYS_CALL_TABLE = g_quark_from_string("sys_call_table"); LTT_EVENT_SOFTIRQ_VEC = g_quark_from_string("softirq_vec"); + LTT_EVENT_KPROBE_TABLE = g_quark_from_string("kprobe_table"); LTT_FIELD_SYSCALL_ID = g_quark_from_string("syscall_id"); LTT_FIELD_TRAP_ID = g_quark_from_string("trap_id"); @@ -4311,6 +4314,7 @@ static void module_init() LTT_FIELD_ID = g_quark_from_string("id"); LTT_FIELD_ADDRESS = g_quark_from_string("address"); LTT_FIELD_SYMBOL = g_quark_from_string("symbol"); + LTT_FIELD_IP = g_quark_from_string("ip"); LTTV_CPU_UNKNOWN = g_quark_from_string("unknown"); LTTV_CPU_IDLE = g_quark_from_string("idle"); diff --git a/trunk/lttv/lttv/lttv/state.h b/trunk/lttv/lttv/lttv/state.h index 8c5fc040..9f4fdd06 100644 --- a/trunk/lttv/lttv/lttv/state.h +++ b/trunk/lttv/lttv/lttv/state.h @@ -103,7 +103,8 @@ extern GQuark LTT_EVENT_REQUEST_COMPLETE, LTT_EVENT_LIST_INTERRUPT, LTT_EVENT_SYS_CALL_TABLE, - LTT_EVENT_SOFTIRQ_VEC; + LTT_EVENT_SOFTIRQ_VEC, + LTT_EVENT_KPROBE_TABLE; /* Fields Quarks */ @@ -133,7 +134,8 @@ extern GQuark LTT_FIELD_ACTION, LTT_FIELD_ID, LTT_FIELD_ADDRESS, - LTT_FIELD_SYMBOL; + LTT_FIELD_SYMBOL, + LTT_FIELD_IP; typedef struct _LttvTracesetState LttvTracesetState; typedef struct _LttvTracesetStateClass LttvTracesetStateClass; -- 2.34.1