From: compudj Date: Sat, 17 Dec 2005 23:52:24 +0000 (+0000) Subject: use enums arch specific for syscall names X-Git-Tag: v0.12.20~2060 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d3cd9e86e2c959b5cf35ff4c47a70822f78cb36e;p=lttv.git use enums arch specific for syscall names git-svn-id: http://ltt.polymtl.ca/svn@1429 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/ltt/type.c b/ltt/branches/poly/ltt/type.c index 0961eb14..97a9593a 100644 --- a/ltt/branches/poly/ltt/type.c +++ b/ltt/branches/poly/ltt/type.c @@ -213,23 +213,22 @@ LttType *ltt_type_element_type(LttType *t) /***************************************************************************** *Function name - * ltt_type_element_number : obtain the number of elements for arrays + * ltt_type_element_number : obtain the number of elements for enums *Input params - * t : a type + * t : a type *Return value * unsigned : the number of elements for arrays ****************************************************************************/ -#if 0 unsigned ltt_type_element_number(LttType *t) { unsigned ret = 0; - if(likely(t->type_class == LTT_ARRAY)) - ret = t->element_number; + if(likely(t->type_class == LTT_ENUM)) + ret = g_hash_table_size(t->enum_map); return ret; } -#endif //0 + /***************************************************************************** *Function name * ltt_type_member_number : obtain the number of data members for structure diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index 0721f7c9..d3879f76 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -777,24 +777,21 @@ create_name_tables(LttvTraceState *tcs) thf = lttv_trace_hook_get_first(&h); t = ltt_field_type(thf->f1); - //nb = ltt_type_element_number(t); + nb = ltt_type_element_number(t); lttv_trace_hook_destroy(&h); - /* CHECK syscalls should be an enum but currently are not! name_tables->syscall_names = g_new(GQuark, nb); for(i = 0 ; i < nb ; i++) { - name_tables->syscall_names[i] = g_quark_from_string( - ltt_enum_string_get(t, i)); + name_tables->syscall_names[i] = ltt_enum_string_get(t, i); } - */ - name_tables->syscall_names = g_new(GQuark, 256); - for(i = 0 ; i < 256 ; i++) { - g_string_printf(fe_name, "syscall %d", i); - name_tables->syscall_names[i] = g_quark_from_string(fe_name->str); - } + //name_tables->syscall_names = g_new(GQuark, 256); + //for(i = 0 ; i < 256 ; i++) { + // g_string_printf(fe_name, "syscall %d", i); + // name_tables->syscall_names[i] = g_quark_from_string(fe_name->str); + //} if(lttv_trace_find_hook(tcs->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_TRAP_ENTRY,