[9] RFR (M) 8054888: Runtime: Add Diagnostic Command that prints the class hierarchy

Staffan Larsen staffan.larsen at oracle.com
Tue Feb 10 12:19:24 UTC 2015


In general I think this looks very good. Simple and well-commented code to follow. I am missing a test, though. Please look at the hotspot/test/serviceability/dcmd set of tests.

A couple of smaller comments:

Are Unsafe.defineAnonymousClass classes included? Should they be?

I think ClassHierarchyDCmd should include this code as well to restrict remote access:
    static const JavaPermission permission() {
      JavaPermission p = {"java.lang.management.ManagementPermission",
                          "monitor", NULL};
      return p;

diagnosticCommand.hpp:278: Missing “if” in the comment

vm_operations.hpp: Spelling error in “VM_PrintClassHierachry” and “PrintClassHierachry”

vm_operations.hpp:461: Should the complete class be surrounded by "#if INCLUDE_SERVICES” ?

heapInspection.hpp:272: The constructor and destructor does not seem to be used. Because of that you should also change it to a AllStatic class.

heapInspection.cpp:339: Shouldn’t this be labeled as an “error”?


> On 10 feb 2015, at 03:00, Chris Plummer <chris.plummer at oracle.com> wrote:
> [Once again the attachment went out but the main body was stripped. Not too sure what's going on, but here it is again. Sorry if you are getting this twice.]
> I've attached updated output:
> • I now use the Klass* of the ClassLoader instead of the CLD*, and this is documented in the help output.
> • The Klass* of the ClassLoader now immediately follows the class name, and is also included when printing interface names.
> The webrevs can be found at:
> http://cr.openjdk.java.net/~cjplummer/8054888/webrev.01/
> http://cr.openjdk.java.net/~cjplummer/8054888/webrev.00-01/
> The first is the full webrev. The 2nd is what's changed since the last webrev that was reviewed. Changes since then include:
> • Support for printing the hierarchy of just one class.
> • -s option for optionally including subclasses when printing one class.
> • -i option for optionally including interfaces implemented by a class.
> • Output formatting changes.
> • Fixed some comment typos as requested.
> • I moved a couple of KlassInfoEntry methods out of the .hpp file and into the .cpp file as requested.
> • No longer keep track of the stack of superclasses when processing all the classes as requested. This also means the super_index field I added is no longer needed.
> • Moved some code within an already existing " #if INCLUDE_SERVICES" block as requested.
> thanks,
> Chris

More information about the hotspot-runtime-dev mailing list