RFR: 8275775: Add jcmd VM.classes to print details of all classes [v2]

Xin Liu xliu at openjdk.java.net
Wed Jan 19 08:43:29 UTC 2022


On Wed, 19 Jan 2022 07:18:03 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> > > > It seems it would be useful to support the verbose output with just a single class that is specified, although that would suggest that the dcmd name should then be something other than `VM.classes`.
> > > 
> > > 
> > > This is a good idea, but `jcmd VM.classes verbose=XX` looks strange, `jcmd VM.class XX` is also not much proper, because we desire to print all classes in default(`jcmd VM.class`). an alternative is to use `jcmd VM.classes verbose | grep XX` currently.
> > 
> > 
> > I was thinking the syntax would look like: `jcmd VM.classes [verbose [classname]]`
> > Your grep solution doesn't work because each class has multiple lines of output.
> 
> How about this:
> 
> ```
> jcmd VM.classes -verbose classname classname ...
> ```
> 
> -verbose is optional
> 
> more than one classnames can be specified.
> 
> if no classnames are specified, all classes are printed

If the class name here means the "fully-qualified" class name, I guess it's not practical to input multiple classnames like "java.lang.invoke.LambdaForm$MH/0x0000000800c0b400" in cmdline. 

The main cost of VM_PrintClasses should be the traversal of all classes. I feel a filter won't save much runtime time.  We can leave it to the external awk scripts. What do you think?

-------------

PR: https://git.openjdk.java.net/jdk/pull/7105


More information about the hotspot-dev mailing list