From: compudj Date: Sun, 18 Dec 2005 06:49:50 +0000 (+0000) Subject: fine tune per architecture facilities X-Git-Tag: v0.12.20~2050 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f5d7967f8c41e4f380d3ea7c4304e68ab5bad8ec;p=lttv.git fine tune per architecture facilities git-svn-id: http://ltt.polymtl.ca/svn@1439 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/facilities/Makefile.am b/ltt/branches/poly/facilities/Makefile.am index 36521458..3a878f1d 100644 --- a/ltt/branches/poly/facilities/Makefile.am +++ b/ltt/branches/poly/facilities/Makefile.am @@ -3,8 +3,8 @@ EXTRA_DIST = \ core.xml \ fs.xml \ ipc.xml \ -asm_i386_kernel.xml \ kernel.xml \ +kernel_arch_i386.xml \ memory.xml \ network.xml \ process.xml \ @@ -16,8 +16,8 @@ facilities_DATA = \ core.xml \ fs.xml \ ipc.xml \ -asm_i386_kernel.xml \ kernel.xml \ +kernel_arch_i386.xml \ memory.xml \ network.xml \ process.xml \ diff --git a/ltt/branches/poly/ltt/ltt.h b/ltt/branches/poly/ltt/ltt.h index e0c7a731..ad1d42e9 100644 --- a/ltt/branches/poly/ltt/ltt.h +++ b/ltt/branches/poly/ltt/ltt.h @@ -155,5 +155,21 @@ typedef enum _LttTypeEnum LTT_UNION, LTT_NONE } LttTypeEnum; - + + +/* Architecture types */ +#define LTT_ARCH_TYPE_I386 1 +#define LTT_ARCH_TYPE_PPC 2 +#define LTT_ARCH_TYPE_SH 3 +#define LTT_ARCH_TYPE_S390 4 +#define LTT_ARCH_TYPE_MIPS 5 +#define LTT_ARCH_TYPE_ARM 6 +#define LTT_ARCH_TYPE_PPC64 7 +#define LTT_ARCH_TYPE_X86_64 8 + +/* Standard definitions for variants */ +#define LTT_ARCH_VARIANT_NONE 0 /* Main architecture implementation */ + + + #endif // LTT_H diff --git a/ltt/branches/poly/ltt/parser.c b/ltt/branches/poly/ltt/parser.c index b8f2a6a2..6dbf402d 100644 --- a/ltt/branches/poly/ltt/parser.c +++ b/ltt/branches/poly/ltt/parser.c @@ -267,6 +267,7 @@ void getFacilityAttributes(parse_file_t *in, facility_t *fac) char car; fac->name = NULL; + fac->arch = NULL; while(1) { token = getToken(in); @@ -281,7 +282,12 @@ void getFacilityAttributes(parse_file_t *in, facility_t *fac) if(car == EOF) in->error(in,"name was expected"); else if(car == '\"') fac->name = allocAndCopy(getQuotedString(in)); else fac->name = allocAndCopy(getName(in)); - } + } else if(!strcmp("arch", token)) { + getEqual(in); + car = seekNextChar(in); + if(car == '\"') fac->name = allocAndCopy(getQuotedString(in)); + else fac->arch = allocAndCopy(getName(in)); + } } } @@ -420,7 +426,7 @@ void parseFacility(parse_file_t *in, facility_t * fac) getFacilityAttributes(in, fac); if(fac->name == NULL) in->error(in, "Attribute not named"); - + fac->capname = allocAndCopy(fac->name); strupper(fac->capname); getRAnglebracket(in); @@ -1551,5 +1557,3 @@ char *appendString(char *s, char *suffix) strcat(tmp,suffix); return tmp; } - - diff --git a/ltt/branches/poly/ltt/parser.h b/ltt/branches/poly/ltt/parser.h index 21884fb6..4215f286 100644 --- a/ltt/branches/poly/ltt/parser.h +++ b/ltt/branches/poly/ltt/parser.h @@ -137,6 +137,7 @@ typedef struct _event { typedef struct _facility { char * name; char * capname; + char * arch; char * description; sequence_t events; sequence_t unnamed_types; //FIXME : remove diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index 5fbf53cb..e7e213dc 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -858,6 +858,8 @@ static int ltt_get_facility_description(LttFacility *f, const gchar *text; guint textlen; gint err; + gint arch_spec; + gint fac_name_len; text = g_quark_to_string(t->pathname); textlen = strlen(text); @@ -871,9 +873,21 @@ static int ltt_get_facility_description(LttFacility *f, strcat(desc_file_name, text); text = g_quark_to_string(f->name); - textlen+=strlen(text); + fac_name_len = strlen(text); + textlen+=fac_name_len; if(textlen >= PATH_MAX) goto name_error; strcat(desc_file_name, text); + + /* arch specific facilities are named like this : name_arch */ + if(fac_name_len+1 < sizeof("_arch")) + arch_spec = 0; + else { + if(!strcmp(&text[fac_name_len+1-sizeof("_arch")], "_arch")) + arch_spec = 1; + else + arch_spec = 0; + } + #if 0 text = "_"; textlen+=strlen(text); @@ -887,6 +901,39 @@ static int ltt_get_facility_description(LttFacility *f, textlen=strlen(desc_file_name); #endif //0 + + if(arch_spec) { + switch(t->arch_type) { + case LTT_ARCH_TYPE_I386: + text = "_i386"; + break; + case LTT_ARCH_TYPE_PPC: + text = "_ppc"; + break; + case LTT_ARCH_TYPE_SH: + text = "_sh"; + break; + case LTT_ARCH_TYPE_S390: + text = "_s390"; + break; + case LTT_ARCH_TYPE_MIPS: + text = "_mips"; + break; + case LTT_ARCH_TYPE_ARM: + text = "_arm"; + case LTT_ARCH_TYPE_PPC64: + text = "_ppc64"; + case LTT_ARCH_TYPE_X86_64: + text = "_x86_64"; + break; + default: + g_error("Trace from unsupported architecture."); + } + textlen+=strlen(text); + if(textlen >= PATH_MAX) goto name_error; + strcat(desc_file_name, text); + } + text = ".xml"; textlen+=strlen(text); if(textlen >= PATH_MAX) goto name_error; diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index d3879f76..18d21fde 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -35,7 +35,7 @@ GQuark LTT_FACILITY_KERNEL, - LTT_FACILITY_ASM_I386_KERNEL, + LTT_FACILITY_KERNEL_ARCH, LTT_FACILITY_PROCESS, LTT_FACILITY_FS; @@ -769,7 +769,7 @@ create_name_tables(LttvTraceState *tcs) } #endif //0 if(lttv_trace_find_hook(tcs->parent.t, - LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_ENTRY, + LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY, LTT_FIELD_SYSCALL_ID, 0, 0, NULL, NULL, &h)) return; @@ -1435,13 +1435,13 @@ void lttv_state_add_event_hooks(LttvTracesetState *self) hooks = g_array_set_size(hooks, 11); ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_ENTRY, + LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY, LTT_FIELD_SYSCALL_ID, 0, 0, syscall_entry, NULL, &g_array_index(hooks, LttvTraceHook, 0)); g_assert(!ret); ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_EXIT, + LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_EXIT, 0, 0, 0, syscall_exit, NULL, &g_array_index(hooks, LttvTraceHook, 1)); g_assert(!ret); @@ -2153,7 +2153,7 @@ static void module_init() LTT_FACILITY_KERNEL = g_quark_from_string("kernel"); - LTT_FACILITY_ASM_I386_KERNEL = g_quark_from_string("asm_i386_kernel"); + LTT_FACILITY_KERNEL_ARCH = g_quark_from_string("kernel_arch"); LTT_FACILITY_PROCESS = g_quark_from_string("process"); LTT_FACILITY_FS = g_quark_from_string("fs"); diff --git a/ltt/branches/poly/lttv/lttv/state.h b/ltt/branches/poly/lttv/lttv/state.h index c6a373ab..de8d36b8 100644 --- a/ltt/branches/poly/lttv/lttv/state.h +++ b/ltt/branches/poly/lttv/lttv/state.h @@ -57,7 +57,7 @@ extern GQuark LTT_FACILITY_KERNEL, - LTT_FACILITY_ASM_I386_KERNEL, + LTT_FACILITY_KERNEL_ARCH, LTT_FACILITY_PROCESS, LTT_FACILITY_FS; diff --git a/ltt/branches/poly/lttv/lttv/stats.c b/ltt/branches/poly/lttv/lttv/stats.c index d4321bce..23a9cca8 100644 --- a/ltt/branches/poly/lttv/lttv/stats.c +++ b/ltt/branches/poly/lttv/lttv/stats.c @@ -808,14 +808,14 @@ void lttv_stats_add_event_hooks(LttvTracesetStats *self) g_array_set_size(hooks, 7); ret = lttv_trace_find_hook(ts->parent.parent.t, - LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_ENTRY, + LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY, LTT_FIELD_SYSCALL_ID, 0, 0, before_syscall_entry, NULL, &g_array_index(hooks, LttvTraceHook, 0)); g_assert(!ret); ret = lttv_trace_find_hook(ts->parent.parent.t, - LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_EXIT, + LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_EXIT, 0, 0, 0, before_syscall_exit, NULL, &g_array_index(hooks, LttvTraceHook, 1)); @@ -862,14 +862,14 @@ void lttv_stats_add_event_hooks(LttvTracesetStats *self) g_array_set_size(hooks, 9); ret = lttv_trace_find_hook(ts->parent.parent.t, - LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_ENTRY, + LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY, LTT_FIELD_SYSCALL_ID, 0, 0, after_syscall_entry, NULL, &g_array_index(hooks, LttvTraceHook, 0)); g_assert(!ret); ret = lttv_trace_find_hook(ts->parent.parent.t, - LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_EXIT, + LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_EXIT, 0, 0, 0, after_syscall_exit, NULL, &g_array_index(hooks, LttvTraceHook, 1)); diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c index b22931d6..b461e8a4 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c @@ -224,7 +224,7 @@ void drawing_data_request(Drawing_t *drawing, /* before hooks */ ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_ENTRY, + LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY, LTT_FIELD_SYSCALL_ID, 0, 0, before_execmode_hook, events_request, @@ -232,7 +232,7 @@ void drawing_data_request(Drawing_t *drawing, g_assert(!ret); ret = lttv_trace_find_hook(ts->parent.t, - LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_EXIT, + LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_EXIT, 0, 0, 0, before_execmode_hook, events_request,