jvm-profiling-tools / honest-profiler

A sampling JVM profiler without the safepoint sample bias
https://github.com/RichardWarburton/honest-profiler/wiki
MIT License
1.25k stars 146 forks source link

No support for Arm64 #239

Closed guyuqi closed 6 years ago

guyuqi commented 6 years ago

Honest-profiler is super awesome.
For honest-profiler is JAVA based, we assumed this profiler is platform independent. So we would like to use this tools to profile jvm on Arm64. Unfortunately, we met some build issues. [INFO] Scanning dependencies of target lagent [INFO] [ 5%] Building CXX object CMakeFiles/lagent.dir/src/main/cpp/agent.cpp.o [INFO] c++: error: unrecognized command line option '-msse2' [INFO] c++: error: unrecognized command line option '-mfpmath=sse' [INFO] CMakeFiles/lagent.dir/build.make:62: recipe for target 'CMakeFiles/lagent.dir/src/main/cpp/agent.cpp.o' failed [INFO] make[2]: *** [CMakeFiles/lagent.dir/src/main/cpp/agent.cpp.o] Error 1 [INFO] CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/lagent.dir/all' failed [INFO] make[1]: *** [CMakeFiles/lagent.dir/all] Error 2 [INFO] Makefile:94: recipe for target 'all' failed [INFO] make: *** [all] Error 2 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE Could you please give some tips to fix this build errors? Thanks!

nitsanw commented 6 years ago

HP is for profiling Java programs, but the agent itself is native. The error above suggests some of the c++ compiler settings are not suitable for ARM. I don't have the environment to reproduce the issue, but would recommend you resolve this by tweaking the CMake configuration. In future we may want to add an ARM environment to the build setup.

RichardWarburton commented 6 years ago

To add to what @nitsanw said. I don't mind accepting a PR to Fix ARM, but I don't have any Arm64 hardware to directly test this on. I would recommend that you look around line 119 of the CMakeLists file. You may also find this SO post useful/depressing: https://stackoverflow.com/questions/11944060/how-to-detect-target-architecture-using-cmake

dchuyko commented 6 years ago

Hello. I've created a fix for that. SSE flags are now included only for x86_64. This should also potentially fix other non-x86 platforms. Checked build on x86_64 and aarch64.

dchuyko commented 6 years ago

Just in case,

ARM64, Ubuntu 16.04, Oracle Java 8u161 + OpenJFX. Tests run: 42301, Failures: 0, Errors: 4, Skipped: 4 That machine has no GUI, failed ones will likely pass with it.

x86 Tests run: 42433, Failures: 0, Errors: 2, Skipped: 4.