fix has_heartbeat : must be per tracefile for fast userspace tracing
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 5 Apr 2007 21:05:40 +0000 (21:05 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 5 Apr 2007 21:05:40 +0000 (21:05 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2475 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/ltt-private.h
ltt/branches/poly/ltt/tracefile.c

index c4684bc6526edf9d3c6c355c25bcc161aaa6253a..2777d8bd4d2bb1f9a18f9dc48fb964e8653f73ab 100644 (file)
@@ -392,6 +392,7 @@ struct _LttTracefile{
   size_t    has_alignment;           //alignment of events in the tracefile.
                                      // 0 or the architecture size in bytes.
 
+  guint8    has_heartbeat;
   size_t    buffer_header_size;
   int       compact;                 //compact tracefile ?
   uint8_t   tsc_lsb_truncate;
@@ -436,7 +437,6 @@ struct _LttTrace{
   guint8    ltt_major_version;
   guint8    ltt_minor_version;
   guint8    flight_recorder;
-  guint8    has_heartbeat;
   guint32    freq_scale;
   uint64_t  start_freq;
   uint64_t  start_tsc;
index 8ac4b5061de96a70269dfedc3a539642d55c11cd..9f3ffe0bf4908c674bb11444225d8104d4f110c3 100644 (file)
@@ -223,6 +223,7 @@ int parse_trace_header(void *header, LttTracefile *tf, LttTrace *t)
    * (or is set to 0 if the trace has no float (kernel trace)) */
   tf->float_word_order = any->float_word_order;
        tf->has_alignment = any->has_alignment;
+  tf->has_heartbeat = any->has_heartbeat;
 
   if(t) {
     t->arch_type = ltt_get_uint32(LTT_GET_BO(tf),
@@ -233,7 +234,6 @@ int parse_trace_header(void *header, LttTracefile *tf, LttTrace *t)
     t->ltt_major_version = any->major_version;
     t->ltt_minor_version = any->minor_version;
     t->flight_recorder = any->flight_recorder;
-    t->has_heartbeat = any->has_heartbeat;
     t->compact_facilities = NULL;
   }
  
@@ -1900,11 +1900,11 @@ int ltt_tracefile_read_update_event(LttTracefile *tf)
        if(!tf->compact)
                pos += ltt_align((size_t)pos, tf->trace->arch_size, tf->has_alignment);
        else {
-               g_assert(tf->trace->has_heartbeat);
+               g_assert(tf->has_heartbeat);
                pos += ltt_align((size_t)pos, sizeof(uint32_t), tf->has_alignment);
        }
   
-       if(tf->trace->has_heartbeat) {
+       if(tf->has_heartbeat) {
                event->timestamp = ltt_get_uint32(LTT_GET_BO(tf),
                                                                                                                                                                        pos);
     if(!tf->compact) {
This page took 0.02549 seconds and 4 git commands to generate.