Hi everyone,
I tried to use Sniper-Arm according to the documentation "README.arm64".
I encountered several problems, such as adding support for ARM in "simulator.cc" on X86 host.
- dl::dl_arch dla;
- String architecture = Sim()->getCfg()->getString("general/arch");
- if (architecture == "intel")
- dla = dl::DL_ARCH_INTEL;
- else if (architecture == "riscv")
- dla = dl::DL_ARCH_RISCV;
- else if (architecture == "armv8")
- dla = dl::DL_ARCH_ARMv8;
Another problem is on the frontend (arm board). I fixed it by setting the path as exact path in "dr-frontend/Cmakelist.txt".
Though I finally can successfully compile the Sniper in x86 host and dynamorio on Arm board, I still cannot get the simulation output.
Since I got everything done, I started compiled a hello.c on Arm board with the command "gcc -o hello hello.c", and then use the command in "README.arm64" to extract trace.
$(SIM_ROOT_ARM)/dynamorio/bin64/drrun -debug -loglevel 1 -c $(SIM_ROOT_ARM)/dynamorio/clients/lib64/debug/libdr-frontend.so -roi 0 -f 0 -d 0 -b 0 -o trace -e 0 -s 0 -r 0 -stop 0 -verbose -- hello
After getting the trace file, I transferred it to the x86 host and used the command to perform the simulation.
./run-sniper -v --traces=NAME_OF_TRACE.sift -ccortex-a72
However, there is no simulation result (sim.out). The output is as follows.
cloudyao@node0:~/yao/snipersim/z-test$ ../run-sniper -v --traces=ntt-trace.sift -c cortex-a72
- [SNIPER] (0) Using trace file /users/cloudyao/yao/snipersim/z-test/ntt-trace.sift
- [SNIPER] Start
- [SNIPER] Start
- [SNIPER] Running ['bash', '-c', '/users/cloudyao/yao/snipersim/lib/sniper -c /users/cloudyao/yao/snipersim/config/base.cfg --general/total_cores=1 --general/output_dir=/users/cloudyao/yao/snipersim/z-test -g --traceinput/mirror_output=true --config=/users/cloudyao/yao/snipersim/config/cortex-a72.cfg -g --traceinput/stop_with_first_app=true -g --traceinput/restart_apps=false -g --traceinput/enabled=true -g --traceinput/emulate_syscalls=false -g --traceinput/num_apps=1 -g --traceinput/thread_0=/users/cloudyao/yao/snipersim/z-test/ntt-trace.sift']
- [SNIPER] Running
- [SNIPER] Start
- [SNIPER] End
- [SNIPER] Elapsed time: 0.15 seconds
I am confused about where the mistakes are lying. Is my generation of the program wrong? Since I do not pass any flags to the hello.c.
Has anyone successfully run the process following the exact same steps in the README without encountering any problems?
Best regards,
Jingyao