Skip to content

ring-buffer: Fixes for 7.1

Steven Rostedt lkml stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5ring-buffer: Fix reporting of missed events in iteratorkernel/trace/ring_buffer.c+3 -50 replies
2/5ring-buffer: Flush and stop persistent ring buffer on panicarch/alpha/include/asm/Kbuild arch/arc/include/asm/Kbuild arch/arm/include/asm/Kbuild +20 more+65 -00 replies
3/5tracing: Fix nr_subbufs initialization in simple_ring_buffer_init_mm()kernel/trace/simple_ring_buffer.c+1 -10 replies
4/5tracing: Fix unload_page for simple_ring_buffer init rollbackkernel/trace/simple_ring_buffer.c+1 -10 replies
5/5tracing: Create output file from cmd_check_undefinedkernel/trace/Makefile+2 -10 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchMasami Hiramatsu (Google)Catalin MarinasGeert UytterhoevenVincent DonnefortNathan Chancellor
1/5A-b
2/5A-b A-b
3/5R-b
4/5
5/5R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v1 thread

Cover letter [for-linus][PATCH 0/5] ring-buffer: Fixes for 7.1

ring-buffer fixes for 7.1:

- Fix reporting MISSED EVENTS in trace iterator

When the "trace" file is read with tracing enabled, if the writer were to pass the iterator reader, it resets, sets a "missed_events" flag and continues. The tracing output checks for missed events and if there are some, it prints out "[LOST EVENTS]" to let the user know events were dropped.

But the clearing of the missed_events happened when the tracing system queried the ring buffer iterator about missed events. This was premature as the ring buffer is per CPU, and the tracing code reads all the CPU buffers and checks for missed events when it is read. If the CPU iterator that had missed events isn't printed next, the output for the LOST EVENTS is lost.

Clear the missed_events flag when the iterator moves to the next event and not when the missed_events flag is queried. Also clear it on reset.

- Flush and stop the persistent ring buffer on panic

On panic the persistent ring buffer is used to debug what caused the panic. But on some architectures, it requires flushing the memory from cache, otherwise, the ring buffer persistent memory may not have the last events and this could also cause the ring buffer to be corrupted on the next boot.

- Fix nr_subbufs initialization in simple_ring_buffer_init_mm

The remote simple ring buffer meta data nr_subbufs is initialized too early and gets cleared later on, making it zero and not reflect the actual number of sub-buffers.

- Fix unload_page for simple_ring_buffer init rollback

On error, the pages loaded need to be unloaded. To unload a page it is expected that: page = load_page(va); -> unload_page(page). But the code was doing: unload_page(va) and not unload_page(page).

- Create output file from cmd_check_undefined

The check for undefined symbols checks if the file *.o.checked exists and if so it skips doing the work. But the *.o.checked file never was created making every build do the work even when it was already done previously.

git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
ring-buffer/fixes

Head SHA1: 057caace5214da3b457bbd295e1a2ad34d3685ea

David Carlier (1):
tracing: Fix nr_subbufs initialization in simple_ring_buffer_init_mm()

Masami Hiramatsu (Google) (1):
ring-buffer: Flush and stop persistent ring buffer on panic

Steven Rostedt (1):
ring-buffer: Fix reporting of missed events in iterator

Thomas Weißschuh (1):
tracing: Create output file from cmd_check_undefined

Vincent Donnefort (1):
tracing: Fix unload_page for simple_ring_buffer init rollback

----

 arch/alpha/include/asm/Kbuild        |  1 +
 arch/arc/include/asm/Kbuild          |  1 +
 arch/arm/include/asm/Kbuild          |  1 +
 arch/arm64/include/asm/ring_buffer.h | 10 ++++++++++
 arch/csky/include/asm/Kbuild         |  1 +
 arch/hexagon/include/asm/Kbuild      |  1 +
 arch/loongarch/include/asm/Kbuild    |  1 +
 arch/m68k/include/asm/Kbuild         |  1 +
 arch/microblaze/include/asm/Kbuild   |  1 +
 arch/mips/include/asm/Kbuild         |  1 +
 arch/nios2/include/asm/Kbuild        |  1 +
 arch/openrisc/include/asm/Kbuild     |  1 +
 arch/parisc/include/asm/Kbuild       |  1 +
 arch/powerpc/include/asm/Kbuild      |  1 +
 arch/riscv/include/asm/Kbuild        |  1 +
 arch/s390/include/asm/Kbuild         |  1 +
 arch/sh/include/asm/Kbuild           |  1 +
 arch/sparc/include/asm/Kbuild        |  1 +
 arch/um/include/asm/Kbuild           |  1 +
 arch/x86/include/asm/Kbuild          |  1 +
 arch/xtensa/include/asm/Kbuild       |  1 +
 include/asm-generic/ring_buffer.h    | 13 +++++++++++++
 kernel/trace/Makefile                |  3 ++-
 kernel/trace/ring_buffer.c           | 30 +++++++++++++++++++++++++-----
 kernel/trace/simple_ring_buffer.c    |  4 ++--
 25 files changed, 72 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm64/include/asm/ring_buffer.h
 create mode 100644 include/asm-generic/ring_buffer.h