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 package jdk.jfr.jvm;
26
27 import java.nio.file.Files;
28 import java.nio.file.Path;
29 import java.nio.file.Paths;
30 import java.util.List;
31
32 import jdk.internal.misc.Unsafe;
33 import jdk.jfr.consumer.RecordedEvent;
34 import jdk.jfr.consumer.RecordingFile;
35 import jdk.test.lib.Asserts;
36 import jdk.test.lib.process.OutputAnalyzer;
37 import jdk.test.lib.process.ProcessTools;
38
39 /*
40 * @test
41 * @key jfr
42 * @summary Verifies that data associated with a running recording can be evacuated to an hs_err_pidXXX.jfr when the VM crashes
43 *
44 * @library /test/lib
45 * @modules java.base/jdk.internal.misc
46 * java.management
47 * jdk.jfr
48 *
49 * @run main/othervm --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED jdk.jfr.jvm.TestDumpOnCrash
50 */
51 public class TestDumpOnCrash {
52
53 private static final CharSequence LOG_FILE_EXTENSION = ".log";
54 private static final CharSequence JFR_FILE_EXTENSION = ".jfr";
55
56 static class Crasher {
57 public static void main(String[] args) {
58 Unsafe.getUnsafe().putInt(0L, 0);
59 }
60 }
61
62 public static void main(String[] args) throws Exception {
|
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 package jdk.jfr.jvm;
26
27 import java.nio.file.Files;
28 import java.nio.file.Path;
29 import java.nio.file.Paths;
30 import java.util.List;
31
32 import jdk.internal.misc.Unsafe;
33 import jdk.jfr.consumer.RecordedEvent;
34 import jdk.jfr.consumer.RecordingFile;
35 import jdk.test.lib.Asserts;
36 import jdk.test.lib.process.OutputAnalyzer;
37 import jdk.test.lib.process.ProcessTools;
38
39 /**
40 * @test
41 * @key jfr
42 * @summary Verifies that data associated with a running recording can be evacuated to an hs_err_pidXXX.jfr when the VM crashes
43 * @requires vm.hasJFR
44 *
45 * @library /test/lib
46 * @modules java.base/jdk.internal.misc
47 * java.management
48 * jdk.jfr
49 *
50 * @run main/othervm --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED jdk.jfr.jvm.TestDumpOnCrash
51 */
52 public class TestDumpOnCrash {
53
54 private static final CharSequence LOG_FILE_EXTENSION = ".log";
55 private static final CharSequence JFR_FILE_EXTENSION = ".jfr";
56
57 static class Crasher {
58 public static void main(String[] args) {
59 Unsafe.getUnsafe().putInt(0L, 0);
60 }
61 }
62
63 public static void main(String[] args) throws Exception {
|