port to trace format 2.5
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 8 Feb 2010 22:47:30 +0000 (17:47 -0500)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 15 Feb 2010 05:40:36 +0000 (00:40 -0500)
libust/buffers.c
libust/buffers.h
libust/serialize.c
libust/tracer.h
ustd/lowlevel.c

index c644cfb72ad2ddc50e6fa324d3a17082cf8ed61b..33c9589861c96efd675ce8602452e406f5974e70 100644 (file)
@@ -307,8 +307,7 @@ static void ltt_buffer_begin(struct ust_buffer *buf,
                                subbuf_idx * buf->chan->subbuf_size);
 
        header->cycle_count_begin = tsc;
-       header->lost_size = 0xFFFFFFFF; /* for debugging */
-       header->buf_size = buf->chan->subbuf_size;
+       header->data_size = 0xFFFFFFFF; /* for debugging */
        ltt_write_trace_header(channel->trace, header);
 }
 
@@ -323,9 +322,10 @@ static notrace void ltt_buffer_end(struct ust_buffer *buf,
                (struct ltt_subbuffer_header *)
                        ust_buffers_offset_address(buf,
                                subbuf_idx * buf->chan->subbuf_size);
+       u32 data_size = SUBBUF_OFFSET(offset - 1, buf->chan) + 1;
 
-       header->lost_size = SUBBUF_OFFSET((buf->chan->subbuf_size - offset),
-                               buf->chan);
+       header->data_size = data_size;
+       header->sb_size = PAGE_ALIGN(data_size);
        header->cycle_count_end = tsc;
        header->events_lost = local_read(&buf->events_lost);
        header->subbuf_corrupt = local_read(&buf->corrupted_subbuffers);
index bff3ed54ba2f2eb4c06192c283f6aa3f6e68bd13..951c9b01bddf64432a543a9ab0d0321e4e8516b7 100644 (file)
@@ -413,9 +413,9 @@ static __inline__ void ltt_force_switch(struct ust_buffer *buf,
 
 /*
  * for flight recording. must be called after relay_commit.
- * This function decrements de subbuffer's lost_size each time the commit count
- * reaches back the reserve offset (module subbuffer size). It is useful for
- * crash dump.
+ * This function increments the subbuffers's commit_seq counter each time the
+ * commit count reaches back the reserve offset (module subbuffer size). It is
+ * useful for crash dump.
  */
 #ifdef CONFIG_LTT_VMCORE
 static __inline__ void ltt_write_commit_counter(struct rchan_buf *buf,
@@ -501,7 +501,7 @@ static __inline__ void ltt_commit_slot(
 
        ltt_check_deliver(chan, buf, offset_end - 1, commit_count, endidx);
        /*
-        * Update lost_size for each commit. It's needed only for extracting
+        * Update data_size for each commit. It's needed only for extracting
         * ltt buffers from vmcore, after crash.
         */
        ltt_write_commit_counter(buf, endidx, buf_offset, commit_count, data_size);
index 6a8688420369ee073d3ae3fba779ed70d23181e1..a9c6f69b79dd4e97b1d3e66169bd780a9aef44f7 100644 (file)
@@ -647,7 +647,6 @@ notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
        largest_align = 1;      /* must be non-zero for ltt_align */
        data_size = ltt_get_data_size(&closure, serialize_private,
                                        &largest_align, fmt, &args_copy);
-       largest_align = min_t(int, largest_align, sizeof(void *));
        va_end(args_copy);
 
        /* Iterate on each trace */
index 431a77c67f00fdb85bdf44238bcf48fd44cd73bd..5d226cd63b8dbb46a85dad4c047c170afa48787b 100644 (file)
@@ -32,6 +32,7 @@
 #include "tracerconst.h"
 #include <ust/marker.h>
 #include <ust/probe.h>
+#include "buffers.h"
 
 /* Number of bytes to log with a read/write event */
 #define LTT_LOG_RW_SIZE                        32L
@@ -213,8 +214,8 @@ struct ltt_subbuffer_header {
                                         * used all along the trace.
                                         */
        uint32_t freq_scale;            /* Frequency scaling (divisor) */
-       uint32_t lost_size;             /* Size unused at end of subbuffer */
-       uint32_t buf_size;              /* Size of this subbuffer */
+       uint32_t data_size;             /* Size of data in subbuffer */
+       uint32_t sb_size;               /* Subbuffer size (including padding) */
        uint32_t events_lost;           /*
                                         * Events lost in this subbuffer since
                                         * the beginning of the trace.
@@ -264,7 +265,7 @@ extern size_t ltt_write_event_header_slow(struct ust_trace *trace,
  * returns : offset where the event data must be written.
  */
 static __inline__ size_t ltt_write_event_header(struct ust_trace *trace,
-               struct ust_channel *channel,
+               struct ust_channel *chan,
                struct ust_buffer *buf, long buf_offset,
                u16 eID, u32 event_size,
                u64 tsc, unsigned int rflags)
@@ -275,11 +276,14 @@ static __inline__ size_t ltt_write_event_header(struct ust_trace *trace,
                goto slow_path;
 
        header.id_time = eID << LTT_TSC_BITS;
+       header.id_time |= (u32)tsc & LTT_TSC_MASK;
+       ust_buffers_write(buf, buf_offset, &header, sizeof(header));
+       buf_offset += sizeof(header);
 
        return buf_offset;
 
 slow_path:
-       return ltt_write_event_header_slow(trace, channel, buf, buf_offset,
+       return ltt_write_event_header_slow(trace, chan, buf, buf_offset,
                                eID, event_size, tsc, rflags);
 }
 
@@ -313,7 +317,7 @@ slow_path:
 #define LTT_DEFAULT_N_SUBBUFS_HIGH     2
 #define LTT_TRACER_MAGIC_NUMBER                0x00D6B7ED
 #define LTT_TRACER_VERSION_MAJOR       2
-#define LTT_TRACER_VERSION_MINOR       4
+#define LTT_TRACER_VERSION_MINOR       5
 
 /**
  * ust_write_trace_header - Write trace header
index 6295a8bc5a4391d6cd7b38b45c07dad66c1950c7..bce1d20f91c09c55cacf2964eabf75fda119b5cc 100644 (file)
@@ -78,18 +78,18 @@ void finish_consuming_dead_subbuffer(struct buffer_info *buf)
                if (((commit_seq - buf->subbuf_size) & commit_seq_mask)
                    - (USTD_BUFFER_TRUNC(consumed_offset, buf) >> n_subbufs_order)
                    == 0) {
-                       /* If it was, we only check the lost_size. This is the lost padding at the end of
-                        * the subbuffer. */
-                       valid_length = (unsigned long)buf->subbuf_size - header->lost_size;
+                       /* If it was, we only check the data_size. This is the amount of valid data at
+                        * the beginning of the subbuffer. */
+                       valid_length = header->data_size;
                }
                else {
-                       /* If the subbuffer was not fully written, then we don't check lost_size because
+                       /* If the subbuffer was not fully written, then we don't check data_size because
                         * it hasn't been written yet. Instead we check commit_seq and use it to choose
-                        * a value for lost_size. The viewer will need this value when parsing.
+                        * a value for data_size. The viewer will need this value when parsing.
                         */
 
                        valid_length = commit_seq & (buf->subbuf_size-1);
-                       header->lost_size = buf->subbuf_size-valid_length;
+                       header->data_size = valid_length;
                        assert(i_subbuf == (last_subbuf % buf->n_subbufs));
                }
 
This page took 0.027953 seconds and 4 git commands to generate.