< prev index next >

test/hotspot/jtreg/runtime/os/TestTrimNative.java

Print this page

  9  * published by the Free Software Foundation.
 10  *
 11  * This code is distributed in the hope that it will be useful, but WITHOUT
 12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  * version 2 for more details (a copy is included in the LICENSE file that
 15  * accompanied this code).
 16  *
 17  * You should have received a copy of the GNU General Public License version
 18  * 2 along with this work; if not, write to the Free Software Foundation,
 19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  * or visit www.oracle.com if you need additional information or have any
 23  * questions.
 24  *
 25  */
 26 
 27 /*
 28  * @test id=trimNative

 29  * @requires (os.family=="linux") & !vm.musl
 30  * @modules java.base/jdk.internal.misc
 31  * @library /test/lib
 32  * @build jdk.test.whitebox.WhiteBox
 33  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 34  * @run driver TestTrimNative trimNative
 35  */
 36 
 37 /*
 38  * @test id=trimNativeStrict

 39  * @requires (os.family=="linux") & !vm.musl
 40  * @modules java.base/jdk.internal.misc
 41  * @library /test/lib
 42  * @build jdk.test.whitebox.WhiteBox
 43  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 44  * @run main/manual TestTrimNative trimNativeStrict
 45  */
 46 
 47 /*
 48  * @test id=trimNativeHighInterval
 49  * @summary High interval trimming should not even kick in for short program runtimes

 50  * @requires (os.family=="linux") & !vm.musl
 51  * @modules java.base/jdk.internal.misc
 52  * @library /test/lib
 53  * @build jdk.test.whitebox.WhiteBox
 54  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 55  * @run driver TestTrimNative trimNativeHighInterval
 56  */
 57 
 58 /*
 59  * @test id=trimNativeLowInterval
 60  * @summary Very low (sub-second) interval, nothing should explode

 61  * @requires (os.family=="linux") & !vm.musl
 62  * @modules java.base/jdk.internal.misc
 63  * @library /test/lib
 64  * @build jdk.test.whitebox.WhiteBox
 65  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 66  * @run driver TestTrimNative trimNativeLowInterval
 67  */
 68 
 69 /*
 70  * @test id=trimNativeLowIntervalStrict
 71  * @summary Very low (sub-second) interval, nothing should explode (stricter test, manual mode)

 72  * @requires (os.family=="linux") & !vm.musl
 73  * @modules java.base/jdk.internal.misc
 74  * @library /test/lib
 75  * @build jdk.test.whitebox.WhiteBox
 76  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 77  * @run main/manual TestTrimNative trimNativeLowIntervalStrict
 78  */
 79 
 80 /*
 81  * @test id=testOffByDefault
 82  * @summary Test that trimming is disabled by default

 83  * @requires (os.family=="linux") & !vm.musl
 84  * @modules java.base/jdk.internal.misc
 85  * @library /test/lib
 86  * @build jdk.test.whitebox.WhiteBox
 87  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 88  * @run driver TestTrimNative testOffByDefault
 89  */
 90 
 91 /*
 92  * @test id=testOffExplicit
 93  * @summary Test that trimming can be disabled explicitly

 94  * @requires (os.family=="linux") & !vm.musl
 95  * @modules java.base/jdk.internal.misc
 96  * @library /test/lib
 97  * @build jdk.test.whitebox.WhiteBox
 98  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 99  * @run driver TestTrimNative testOffExplicit
100  */
101 
102 /*
103  * @test id=testOffOnNonCompliantPlatforms
104  * @summary Test that trimming is correctly reported as unavailable if unavailable

105  * @requires (os.family!="linux") | vm.musl
106  * @modules java.base/jdk.internal.misc
107  * @library /test/lib
108  * @build jdk.test.whitebox.WhiteBox
109  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
110  * @run driver TestTrimNative testOffOnNonCompliantPlatforms
111  */
112 
113 import jdk.test.lib.Platform;
114 import jdk.test.lib.process.OutputAnalyzer;
115 import jdk.test.lib.process.ProcessTools;
116 
117 import java.io.IOException;
118 import java.util.*;
119 import java.util.regex.Matcher;
120 import java.util.regex.Pattern;
121 
122 import jdk.test.whitebox.WhiteBox;
123 
124 public class TestTrimNative {

  9  * published by the Free Software Foundation.
 10  *
 11  * This code is distributed in the hope that it will be useful, but WITHOUT
 12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  * version 2 for more details (a copy is included in the LICENSE file that
 15  * accompanied this code).
 16  *
 17  * You should have received a copy of the GNU General Public License version
 18  * 2 along with this work; if not, write to the Free Software Foundation,
 19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  * or visit www.oracle.com if you need additional information or have any
 23  * questions.
 24  *
 25  */
 26 
 27 /*
 28  * @test id=trimNative
 29  * @requires vm.flagless
 30  * @requires (os.family=="linux") & !vm.musl
 31  * @modules java.base/jdk.internal.misc
 32  * @library /test/lib
 33  * @build jdk.test.whitebox.WhiteBox
 34  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 35  * @run driver TestTrimNative trimNative
 36  */
 37 
 38 /*
 39  * @test id=trimNativeStrict
 40  * @requires vm.flagless
 41  * @requires (os.family=="linux") & !vm.musl
 42  * @modules java.base/jdk.internal.misc
 43  * @library /test/lib
 44  * @build jdk.test.whitebox.WhiteBox
 45  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 46  * @run main/manual TestTrimNative trimNativeStrict
 47  */
 48 
 49 /*
 50  * @test id=trimNativeHighInterval
 51  * @summary High interval trimming should not even kick in for short program runtimes
 52  * @requires vm.flagless
 53  * @requires (os.family=="linux") & !vm.musl
 54  * @modules java.base/jdk.internal.misc
 55  * @library /test/lib
 56  * @build jdk.test.whitebox.WhiteBox
 57  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 58  * @run driver TestTrimNative trimNativeHighInterval
 59  */
 60 
 61 /*
 62  * @test id=trimNativeLowInterval
 63  * @summary Very low (sub-second) interval, nothing should explode
 64  * @requires vm.flagless
 65  * @requires (os.family=="linux") & !vm.musl
 66  * @modules java.base/jdk.internal.misc
 67  * @library /test/lib
 68  * @build jdk.test.whitebox.WhiteBox
 69  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 70  * @run driver TestTrimNative trimNativeLowInterval
 71  */
 72 
 73 /*
 74  * @test id=trimNativeLowIntervalStrict
 75  * @summary Very low (sub-second) interval, nothing should explode (stricter test, manual mode)
 76  * @requires vm.flagless
 77  * @requires (os.family=="linux") & !vm.musl
 78  * @modules java.base/jdk.internal.misc
 79  * @library /test/lib
 80  * @build jdk.test.whitebox.WhiteBox
 81  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 82  * @run main/manual TestTrimNative trimNativeLowIntervalStrict
 83  */
 84 
 85 /*
 86  * @test id=testOffByDefault
 87  * @summary Test that trimming is disabled by default
 88  * @requires vm.flagless
 89  * @requires (os.family=="linux") & !vm.musl
 90  * @modules java.base/jdk.internal.misc
 91  * @library /test/lib
 92  * @build jdk.test.whitebox.WhiteBox
 93  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
 94  * @run driver TestTrimNative testOffByDefault
 95  */
 96 
 97 /*
 98  * @test id=testOffExplicit
 99  * @summary Test that trimming can be disabled explicitly
100  * @requires vm.flagless
101  * @requires (os.family=="linux") & !vm.musl
102  * @modules java.base/jdk.internal.misc
103  * @library /test/lib
104  * @build jdk.test.whitebox.WhiteBox
105  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
106  * @run driver TestTrimNative testOffExplicit
107  */
108 
109 /*
110  * @test id=testOffOnNonCompliantPlatforms
111  * @summary Test that trimming is correctly reported as unavailable if unavailable
112  * @requires vm.flagless
113  * @requires (os.family!="linux") | vm.musl
114  * @modules java.base/jdk.internal.misc
115  * @library /test/lib
116  * @build jdk.test.whitebox.WhiteBox
117  * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
118  * @run driver TestTrimNative testOffOnNonCompliantPlatforms
119  */
120 
121 import jdk.test.lib.Platform;
122 import jdk.test.lib.process.OutputAnalyzer;
123 import jdk.test.lib.process.ProcessTools;
124 
125 import java.io.IOException;
126 import java.util.*;
127 import java.util.regex.Matcher;
128 import java.util.regex.Pattern;
129 
130 import jdk.test.whitebox.WhiteBox;
131 
132 public class TestTrimNative {
< prev index next >