aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorArun Sharma <asharma@fb.com>2012-04-20 18:41:33 -0400
committerIngo Molnar <mingo@kernel.org>2012-06-06 11:07:58 -0400
commit302fa4b58ac754a6da13f4f5546f710fecc3b945 (patch)
tree6df70de7ed659a0c5b670c781a2022386aaa0732 /arch
parent8440ccb43fc0ecffcf1acee0273d766e6a8cd51d (diff)
perf/x86: Allow multiple stacks
Without this patch, applications with two different stack regions (eg: native stack vs JIT stack) get truncated callchains even when RBP chaining is present. GDB shows proper stack traces and the frame pointer chaining is intact. This patch disables the (fp < RSP) check, hoping that other checks in the code save the day for us. In our limited testing, this didn't seem to break anything. In the long term, we could potentially have userspace advise the kernel on the range of valid stack addresses, so we don't spend a lot of time unwinding from bogus addresses. Signed-off-by: Arun Sharma <asharma@fb.com> CC: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Stephane Eranian <eranian@google.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Tom Zanussi <tzanussi@gmail.com> Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1334961696-19580-2-git-send-email-asharma@fb.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/cpu/perf_event.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index cb608383e4f6..e78bc256aea8 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -1781,9 +1781,6 @@ perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry *entry)
1781 if (bytes != sizeof(frame)) 1781 if (bytes != sizeof(frame))
1782 break; 1782 break;
1783 1783
1784 if (fp < compat_ptr(regs->sp))
1785 break;
1786
1787 perf_callchain_store(entry, frame.return_address); 1784 perf_callchain_store(entry, frame.return_address);
1788 fp = compat_ptr(frame.next_frame); 1785 fp = compat_ptr(frame.next_frame);
1789 } 1786 }
@@ -1827,9 +1824,6 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
1827 if (bytes != sizeof(frame)) 1824 if (bytes != sizeof(frame))
1828 break; 1825 break;
1829 1826
1830 if ((unsigned long)fp < regs->sp)
1831 break;
1832
1833 perf_callchain_store(entry, frame.return_address); 1827 perf_callchain_store(entry, frame.return_address);
1834 fp = frame.next_frame; 1828 fp = frame.next_frame;
1835 } 1829 }