lib/third_party/tracing/extras/importer/linux_perf/sync_parser.js
function(eventName, cpuNumber, pid,
                            ts, eventBase) {
      var event = syncTimelineRE.exec(eventBase.details);
      if (!event)
        return false;

      var thread = this.importer.getOrCreatePseudoThread(event[1]);

      if (thread.lastActiveTs !== undefined) {
        var duration = ts - thread.lastActiveTs;
        var value = thread.lastActiveValue;
        if (value == undefined)
          value = ' ';
        var slice = new tr.model.Slice(
            '', value,
            ColorScheme.getColorIdForGeneralPurposeString(value),
            thread.lastActiveTs, {},
            duration);
        thread.thread.sliceGroup.pushSlice(slice);
      }
      thread.lastActiveTs = ts;
      thread.lastActiveValue = event[2];
      return true;
    }
function(eventName, cpuNumber, pid,
                            ts, eventBase) {
      var event = syncTimelineRE.exec(eventBase.details);
      if (!event)
        return false;

      var thread = this.importer.getOrCreatePseudoThread(event[1]);

      if (thread.lastActiveTs !== undefined) {
        var duration = ts - thread.lastActiveTs;
        var value = thread.lastActiveValue;
        if (value == undefined)
          value = ' ';
        var slice = new tr.model.Slice(
            '', value,
            ColorScheme.getColorIdForGeneralPurposeString(value),
            thread.lastActiveTs, {},
            duration);
        thread.thread.sliceGroup.pushSlice(slice);
      }
      thread.lastActiveTs = ts;
      thread.lastActiveValue = event[2];
      return true;
    }
function ( eventName , cpuNumber , pid , ts , eventBase ) { var event = syncTimelineRE . exec ( eventBase . details ) ; if ( ! event ) return false ; var thread = this . importer . getOrCreatePseudoThread ( event [ 1 ] ) ; if ( thread . lastActiveTs !== undefined ) { var duration = ts - thread . lastActiveTs ; var value = thread . lastActiveValue ; if ( value == undefined ) value = ' ' ; var slice = new tr . model . Slice ( '' , value , ColorScheme . getColorIdForGeneralPurposeString ( value ) , thread . lastActiveTs , { } , duration ) ; thread . thread . sliceGroup . pushSlice ( slice ) ; } thread . lastActiveTs = ts ; thread . lastActiveValue = event [ 2 ] ; return true ; }
Parses sync events and sets up state in the importer.
Parses sync events and sets up state in the importer .