lib/third_party/tracing/extras/importer/linux_perf/ftrace_importer.js
function() {
      var isSecondaryImport = this.model.getClockSyncRecordsNamed(
          'ftrace_importer').length !== 0;

      var mSyncs = this.model_.getClockSyncRecordsNamed('monotonic');
      // If this is a secondary import, and no clock syncing records were
      // found, then abort the import. Otherwise, just skip clock alignment.
      if (mSyncs.length == 0)
        return isSecondaryImport ? undefined : 0;

      // Shift all the slice times based on the sync record.
      // TODO(skyostil): Compute a scaling factor if we have multiple clock sync
      // records.
      var sync = mSyncs[0].args;
      // NB: parentTS of zero denotes no times-shift; this is
      // used when user and kernel event clocks are identical.
      if (sync.parentTS == 0 || sync.parentTS == sync.perfTS)
        return 0;
      return sync.parentTS - sync.perfTS;
    }
function() {
      var isSecondaryImport = this.model.getClockSyncRecordsNamed(
          'ftrace_importer').length !== 0;

      var mSyncs = this.model_.getClockSyncRecordsNamed('monotonic');
      // If this is a secondary import, and no clock syncing records were
      // found, then abort the import. Otherwise, just skip clock alignment.
      if (mSyncs.length == 0)
        return isSecondaryImport ? undefined : 0;

      // Shift all the slice times based on the sync record.
      // TODO(skyostil): Compute a scaling factor if we have multiple clock sync
      // records.
      var sync = mSyncs[0].args;
      // NB: parentTS of zero denotes no times-shift; this is
      // used when user and kernel event clocks are identical.
      if (sync.parentTS == 0 || sync.parentTS == sync.perfTS)
        return 0;
      return sync.parentTS - sync.perfTS;
    }
function ( ) { var isSecondaryImport = this . model . getClockSyncRecordsNamed ( 'ftrace_importer' ) . length !== 0 ; var mSyncs = this . model_ . getClockSyncRecordsNamed ( 'monotonic' ) ; // If this is a secondary import, and no clock syncing records were // found, then abort the import. Otherwise, just skip clock alignment. if ( mSyncs . length == 0 ) return isSecondaryImport ? undefined : 0 ; // Shift all the slice times based on the sync record. // TODO(skyostil): Compute a scaling factor if we have multiple clock sync // records. var sync = mSyncs [ 0 ] . args ; // NB: parentTS of zero denotes no times-shift; this is // used when user and kernel event clocks are identical. if ( sync . parentTS == 0 || sync . parentTS == sync . perfTS ) return 0 ; return sync . parentTS - sync . perfTS ; }
Computes a time transform from perf time to parent time based on the
imported clock sync records.
@return {number} offset from perf time to parent time or undefined if
the necessary sync records were not found.
Computes a time transform from perf time to parent time based on the imported clock sync records .