|
@@ -2374,6 +2374,15 @@ void trace_event_buffer_commit(struct trace_event_buffer *fbuffer)
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(trace_event_buffer_commit);
|
|
|
|
|
|
+/*
|
|
|
+ * Skip 3:
|
|
|
+ *
|
|
|
+ * trace_buffer_unlock_commit_regs()
|
|
|
+ * trace_event_buffer_commit()
|
|
|
+ * trace_event_raw_event_xxx()
|
|
|
+*/
|
|
|
+# define STACK_SKIP 3
|
|
|
+
|
|
|
void trace_buffer_unlock_commit_regs(struct trace_array *tr,
|
|
|
struct ring_buffer *buffer,
|
|
|
struct ring_buffer_event *event,
|
|
@@ -2383,16 +2392,12 @@ void trace_buffer_unlock_commit_regs(struct trace_array *tr,
|
|
|
__buffer_unlock_commit(buffer, event);
|
|
|
|
|
|
/*
|
|
|
- * If regs is not set, then skip the following callers:
|
|
|
- * trace_buffer_unlock_commit_regs
|
|
|
- * event_trigger_unlock_commit
|
|
|
- * trace_event_buffer_commit
|
|
|
- * trace_event_raw_event_sched_switch
|
|
|
+ * If regs is not set, then skip the necessary functions.
|
|
|
* Note, we can still get here via blktrace, wakeup tracer
|
|
|
* and mmiotrace, but that's ok if they lose a function or
|
|
|
- * two. They are that meaningful.
|
|
|
+ * two. They are not that meaningful.
|
|
|
*/
|
|
|
- ftrace_trace_stack(tr, buffer, flags, regs ? 0 : 4, pc, regs);
|
|
|
+ ftrace_trace_stack(tr, buffer, flags, regs ? 0 : STACK_SKIP, pc, regs);
|
|
|
ftrace_trace_userstack(buffer, flags, pc);
|
|
|
}
|
|
|
|
|
@@ -2579,11 +2584,13 @@ static void __ftrace_trace_stack(struct ring_buffer *buffer,
|
|
|
trace.skip = skip;
|
|
|
|
|
|
/*
|
|
|
- * Add two, for this function and the call to save_stack_trace()
|
|
|
+ * Add one, for this function and the call to save_stack_trace()
|
|
|
* If regs is set, then these functions will not be in the way.
|
|
|
*/
|
|
|
+#ifndef CONFIG_UNWINDER_ORC
|
|
|
if (!regs)
|
|
|
- trace.skip += 2;
|
|
|
+ trace.skip++;
|
|
|
+#endif
|
|
|
|
|
|
/*
|
|
|
* Since events can happen in NMIs there's no safe way to
|
|
@@ -2711,11 +2718,10 @@ void trace_dump_stack(int skip)
|
|
|
|
|
|
local_save_flags(flags);
|
|
|
|
|
|
- /*
|
|
|
- * Skip 3 more, seems to get us at the caller of
|
|
|
- * this function.
|
|
|
- */
|
|
|
- skip += 3;
|
|
|
+#ifndef CONFIG_UNWINDER_ORC
|
|
|
+ /* Skip 1 to skip this function. */
|
|
|
+ skip++;
|
|
|
+#endif
|
|
|
__ftrace_trace_stack(global_trace.trace_buffer.buffer,
|
|
|
flags, skip, preempt_count(), NULL);
|
|
|
}
|