Re: [PATCH v14 2/5] ring-buffer: Skip invalid sub-buffers when validating persistent ring buffer

From
Steven Rostedt <rostedt@goodmis.org>
Date
2026-03-30 20:21:17
Also in
lkml
Reply to
Masami Hiramatsu (Google), 2026-03-30
On Mon, 30 Mar 2026 21:50:04 +0900
"Masami Hiramatsu (Google)" [off-list ref] wrote:
quoted hunk ↗ jump to hunk
@@ -2042,7 +2065,8 @@ static void rb_meta_validate_events(struct ring_buffer_per_cpu *cpu_buffer)
 	local_set(&cpu_buffer->entries, entries);
 	local_set(&cpu_buffer->entries_bytes, entry_bytes);
 
-	pr_info("Ring buffer meta [%d] is from previous boot!\n", cpu_buffer->cpu);
+	pr_info("Ring buffer meta [%d] is from previous boot! (%d pages discarded)\n",
+		cpu_buffer->cpu, discarded);
As pages should never be discarded unless something went wrong, let's only
print that if there were discarded pages.

	if (discarded) {
		pr_info("Ring buffer meta [%d] is from previous boot! (%d pages discarded)\n",
			cpu_buffer->cpu, discarded);
	} else {
		pr_info("Ring buffer meta [%d] is from previous boot!\n", cpu_buffer->cpu);
	}

-- Steve



 	return;
 
  invalid:
Thread (15 messages) 15 messages, 2 authors, last reply 2026-03-31
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help