Creates an instant trace event. This method does not queue the
event. Call {@link TraceEventBatch#add(Supplier)} to queue the event.
163483
public static TraceEvent instant(String name, Object... args) {
        return new TraceEvent(TraceEventType.INSTANT, name, null, args);
    }
862276
@Override
	protected void append(ILoggingEvent eventObject)
	{
		Trace<ILoggingEvent> trace = traceManager.getTrace();
		if(trace != null)
		{
			trace.addEvent(eventObject);
		}
	}
579027
function(progressMeter, traces) {
      if (this.importing_)
        throw new Error('Already importing.');
      this.importing_ = true;

      // Just some simple setup. It is useful to have a no-op first
      // task so that we can set up the lastTask = lastTask.after()
      // pattern that follows.
      var importTask = new tr.b.Task(function prepareImport() {
        progressMeter.update('I will now import your traces for you...');
      }, this);
      var lastTask = importTask;

      var importers = [];

      lastTask = lastTask.after(function createImports() {
        // Copy the traces array, we may mutate it.
        traces = traces.slice(0);
        progressMeter.update('Creating importers...');
        // Figure out which importers to use.
        for (var i = 0; i < traces.length; ++i)
          importers.push(this.createImporter_(traces[i]));

        // Some traces have other traces inside them. Before doing the full
        // import, ask the importer if it has any subtraces, and if so, create
        // importers for them, also.
        for (var i = 0; i < importers.length; i++) {
          var subtraces = importers[i].extractSubtraces();
          for (var j = 0; j < subtraces.length; j++) {
            try {
              traces.push(subtraces[j]);
              importers.push(this.createImporter_(subtraces[j]));
            } catch (error) {
              // TODO(kphanee): Log the subtrace file which has failed.
              console.warn(error.name + ': ' + error.message);
              continue;
            }
          }
        }

        if (traces.length && !this.hasEventDataDecoder_(importers)) {
          throw new Error(
              'Could not find an importer for the provided eventData.');
        }

        // Sort them on priority. This ensures importing happens in a
        // predictable order, e.g. ftrace_importer before
        // trace_event_importer.
        importers.sort(function(x, y) {
          return x.importPriority - y.importPriority;
        });
      }, this);

      // Run the import.
      lastTask = lastTask.after(function runImport(task) {
        importers.forEach(function(importer, index) {
          task.subTask(function runImportEventsOnOneImporter() {
            progressMeter.update(
                'Importing ' + (index + 1) + ' of ' + importers.length);
            importer.importEvents();
          }, this);
        }, this);
      }, this);

      // Run the cusomizeModelCallback if needed.
      if (this.importOptions_.customizeModelCallback) {
        lastTask = lastTask.after(function runCustomizeCallbacks(task) {
          this.importOptions_.customizeModelCallback(this.model_);
        }, this);
      }

      // Import sample data.
      lastTask = lastTask.after(function(task) {
        importers.forEach(function importSampleData(importer, index) {
          progressMeter.update(
              'Importing sample data ' + (index + 1) + '/' + importers.length);
          importer.importSampleData();
        }, this);
      }, this);

      // Autoclose open slices and create subSlices.
      lastTask = lastTask.after(function runAutoclosers() {
        progressMeter.update('Autoclosing open slices...');
        this.model_.autoCloseOpenSlices();
        this.model_.createSubSlices();
      }, this);

      // Finalize import.
      lastTask = lastTask.after(function finalizeImport(task) {
        importers.forEach(function(importer, index) {
          progressMeter.update(
              'Finalizing import ' + (index + 1) + '/' + importers.length);
          importer.finalizeImport();
        }, this);
      }, this);

      // Run preinit.
      lastTask = lastTask.after(function runPreinits() {
        progressMeter.update('Initializing objects (step 1/2)...');
        this.model_.preInitializeObjects();
      }, this);

      // Prune empty containers.
      if (this.importOptions_.pruneEmptyContainers) {
        lastTask = lastTask.after(function runPruneEmptyContainers() {
          progressMeter.update('Pruning empty containers...');
          this.model_.pruneEmptyContainers();
        }, this);
      }

      // Merge kernel and userland slices on each thread.
      lastTask = lastTask.after(function runMergeKernelWithuserland() {
        progressMeter.update('Merging kernel with userland...');
        this.model_.mergeKernelWithUserland();
      }, this);

      // Create auditors
      var auditors = [];
      lastTask = lastTask.after(function createAuditorsAndRunAnnotate() {
        progressMeter.update('Adding arbitrary data to model...');
        auditors = this.importOptions_.auditorConstructors.map(
          function(auditorConstructor) {
            return new auditorConstructor(this.model_);
          }, this);
        auditors.forEach(function(auditor) {
          auditor.runAnnotate();
          auditor.installUserFriendlyCategoryDriverIfNeeded();
        });
      }, this);

      lastTask = lastTask.after(function computeWorldBounds() {
        progressMeter.update('Computing final world bounds...');
        this.model_.computeWorldBounds(this.importOptions_.shiftWorldToZero);
      }, this);

      // Build the flow event interval tree.
      lastTask = lastTask.after(function buildFlowEventIntervalTree() {
        progressMeter.update('Building flow event map...');
        this.model_.buildFlowEventIntervalTree();
      }, this);

      // Join refs.
      lastTask = lastTask.after(function joinRefs() {
        progressMeter.update('Joining object refs...');
        for (var i = 0; i < importers.length; i++)
          importers[i].joinRefs();
      }, this);

      // Delete any undeleted objects.
      lastTask = lastTask.after(function cleanupUndeletedObjects() {
        progressMeter.update('Cleaning up undeleted objects...');
        this.model_.cleanupUndeletedObjects();
      }, this);

      // Sort global and process memory dumps.
      lastTask = lastTask.after(function sortMemoryDumps() {
        progressMeter.update('Sorting memory dumps...');
        this.model_.sortMemoryDumps();
      }, this);

      // Calculate memory dump graph attributes.
      lastTask = lastTask.after(function calculateMemoryGraphAttributes() {
        progressMeter.update('Calculating memory dump graph attributes...');
        this.model_.calculateMemoryGraphAttributes();
      }, this);

      // Run initializers.
      lastTask = lastTask.after(function initializeObjects() {
        progressMeter.update('Initializing objects (step 2/2)...');
        this.model_.initializeObjects();
      }, this);

      // Build event indices mapping from an event id to all flow events.
      lastTask = lastTask.after(function buildEventIndices() {
        progressMeter.update('Building event indices...');
        this.model_.buildEventIndices();
      }, this);

      // Run audits.
      lastTask = lastTask.after(function runAudits() {
        progressMeter.update('Running auditors...');
        auditors.forEach(function(auditor) {
          auditor.runAudit();
        });
      }, this);

      lastTask = lastTask.after(function sortInteractionRecords() {
        progressMeter.update('Updating interaction records...');
        this.model_.sortInteractionRecords();
      }, this);

      lastTask = lastTask.after(function sortAlerts() {
        progressMeter.update('Updating alerts...');
        this.model_.sortAlerts();
      }, this);

      lastTask = lastTask.after(function lastUpdateBounds() {
        progressMeter.update('Update bounds...');
        this.model_.updateBounds();
      }, this);

      lastTask = lastTask.after(function addModelWarnings() {
        progressMeter.update('Looking for warnings...');
        // Log an import warning if the clock is low resolution.
        if (!this.model_.isTimeHighResolution) {
          this.model_.importWarning({
            type: 'low_resolution_timer',
            message: 'Trace time is low resolution, trace may be unusable.',
            showToUser: true
          });
        }
      }, this);

      // Cleanup.
      lastTask.after(function() {
        this.importing_ = false;
      }, this);
      return importTask;
    }
1220814
static void registerTraceComponent(TraceComponent tc) {
        tc.setTraceSpec(activeTraceSpec);

        TrService activeDelegate = TrConfigurator.getDelegate();
        activeDelegate.register(tc);

        TrConfigurator.traceComponentRegistered(tc);

        // Add the new TraceComponent to the queue of new trace components
        newTracecomponents.add(tc);
        processNewTraceComponents();
        // There is a tiny window where the new trace component never gets processed,
        // however that isn't a problem as we only care that the set is correct is at the
        // beginning of our setTraceSpec method and it does process the list first
    }
529095
def _create_create_tracking_event(instance):
    
    event = _create_event(instance, CREATE)
    for field in instance._tracked_fields:
        if not isinstance(instance._meta.get_field(field), ManyToManyField):
            _create_tracked_field(event, instance, field)
1062517
@Override
    public void createInputHandlersForPtoP()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "createInputHandlersForPtoP", this);
        //Create a point to point input handler
        _baseDestinationHandler.
                        setInputHandler(new PtoPInputHandler(_baseDestinationHandler,
                                        _remoteSupport.getTargetProtocolItemStream()));

        //TODO is this a good idea?
        //We don't yet know what type of InputHandler to create

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createInputHandlersForPtoP");
    }
151607
@Around("execute() || testing()")
  public Object trace(ProceedingJoinPoint call) throws Throwable {
    if (call.getArgs().length == 0 || call.getArgs()[0] == null) {
      return call.proceed();
    }

    String sql = (String) call.getArgs()[0];
    String spanName = makeSpanName(call, sql);

    return Handler.proceed(call, tracer, spanName, sql);
  }
1119490
public Router trace(@NotNull final String pattern, @NotNull final IMiddleware... handlers) {
        addPattern("TRACE", pattern, handlers, traceBindings);
        return this;
    }
593895
public void addMithraNotificationEvent(String databaseIdentifier, String classname, byte databaseOperation,
                                           List mithraObjects, Object sourceAttribute)
    {
        MithraDataObject[] dataObjects = new MithraDataObject[mithraObjects.size()];
        MithraDataObject dataObject;
        for (int i = 0; i < mithraObjects.size(); i++)
        {
            dataObject = ((MithraTransactionalObject) mithraObjects.get(i)).zGetTxDataForRead();
            dataObjects[i] = dataObject;
        }
        createAndAddNotificationEvent(databaseIdentifier, classname, databaseOperation, dataObjects, null, null, sourceAttribute);
    }
1345949
@Override
  protected SimpleDataEvent createNextEvent() {
    SimpleDataEvent event = new SimpleDataEvent("" + ++created);
    for (Map.Entry<String, FieldType> entry : fields.entrySet()) {
      addField(event, entry.getKey(), entry.getValue());
    }
    return event;
  }
1201003
@Override
    public void supplierChanged(SupplierEvent supplierEvent) {
        SupplierEvent.Type type = supplierEvent.type();
        @SuppressWarnings("unchecked")
        Supplier<T> supplier = (Supplier<T>) supplierEvent.supplier();
        switch (type) {
            case ADD:
                if (supplierReference.compareAndSet(null, supplier)) {
                    supplierFutureRef.get().complete(supplier);
                }
                break;
            case REMOVE:
                if (supplierReference.compareAndSet(supplier, null)) {
                    supplierFutureRef.set(new CompletableFuture<>());
                }
                break;
            default:
                throw new IllegalStateException("Unknown supplier event: " + supplierEvent);
        }
    }
936686
protected static <T> T getTracer(Class<T> intf, InterfaceTracer tracer, T ob)
    {
        tracer.setAppendable(System.err);
        tracer.setObj(ob);
        return (T) Proxy.newProxyInstance(
                intf.getClassLoader(), 
                new Class<?>[] {intf}, 
                tracer);
    }
647955
public static Event create(final Object runner, final EventType type, final EventData eventData)
      throws NullPointerException {
    Preconditions.checkNotNull(eventData, "EventData was null");
    return new Event(runner, type, eventData);
  }
437234
@Override
  public OperableTrigger instantiate() {

    SimpleTriggerImpl st = new SimpleTriggerImpl();
    st.setRepeatInterval(interval);
    st.setRepeatCount(repeatCount);
    st.setMisfireInstruction(misfireInstruction);
    return st;
  }
352744
static TracezZPageHandler create(
      @javax.annotation.Nullable RunningSpanStore runningSpanStore,
      @javax.annotation.Nullable SampledSpanStore sampledSpanStore) {
    return new TracezZPageHandler(runningSpanStore, sampledSpanStore);
  }
1157346
@Override
    public <T extends Event<?>> T add(T event, Channel... channels) {
        ((EventBase<?>) event).generatedBy(newEventsParent.get());
        ((EventBase<?>) event).processedBy(this);
        synchronized (queue) {
            queue.add(event, channels);
        }
        if (isRunning) {
            return event;
        }
        isRunning = true;
        GeneratorRegistry.instance().add(this);
        run();
        isRunning = false;
        return event;
    }
1232055
public TraceStep startStep(String call, IStatsProducer producer, String methodName){
		TraceStep last = current;
		current = new TraceStep(call, producer, methodName);
		//it actually happened in production, we are still investigating why, but this fix should at least prevent the NPE for now.
		if (last!=null)
			last.addChild(current);
		return current;
	}