lib/third_party/tracing/extras/importer/linux_perf/ftrace_importer.js
function() {
      var lines = [];
      var extractResult = LinuxPerfImporter._extractEventsFromSystraceHTML(
          this.events_, true);
      if (!extractResult.ok)
        extractResult = LinuxPerfImporter._extractEventsFromSystraceMultiHTML(
            this.events_, true);
      var lines = extractResult.ok ?
        extractResult.lines : this.events_.split('\n');

      var lineParser = null;
      for (var lineNumber = 0; lineNumber < lines.length; ++lineNumber) {
        var line = lines[lineNumber].trim();
        if (line.length == 0 || /^#/.test(line))
          continue;
        if (lineParser == null) {
          lineParser = autoDetectLineParser(line);
          if (lineParser == null) {
            this.model_.importWarning({
              type: 'parse_error',
              message: 'Cannot parse line: ' + line
            });
            continue;
          }
        }
        var eventBase = lineParser(line);
        if (!eventBase) {
          this.model_.importWarning({
            type: 'parse_error',
            message: 'Unrecognized line: ' + line
          });
          continue;
        }

        this.lines_.push([
          line,
          eventBase,
          parseInt(eventBase.cpuNumber),
          parseInt(eventBase.pid),
          parseFloat(eventBase.timestamp) * 1000
        ]);
      }
    }
function() {
      var lines = [];
      var extractResult = LinuxPerfImporter._extractEventsFromSystraceHTML(
          this.events_, true);
      if (!extractResult.ok)
        extractResult = LinuxPerfImporter._extractEventsFromSystraceMultiHTML(
            this.events_, true);
      var lines = extractResult.ok ?
        extractResult.lines : this.events_.split('\n');

      var lineParser = null;
      for (var lineNumber = 0; lineNumber < lines.length; ++lineNumber) {
        var line = lines[lineNumber].trim();
        if (line.length == 0 || /^#/.test(line))
          continue;
        if (lineParser == null) {
          lineParser = autoDetectLineParser(line);
          if (lineParser == null) {
            this.model_.importWarning({
              type: 'parse_error',
              message: 'Cannot parse line: ' + line
            });
            continue;
          }
        }
        var eventBase = lineParser(line);
        if (!eventBase) {
          this.model_.importWarning({
            type: 'parse_error',
            message: 'Unrecognized line: ' + line
          });
          continue;
        }

        this.lines_.push([
          line,
          eventBase,
          parseInt(eventBase.cpuNumber),
          parseInt(eventBase.pid),
          parseFloat(eventBase.timestamp) * 1000
        ]);
      }
    }
function ( ) { var lines = [ ] ; var extractResult = LinuxPerfImporter . _extractEventsFromSystraceHTML ( this . events_ , true ) ; if ( ! extractResult . ok ) extractResult = LinuxPerfImporter . _extractEventsFromSystraceMultiHTML ( this . events_ , true ) ; var lines = extractResult . ok ? extractResult . lines : this . events_ . split ( '\n' ) ; var lineParser = null ; for ( var lineNumber = 0 ; lineNumber < lines . length ; ++ lineNumber ) { var line = lines [ lineNumber ] . trim ( ) ; if ( line . length == 0 || / ^# / . test ( line ) ) continue ; if ( lineParser == null ) { lineParser = autoDetectLineParser ( line ) ; if ( lineParser == null ) { this . model_ . importWarning ( { type : 'parse_error' , message : 'Cannot parse line: ' + line } ) ; continue ; } } var eventBase = lineParser ( line ) ; if ( ! eventBase ) { this . model_ . importWarning ( { type : 'parse_error' , message : 'Unrecognized line: ' + line } ) ; continue ; } this . lines_ . push ( [ line , eventBase , parseInt ( eventBase . cpuNumber ) , parseInt ( eventBase . pid ) , parseFloat ( eventBase . timestamp ) * 1000 ] ) ; } }
Walks the this.events_ structure and populates this.lines_.
Walks the this . events_ structure and populates this . lines_ .