Skip to content

Commit

Permalink
pythongh-120400 :Support Linux perf profile to see Python calls on RI…
Browse files Browse the repository at this point in the history
…SC-V architecture (python#120089)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
  • Loading branch information
ixgbe00 and pablogsal committed Jun 12, 2024
1 parent 32d3e05 commit 4b1e85b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support Linux perf profiler to see Python calls on RISC-V architecture
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support Linux perf profiler to see Python calls on RISC-V architecture.
8 changes: 8 additions & 0 deletions Python/asm_trampoline.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ _Py_trampoline_func_start:
blr x3
ldp x29, x30, [sp], 16
ret
#endif
#ifdef __riscv
addi sp,sp,-16
sd ra,8(sp)
jalr a3
ld ra,8(sp)
addi sp,sp,16
jr ra
#endif
.globl _Py_trampoline_func_end
_Py_trampoline_func_end:
Expand Down
2 changes: 2 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3641,6 +3641,7 @@ AC_MSG_CHECKING([perf trampoline])
AS_CASE([$PLATFORM_TRIPLET],
[x86_64-linux-gnu], [perf_trampoline=yes],
[aarch64-linux-gnu], [perf_trampoline=yes],
[riscv64-linux-gnu], [perf_trampoline=yes],
[perf_trampoline=no]
)
AC_MSG_RESULT([$perf_trampoline])
Expand Down

0 comments on commit 4b1e85b

Please sign in to comment.