Examples of CallEntry


Examples of com.onpositive.instrumentation.tasks.CallEntry

    dictionary = CallDictionary.read(di);
    ArrayList<String> jsps2 = storage.getJSPS();
    this.jsp = new CallEntry[jsps2.size()];
    int size = jsps2.size();
    for (int a = 0; a < size; a++) {
      jsp[a] = new CallEntry(jsps2.get(a), "", "");
    }
    roots = new ArrayList<AccumulatedMethod>();
    methods = new ArrayList<AccumulatedMethod>();
    dataStoreInfo = (DataStoreCallStorageAttachment) storage
        .getAttachment(DataStoreCallStorageAttachment.class);
    memCacheInfo = (MemCacheStorageAttachment) storage
        .getAttachment(MemCacheStorageAttachment.class);
    final IdentityHashMap<CallEntry, AccumulatedMethod> ps = new IdentityHashMap<CallEntry, AccumulatedMethod>();
    storage.iterate(new StorageIterator() {

      public void accept(int from, int to, int index, int[] values) {
        if (to == 0) {
          CallEntry root = null;
          if (from > Integer.MAX_VALUE / 2) {
            root = jsp[Integer.MAX_VALUE - from];
          } else {
            if(from -1 > dictionary.length -1){
              return;
            }
            root = dictionary[from - 1];
          }
          AccumulatedMethod accumulatedMethod = new AccumulatedMethod(
              root);
          accumulatedMethod.count = values[index];
          accumulatedMethod.time = values[index + 1];
          accumulatedMethod.apicpuTime = values[index + 2];
          roots.add(accumulatedMethod);
        } else {
          CallEntry entry = null;
          if (from > Integer.MAX_VALUE / 2) {
            entry = jsp[Integer.MAX_VALUE - from];
          } else {
            if(from -1 > dictionary.length -1){
              return;
            }
            entry = dictionary[from - 1];
          }
          AccumulatedMethod accumulatedMethod = ps.get(entry);
          if (accumulatedMethod == null) {
            AccumulatedMethod m = new AccumulatedMethod(entry);
            accumulatedMethod = m;
            methods.add(m);
            ps.put(entry, m);
          }
          accumulatedMethod.count += values[index];
          accumulatedMethod.time += values[index + 1];
          accumulatedMethod.selftime += values[index + 1];
          accumulatedMethod.apicpuTime = values[index + 2];
        }
      }
    });
    storage.iterate(new StorageIterator() {

      public void accept(int from, int to, int index, int[] values) {
        if (to == 0) {

        } else {
          CallEntry entry = null;
          if (to > Integer.MAX_VALUE / 2) {
            entry = jsp[Integer.MAX_VALUE - to];
          } else {
            if(to -1 > dictionary.length -1){
              return;
View Full Code Here

Examples of com.onpositive.instrumentation.tasks.CallEntry

    storage.iterate(new StorageIterator() {

      public void accept(int from, int to, int index, int[] values) {

        if (to != 0) {
          CallEntry entry = null;
          if (to > Integer.MAX_VALUE/2) {
            entry = jsp[Integer.MAX_VALUE - to];
          } else {
            if(to -1 > dictionary.length -1){
              return;
            }
            entry = dictionary[to - 1];
          }
          if (isFrom(ma, entry)) {
            AccumulatedMethod m = new AccumulatedMethod(
                dictionary[from - 1]);
            mz.put(dictionary[from - 1], m);
            m.count += values[index];
            m.time += values[index + 1];
            m.selftime += values[index + 1];
            m.apicpuTime += values[index + 2];
          }
        }
      }
    });
    storage.iterate(new StorageIterator() {

      public void accept(int from, int to, int index, int[] values) {
        if (to != 0) {
          CallEntry entry = null;
          if (to > Integer.MAX_VALUE/2) {
            entry = jsp[Integer.MAX_VALUE - to];
          } else {
            entry = dictionary[to - 1];
          }
View Full Code Here

Examples of se.sics.mspsim.profiler.CallEntry

      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

Examples of se.sics.mspsim.profiler.CallEntry

      } 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

Examples of se.sics.mspsim.profiler.CallEntry

      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

Examples of se.sics.mspsim.profiler.CallEntry

  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
Copyright © 2018 www.massapi.com. 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.