Get --ftrace working on aarch64

This change implements a new approach to function call logging, that's
based on the GCC flag: -fpatchable-function-entry. Read the commentary
in build/config.mk to learn how it works.
This commit is contained in:
Justine Tunney 2023-06-05 23:35:31 -07:00
parent 5b908bc756
commit eb40cb371d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
934 changed files with 2259 additions and 1268 deletions

View file

@ -23,8 +23,9 @@
// @param edi is int to encode
// @return rax is word-encoded byte buffer
// @note invented on a napkin in a new jersey diner
_tpenc: .leafprologue
.profilable
.ftrace1
_tpenc: .ftrace2
.leafprologue
mov %edi,%edi
xor %eax,%eax
cmp $127,%edi
@ -47,20 +48,20 @@ _tpenc: .leafprologue
.rodata
.balign 4
.underrun
kTpenc: .rept 4 # MSB10 (0x7FF)
.byte 1,0b11000000 # len,mark
kTpenc: .rept 4 // MSB10 (0x7FF)
.byte 1,0b11000000 // len,mark
.endr
.rept 5 # MSB15 (0xFFFF)
.byte 2,0b11100000 # len,mark
.rept 5 // MSB15 (0xFFFF)
.byte 2,0b11100000 // len,mark
.endr
.rept 5 # MSB20 (0x1FFFFF)
.byte 3,0b11110000 # len,mark
.rept 5 // MSB20 (0x1FFFFF)
.byte 3,0b11110000 // len,mark
.endr
.rept 5 # MSB25 (0x3FFFFFF)
.byte 4,0b11111000 # len,mark
.rept 5 // MSB25 (0x3FFFFFF)
.byte 4,0b11111000 // len,mark
.endr
.rept 6 # MSB31 (0xffffffff)
.byte 5,0b11111100 # len,mark
.rept 6 // MSB31 (0xffffffff)
.byte 5,0b11111100 // len,mark
.endr
.zero 2
.endobj kTpenc