コード例 #1
0
    @Override
    public void methodExited(VM vm, ThreadInfo ti, MethodInfo mi) {
      if (traceActive) {
        assertSame(mi, ThreadInfo.getCurrentThread().getTopFrameMethodInfo());

        if (CLSNAME.equals(mi.getClassName())) {
          level--;

          String prefix = levelPrefix(level);
          trace.add(prefix + "< " + mi.getName());

          System.out.println(prefix + "< " + mi.getName());

          if (level == 0) {
            traceActive = false;
          }
        }
      }
    }
コード例 #2
0
    @Override
    public void methodEntered(VM vm, ThreadInfo ti, MethodInfo mi) {
      assertSame(mi, ThreadInfo.getCurrentThread().getTopFrameMethodInfo());

      if (CLSNAME.equals(mi.getClassName())) {
        String mthName = mi.getName();
        if (mthName.equals(startMthName)) {
          traceActive = true;
          level = 0;
        }

        if (traceActive) {
          String prefix = levelPrefix(level);
          trace.add(prefix + "> " + mthName);

          System.out.println(prefix + "> " + mthName);

          level++;
        }
      }
    }