|
|
|
@ -2,6 +2,8 @@ package arthas;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
|
|
import com.taobao.arthas.common.OSUtils;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author ZhangZiCheng 2021-02-12
|
|
|
|
|
* @author hengyunabc 2021-04-26
|
|
|
|
@ -14,6 +16,24 @@ public class Vmtool implements VMtoolMXBean {
|
|
|
|
|
*/
|
|
|
|
|
public final static String JNI_LIBRARY_NAME = "ArthasJniLibrary";
|
|
|
|
|
|
|
|
|
|
private static String libName = null;
|
|
|
|
|
static {
|
|
|
|
|
if (OSUtils.isMac()) {
|
|
|
|
|
libName = "libArthasJniLibrary-x64.dylib";
|
|
|
|
|
}
|
|
|
|
|
if (OSUtils.isLinux()) {
|
|
|
|
|
libName = "libArthasJniLibrary-x64.so";
|
|
|
|
|
if (OSUtils.isArm32()) {
|
|
|
|
|
libName = "libArthasJniLibrary-arm.so";
|
|
|
|
|
} else if (OSUtils.isArm64()) {
|
|
|
|
|
libName = "libArthasJniLibrary-aarch64.so";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (OSUtils.isWindows()) {
|
|
|
|
|
libName = "libArthasJniLibrary-x64.dll";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static Vmtool instance;
|
|
|
|
|
|
|
|
|
|
private Vmtool() {
|
|
|
|
@ -38,6 +58,10 @@ public class Vmtool implements VMtoolMXBean {
|
|
|
|
|
return instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String detectLibName() {
|
|
|
|
|
return libName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检测jni-lib是否正常,如果正常,应该输出OK
|
|
|
|
|
*/
|
|
|
|
|