tracing: Add trace_seq_has_overflowed() and trace_handle_return()
[deliverable/linux.git] / include / linux / ftrace_event.h
index 28672e87e9100c7a02e36e47db2317e0a46d3313..0bebb5c348b8268eff6135f24f1635c0adf2dbb1 100644 (file)
@@ -138,6 +138,17 @@ enum print_line_t {
        TRACE_TYPE_NO_CONSUME   = 3     /* Handled but ask to not consume */
 };
 
+/*
+ * Several functions return TRACE_TYPE_PARTIAL_LINE if the trace_seq
+ * overflowed, and TRACE_TYPE_HANDLED otherwise. This helper function
+ * simplifies those functions and keeps them in sync.
+ */
+static inline enum print_line_t trace_handle_return(struct trace_seq *s)
+{
+       return trace_seq_has_overflowed(s) ?
+               TRACE_TYPE_PARTIAL_LINE : TRACE_TYPE_HANDLED;
+}
+
 void tracing_generic_entry_update(struct trace_entry *entry,
                                  unsigned long flags,
                                  int pc);
This page took 0.024348 seconds and 5 git commands to generate.