def loadInstrumentationData(self, traceName): """ Load previously computed instrumentation data for a trace file. @param traceName: Trace for which data should be loaded. """ if not traceName in self.analyzer.traces: self.analyzer.fail("Trace not found: %s" % traceName) if not traceName in self.analyzer.traceFiles: self.analyzer.fail("The trace file for trace %s is not known." % traceName) trace = self.analyzer.traces[traceName] traceFileName = self.analyzer.traceFiles[traceName] logFile = Instrumentation.instrumentationLogFileName(traceFileName) if not os.path.exists(logFile): self.analyzer.fail( "Instrumentation log file not found (try the 'play' command): %s" % logFile) Instrumentation.loadInstrumentationData(self.analyzer, trace, logFile) self.analyzer.reportInfo("Instrumentation data loaded for trace %s." % traceName)
def play(self, trace, traceFileName=None, profile=False, saveFrames=False, checkCoherence=True, synchronize=False): # Check that the player is there if not os.path.isfile(self.binary): self.analyzer.fail("Player not found: %s" % self.binary) traceFileName, removeTraceFile = self._makeTracePlayable( trace, traceFileName, checkCoherence) # Play it try: args = [self.binary, traceFileName] if saveFrames: args += ["--save-frames"] if profile or saveFrames: args += ["--profile"] if synchronize: args += ["--synchronize"] subprocess.call(args) finally: if removeTraceFile: os.unlink(traceFileName) # Return the instrumentation log if it exists instLog = Instrumentation.instrumentationLogFileName(traceFileName) if os.path.exists(instLog): return instLog
def play(self, trace, traceFileName=None, profile=False, saveFrames=False, checkCoherence=True, synchronize=False): # Check that the player is there if not os.path.isfile(self.binary): self.analyzer.fail("Player not found: %s" % self.binary) traceFileName, removeTraceFile = self._makeTracePlayable(trace, traceFileName, checkCoherence) # Play it try: args = [self.binary, traceFileName] if saveFrames: args += ["--save-frames"] if profile or saveFrames: args += ["--profile"] if synchronize: args += ["--synchronize"] subprocess.call(args) finally: if removeTraceFile: os.unlink(traceFileName) # Return the instrumentation log if it exists instLog = Instrumentation.instrumentationLogFileName(traceFileName) if os.path.exists(instLog): return instLog
def saveInstrumentationData(self, traceName): """ Save the current instrumentation data for a trace file. @param traceName: Trace for which data should be saved. """ if not traceName in self.analyzer.traces: self.analyzer.fail("Trace not found: %s" % traceName) if not traceName in self.analyzer.traceFiles: self.analyzer.fail("The trace file for trace %s is not known." % traceName) trace = self.analyzer.traces[traceName] traceFileName = self.analyzer.traceFiles[traceName] logFile = Instrumentation.instrumentationLogFileName(traceFileName) Instrumentation.saveInstrumentationData(self.analyzer, trace, logFile) self.analyzer.reportInfo("Instrumentation data saved for trace %s." % traceName)
def loadInstrumentationData(self, traceName): """ Load previously computed instrumentation data for a trace file. @param traceName: Trace for which data should be loaded. """ if not traceName in self.analyzer.traces: self.analyzer.fail("Trace not found: %s" % traceName) if not traceName in self.analyzer.traceFiles: self.analyzer.fail("The trace file for trace %s is not known." % traceName) trace = self.analyzer.traces[traceName] traceFileName = self.analyzer.traceFiles[traceName] logFile = Instrumentation.instrumentationLogFileName(traceFileName) if not os.path.exists(logFile): self.analyzer.fail("Instrumentation log file not found (try the 'play' command): %s" % logFile) Instrumentation.loadInstrumentationData(self.analyzer, trace, logFile) self.analyzer.reportInfo("Instrumentation data loaded for trace %s." % traceName)