Skip to content

Commit d73f856

Browse files
miss-islingtonixgbe00pablogsal
authored
[3.13] gh-120400 :Support Linux perf profile to see Python calls on RISC-V architecture (GH-120089) (#120413)
gh-120400 :Support Linux perf profile to see Python calls on RISC-V architecture (GH-120089) (cherry picked from commit 4b1e85b) Co-authored-by: ixgbe00 <[email protected]> Co-authored-by: Pablo Galindo Salgado <[email protected]>
1 parent d4174fa commit d73f856

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Support Linux perf profiler to see Python calls on RISC-V architecture
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Support Linux perf profiler to see Python calls on RISC-V architecture.

Python/asm_trampoline.S

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ _Py_trampoline_func_start:
2222
blr x3
2323
ldp x29, x30, [sp], 16
2424
ret
25+
#endif
26+
#ifdef __riscv
27+
addi sp,sp,-16
28+
sd ra,8(sp)
29+
jalr a3
30+
ld ra,8(sp)
31+
addi sp,sp,16
32+
jr ra
2533
#endif
2634
.globl _Py_trampoline_func_end
2735
_Py_trampoline_func_end:

configure

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3641,6 +3641,7 @@ AC_MSG_CHECKING([perf trampoline])
36413641
AS_CASE([$PLATFORM_TRIPLET],
36423642
[x86_64-linux-gnu], [perf_trampoline=yes],
36433643
[aarch64-linux-gnu], [perf_trampoline=yes],
3644+
[riscv64-linux-gnu], [perf_trampoline=yes],
36443645
[perf_trampoline=no]
36453646
)
36463647
AC_MSG_RESULT([$perf_trampoline])

0 commit comments

Comments
 (0)