-
Notifications
You must be signed in to change notification settings - Fork 74
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
jcmd supports VMID query via Java process display name #1301
Conversation
Jenkins doc stage |
docs/tool_jcmd.md
Outdated
@@ -39,6 +39,10 @@ Where: | |||
|
|||
- `<vmid>` is the Attach API virtual machine identifier for the Java™ VM process. This ID is often, but not always, the same as the operating system *process ID*. One example where the ID might be different is if you specified the system property `-Dcom.ibm.tools.attach.id` when you started the process. You can use the [`jps`](tool_jps.md) command to find the VMID. | |||
|
|||
You can also specify the full or partial Java process display name instead of the VMID. The `jcmd` tool finds the corresponding VMID of the display name and runs the `jcmd` command. |
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.
What is a Java process display name, is this defined somewhere?
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.
No, not specifically. But, I can see display name mentioned in https://eclipse.dev/openj9/docs/dcomibmtoolsattachdisplayname/. Is this same as Java process display name? Could you specify any other definition that I should add? Thanks!
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.
Jason pls help clear this up. The linked topic https://eclipse.dev/openj9/docs/dcomibmtoolsattachdisplayname/ could use more explanation of what the display name is, what is the default, what it's used for.
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.
Jcmd
or Jcmd -l
lists current java processes recognized by this utility, the list comes with two columns, one is VMID which usually is the process id, and the other is the display name.
The display name for a virtual machine could be specified via a system property com.ibm.tools.attach.displayName
as per https://eclipse.dev/openj9/docs/dcomibmtoolsattachdisplayname/, otherwise it is the main class name along with the application arguments.
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.
So basically the default display name is the entire java command line. I don't know that sun.java.command
is documented so better not to mention it.
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.
Replace it with the main class name along with the application arguments.
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.
Jcmd
orJcmd -l
lists current java processes recognized by this utility, the list comes with two columns, one is VMID which usually is the process id, and the other is the display name.The display name for a virtual machine could be specified via a system property
com.ibm.tools.attach.displayName
as per https://eclipse.dev/openj9/docs/dcomibmtoolsattachdisplayname/, otherwise it is the main class name along with the application arguments.
@JasonFengJ9 - Is it "The display name for a virtual machine" or "The display name for the Java VM process", or "The display name for the Attach API virtual machine" or "The display name for the target virtual machine on which the jcmd
command must run."?
- is
-l
, one of the options available forjcmd
in addition to-J
and-h
? - Also, do both
jcmd
andjcmd -l
list the current java processes recognized by this utility? i.e. even if we don't specify the-l
option, will it still list the current java processes?
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 it "The display name for a virtual machine" or "The display name for the Java VM process", or "The display name for the Attach API virtual machine" or "The display name for the target virtual machine on which the jcmd command must run."?
When Jcmd
or other AttachAPI utilities list the currently running Java processes, the display name refers to the target Java process that could be attached by Jcmd
.
is -l, one of the options available for jcmd in addition to -J and -h?
Correct.
Also, do both jcmd and jcmd -l list the current java processes recognized by this utility? i.e. even if we don't specify the -l option, will it still list the current java processes?
Yes, -l
is the default option.
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 the following correct? Especially this part jcmd [pid | main-class] command
. I saw this mentioned in eclipse-openj9/openj9#19045 (comment)
The display name for a target VM is specified either through a system property
com.ibm.tools.attach.displayName
, or by specifying the main class name along with the application arguments -jcmd [pid | main-class] command
.
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.
The main-class
(along with application arguments) are the default display name if no system property com.ibm.tools.attach.displayName was set.
Suggest changing to something like following:
The display name for a target VM is specified through a system property com.ibm.tools.attach.displayName, or by default the main class name along with the application arguments - jcmd [pid | main-class] command.
8aad2cf
to
b17f32c
Compare
Jenkins doc stage |
b17f32c
to
45581c3
Compare
Jenkins doc stage |
45581c3
to
39fbf24
Compare
Jenkins doc stage |
39fbf24
to
4b7710a
Compare
Jenkins doc stage |
1 similar comment
Jenkins doc stage |
@JasonFengJ9 @pshipton - I have updated the documents. Please check and confirm. Thanks! |
Can we pls add the information describing the default display name into the https://eclipse.dev/openj9/docs/dcomibmtoolsattachdisplayname/ topic. |
In the existing content, default is described as "The command line invocation used to start the application", which doesn't make sense. Can I replace this line with "Main class name along with the application arguments"? Will that be correct? Does the -Dcom.ibm.tools.attach.displayName system property have a specific default value of its own? Or is it just that if the nothing is specified in the system property then the display name is set as "Main class name along with the application arguments and not that the system property is defaulted to "Main class name along with the application arguments"? Thanks! |
Works for me.
Yes |
Then, that means "Main class name along with the application arguments" is not the default value of |
I agree. I didn't even notice the default value column described the behavior until you mentioned it. |
7e7af7b
to
87ca04a
Compare
Jenkins doc stage |
@pshipton - I have made the changes. Please check and confirm. Thanks! |
docs/tool_jcmd.md
Outdated
|
||
You can specify the display name for a target VM through the [`com.ibm.tools.attach.displayName`](dcomibmtoolsattachdisplayname.md) system property. If the display name is not set through the system property, then the main class name along with the application arguments is set as the default display name. The command syntax is as follows: | ||
|
||
jcmd [pid | main-class] command |
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.
I still don't understand the purpose of this. The jcmd command syntax is already shown on line 32 as jcmd <vmid | display name | 0> <arguments>
, why do we want to state it again here, in a paragraph describing the display name, and using different parameter names, ie. pid vs vmid, main-class vs display name, command vs arguments.
e14345f
to
f69a4bd
Compare
Jenkins doc stage |
@pshipton - I have made the change. Thanks! |
@JasonFengJ9 any further concerns? |
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.
LGTM
f69a4bd
to
f46a96d
Compare
Jenkins doc stage |
@pshipton - Please check and confirm. Thanks! |
eclipse-openj9#1292 Updated the related topics with the change in jcmd VMID query behavior. Incorporated the feedback Closes eclipse-openj9#1292 Signed-off-by: Sreekala Gopakumar <[email protected]>
f46a96d
to
31f4830
Compare
Jenkins doc stage |
#1292
Updated the related topics with the change in jcmd VMID query behavior
Closes #1292
Signed-off-by: Sreekala Gopakumar [email protected]