< prev index next >

test/jdk/jdk/jfr/event/profiling/TestFullStackTrace.java

Print this page
rev 51054 : imported patch 9000013-aixDisableJFR-requires.patch


  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 package jdk.jfr.event.profiling;
  27 
  28 import java.time.Duration;
  29 import java.util.ArrayList;
  30 import java.util.List;
  31 
  32 import jdk.jfr.Recording;
  33 import jdk.jfr.consumer.RecordedEvent;
  34 import jdk.jfr.consumer.RecordedFrame;
  35 import jdk.jfr.consumer.RecordedStackTrace;
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.jfr.EventNames;
  38 import jdk.test.lib.jfr.Events;
  39 import jdk.test.lib.jfr.RecurseThread;
  40 
  41 /*
  42  * @test
  43  * @key jfr

  44  * @library /test/lib
  45  * @run main/othervm jdk.jfr.event.profiling.TestFullStackTrace
  46  */
  47 public class TestFullStackTrace {
  48     private final static String EVENT_NAME = EventNames.ExecutionSample;
  49     private final static int MAX_DEPTH = 64; // currently hardcoded in jvm
  50 
  51     public static void main(String[] args) throws Throwable {
  52         RecurseThread[] threads = new RecurseThread[3];
  53         for (int i = 0; i < threads.length; ++i) {
  54             int depth = MAX_DEPTH - 1 + i;
  55             threads[i] = new RecurseThread(depth);
  56             threads[i].setName("recursethread-" + depth);
  57             threads[i].start();
  58         }
  59 
  60         for (RecurseThread thread : threads) {
  61             while (!thread.isInRunLoop()) {
  62                 Thread.sleep(20);
  63             }




  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 package jdk.jfr.event.profiling;
  27 
  28 import java.time.Duration;
  29 import java.util.ArrayList;
  30 import java.util.List;
  31 
  32 import jdk.jfr.Recording;
  33 import jdk.jfr.consumer.RecordedEvent;
  34 import jdk.jfr.consumer.RecordedFrame;
  35 import jdk.jfr.consumer.RecordedStackTrace;
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.jfr.EventNames;
  38 import jdk.test.lib.jfr.Events;
  39 import jdk.test.lib.jfr.RecurseThread;
  40 
  41 /**
  42  * @test
  43  * @key jfr
  44  * @requires vm.hasJFR
  45  * @library /test/lib
  46  * @run main/othervm jdk.jfr.event.profiling.TestFullStackTrace
  47  */
  48 public class TestFullStackTrace {
  49     private final static String EVENT_NAME = EventNames.ExecutionSample;
  50     private final static int MAX_DEPTH = 64; // currently hardcoded in jvm
  51 
  52     public static void main(String[] args) throws Throwable {
  53         RecurseThread[] threads = new RecurseThread[3];
  54         for (int i = 0; i < threads.length; ++i) {
  55             int depth = MAX_DEPTH - 1 + i;
  56             threads[i] = new RecurseThread(depth);
  57             threads[i].setName("recursethread-" + depth);
  58             threads[i].start();
  59         }
  60 
  61         for (RecurseThread thread : threads) {
  62             while (!thread.isInRunLoop()) {
  63                 Thread.sleep(20);
  64             }


< prev index next >