Package se.sics.mspsim.profiler

Examples of se.sics.mspsim.profiler.CallEntry$CallCounter


      CallEntry[] tmp = new CallEntry[cSP + 64];
      System.arraycopy(callStack, 0, tmp, 0, cSP);
      callStack = tmp;
    }
    if (callStack[cSP] == null) {
      callStack[cSP] = new CallEntry();
    }

    int hide = 0;
    PrintStream logger = this.logger;
    if (logger != null) {
      /* hide this if last call was to be hidden */
      hide = (cSP == 0 || newIRQ) ? 0 : callStack[cSP - 1].hide;
      /* increase level of "hide" if last was hidden */
      if (hide > 0) hide++;
      if ((!hideIRQ || servicedInterrupt == -1) && hide == 0) {
        if (servicedInterrupt >= 0) logger.printf("[%2d] ", servicedInterrupt);
        printSpace(logger, (cSP - interruptLevel) * 2);
        logger.println("Call to $" + Utils.hex(entry.getAddress(), 4) +
                       ": " + entry.getInfo());
        if (ignoreFunctions.get(entry.getName()) != null) {
          hide = 1;
        }
      }
    }

    CallEntry ce = callStack[cSP++];
    ce.function = entry;
    ce.calls = 0;
    ce.cycles = cycles;
    ce.exclusiveCycles = cycles;
    ce.hide = hide;
View Full Code Here


      } else {
        // System.err.println("SimpleProfiler: Too many returns?");
      }
      return;
    }
    CallEntry cspEntry = callStack[--cSP];
    MapEntry fkn = cspEntry.function;
//     System.out.println("Profiler: return / call stack: " + cSP + ", " + fkn);
   
    long elapsed = cycles - cspEntry.cycles;
    long exElapsed = cycles - cspEntry.exclusiveCycles;
    if (cSP != 0) {
      callStack[cSP-1].exclusiveCycles += elapsed;
    }
    int maxUsage = 0;
   
    if (cspEntry.calls >= 0) {
      CallEntry ce = profileData.get(fkn);
      if (ce == null) {
        profileData.put(fkn, ce = new CallEntry());
        ce.function = fkn;
      }
      ce.cycles += elapsed;
      ce.exclusiveCycles += exElapsed;
      ce.calls++;
View Full Code Here

      for (int i = 0, n = entries.length; i < n; i++) {
        entries[i].cycles = 0;
        entries[i].calls = 0;
      }
      for (int i = 0, n = callStack.length; i < n; i++) {
        CallEntry e = callStack[i];
        if (e != null) {
          e.calls = -1;
        }
      }
    }
View Full Code Here

  public void printStackTrace(PrintStream out) {
    int stackCount = cSP;
    out.println("Stack Trace: number of calls: " + stackCount
        + " PC: $" + Utils.hex(cpu.getPC(), 5));
    for (int i = 0; i < stackCount; i++) {
      CallEntry call = callStack[stackCount - i - 1];
      out.println("  " + call.function.getInfo()
          + " called from PC: $" + Utils.hex(call.fromPC, 5)
          + " (elapsed: " + (cpu.cpuCycles - call.cycles) + ')');
      if (stackCount - i - 1 == interruptLevel && servicedInterrupt != -1) {
        out.println(" *** Interrupt " + servicedInterrupt + " from PC: $" + Utils.hex(interruptFrom, 5));
View Full Code Here

TOP

Related Classes of se.sics.mspsim.profiler.CallEntry$CallCounter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.