Пример #1
0
 def __init__(self, args):
     Collector.__init__(self, args)
     wpr = WPRCollector.detect()
     self.xperf = os.path.normpath(
         os.path.join(os.path.dirname(wpr), 'xperf')) if wpr else None
     self.files = []
     self.start()
Пример #2
0
    def __init__(self, args):
        Collector.__init__(self, args)

        self.processes = {}

        self.files = []
        self.subcollectors = set()

        self.attached = set()

        decoders = get_decoders()
        for decoder_group in decoders.values():
            for decoder_class in decoder_group:
                if any('Subcollector' in str(name)
                       for name in decoder_class.__bases__):
                    self.subcollectors.add(decoder_class)

        if 'SUDO_ASKPASS' not in os.environ:
            get_original_env()['SUDO_ASKPASS'] = self.create_ask_pass()
        assert 'DYLD_INSERT_LIBRARIES' not in os.environ

        self.sudo_execute('pkill dtrace')
        self.script = None
        if args.follow:
            self.fifo_reader = FifoReader(
                self, os.path.join(self.args.output, 'follow_child.fifo'))
        self.prepare()
        self.times = []
        self.attach_by_pid = True
Пример #3
0
 def __init__(self, args):
     Collector.__init__(self, args)
     self.pid = None
     self.files = []
     os.environ['SUDO_ASKPASS'] = self.create_ask_pass()
     del os.environ['DYLD_INSERT_LIBRARIES']
     self.execute('sudo -A pkill dtrace', env=os.environ)
     self.start()
Пример #4
0
 def __init__(self, args, remote=False):
     Collector.__init__(self, args)
     self.remote = remote
     self.event_list = []
     self.file = None
     for event in supported_events:
         for path in glob.glob('/sys/kernel/debug/tracing/events/*/%s/enable' % event):
             self.event_list.append(path)
     self.start()
Пример #5
0
 def __init__(self, args, remote=False):
     Collector.__init__(self, args)
     self.remote = remote
     self.event_list = []
     self.file = None
     for event in supported_events:
         for path in glob.glob(
                 '/sys/kernel/debug/tracing/events/*/%s/enable' % event):
             self.event_list.append(path)
     self.start()
Пример #6
0
 def __init__(self, args):
     Collector.__init__(self, args)
     self.pid = None
     self.files = []
     if 'SUDO_ASKPASS' not in os.environ:
         os.environ['SUDO_ASKPASS'] = self.create_ask_pass()
     if 'DYLD_INSERT_LIBRARIES' in os.environ:
         del os.environ['DYLD_INSERT_LIBRARIES']
     self.execute('sudo -A pkill dtrace', env=os.environ)
     self.start()
Пример #7
0
 def __init__(self, args):
     Collector.__init__(self, args)
     self.wpr = self.detect()
     self.started = False
     if self.args.cuts:
         self.file = os.path.join(
             args.output,
             "wpa-%s.etl" % (self.args.cuts[0] if self.args.cuts else '0'))
     else:
         self.file = os.path.join(args.output, "wpa.etl")
Пример #8
0
 def __init__(self, args):
     Collector.__init__(self, args)
     self.wpr = self.detect()
     self.started = False
     if self.args.cuts:
         self.file = os.path.join(args.output, "wpa-%s.etl" % (self.args.cuts[0] if self.args.cuts else '0'))
     else:
         self.file = os.path.join(args.output, "wpa.etl")
     if self.wpr:
         self.start()
Пример #9
0
 def __init__(self, args):
     Collector.__init__(self, args)
     self.gpuview = self.detect()
     self.started = None
     if self.args.cuts:
         self.file = os.path.join(args.output, "gpuview-%s.etl" % (self.args.cuts[0] if self.args.cuts else '0'))
     else:
         self.file = os.path.join(args.output, "gpuview.etl")
     if self.gpuview:
         self.start()
Пример #10
0
 def __init__(self, args):
     Collector.__init__(self, args)
     self.gpuview = self.detect()
     self.started = None
     if self.args.cuts:
         self.file = os.path.join(args.output, "gpuview-%s.etl" % (self.args.cuts[0] if self.args.cuts else '0'))
     else:
         self.file = os.path.join(args.output, "gpuview.etl")
     if self.gpuview:
         self.start()
Пример #11
0
 def __init__(self, args):
     Collector.__init__(self, args)
     wpr = WPRCollector.detect()
     self.xperf = os.path.normpath(os.path.join(os.path.dirname(wpr), 'xperf')) if wpr else None
     if not self.xperf or not os.path.exists(self.xperf):
         variants = self.detect_instances('xperf')
         if variants:
             self.xperf = variants[0]  # TODO: select by higher version
     self.files = []
     self.start()
Пример #12
0
    def __init__(self, args):
        Collector.__init__(self, args)

        self.processes = {}

        self.files = []
        self.subcollectors = set()

        self.attached = set()

        if 'SUDO_ASKPASS' not in os.environ:
            get_original_env()['SUDO_ASKPASS'] = self.create_ask_pass()
        assert 'DYLD_INSERT_LIBRARIES' not in os.environ

        self.sudo_execute('pkill dtrace')
        self.script = None
        self.prepare()
        self.times = []
        self.attach_by_pid = True
Пример #13
0
    def __init__(self, args):
        Collector.__init__(self, args)

        self.pid = None
        self.files = []
        self.subcollectors = set()

        decoders = get_decoders()
        for decoder_group in itervalues(decoders):
            for decoder_class in decoder_group:
                if any('Subcollector' in str(name)
                       for name in decoder_class.__bases__):
                    self.subcollectors.add(decoder_class)

        if 'SUDO_ASKPASS' not in os.environ:
            os.environ['SUDO_ASKPASS'] = self.create_ask_pass()
        if 'DYLD_INSERT_LIBRARIES' in os.environ:
            del os.environ['DYLD_INSERT_LIBRARIES']
        self.execute('sudo -A pkill dtrace', env=os.environ)
        self.start()
Пример #14
0
 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
Пример #15
0
 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
Пример #16
0
 def __init__(self, args):
     Collector.__init__(self, args)
     self.start()
Пример #17
0
 def __init__(self, args):
     Collector.__init__(self, args)
     self.start()
Пример #18
0
 def __init__(self, args):
     Collector.__init__(self, args)
     wpr = WPRCollector.detect()
     self.xperf = os.path.normpath(os.path.join(os.path.dirname(wpr), 'xperf')) if wpr else None
     self.files = []
     self.start()
Пример #19
0
 def __init__(self, args):
     Collector.__init__(self, args)
     self.adb = self.detect()
     self.file = None
Пример #20
0
 def __init__(self, args):
     Collector.__init__(self, args)
     self.adb = self.detect()
     self.file = None
     if self.adb:
         self.start()