-
Notifications
You must be signed in to change notification settings - Fork 738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement jps: java process status #4650
Conversation
5a17cdd
to
760fd23
Compare
To build a launcher, add
|
760fd23
to
94a24de
Compare
Please open a https://github.com/eclipse/openj9-docs issue |
I prefer to have the launchers and tests before this is merged, so they can be run to confirm everything is working properly. |
jcl/src/openj9.diagnostics/share/classes/openj9/tools/attach/diagnostics/Jps.java
Outdated
Show resolved
Hide resolved
jcl/src/openj9.diagnostics/share/classes/openj9/tools/attach/diagnostics/Jps.java
Outdated
Show resolved
Hide resolved
jcl/src/openj9.diagnostics/share/classes/openj9/tools/attach/diagnostics/Jps.java
Outdated
Show resolved
Hide resolved
Likely been asked before, but for the record here, does the sun.tools.jps.Jps implementation work on OpenJ9? Is there any need to write another one? If we do, I'm thinking it should go into the jdk.jcmd module for compatibility, instead of openj9.diagnostics. |
I'm thinking any new module we use needs to be added to the j9modules.txt to ensure everything is built in the correct order. |
jcl/src/java.base/share/classes/com/ibm/tools/attach/target/Attachment.java
Outdated
Show resolved
Hide resolved
jcl/src/openj9.diagnostics/share/classes/openj9/tools/attach/diagnostics/Jps.java
Outdated
Show resolved
Hide resolved
jcl/src/openj9.diagnostics/share/classes/openj9/tools/attach/diagnostics/Jps.java
Outdated
Show resolved
Hide resolved
jcl/src/openj9.diagnostics/share/classes/openj9/tools/attach/diagnostics/Jps.java
Outdated
Show resolved
Hide resolved
jcl/src/openj9.diagnostics/share/classes/openj9/tools/attach/diagnostics/Jps.java
Outdated
Show resolved
Hide resolved
No, the existing
Will do. |
Done |
I don't see the changes you've claimed to have made - will you be pushing to your branch shortly? |
I am testing the changes now and will advise when the updates are pushed. |
Note that Keith advised me the j9modules.txt was only needed for IBM builds and is now obsolete. |
Requires eclipse-openj9/openj9#4650 Signed-off-by: Peter Bain <peter_bain@ca.ibm.com>
Requires eclipse-openj9/openj9#4650 Signed-off-by: Peter Bain <peter_bain@ca.ibm.com>
Depends on eclipse-openj9/openj9#4650 Signed-off-by: Peter Bain <peter_bain@ca.ibm.com>
81dd587
to
48b2b84
Compare
Requires eclipse-openj9/openj9#4650 Signed-off-by: Peter Bain <peter_bain@ca.ibm.com>
Recent changes seem to have broken Java 8. Investigating... |
f5a256c
to
1f59efc
Compare
@pdbain-ibm please indicate when this is ready to go, and remove the WIP. |
Working on it. The first problem was I mucked up |
347d99b
to
68853e7
Compare
Updated and re-tested on Linux X86 Java 8 & 11. Changes since last review:
|
68853e7
to
129b19f
Compare
I ran some testing on plinux, which passed, although the jps tests took 20min to run.
jdk8: https://ci.eclipse.org/openj9/view/Test/job/Test-Grinder/308/ - ub16-ppcle-1 |
The test runs in well under a minute on my Mac and Linux box, and on the internal Linux X86 build farm. I am testing on a PPCLE machine. Note that the |
I ran TestJps on a pLinux box locally; it ran in ~15 seconds. Manually tested on Windows. |
129b19f
to
24314b7
Compare
Checked AttachAPISanity on plinux from the nightly build last night, but it isn't taking much time to run.
|
~10s on xlinux. Please request access to the plinux machine ub16-ppcle-1 and check why it is slow to run TestJps. |
assertTrue(CHILD_PROCESS_DID_NOT_LAUNCH, tgtMgr.syncWithTarget()); | ||
List<String> jpsOutput = runCommand(Collections.singletonList("-l")); //$NON-NLS-1$ | ||
Optional<String> searchResult = search(tgtMgr.targetId, jpsOutput); | ||
assertTrue(CHILD_IS_MISSING, search(tgtMgr.targetId, jpsOutput).isPresent()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
searchResult can be used here.
commandName = JPS_COMMAND; | ||
assertTrue("Attach API failed to launch", TargetManager.waitForAttachApiInitialization()); //$NON-NLS-1$ | ||
vmId = TargetManager.getVmId(); | ||
skipTest = !System.getProperty("java.vm.vendor").contains("OpenJ9"); //$NON-NLS-1$//$NON-NLS-2$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really required? I'm not sure that it is, since IBM isn't listed as an <impl>
in the playlist.
Windows - all passed |
Ran a personal build on Windows, Java 8 and 11 passed. |
Add Java code to implement the main function Update Attach API to return JVM arguments Add unit test [ci skip] Signed-off-by: Peter Bain <peter_bain@ca.ibm.com>
24314b7
to
142da72
Compare
Right.
Yes.
I added it for the case where someone is running testNG without the test tooling. I removed the flag and changed the check to an assertion so the test fails if you try to run with a different JVM. |
Test code updated. |
Validation test https://ci.eclipse.org/openj9/view/Test/job/Test-Grinder/315/ |
Previous grinder passed. |
Add Java code to implement the main function. This uses Attach API to acquire the list of processes
and query their information.
Update Attach API to return JVM arguments
Launchers will be added using coordinated changes in the extension repos.
Requires (mutually):
These required test utility changes should be merged before this is merged:
Create generic test process launcher #4672 for testingNot requiredAdd test utility methods to get attach API information #4639 for testing.MergedDoc issues:
Fixes #2377
Signed-off-by: Peter Bain peter_bain@ca.ibm.com