I am trying to do profiling of the code written in C++ with the target Architecture RISC-V. The code has been cross-compiled using RISC-V GNU Toolchain. My executable is unit_tests "ELF 64-bit LSB executable, UCB RISC-V, version 1 (GNU/Linux), dynamically linked,nterpreter /lib/ld-linux-riscv64-lp64d.so.1, for GNU/Linux 4.15.0, with debug_info, not stripped" this information is retrieved using the file command.
What I am trying to do is the profiling of this using gprof. But to do the gprof gmon.out needs to be generated, to generate gmon.out the executable should be run first. I cannot run the binary elf of other architecture in some different architecture. I need a suggestion for this on which emulator or simulator does this for me or I can run on?
I have tried installing qemu using the follwing link:
but not able to successfully install it. Also have tried with spike but got "bad synccall" error. Any leads how can I resolve this issue.
apt install qemu-user
; you do not need to compile qemu from source as your link describes. – Nate Eldredgeapt install qemu-user
as root (sudo
if needed) will install qemu. You may have to doapt update
first. Sorry, I do not know about profiling specifically. I believe thatgprof
just uses standard OS features that I would expect the emulator to support. I'm just not sure that the data you gather will be very useful. – Nate Eldredge