summaryrefslogtreecommitdiffstats
path: root/include/linux/trace_seq.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/trace_seq.h')
-rw-r--r--include/linux/trace_seq.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h
index ea6c9de..07eda41 100644
--- a/include/linux/trace_seq.h
+++ b/include/linux/trace_seq.h
@@ -40,6 +40,18 @@ trace_seq_buffer_ptr(struct trace_seq *s)
return s->buffer + s->len;
}
+/**
+ * trace_seq_has_overflowed - return true if the trace_seq took too much
+ * @s: trace sequence descriptor
+ *
+ * Returns true if too much data was added to the trace_seq and it is
+ * now full and will not take anymore.
+ */
+static inline bool trace_seq_has_overflowed(struct trace_seq *s)
+{
+ return s->full || s->len > PAGE_SIZE - 1;
+}
+
/*
* Currently only defined when tracing is enabled.
*/
OpenPOWER on IntegriCloud