ust_safe_snprintf: add openbsd mbrtowc() function
[ust.git] / libust / buffers.h
index bff3ed54ba2f2eb4c06192c283f6aa3f6e68bd13..a2f17a9f78d01e83f3e1ee2a5d4e7eb40e92f081 100644 (file)
@@ -356,7 +356,8 @@ static __inline__ int ltt_reserve_slot(struct ust_trace *trace,
         * Perform retryable operations.
         */
        /* FIXME: make this rellay per cpu? */
-       if (unlikely(__get_cpu_var(ltt_nesting) > 4)) {
+       if (unlikely(LOAD_SHARED(ltt_nesting) > 4)) {
+               DBG("Dropping event because nesting is too deep.");
                local_inc(&buf->events_lost);
                return -EPERM;
        }
@@ -413,14 +414,14 @@ 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,
-               struct ltt_channel_buf_struct *ltt_buf,
-               long idx, long buf_offset, long commit_count, size_t data_size)
+//ust// #ifdef CONFIG_LTT_VMCORE
+static __inline__ void ltt_write_commit_counter(struct ust_channel *chan,
+               struct ust_buffer *buf, long idx, long buf_offset,
+               long commit_count, size_t data_size)
 {
        long offset;
        long commit_seq_old;
@@ -436,17 +437,19 @@ static __inline__ void ltt_write_commit_counter(struct rchan_buf *buf,
        if (unlikely(SUBBUF_OFFSET(offset - commit_count, buf->chan)))
                return;
 
-       commit_seq_old = local_read(&ltt_buf->commit_seq[idx]);
+       commit_seq_old = local_read(&buf->commit_seq[idx]);
        while (commit_seq_old < commit_count)
-               commit_seq_old = local_cmpxchg(&ltt_buf->commit_seq[idx],
+               commit_seq_old = local_cmpxchg(&buf->commit_seq[idx],
                                         commit_seq_old, commit_count);
+
+       DBG("commit_seq for channel %s_%d, subbuf %ld is now %ld", buf->chan->channel_name, buf->cpu, idx, commit_count);
 }
-#else
-static __inline__ void ltt_write_commit_counter(struct ust_buffer *buf,
-               long idx, long buf_offset, long commit_count, size_t data_size)
-{
-}
-#endif
+//ust// #else
+//ust// static __inline__ void ltt_write_commit_counter(struct ust_buffer *buf,
+//ust//                long idx, long buf_offset, long commit_count, size_t data_size)
+//ust// {
+//ust// }
+//ust// #endif
 
 /*
  * Atomic unordered slot commit. Increments the commit count in the
@@ -501,10 +504,10 @@ 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);
+       ltt_write_commit_counter(chan, buf, endidx, buf_offset, commit_count, data_size);
 }
 
 void _ust_buffers_write(struct ust_buffer *buf, size_t offset,
This page took 0.02486 seconds and 4 git commands to generate.