Exemplo n.º 1
0
void FlatProfiler::record_tick() {
  // If we're idle forget about the tick.
  if (DeltaProcess::is_idle()) return;

  // check for special vm flags
  if (theCompiler)      { FlatProfiler::compiler_ticks++; }
  if (GCInProgress)     { FlatProfiler::gc_ticks++;        return; }
  if (processSemaphore) { FlatProfiler::semaphore_ticks++; return; }
 
  { FlagSetting(processSemaphore, true);
    DeltaProcess* p = DeltaProcess::active();
    if (p->last_Delta_fp()) {
      record_tick_for_calling_frame(p->last_frame());
    } else {
      record_tick_for_running_frame(p->profile_top_frame());
    }
  }
}
Exemplo n.º 2
0
void ps() { // print stack
  // Retrieve the frame pointer of the current frame 
  int* fp;
  __asm { mov fp, ebp }
  {
    Command c("ps");
    // Prints the stack of the current Delta process
    DeltaProcess* p = DeltaProcess::active();
    std->print(" for process: ");
    p->print();
    std->cr();

    if (p->last_Delta_fp() != NULL) {
      // If the last_Delta_fp is set we are in C land and
      // can call the standard stack_trace function.
      p->trace_stack();
    } else {
      // fp point to the frame of the ps stub routine
      frame f(NULL, fp, NULL);
      f = f.sender();
      p->trace_stack_from(vframe::new_vframe(&f));
    }
  }