Mercurial > hg > graal-compiler
annotate agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java @ 14223:de6a9e811145
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
Summary: Copyright year updated for files modified during 2013
Reviewed-by: twisti, iveresov
author | mikael |
---|---|
date | Tue, 24 Dec 2013 11:48:39 -0800 |
parents | 7fe6ef09d242 |
children | 4ca6dc0799b6 |
rev | line source |
---|---|
0 | 1 /* |
14223
de6a9e811145
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents:
12932
diff
changeset
|
2 * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 package sun.jvm.hotspot.tools; | |
26 | |
11054
38ea2efa32a7
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
1552
diff
changeset
|
27 import sun.jvm.hotspot.debugger.JVMDebugger; |
38ea2efa32a7
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
1552
diff
changeset
|
28 |
0 | 29 public class JStack extends Tool { |
30 public JStack(boolean mixedMode, boolean concurrentLocks) { | |
31 this.mixedMode = mixedMode; | |
32 this.concurrentLocks = concurrentLocks; | |
33 } | |
34 | |
35 public JStack() { | |
36 this(true, true); | |
37 } | |
38 | |
11054
38ea2efa32a7
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
1552
diff
changeset
|
39 public JStack(JVMDebugger d) { |
38ea2efa32a7
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
1552
diff
changeset
|
40 super(d); |
38ea2efa32a7
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
1552
diff
changeset
|
41 } |
38ea2efa32a7
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
1552
diff
changeset
|
42 |
0 | 43 protected boolean needsJavaPrefix() { |
44 return false; | |
45 } | |
46 | |
47 public String getName() { | |
48 return "jstack"; | |
49 } | |
50 | |
51 protected void printFlagsUsage() { | |
52 System.out.println(" -l\tto print java.util.concurrent locks"); | |
53 System.out.println(" -m\tto print both java and native frames (mixed mode)"); | |
54 super.printFlagsUsage(); | |
55 } | |
56 | |
57 public void run() { | |
58 Tool tool = null; | |
59 if (mixedMode) { | |
60 tool = new PStack(false, concurrentLocks); | |
61 } else { | |
62 tool = new StackTrace(false, concurrentLocks); | |
63 } | |
64 tool.setAgent(getAgent()); | |
65 tool.setDebugeeType(getDebugeeType()); | |
66 tool.run(); | |
67 } | |
68 | |
69 public static void main(String[] args) { | |
70 boolean mixedMode = false; | |
71 boolean concurrentLocks = false; | |
72 int used = 0; | |
73 for (int i = 0; i < args.length; i++) { | |
74 if (args[i].equals("-m")) { | |
75 mixedMode = true; | |
76 used++; | |
77 } else if (args[i].equals("-l")) { | |
78 concurrentLocks = true; | |
79 used++; | |
80 } | |
81 } | |
82 | |
83 if (used != 0) { | |
84 String[] newArgs = new String[args.length - used]; | |
85 for (int i = 0; i < newArgs.length; i++) { | |
86 newArgs[i] = args[i + used]; | |
87 } | |
88 args = newArgs; | |
89 } | |
90 | |
91 JStack jstack = new JStack(mixedMode, concurrentLocks); | |
12932
7fe6ef09d242
8025638: jmap returns 0 instead of 1 when it fails.
farvidsson
parents:
11054
diff
changeset
|
92 jstack.execute(args); |
0 | 93 } |
94 | |
95 private boolean mixedMode; | |
96 private boolean concurrentLocks; | |
97 } |