+ lttv_trace_find_hook(tcs->parent.t, "core", "syscall_entry",
+ "syscall_id", NULL, NULL, NULL, &h);
+ t = ltt_field_type(h.f1);
+ nb = ltt_type_element_number(t);
+
+ /* CHECK syscalls should be an emun but currently are not!
+ tcs->syscall_names = g_new(GQuark, nb);
+
+ for(i = 0 ; i < nb ; i++) {
+ tcs->syscall_names[i] = g_quark_from_string(ltt_enum_string_get(t, i));
+ }
+ */
+
+ tcs->syscall_names = g_new(GQuark, 256);
+ for(i = 0 ; i < 256 ; i++) {
+ g_string_printf(fe_name, "syscall %d", i);
+ tcs->syscall_names[i] = g_quark_from_string(fe_name->str);
+ }
+
+ lttv_trace_find_hook(tcs->parent.t, "core", "trap_entry",
+ "trap_id", NULL, NULL, NULL, &h);
+ t = ltt_field_type(h.f1);
+ nb = ltt_type_element_number(t);
+
+ /*
+ tcs->trap_names = g_new(GQuark, nb);
+ for(i = 0 ; i < nb ; i++) {
+ tcs->trap_names[i] = g_quark_from_string(ltt_enum_string_get(t, i));
+ }
+ */
+
+ tcs->trap_names = g_new(GQuark, 256);
+ for(i = 0 ; i < 256 ; i++) {
+ g_string_printf(fe_name, "trap %d", i);
+ tcs->trap_names[i] = g_quark_from_string(fe_name->str);
+ }
+
+ lttv_trace_find_hook(tcs->parent.t, "core", "irq_entry",
+ "irq_id", NULL, NULL, NULL, &h);
+ t = ltt_field_type(h.f1);
+ nb = ltt_type_element_number(t);
+
+ /*
+ tcs->irq_names = g_new(GQuark, nb);
+ for(i = 0 ; i < nb ; i++) {
+ tcs->irq_names[i] = g_quark_from_string(ltt_enum_string_get(t, i));
+ }
+ */
+
+ tcs->irq_names = g_new(GQuark, 256);
+ for(i = 0 ; i < 256 ; i++) {
+ g_string_printf(fe_name, "irq %d", i);
+ tcs->irq_names[i] = g_quark_from_string(fe_name->str);
+ }
+
+ g_string_free(fe_name, TRUE);
+}
+
+
+static void
+free_name_tables(LttvTraceState *tcs)
+{
+ g_free(tcs->eventtype_names);
+ g_free(tcs->syscall_names);
+ g_free(tcs->trap_names);
+ g_free(tcs->irq_names);
+}