clang generate stack frame differently than gcc.
The patch handle both compiler and enable stack frame when HWPMC is enabled.
If some userland program is using gcc the stack frame will not be captured correctly. A future possible evolution is to add a heuristic on failure to change from one mode to the other.
Details
Without patch "pmcstat -n1 -S clock.hard -T" will not show any level above captured location.
With the patch chain is captured correctly.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
We should be using the EABI unwinding function. The location of any given register on the EABI stack is compiler specific so we shouldn't hard code it.
sys/conf/Makefile.arm | ||
---|---|---|
54 ↗ | (On Diff #18961) | Your source tree seems to be out of date. WITHOUT_ARM_EABI was removed from this file over 2 years ago. |
Yes but the EABI unwinding cost is not the same.
At the moment every platform use basic stack walk.
This patch only repair something broken since clang as default compiler.
https://llvm.org/bugs/show_bug.cgi?id=18505
As a second step it will be interesting to benchmark.
sys/conf/Makefile.arm | ||
---|---|---|
54 ↗ | (On Diff #18961) | Yes I've imported the patch for 10.3... |
Please can you review ? :)
If no one is strictly opposed I will commit next week.
Thanks in advance.