core.xml \
fs.xml \
ipc.xml \
-asm_i386_kernel.xml \
kernel.xml \
+kernel_arch_i386.xml \
memory.xml \
network.xml \
process.xml \
core.xml \
fs.xml \
ipc.xml \
-asm_i386_kernel.xml \
kernel.xml \
+kernel_arch_i386.xml \
memory.xml \
network.xml \
process.xml \
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
char car;
fac->name = NULL;
+ fac->arch = NULL;
while(1) {
token = getToken(in);
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));
+ }
}
}
getFacilityAttributes(in, fac);
if(fac->name == NULL) in->error(in, "Attribute not named");
-
+
fac->capname = allocAndCopy(fac->name);
strupper(fac->capname);
getRAnglebracket(in);
strcat(tmp,suffix);
return tmp;
}
-
-
typedef struct _facility {
char * name;
char * capname;
+ char * arch;
char * description;
sequence_t events;
sequence_t unnamed_types; //FIXME : remove
const gchar *text;
guint textlen;
gint err;
+ gint arch_spec;
+ gint fac_name_len;
text = g_quark_to_string(t->pathname);
textlen = strlen(text);
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);
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;
GQuark
LTT_FACILITY_KERNEL,
- LTT_FACILITY_ASM_I386_KERNEL,
+ LTT_FACILITY_KERNEL_ARCH,
LTT_FACILITY_PROCESS,
LTT_FACILITY_FS;
}
#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;
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);
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");
extern GQuark
LTT_FACILITY_KERNEL,
- LTT_FACILITY_ASM_I386_KERNEL,
+ LTT_FACILITY_KERNEL_ARCH,
LTT_FACILITY_PROCESS,
LTT_FACILITY_FS;
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));
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));
/* 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,
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,