Re: [PATCH 00/26 v5] trace-seq/seq-buf/x86/printk: Print all stacks from NMI safely
From: Steven Rostedt
Date: Mon Nov 17 2014 - 22:21:54 EST
So far the only difference between v5 I have is that I split the update
of tracing_fill_pipe_page() out of "tracing: Use trace_seq_used() and
seq_buf_used() instead of len", and this:
-- Steve
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 9f1ffc707f3b..9023446b2c2b 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4601,7 +4601,7 @@ tracing_fill_pipe_page(size_t rem, struct trace_iterator *iter)
count = trace_seq_used(&iter->seq) - save_len;
if (rem < count) {
rem = 0;
- iter->seq.seq.len = save_len;;
+ iter->seq.seq.len = save_len;
break;
}
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 2193e8038681..a72f3d8d813e 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -131,6 +131,10 @@ print_syscall_enter(struct trace_iterator *iter, int flags,
trace_seq_printf(s, "%s(", entry->name);
for (i = 0; i < entry->nb_args; i++) {
+
+ if (trace_seq_has_overflowed(s))
+ goto end;
+
/* parameter types */
if (trace_flags & TRACE_ITER_VERBOSE)
trace_seq_printf(s, "%s ", entry->types[i]);
diff --git a/lib/seq_buf.c b/lib/seq_buf.c
index a2288ca567a3..4eedfedb9e31 100644
--- a/lib/seq_buf.c
+++ b/lib/seq_buf.c
@@ -16,6 +16,14 @@
#include <linux/seq_file.h>
#include <linux/seq_buf.h>
+/**
+ * seq_buf_can_fit - can the new data fit in the current buffer?
+ * @s: the seq_buf descriptor
+ * @len: The length to see if it can fit in the current buffer
+ *
+ * Returns true if there's enough unused space in the seq_buf buffer
+ * to fit the amount of new data according to @len.
+ */
static bool seq_buf_can_fit(struct seq_buf *s, size_t len)
{
return s->len + len <= s->size;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/