@@ -2973,8 +2973,14 @@ static void __ftrace_trace_stack(struct trace_array *tr,
for (int i = 0; i < nr_entries; i++) {
if (calls[i] >= tramp_start && calls[i] < tramp_end)
calls[i] = FTRACE_TRAMPOLINE_MARKER;
+ else
+ calls[i] -= (unsigned long)_stext;
}
}
+#else
+ /* Adjsut entries as the offset from _stext, instead of raw address. */
+ for (int i = 0; i < nr_entries; i++)
+ fstack->calls[i] -= (unsigned long)_stext;
#endif
event = __trace_buffer_lock_reserve(buffer, TRACE_STACK,
@@ -1248,7 +1248,7 @@ static enum print_line_t trace_stack_print(struct trace_iterator *iter,
struct trace_seq *s = &iter->seq;
unsigned long *p;
unsigned long *end;
- long delta = iter->tr->text_delta;
+ long delta = (unsigned long)_stext + iter->tr->text_delta;
trace_assign_type(field, iter->ent);
end = (unsigned long *)((long)iter->ent + iter->ent_size);