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:27:34
Also in
lkml
Reply to
Steven Rostedt, 2026-03-30
On Mon, 30 Mar 2026 16:22:10 -0400
Steven Rostedt [off-list ref] wrote:
On Mon, 30 Mar 2026 21:50:04 +0900
"Masami Hiramatsu (Google)" [off-list ref] wrote:
quoted
@@ -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);
	}
Or perhaps:

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

-- Steve
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