git-svn-id: http://ltt.polymtl.ca/svn@175 04897980-b3bd-0310-b5e0-8ef037075253
authoryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 12 Aug 2003 19:50:49 +0000 (19:50 +0000)
committeryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 12 Aug 2003 19:50:49 +0000 (19:50 +0000)
ltt/branches/poly/lttv/main.c
ltt/branches/poly/lttv/processTrace.c
ltt/branches/poly/lttv/state.c

index ec131915dfd59a37c87fa8a59c3463f91a335c10..5fc5abb6cf4861642ba8af70bd5a9563022ddfe9 100644 (file)
@@ -126,7 +126,7 @@ int main(int argc, char **argv) {
 
 LttvAttribute *lttv_global_attributes()
 {
-  return attributes;
+  return (LttvAttribute*)attributes;
 }
 
 
index f10aec13607c1ac6366b0c901670738ba965550e..8723204c70bc58d1b7afa0f9b6da33acf7558205 100644 (file)
@@ -466,7 +466,8 @@ void lttv_process_trace(LttTime start, LttTime end, LttvTraceset *traceset,
      read one event and insert in the pqueue based on the event time. */
 
   lttv_hooks_call(context->before, context);
-  nbi = ltt_trace_set_number(traceset);
+  nbi = lttv_traceset_number(traceset);
+  //  nbi = ltt_trace_set_number(traceset);
 
   for(i = 0 ; i < nbi ; i++) {
     tc = context->traces[i];
@@ -524,7 +525,7 @@ void lttv_process_trace(LttTime start, LttTime end, LttvTraceset *traceset,
     g_tree_remove(pqueue, &(tfc->timestamp));
 
     if(!lttv_hooks_call(tfc->check_event, context)) {
-      id = lttv_event_id(tfc->e);
+      id = ltt_event_eventtype_id(tfc->e);
       lttv_hooks_call(tfc->before_event, tfc);
       lttv_hooks_call(lttv_hooks_by_id_get(tfc->before_event_by_id, id), tfc);
       lttv_hooks_call(tfc->after_event, context);
index 2a9164caeb6da7ae0c311c788f952a364c397164..794a94f66d4d5a6a100f21b31b061d78359496d1 100644 (file)
@@ -319,6 +319,8 @@ LttvProcessState *create_process(LttvTracefileState *tfs,
   intr->entry = tfc->timestamp;
   intr->last_change = tfc->timestamp;
   intr->s = LTTV_STATE_WAIT_FORK;
+
+  return process;
 }
 
 
@@ -561,36 +563,54 @@ lttv_state_add_event_hooks(LttvTracesetState *self)
        associated by id hooks. */
 
     hooks = g_array_new(FALSE, FALSE, sizeof(struct HookId));
-    g_array_add(hooks, find_hook(ts->parent.t, "core","syscall_entry", 
-        "syscall_id", NULL, NULL, syscall_entry));
-    g_array_add(hooks, find_hook(ts->parent.t, "core", "syscall_exit", 
-        NULL, NULL, NULL, syscall_exit));
-    g_array_add(hooks, find_hook(ts->parent.t, "core", "trap_entry", "trap_id",
-        NULL, NULL, trap_entry));
-    g_array_add(hooks, find_hook(ts->parent.t, "core", "trap_exit", NULL, NULL,
-        NULL, trap_exit));
-    g_array_add(hooks, find_hook(ts->parent.t, "core", "irq_entry", "irq_id",
-        NULL, NULL, irq_entry));
-    g_array_add(hooks, find_hook(ts->parent.t, "core", "irq_exit", NULL, NULL,
-        NULL, irq_exit));
-    g_array_add(hooks, find_hook(ts->parent.t, "core", "schedchange", 
-        "in", "out", "out_state", schedchange));
-    g_array_add(hooks, find_hook(ts->parent.t, "core", "process_fork", 
-        "child_pid", NULL, NULL, process_fork));
-    g_array_add(hooks, find_hook(ts->parent.t, "core", "process_exit", 
-        NULL, NULL, NULL, process_exit));
+    hook_id = find_hook(ts->parent.t, "core","syscall_entry","syscall_id", 
+                       NULL, NULL, syscall_entry);
+    g_array_append_val(hooks, hook_id);
+
+    hook_id = find_hook(ts->parent.t, "core", "syscall_exit", 
+                       NULL, NULL, NULL, syscall_exit);
+    g_array_append_val(hooks, hook_id);
+
+    hook_id = find_hook(ts->parent.t, "core", "trap_entry", "trap_id",
+                       NULL, NULL, trap_entry);
+    g_array_append_val(hooks, hook_id);
+
+    hook_id = find_hook(ts->parent.t, "core", "trap_exit", NULL, NULL,
+                       NULL, trap_exit);
+    g_array_append_val(hooks, hook_id);
+
+    hook_id = find_hook(ts->parent.t, "core", "irq_entry", "irq_id",
+                       NULL, NULL, irq_entry);
+    g_array_append_val(hooks, hook_id);
+
+    hook_id = find_hook(ts->parent.t, "core", "irq_exit", NULL, NULL,
+                       NULL, irq_exit);
+    g_array_append_val(hooks, hook_id);
+
+    hook_id = find_hook(ts->parent.t, "core", "schedchange", 
+                       "in", "out", "out_state", schedchange);
+    g_array_append_val(hooks, hook_id);
+
+    hook_id = find_hook(ts->parent.t, "core", "process_fork", 
+                       "child_pid", NULL, NULL, process_fork);
+    g_array_append_val(hooks, hook_id);
+
+    hook_id = find_hook(ts->parent.t, "core", "process_exit", 
+                       NULL, NULL, NULL, process_exit);
+    g_array_append_val(hooks, hook_id);
+
 
     /* Add these hooks to each before_event_by_id hooks list */
 
     nb_control = ltt_trace_control_tracefile_number(ts->parent.t);
-    nb_per_cpu = ltt_trace_control_tracefile_number(ts->parent.t);
+    nb_per_cpu = ltt_trace_per_cpu_tracefile_number(ts->parent.t);
     nb_tracefile = nb_control + nb_per_cpu;
     for(j = 0 ; j < nb_tracefile ; j++) {
       if(j < nb_control) {
         tfs = LTTV_TRACEFILE_STATE(ts->parent.control_tracefiles[j]);
       }
       else {
-        tfs = LTTV_TRACEFILE_STATE(ts->parent.per_cpu_tracefiles[j]);
+        tfs = LTTV_TRACEFILE_STATE(ts->parent.per_cpu_tracefiles[j-nb_control]);
       }
 
       for(k = 0 ; k < hooks->len ; k++) {
@@ -632,14 +652,14 @@ lttv_state_remove_event_hooks(LttvTracesetState *self)
     /* Add these hooks to each before_event_by_id hooks list */
 
     nb_control = ltt_trace_control_tracefile_number(ts->parent.t);
-    nb_per_cpu = ltt_trace_control_tracefile_number(ts->parent.t);
+    nb_per_cpu = ltt_trace_per_cpu_tracefile_number(ts->parent.t);
     nb_tracefile = nb_control + nb_per_cpu;
     for(j = 0 ; j < nb_tracefile ; j++) {
       if(j < nb_control) {
         tfs = LTTV_TRACEFILE_STATE(ts->parent.control_tracefiles[j]);
       }
       else {
-        tfs = LTTV_TRACEFILE_STATE(ts->parent.per_cpu_tracefiles[j]);
+        tfs = LTTV_TRACEFILE_STATE(ts->parent.per_cpu_tracefiles[j-nb_control]);
       }
 
       for(k = 0 ; k < hooks->len ; k++) {
@@ -647,12 +667,12 @@ lttv_state_remove_event_hooks(LttvTracesetState *self)
         lttv_hooks_remove_data(
             lttv_hooks_by_id_find(tfs->parent.before_event_by_id, 
            hook_id.id), hook_id.h, hook_id.hook_data);
-
-      }
-      for(k = 0 ; k < hooks->len ; k++) {
-        hook_id = g_array_index(hooks, struct HookId, k);
         if(hook_id.free_hook_data) g_free(hook_id.hook_data);
       }
+      //      for(k = 0 ; k < hooks->len ; k++) {
+      //        hook_id = g_array_index(hooks, struct HookId, k);
+      //        if(hook_id.free_hook_data) g_free(hook_id.hook_data);
+      //      }
     }
     g_array_free(hooks, TRUE);
   }
This page took 0.032119 seconds and 4 git commands to generate.