Skip to content

Commit

Permalink
Merge pull request #87 from renfeiw/machineInfo
Browse files Browse the repository at this point in the history
Update MachineInfo
  • Loading branch information
llxia authored Jul 6, 2020
2 parents b3d753d + fc47e95 commit 4689da2
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 259 deletions.
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ compile: envDetect
envDetect: compileTools
ifneq ($(AUTO_DETECT), false)
@echo "AUTO_DETECT is set to true"
${TEST_JDK_HOME}$(D)bin$(D)java -cp .$(D)bin$(D)TestKitGen.jar org.openj9.envInfo.EnvDetector JavaInfo
${TEST_JDK_HOME}$(D)bin$(D)java -cp .$(D)bin$(D)TestKitGen.jar org.openj9.envInfo.EnvDetector
else
@echo "AUTO_DETECT is set to false"
endif
Expand Down
18 changes: 7 additions & 11 deletions src/org/openj9/envInfo/EnvDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public static void main(String[] args) {
}

private static void parseArgs(String[] args) {
if (args.length == 0) {
getJavaInfo();
getMachineInfo();
}
for (int i = 0; i < args.length; i++) {
String option = args[i].toLowerCase();
if (option.equals("machineinfo")) {
Expand Down Expand Up @@ -69,21 +73,13 @@ private static void getJavaInfo() {
} catch (IOException e) {
e.printStackTrace();
}

}

private static void getMachineInfo() {
MachineInfo machineInfo = new MachineInfo();

machineInfo.getMachineInfo(MachineInfo.UNAME_CMD);
machineInfo.getMachineInfo(MachineInfo.SYS_ARCH_CMD);
machineInfo.getMachineInfo(MachineInfo.PROC_ARCH_CMD);
machineInfo.getMachineInfo(MachineInfo.SYS_OS_CMD);
machineInfo.getMachineInfo(MachineInfo.CPU_CORES_CMD);
machineInfo.getMachineInfo(MachineInfo.ULIMIT_CMD);

machineInfo.getRuntimeInfo();
machineInfo.getSpaceInfo("");
machineInfo.getInfo();
System.out.println("****************************** MACHINE INFO ******************************");
System.out.println(machineInfo);
System.out.println("**************************************************************************\n");
}
}
Loading

0 comments on commit 4689da2

Please sign in to comment.