0.8.23
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 27 Feb 2006 23:12:29 +0000 (23:12 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 27 Feb 2006 23:12:29 +0000 (23:12 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1562 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ChangeLog
ltt/branches/poly/configure.in
ltt/branches/poly/doc/developer/format.html
ltt/branches/poly/doc/developer/lttng-lttv-compatibility.html
ltt/branches/poly/lttv/lttv/state.c
ltt/branches/poly/lttv/lttv/state.h

index e65da2f3b11255ae9f50f6edc0a1dd92e7e8c80e..04e3594168e2ec7b7bd1ef441733a7d045a566f2 100644 (file)
@@ -1,5 +1,7 @@
 LinuxTraceToolkit ChangeLog
 
+27/02/2006     LTTV 0.8.23
+                                               Add kernel_thread information in state.
 15/02/2006     LTTV 0.8.21
                                                Add support for data with network byte order.
 15/02/2006     LTTV 0.8.20
index 4b819f48878c18b17642af8830a9296b5ef021d8..9877a4d9e6f02e47e31cddb11094f8c6ddb4c5f1 100644 (file)
@@ -23,7 +23,7 @@
 AC_PREREQ(2.57)
 AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
 #AC_WITH_LTDL  # not needed ?
-AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.22-27022006)
+AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.23-27022006)
 AM_CONFIG_HEADER(config.h)
 AM_PROG_LIBTOOL
 
index 4f92153030fd20af82a54447de5c9a4a5de80a98..b24e0c0a1ad97e125f29671f846a5c839a47ea48 100644 (file)
@@ -377,6 +377,20 @@ following event types.
   &lt;/struct&gt;
 &lt;/event&gt;
 
+&lt;event name=state_dump_facility_load&gt;
+  &lt;description&gt;Facility used in the trace&lt;/description&gt;
+  &lt;struct&gt;
+    &lt;field name="name"&gt;&lt;string/&gt;&lt;/field&gt;
+    &lt;field name="checksum"&gt;&lt;uint size=4/&gt;&lt;/field&gt;
+    &lt;field name="id"&gt;&lt;uint size=4/&gt;&lt;/field&gt;
+    &lt;field name="int_size"&gt;&lt;uint size=4/&gt;&lt;/field&gt;
+    &lt;field name="long_size"&gt;&lt;uint size=4/&gt;&lt;/field&gt;
+    &lt;field name="pointer_size"&gt;&lt;uint size=4/&gt;&lt;/field&gt;
+    &lt;field name="size_t_size"&gt;&lt;uint size=4/&gt;&lt;/field&gt;
+    &lt;field name="has_alignment"&gt;&lt;uint size=4/&gt;&lt;/field&gt;
+  &lt;/struct&gt;
+&lt;/event&gt;
+
 &lt;event name=time_heartbeat&gt;
   &lt;description&gt;System time values sent periodically to minimize cycle counter 
     drift with respect to real time clock and to detect cycle counter
index 80de97cfae8081c0fdf60b6cc432a92b3773dcf0..c17042332fa120690630da31e564d4b6c853a081 100644 (file)
@@ -301,6 +301,7 @@ Kernel State Dump : get vmaps, process names, fd at the beginning of a trace.<br
 0.8.20<br>
 0.8.21<br>
 0.8.22<br>
+0.8.23<br>
 </td>
 <td style="vertical-align: top;">
 0.5.20<br>
index 05a6aa53683536d5669dbbb6072b190271f80258..eba65ab86c830ae37eee3de2d2097f5c5b667e9a 100644 (file)
@@ -54,6 +54,7 @@ GQuark
     LTT_EVENT_SOFT_IRQ_EXIT,
     LTT_EVENT_SCHEDCHANGE,
     LTT_EVENT_FORK,
+    LTT_EVENT_KERNEL_THREAD,
     LTT_EVENT_EXIT,
     LTT_EVENT_FREE,
     LTT_EVENT_EXEC,
@@ -1017,6 +1018,8 @@ lttv_state_create_process(LttvTraceState *tcs, LttvProcessState *parent,
   process->name = name;
   //process->last_cpu = tfs->cpu_name;
   //process->last_cpu_index = ltt_tracefile_num(((LttvTracefileContext*)tfs)->tf);
+       process->kernel_thread = 0;
+
   g_info("Process %u, core %p", process->pid, process);
   g_hash_table_insert(tcs->processes, process, process);
 
@@ -1082,10 +1085,17 @@ lttv_state_find_process_or_create(LttvTraceState *ts, guint cpu, guint pid,
     LttTime *timestamp)
 {
   LttvProcessState *process = lttv_state_find_process(ts, cpu, pid);
+  LttvExecutionState *es;
   
   /* Put ltt_time_zero creation time for unexisting processes */
-  if(unlikely(process == NULL)) process = lttv_state_create_process(ts,
+  if(unlikely(process == NULL)) {
+               process = lttv_state_create_process(ts,
                 NULL, cpu, pid, LTTV_STATE_UNNAMED, timestamp);
+               /* We are not sure is it's a kernel thread or normal thread, put the
+                * bottom stack state to unknown */
+               es = &g_array_index(process->execution_stack, LttvExecutionState, 0);
+               es->t = LTTV_STATE_MODE_UNKNOWN;
+       }
   return process;
 }
 
@@ -1355,6 +1365,28 @@ static gboolean process_fork(void *hook_data, void *call_data)
   return FALSE;
 }
 
+/* We stamp a newly created process as kernel_thread */
+static gboolean process_kernel_thread(void *hook_data, void *call_data)
+{
+  LttvTracefileState *s = (LttvTracefileState *)call_data;
+  LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
+  LttvTraceHookByFacility *thf = (LttvTraceHookByFacility *)hook_data;
+  guint pid;
+  guint cpu = ltt_tracefile_num(s->parent.tf);
+  LttvTraceState *ts = (LttvTraceState*)s->parent.t_context;
+  LttvProcessState *process;
+  LttvExecutionState *es;
+
+  /* PID */
+  pid = ltt_event_get_unsigned(e, thf->f1);
+
+  process = lttv_state_find_process(ts, ANY_CPU, pid);
+       es = &g_array_index(process->execution_stack, LttvExecutionState, 0);
+       es->t = LTTV_STATE_SYSCALL;
+       process->kernel_thread = 1;
+
+       return FALSE;
+}
 
 static gboolean process_exit(void *hook_data, void *call_data)
 {
@@ -1575,8 +1607,8 @@ void lttv_state_add_event_hooks(LttvTracesetState *self)
     /* Find the eventtype id for the following events and register the
        associated by id hooks. */
 
-    hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 14);
-    hooks = g_array_set_size(hooks, 14);
+    hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 15);
+    hooks = g_array_set_size(hooks, 15);
 
     ret = lttv_trace_find_hook(ts->parent.t,
         LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY,
@@ -1638,29 +1670,35 @@ void lttv_state_add_event_hooks(LttvTracesetState *self)
         process_fork, NULL, &g_array_index(hooks, LttvTraceHook, 9));
     g_assert(!ret);
 
+    ret = lttv_trace_find_hook(ts->parent.t,
+        LTT_FACILITY_PROCESS, LTT_EVENT_KERNEL_THREAD,
+        LTT_FIELD_PID, 0, 0,
+        process_kernel_thread, NULL, &g_array_index(hooks, LttvTraceHook, 10));
+    g_assert(!ret);
+
     ret = lttv_trace_find_hook(ts->parent.t,
         LTT_FACILITY_PROCESS, LTT_EVENT_EXIT,
         LTT_FIELD_PID, 0, 0,
-        process_exit, NULL, &g_array_index(hooks, LttvTraceHook, 10));
+        process_exit, NULL, &g_array_index(hooks, LttvTraceHook, 11));
     g_assert(!ret);
     
     ret = lttv_trace_find_hook(ts->parent.t,
         LTT_FACILITY_PROCESS, LTT_EVENT_FREE,
         LTT_FIELD_PID, 0, 0,
-        process_free, NULL, &g_array_index(hooks, LttvTraceHook, 11));
+        process_free, NULL, &g_array_index(hooks, LttvTraceHook, 12));
     g_assert(!ret);
 
     ret = lttv_trace_find_hook(ts->parent.t,
         LTT_FACILITY_FS, LTT_EVENT_EXEC,
         LTT_FIELD_FILENAME, 0, 0,
-        process_exec, NULL, &g_array_index(hooks, LttvTraceHook, 12));
+        process_exec, NULL, &g_array_index(hooks, LttvTraceHook, 13));
     g_assert(!ret);
 
      /* statedump-related hooks */
     ret = lttv_trace_find_hook(ts->parent.t,
         LTT_FACILITY_STATEDUMP, LTT_EVENT_ENUM_PROCESS_STATE,
         LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME,
-        enum_process_state, NULL, &g_array_index(hooks, LttvTraceHook, 13));
+        enum_process_state, NULL, &g_array_index(hooks, LttvTraceHook, 14));
     g_assert(!ret);
 
     
@@ -2332,6 +2370,7 @@ static void module_init()
   LTT_EVENT_SOFT_IRQ_EXIT      = g_quark_from_string("soft_irq_exit");
   LTT_EVENT_SCHEDCHANGE   = g_quark_from_string("schedchange");
   LTT_EVENT_FORK          = g_quark_from_string("fork");
+  LTT_EVENT_KERNEL_THREAD = g_quark_from_string("kernel_thread");
   LTT_EVENT_EXIT          = g_quark_from_string("exit");
   LTT_EVENT_FREE          = g_quark_from_string("free");
   LTT_EVENT_EXEC          = g_quark_from_string("exec");
index f8d62d4cd2e50480559ecb5b8ea6f580a3242b93..c1095d80be13403bd063850b3a9dbfd0129a22b1 100644 (file)
@@ -75,6 +75,7 @@ extern GQuark
     LTT_EVENT_SOFT_IRQ_EXIT,
     LTT_EVENT_SCHEDCHANGE,
     LTT_EVENT_FORK,
+    LTT_EVENT_KERNEL_THREAD,
     LTT_EVENT_EXIT,
     LTT_EVENT_FREE,
     LTT_EVENT_EXEC,
@@ -204,6 +205,7 @@ typedef struct _LttvProcessState {
        * (Mathieu) */
   guint cpu;                /* CPU where process is scheduled (being either in
                                the active or inactive runqueue)*/
+       gboolean kernel_thread;         /* Is this thread a kernel_thread ? */
 //  guint  last_tracefile_index;    /* index in the trace for cpu tracefile */
   /* opened file descriptors, address map?... */
 } LttvProcessState;
This page took 0.029343 seconds and 4 git commands to generate.