lib/third_party/tracing/extras/importer/linux_perf/ftrace_importer.js
function(state) {
            if (wakeup !== undefined) {
              midDuration = wakeup.ts - prevSlice.end;
            }

            if (blocked_reason !== undefined) {
              var args = {
                'kernel callsite when blocked:' : blocked_reason.caller
              };
              if (blocked_reason.iowait) {
                switch (state) {
                  case SCHEDULING_STATE.UNINTR_SLEEP:
                    state = SCHEDULING_STATE.UNINTR_SLEEP_IO;
                    break;
                  case SCHEDULING_STATE.UNINTR_SLEEP_WAKE_KILL:
                    state = SCHEDULING_STATE.UNINTR_SLEEP_WAKE_KILL_IO;
                    break;
                  case SCHEDULING_STATE.UNINTR_SLEEP_WAKING:
                    state = SCHEDULING_STATE.UNINTR_SLEEP_WAKE_KILL_IO;
                    break;
                  default:
                }
              }
              slices.push(new tr.model.ThreadTimeSlice(
                  thread,
                  state, '', prevSlice.end, args, midDuration));
            } else {
              slices.push(new tr.model.ThreadTimeSlice(
                  thread,
                  state, '', prevSlice.end, {}, midDuration));
            }
            if (wakeup !== undefined) {
              var wakeupDuration = nextSlice.start - wakeup.ts;
              var args = {'wakeup from tid': wakeup.fromTid};
              slices.push(new tr.model.ThreadTimeSlice(
                  thread, SCHEDULING_STATE.RUNNABLE, '',
                  wakeup.ts, args, wakeupDuration));
              wakeup = undefined;
            }
          }
function(state) {
            if (wakeup !== undefined) {
              midDuration = wakeup.ts - prevSlice.end;
            }

            if (blocked_reason !== undefined) {
              var args = {
                'kernel callsite when blocked:' : blocked_reason.caller
              };
              if (blocked_reason.iowait) {
                switch (state) {
                  case SCHEDULING_STATE.UNINTR_SLEEP:
                    state = SCHEDULING_STATE.UNINTR_SLEEP_IO;
                    break;
                  case SCHEDULING_STATE.UNINTR_SLEEP_WAKE_KILL:
                    state = SCHEDULING_STATE.UNINTR_SLEEP_WAKE_KILL_IO;
                    break;
                  case SCHEDULING_STATE.UNINTR_SLEEP_WAKING:
                    state = SCHEDULING_STATE.UNINTR_SLEEP_WAKE_KILL_IO;
                    break;
                  default:
                }
              }
              slices.push(new tr.model.ThreadTimeSlice(
                  thread,
                  state, '', prevSlice.end, args, midDuration));
            } else {
              slices.push(new tr.model.ThreadTimeSlice(
                  thread,
                  state, '', prevSlice.end, {}, midDuration));
            }
            if (wakeup !== undefined) {
              var wakeupDuration = nextSlice.start - wakeup.ts;
              var args = {'wakeup from tid': wakeup.fromTid};
              slices.push(new tr.model.ThreadTimeSlice(
                  thread, SCHEDULING_STATE.RUNNABLE, '',
                  wakeup.ts, args, wakeupDuration));
              wakeup = undefined;
            }
          }
function ( state ) { if ( wakeup !== undefined ) { midDuration = wakeup . ts - prevSlice . end ; } if ( blocked_reason !== undefined ) { var args = { 'kernel callsite when blocked:' : blocked_reason . caller } ; if ( blocked_reason . iowait ) { switch ( state ) { case SCHEDULING_STATE . UNINTR_SLEEP : state = SCHEDULING_STATE . UNINTR_SLEEP_IO ; break ; case SCHEDULING_STATE . UNINTR_SLEEP_WAKE_KILL : state = SCHEDULING_STATE . UNINTR_SLEEP_WAKE_KILL_IO ; break ; case SCHEDULING_STATE . UNINTR_SLEEP_WAKING : state = SCHEDULING_STATE . UNINTR_SLEEP_WAKE_KILL_IO ; break ; default : } } slices . push ( new tr . model . ThreadTimeSlice ( thread , state , '' , prevSlice . end , args , midDuration ) ) ; } else { slices . push ( new tr . model . ThreadTimeSlice ( thread , state , '' , prevSlice . end , { } , midDuration ) ) ; } if ( wakeup !== undefined ) { var wakeupDuration = nextSlice . start - wakeup . ts ; var args = { 'wakeup from tid' : wakeup . fromTid } ; slices . push ( new tr . model . ThreadTimeSlice ( thread , SCHEDULING_STATE . RUNNABLE , '' , wakeup . ts , args , wakeupDuration ) ) ; wakeup = undefined ; } }
Push a sleep slice onto the slices list, interrupting it with a wakeup if appropriate.
Push a sleep slice onto the slices list interrupting it with a wakeup if appropriate .