author | mockner |
Tue, 29 Mar 2016 14:37:07 -0400 | |
changeset 37203 | 90eabed33a6c |
child 38152 | 80e5da81fb2c |
permissions | -rw-r--r-- |
37203
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
1 |
/* |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
2 |
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
4 |
* |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
8 |
* |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
13 |
* accompanied this code). |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
14 |
* |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
18 |
* |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
21 |
* questions. |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
22 |
*/ |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
23 |
|
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
24 |
|
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
25 |
/* |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
26 |
* @test MonitorMismatchTest |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
27 |
* @bug 8150084 |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
28 |
* @library /testlibrary |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
29 |
* @compile MonitorMismatchHelper.jasm |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
30 |
* @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools jdk.test.lib.Platform |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
31 |
* @run driver MonitorMismatchTest |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
32 |
*/ |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
33 |
|
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
34 |
import jdk.test.lib.OutputAnalyzer; |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
35 |
import jdk.test.lib.ProcessTools; |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
36 |
import jdk.test.lib.Platform; |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
37 |
|
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
38 |
public class MonitorMismatchTest { |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
39 |
|
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
40 |
public static void main(String... args) throws Exception { |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
41 |
if (!Platform.isEmbedded()){ |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
42 |
// monitormismatch should turn on. |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
43 |
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xcomp", |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
44 |
"-XX:+TieredCompilation", |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
45 |
"-Xlog:monitormismatch=info", |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
46 |
"MonitorMismatchHelper"); |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
47 |
OutputAnalyzer o = new OutputAnalyzer(pb.start()); |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
48 |
o.shouldContain("[monitormismatch] Monitor mismatch in method"); |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
49 |
|
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
50 |
// monitormismatch should turn off. |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
51 |
pb = ProcessTools.createJavaProcessBuilder("-Xcomp", |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
52 |
"-XX:+TieredCompilation", |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
53 |
"-Xlog:monitormismatch=off", |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
54 |
"MonitorMismatchHelper"); |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
55 |
o = new OutputAnalyzer(pb.start()); |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
56 |
o.shouldNotContain("[monitormismatch]"); |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
57 |
} |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
58 |
}; |
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
59 |
|
90eabed33a6c
8150084: Convert TraceMonitorMismatch to Unified Logging.
mockner
parents:
diff
changeset
|
60 |
} |