Fix: add missing debug printout to identify the cause of lost events
[lttng-ust.git] / libringbuffer / ring_buffer_frontend.c
index cb9446ea45557dbe9b68c53e97344cf304b5c975..9d89c6fa68a7117b06b1701f17d33b2b3762e308 100644 (file)
@@ -38,6 +38,7 @@
  * Dual LGPL v2.1/GPL v2 license.
  */
 
+#define _GNU_SOURCE
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
@@ -1340,6 +1341,7 @@ int lib_ring_buffer_try_reserve_slow(struct lttng_ust_lib_ring_buffer *buf,
                                 * and we are full : record is lost.
                                 */
                                v_inc(config, &buf->records_lost_full);
+                               DBG("Record lost: buffer is full\n");
                                return -ENOBUFS;
                        } else {
                                /*
@@ -1357,6 +1359,7 @@ int lib_ring_buffer_try_reserve_slow(struct lttng_ust_lib_ring_buffer *buf,
                         * many nested writes over a reserve/commit pair.
                         */
                        v_inc(config, &buf->records_lost_wrap);
+                       DBG("Record lost: buffer wrap-around\n");
                        return -EIO;
                }
                offsets->size =
@@ -1375,6 +1378,7 @@ int lib_ring_buffer_try_reserve_slow(struct lttng_ust_lib_ring_buffer *buf,
                         * complete the sub-buffer switch.
                         */
                        v_inc(config, &buf->records_lost_big);
+                       DBG("Record lost: record size (%zu bytes) is too large for buffer\n", offsets->size);
                        return -ENOSPC;
                } else {
                        /*
This page took 0.025152 seconds and 4 git commands to generate.