fix hotplug support
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 17 Jul 2008 21:25:35 +0000 (21:25 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 17 Jul 2008 21:25:35 +0000 (21:25 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2964 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/tracefile.c
ltt/branches/poly/lttv/lttv/state.c
ltt/branches/poly/lttv/lttv/state.h
ltt/branches/poly/lttv/modules/text/textDump.c

index 9cb5c7a6fcc13a6ce8f0a4fa639bb676f3909552..995a907506b4a937efffe2f8a18a792c8de0d982 100644 (file)
@@ -1031,8 +1031,9 @@ LttTrace *ltt_trace_open(const gchar *pathname)
 
   for(i=0; i<group->len; i++) {
     tf = &g_array_index (group, LttTracefile, i);
-    if(ltt_process_facility_tracefile(tf))
-      goto facilities_error;
+    if (tf->cpu_online)
+      if(ltt_process_facility_tracefile(tf))
+        goto facilities_error;
   }
 
   return t;
index 6fb3b2afd2d6450a9b8019e65e2ea5506f1737b8..c2e65a44ebf1cb5bd58a741e6c9dc0f25e6a1341 100644 (file)
@@ -33,6 +33,8 @@
 #include <string.h>
 #include <ltt/ltt-private.h>
 
+guint64 nr_states = 0;
+
 /* Comment :
  * Mathieu Desnoyers
  * usertrace is there only to be able to update the current CPU of the
@@ -2359,6 +2361,8 @@ static int exit_process(LttvTracefileState *tfs, LttvProcessState *process)
   LttvTraceState *ts = LTTV_TRACE_STATE(tfs->parent.t_context);
   LttvProcessState key;
 
+  nr_states++;
+
   /* Wait for both schedule with exit dead and process free to happen.
    * They can happen in any order. */
   if (++(process->free_events) < 2)
@@ -2400,6 +2404,8 @@ static gboolean syscall_entry(void *hook_data, void *call_data)
   struct marker_field *f = lttv_trace_get_hook_field(th, 0);
   LttvExecutionSubmode submode;
 
+  nr_states++;
+
   guint syscall = ltt_event_get_unsigned(e, f);
   expand_syscall_table(ts, syscall);
   submode = ((LttvTraceState *)(s->parent.t_context))->syscall_names[syscall];
@@ -2434,6 +2440,7 @@ static gboolean trap_entry(void *hook_data, void *call_data)
 
   LttvExecutionSubmode submode;
 
+  nr_states++;
   guint64 trap = ltt_event_get_long_unsigned(e, f);
 
   expand_trap_table(ts, trap);
@@ -2479,6 +2486,7 @@ static gboolean irq_entry(void *hook_data, void *call_data)
   LttvTraceHook *th = (LttvTraceHook *)hook_data;
   struct marker_field *f = lttv_trace_get_hook_field(th, 0);
 
+  nr_states++;
   LttvExecutionSubmode submode;
   guint64 irq = ltt_event_get_long_unsigned(e, f);
 
@@ -2576,6 +2584,7 @@ static gboolean soft_irq_entry(void *hook_data, void *call_data)
   expand_soft_irq_table(ts, softirq);
   submode = ((LttvTraceState *)(s->parent.t_context))->soft_irq_names[softirq];
 
+  nr_states++;
   /* Do something with the info about being in user or system mode when int? */
   push_state(s, LTTV_STATE_SOFT_IRQ, submode);
 
@@ -2626,6 +2635,7 @@ static gboolean bdev_request_issue(void *hook_data, void *call_data)
     lttv_trace_get_hook_field(th, 2));
   guint16 devcode = MKDEV(major,minor);
 
+  nr_states++;
   /* have we seen this block device before? */
   gpointer bdev = get_hashed_bdevstate(ts, devcode);
 
@@ -2796,6 +2806,7 @@ static gboolean schedchange(void *hook_data, void *call_data)
   pid_in = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 1));
   state_out = ltt_event_get_long_int(e, lttv_trace_get_hook_field(th, 2));
   
+  nr_states++;
   if(likely(process != NULL)) {
 
     /* We could not know but it was not the idle process executing.
@@ -2885,6 +2896,7 @@ static gboolean process_fork(void *hook_data, void *call_data)
   LttvProcessState *child_process;
   struct marker_field *f;
 
+  nr_states++;
   /* Parent PID */
   parent_pid = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 0));
 
@@ -3060,6 +3072,7 @@ static gboolean process_exec(void *hook_data, void *call_data)
   guint cpu = s->cpu;
   LttvProcessState *process = ts->running_process[cpu];
 
+  nr_states++;
 #if 0//how to use a sequence that must be transformed in a string
   /* PID of the process to release */
   guint64 name_len = ltt_event_field_element_number(e,
index 523e058b2cdd107d851f219ba0850bfb08cddc76..0092f7965b143bdc932eaadc73b8193bd249d1f8 100644 (file)
@@ -53,6 +53,7 @@
 
 #define LTTV_STATE_SAVE_INTERVAL 50000
 
+extern guint64 nr_states;
 /* Facilities Quarks */
 
 extern GQuark
index 4fcd5b5c49abd779a51c962b19cddf55c705541a..a5a09d5e91b1118bf280a6d3e8fa1e541151e1a8 100644 (file)
@@ -274,6 +274,7 @@ static gboolean write_traceset_footer(void *hook_data, void *call_data)
   g_info("TextDump traceset footer");
 
   fprintf(a_file,"End trace set\n\n");
+  fprintf(a_file,"nr states created (total) : %llu\n\n", nr_states);
 
   if(LTTV_IS_TRACESET_STATS(tc)) {
     lttv_stats_sum_traceset((LttvTracesetStats *)tc, ltt_time_infinite);
This page took 0.027588 seconds and 4 git commands to generate.