code: static void initCurrentThreadTrace() {
      ThreadTrace events = getThreadTrace();
      if (!events.isEmpty()) {
        logger.log(Level.WARNING,
                   "Non-empty timer log:\n" + events,
                   new Throwable());
        clearThreadTrace();
  
        // Grab a new thread trace if we find a previous non-empty ThreadTrace.
        events = getThreadTrace();
      }
  
      // Mark the thread trace as initialized.
      events.init();
    }
docs: Initialize the trace associated with the current thread by clearing
  out any existing trace. There shouldn't be a trace so if one is
  found we log it as an error.