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

      var prevState = event[4];
      var nextComm = event[5];
      var nextPid = parseInt(event[6]);
      var nextPrio = parseInt(event[7]);

      var nextThread = this.importer.threadsByLinuxPid[nextPid];
      var nextName;
      if (nextThread)
        nextName = nextThread.userFriendlyName;
      else
        nextName = nextComm;

      var cpu = this.importer.getOrCreateCpu(cpuNumber);
      cpu.switchActiveThread(
          ts,
          {stateWhenDescheduled: prevState},
          nextPid,
          nextName,
          {
            comm: nextComm,
            tid: nextPid,
            prio: nextPrio
          });

      return true;
    }
function(eventName, cpuNumber, pid, ts, eventBase) {
      var event = schedSwitchRE.exec(eventBase.details);
      if (!event)
        return false;

      var prevState = event[4];
      var nextComm = event[5];
      var nextPid = parseInt(event[6]);
      var nextPrio = parseInt(event[7]);

      var nextThread = this.importer.threadsByLinuxPid[nextPid];
      var nextName;
      if (nextThread)
        nextName = nextThread.userFriendlyName;
      else
        nextName = nextComm;

      var cpu = this.importer.getOrCreateCpu(cpuNumber);
      cpu.switchActiveThread(
          ts,
          {stateWhenDescheduled: prevState},
          nextPid,
          nextName,
          {
            comm: nextComm,
            tid: nextPid,
            prio: nextPrio
          });

      return true;
    }
function ( eventName , cpuNumber , pid , ts , eventBase ) { var event = schedSwitchRE . exec ( eventBase . details ) ; if ( ! event ) return false ; var prevState = event [ 4 ] ; var nextComm = event [ 5 ] ; var nextPid = parseInt ( event [ 6 ] ) ; var nextPrio = parseInt ( event [ 7 ] ) ; var nextThread = this . importer . threadsByLinuxPid [ nextPid ] ; var nextName ; if ( nextThread ) nextName = nextThread . userFriendlyName ; else nextName = nextComm ; var cpu = this . importer . getOrCreateCpu ( cpuNumber ) ; cpu . switchActiveThread ( ts , { stateWhenDescheduled : prevState } , nextPid , nextName , { comm : nextComm , tid : nextPid , prio : nextPrio } ) ; return true ; }
Parses scheduler events and sets up state in the CPUs of the importer.
Parses scheduler events and sets up state in the CPUs of the importer .