author | lfoltan |
Mon, 21 Oct 2019 13:13:16 -0400 | |
changeset 58722 | cba8afa5cfed |
parent 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
50443
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50863
diff
changeset
|
2 |
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
50443
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
3 |
* Copyright (c) 2018 SAP SE. All rights reserved. |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
5 |
* |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
6 |
* This code is free software; you can redistribute it and/or modify it |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
7 |
* under the terms of the GNU General Public License version 2 only, as |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
8 |
* published by the Free Software Foundation. |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
9 |
* |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
14 |
* accompanied this code). |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
15 |
* |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
16 |
* You should have received a copy of the GNU General Public License version |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation, |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
19 |
* |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
21 |
* or visit www.oracle.com if you need additional information or have any |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
22 |
* questions. |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
23 |
* |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
24 |
*/ |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
25 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50863
diff
changeset
|
26 |
#ifndef SHARE_CLASSFILE_CLASSLOADERHIERARCHYDCMD_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50863
diff
changeset
|
27 |
#define SHARE_CLASSFILE_CLASSLOADERHIERARCHYDCMD_HPP |
50443
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
28 |
|
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
29 |
#include "services/diagnosticCommand.hpp" |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
30 |
|
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
31 |
class ClassLoaderHierarchyDCmd: public DCmdWithParser { |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
32 |
DCmdArgument<bool> _show_classes; |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
33 |
DCmdArgument<bool> _verbose; |
50863
9084fd587141
8205531: jcmd VM.classloaders should fold similar loaders
stuefe
parents:
50443
diff
changeset
|
34 |
DCmdArgument<bool> _fold; |
50443
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
35 |
public: |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
36 |
|
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
37 |
ClassLoaderHierarchyDCmd(outputStream* output, bool heap); |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
38 |
|
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
39 |
static const char* name() { |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
40 |
return "VM.classloaders"; |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
41 |
} |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
42 |
|
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
43 |
static const char* description() { |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
44 |
return "Prints classloader hierarchy."; |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
45 |
} |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
46 |
static const char* impact() { |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
47 |
return "Medium: Depends on number of class loaders and classes loaded."; |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
48 |
} |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
49 |
static const JavaPermission permission() { |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
50 |
JavaPermission p = {"java.lang.management.ManagementPermission", |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
51 |
"monitor", NULL}; |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
52 |
return p; |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
53 |
} |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
54 |
static int num_arguments(); |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
55 |
virtual void execute(DCmdSource source, TRAPS); |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
56 |
|
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
57 |
}; |
8e56de95ce10
8203682: Add jcmd "VM.classloaders" command to print out class loader hierarchy, details
stuefe
parents:
diff
changeset
|
58 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50863
diff
changeset
|
59 |
#endif // SHARE_CLASSFILE_CLASSLOADERHIERARCHYDCMD_HPP |