def stop(self, wait=True): if not self.started: return [] self.log("Stop wait=%s" % str(wait)) if not wait: cmd = 'start "WPR stop" /MIN /LOW "%s" "%s" wpa "%s" "%s"' % ( sys.executable, os.path.realpath(__file__), self.file, self.args.output) self.log(cmd) subprocess.Popen(cmd, shell=True, stdin=None, stdout=None, stderr=None, creationflags=0x00000008, env=sea.prepare_environ( self.args)) # DETACHED_PROCESS while self.is_recording(): self.log("is_recording") time.sleep(1) return [self.file] else: sea.prepare_environ(self.args) self.stop_wpr(self.wpr, self.file, self.args.output) return [self.file]
def handle_etw_trace(self, etw_file): sea.prepare_environ(self.args) sea_itf = sea.ITT('tools') if sea_itf.can_parse_standard_source(): save = (self.args.input, self.args.output, self.args.trace) (self.args.input, self.args.output, self.args.trace) = (etw_file, etw_file, None) res = get_importers()['etl'](self.args) (self.args.input, self.args.output, self.args.trace) = save else: etw_xml = etw_file + ".xml" proc = subprocess.Popen( 'tracerpt "%s" -of XML -rts -lr -o "%s" -y' % (etw_file, etw_xml), shell=True, stderr=subprocess.PIPE) (out, err) = proc.communicate() if err: return None save = (self.args.input, self.args.output, self.args.trace) (self.args.input, self.args.output, self.args.trace) = (etw_xml, etw_xml, None) res = get_importers()['xml'](self.args) (self.args.input, self.args.output, self.args.trace) = save self.targets += res return res
def stop(self, wait=True): if not self.started: return [] (out, err) = self.execute('"%s" -stop "%s"' % (self.wpr, self.file)) if err: return [] assert (self.file in out) tmp = os.path.join(self.args.output, 'tmp.etl') sea.prepare_environ(self.args) relog_etl(self.file, tmp) os.remove(self.file) os.rename(tmp, self.file) return [self.file]
def stop(self, wait=True): if not self.started: return [] self.log("Stop wait=%s" % str(wait)) if not wait: cmd = 'start "WPR stop" /MIN /LOW "%s" "%s" wpa "%s" "%s"' % (sys.executable, os.path.realpath(__file__), self.file, self.args.output) self.log(cmd) subprocess.Popen(cmd, shell=True, stdin=None, stdout=None, stderr=None, creationflags=0x00000008, env=sea.prepare_environ(self.args)) # DETACHED_PROCESS while self.is_recording(): self.log("is_recording") time.sleep(1) return [self.file] else: sea.prepare_environ(self.args) self.stop_wpr(self.wpr, self.file, self.args.output) return [self.file]
def merge(cls, gpuview, file, started, wait, args=None): xperf = os.path.normpath( os.path.join(os.path.dirname(gpuview), '..', 'xperf')) if wait: cmd = '"%s" -merge Merged.etl IntelSEAPI.etl "%s"' % ( xperf, os.path.basename(file)) (out, err) = Collector.execute(cmd, cwd=started) if err and (os.path.basename(file) not in err): print(err) relog_etl(os.path.join(started, os.path.basename(file)), file) shutil.rmtree(started) else: cmd = 'start "GPUView merge" /MIN /LOW "%s" "%s" gpuview "%s" "%s"' % ( sys.executable, os.path.realpath(__file__), file, started) cls.log(cmd) subprocess.Popen(cmd, shell=True, stdin=None, stdout=None, stderr=None, creationflags=0x00000008, env=sea.prepare_environ(args)) # DETACHED_PROCESS
def merge(cls, gpuview, file, started, wait, args=None): xperf = os.path.normpath(os.path.join(os.path.dirname(gpuview), '..', 'xperf')) if wait: cmd = '"%s" -merge Merged.etl IntelSEAPI.etl "%s"' % (xperf, os.path.basename(file)) (out, err) = Collector.execute(cmd, cwd=started) if err and (os.path.basename(file) not in err): print err relog_etl(os.path.join(started, os.path.basename(file)), file) shutil.rmtree(started) else: cmd = 'start "GPUView merge" /MIN /LOW "%s" "%s" gpuview "%s" "%s"' % (sys.executable, os.path.realpath(__file__), file, started) cls.log(cmd) subprocess.Popen(cmd, shell=True, stdin=None, stdout=None, stderr=None, creationflags=0x00000008, env=sea.prepare_environ(args)) # DETACHED_PROCESS