1 /* |
1 /* |
2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
42 * JVMTI_VERBOSE_GC flag in Onload phase. |
42 * JVMTI_VERBOSE_GC flag in Onload phase. |
43 * The test's script wrapper runs the 'gf08t001' class twice. |
43 * The test's script wrapper runs the 'gf08t001' class twice. |
44 * First time, with "setVerboseMode=yes" agent mode. Second |
44 * First time, with "setVerboseMode=yes" agent mode. Second |
45 * time, with "setVerboseMode=no" agent mode and with |
45 * time, with "setVerboseMode=no" agent mode and with |
46 * "-verbose:gc" VM option. In both cases the output is |
46 * "-verbose:gc" VM option. In both cases the output is |
47 * searched for 'Full GC' string, unless ExplicitGCInvokesConcurrent |
47 * searched for 'Pause Full' string, unless ExplicitGCInvokesConcurrent |
48 * is enabled and G1 or CMS GCs are enbled. If ExplicitGCInvokesConcurrent and |
48 * is enabled and G1 is enabled. If ExplicitGCInvokesConcurrent and |
49 * either G1 or CMS GCs are enbled the test searches for 'GC' string in output. |
49 * G1 is enabled the test searches for 'GC' string in output. |
50 * The test fails if this string is not found in the output. |
50 * The test fails if this string is not found in the output. |
51 * COMMENTS |
51 * COMMENTS |
52 * |
52 * |
53 * @library /vmTestbase |
53 * @library /vmTestbase |
54 * /test/lib |
54 * /test/lib |
68 public class TestDriver { |
68 public class TestDriver { |
69 public static void main(String[] args) throws Exception { |
69 public static void main(String[] args) throws Exception { |
70 sun.hotspot.WhiteBox wb = sun.hotspot.WhiteBox.getWhiteBox(); |
70 sun.hotspot.WhiteBox wb = sun.hotspot.WhiteBox.getWhiteBox(); |
71 Boolean isExplicitGCInvokesConcurrentOn = wb.getBooleanVMFlag("ExplicitGCInvokesConcurrent"); |
71 Boolean isExplicitGCInvokesConcurrentOn = wb.getBooleanVMFlag("ExplicitGCInvokesConcurrent"); |
72 Boolean isUseG1GCon = wb.getBooleanVMFlag("UseG1GC"); |
72 Boolean isUseG1GCon = wb.getBooleanVMFlag("UseG1GC"); |
73 Boolean isUseConcMarkSweepGCon = wb.getBooleanVMFlag("UseConcMarkSweepGC"); |
|
74 Boolean isUseZGCon = wb.getBooleanVMFlag("UseZGC"); |
73 Boolean isUseZGCon = wb.getBooleanVMFlag("UseZGC"); |
75 Boolean isShenandoahGCon = wb.getBooleanVMFlag("UseShenandoahGC"); |
74 Boolean isShenandoahGCon = wb.getBooleanVMFlag("UseShenandoahGC"); |
76 Boolean isUseEpsilonGCon = wb.getBooleanVMFlag("UseEpsilonGC"); |
75 Boolean isUseEpsilonGCon = wb.getBooleanVMFlag("UseEpsilonGC"); |
77 |
76 |
78 if (Compiler.isGraalEnabled() && |
77 if (Compiler.isGraalEnabled() && |
79 (isUseConcMarkSweepGCon || isUseZGCon || isUseEpsilonGCon || isShenandoahGCon)) { |
78 (isUseZGCon || isUseEpsilonGCon || isShenandoahGCon)) { |
80 return; // Graal does not support these GCs |
79 return; // Graal does not support these GCs |
81 } |
80 } |
82 |
81 |
83 String keyPhrase; |
82 String keyPhrase; |
84 if ((isExplicitGCInvokesConcurrentOn && (isUseG1GCon || isUseConcMarkSweepGCon)) || isUseZGCon || isShenandoahGCon) { |
83 if ((isExplicitGCInvokesConcurrentOn && isUseG1GCon) || isUseZGCon || isShenandoahGCon) { |
85 keyPhrase = "GC"; |
84 keyPhrase = "GC"; |
86 } else { |
85 } else { |
87 keyPhrase = "Pause Full"; |
86 keyPhrase = "Pause Full"; |
88 } |
87 } |
89 |
88 |