Skip to content

feat: support risc-v #709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

feat: support risc-v #709

wants to merge 1 commit into from

Conversation

lievenhey
Copy link
Contributor

Requires KDAB/perfparser#39 to be merged. Fixes: #705

@lievenhey
Copy link
Contributor Author

@dendibakh I added some support for risc-v. I can't really test this, but the result looks sane.

Requires KDAB/perfparser#39 to be merged.
Fixes: #705
@dendibakh
Copy link

Thanks @lievenhey! Is there an easy way for me to test this? IIRC, building hotspots from sources is not trivial. But if I can update a few libs and test, then I can test the fix.

@lievenhey
Copy link
Contributor Author

@dendibakh there is a ci job running which builds an appimage. You can download the current appimage here https://github.com/KDAB/hotspot/actions/runs/14440980603?pr=709

@dendibakh
Copy link

Thanks @lievenhey. The appimage is x86, so I can't install it on my P550 board. However, I installed it on a Linux x86 system and opened the profile there. I can see the correct function names, which is good.
image
I can't see the disassembly for the solution function though -- it shows a blank window.

@lievenhey
Copy link
Contributor Author

Yeah the disassembly is a little bit funky but I am working on a better solution.

@lievenhey
Copy link
Contributor Author

I am still not sure if hotspot works with bigger recordings of riscv programs. But I don't have a risc-v board so I can't test it.

@dendibakh
Copy link

I see. How hard do you think it would be to add the riscv disasm support to hotspot (assuming you have access to a riscv board)?

Anyway, from my perspective, this patch is already a step forward.

@lievenhey
Copy link
Contributor Author

We are using objdump for the disassembly. If you have a objdump version which supports riscv you can set that in Settings -> Unwind -> objdump path. Then it should work.

@dendibakh
Copy link

I installed riscv binutils with sudo apt install binutils-riscv64-unknown-elf and added /usr/bin/riscv64-unknown-elf-objdump in Settings -> Unwind -> objdump path. Now when I try to show disassembly for a function, the application crashes.

/tmp/.mount_hotspoe5cYDy/AppRun.wrapped: line 6:  8792 Segmentation fault      (core dumped) LD_LIBRARY_PATH="$d/usr/lib":$LD_LIBRARY_PATH "$bin/hotspot" "$@"

@dendibakh dendibakh mentioned this pull request May 29, 2025
@milianw
Copy link
Member

milianw commented May 29, 2025

Can you get us a backtrace for the crash by any chance? Ideally self-compiled?

@dendibakh
Copy link

Can you get us a backtrace for the crash by any chance? Ideally self-compiled?

@milianw , I tried getting a stack trace but it seems the image provided by @lievenhey doesn't have symbols. So, when I run it under gdb it shows no useful data.

[Inferior 1 (process 3227653) exited with code 0213]
Core was generated by `/usr/libexec/ibus-ui-gtk3'.
Program terminated with signal SIGSEGV, Segmentation fault.

I don't know how to build hotspots and I'm afraid it will take me a lot of time to do it.

The crash that I see can be reproduced on an x86 system as I described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RISC-V support
3 participants