]> Pileus Git - ~andy/linux/blobdiff - kernel/trace/ring_buffer.c
ring-buffer: Fix accounting of entries when removing pages
[~andy/linux] / kernel / trace / ring_buffer.c
index ba39cbabdc9fe6f1b94a19047ee994c9f1a511fa..f765465bffe47968752e272308d7fb5b63093a65 100644 (file)
@@ -1347,10 +1347,9 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned int nr_pages)
                         * If something was added to this page, it was full
                         * since it is not the tail page. So we deduct the
                         * bytes consumed in ring buffer from here.
-                        * No need to update overruns, since this page is
-                        * deleted from ring buffer and its entries are
-                        * already accounted for.
+                        * Increment overrun to account for the lost events.
                         */
+                       local_add(page_entries, &cpu_buffer->overrun);
                        local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes);
                }