コード例 #1
0
    def __init__(self, options, orderfile_updater_class):
        self._options = options

        self._instrumented_out_dir = os.path.join(
            self._BUILD_ROOT, self._options.arch + '_instrumented_out')
        self._uninstrumented_out_dir = os.path.join(
            self._BUILD_ROOT, self._options.arch + '_uninstrumented_out')

        if options.profile:
            output_directory = os.path.join(self._instrumented_out_dir,
                                            'Release')
            host_profile_dir = os.path.join(output_directory, 'profile_data')
            urls = [profile_android_startup.AndroidProfileTool.TEST_URL]
            use_wpr = True
            simulate_user = False
            urls = options.urls
            use_wpr = not options.no_wpr
            simulate_user = options.simulate_user
            self._profiler = profile_android_startup.AndroidProfileTool(
                output_directory, host_profile_dir, use_wpr, urls,
                simulate_user)

        self._output_data = {}
        self._step_recorder = StepRecorder(options.buildbot)
        self._compiler = None
        assert issubclass(orderfile_updater_class, OrderfileUpdater)
        self._orderfile_updater = orderfile_updater_class(
            self._CLANK_REPO, self._step_recorder, options.branch,
            options.netrc)
        assert os.path.isdir(
            constants.DIR_SOURCE_ROOT), 'No src directory found'
        symbol_extractor.SetArchitecture(options.arch)
コード例 #2
0
    def __init__(self, options, orderfile_updater_class):
        self._options = options
        self._instrumented_out_dir = os.path.join(
            self._BUILD_ROOT, self._options.arch + '_instrumented_out')
        if self._options.use_call_graph:
            self._instrumented_out_dir += '_call_graph'

        self._uninstrumented_out_dir = os.path.join(
            self._BUILD_ROOT, self._options.arch + '_uninstrumented_out')
        self._no_orderfile_out_dir = os.path.join(
            self._BUILD_ROOT, self._options.arch + '_no_orderfile_out')

        self._PrepareOrderfilePaths()

        if options.profile:
            output_directory = os.path.join(self._instrumented_out_dir,
                                            'Release')
            host_profile_dir = os.path.join(output_directory, 'profile_data')
            urls = [profile_android_startup.AndroidProfileTool.TEST_URL]
            use_wpr = True
            simulate_user = False
            urls = options.urls
            use_wpr = not options.no_wpr
            simulate_user = options.simulate_user
            device = self._SetDevice()
            self._profiler = profile_android_startup.AndroidProfileTool(
                output_directory,
                host_profile_dir,
                use_wpr,
                urls,
                simulate_user,
                device,
                debug=self._options.streamline_for_debugging)
            if options.pregenerated_profiles:
                self._profiler.SetPregeneratedProfiles(
                    glob.glob(options.pregenerated_profiles))
        else:
            assert not options.pregenerated_profiles, (
                '--pregenerated-profiles cannot be used with --skip-profile')
            assert not options.profile_save_dir, (
                '--profile-save-dir cannot be used with --skip-profile')
            self._monochrome = not self._options.use_legacy_chrome_apk

        # Outlined function handling enabled by default for all architectures.
        self._order_outlined_functions = not options.noorder_outlined_functions

        self._output_data = {}
        self._step_recorder = StepRecorder(options.buildbot)
        self._compiler = None
        if orderfile_updater_class is None:
            if options.public:
                orderfile_updater_class = OrderfileNoopUpdater
            else:
                orderfile_updater_class = OrderfileUpdater
        assert issubclass(orderfile_updater_class, OrderfileUpdater)
        self._orderfile_updater = orderfile_updater_class(
            self._clank_dir, self._step_recorder)
        assert os.path.isdir(
            constants.DIR_SOURCE_ROOT), 'No src directory found'
        symbol_extractor.SetArchitecture(options.arch)
コード例 #3
0
    def __init__(self, options, orderfile_updater_class):
        self._options = options

        self._instrumented_out_dir = os.path.join(
            self._BUILD_ROOT, self._options.arch + '_instrumented_out')
        self._uninstrumented_out_dir = os.path.join(
            self._BUILD_ROOT, self._options.arch + '_uninstrumented_out')

        if options.profile:
            output_directory = os.path.join(self._instrumented_out_dir,
                                            'Release')
            host_profile_dir = os.path.join(output_directory, 'profile_data')
            urls = [profile_android_startup.AndroidProfileTool.TEST_URL]
            use_wpr = True
            simulate_user = False
            urls = options.urls
            use_wpr = not options.no_wpr
            simulate_user = options.simulate_user
            self._profiler = profile_android_startup.AndroidProfileTool(
                output_directory,
                host_profile_dir,
                use_wpr,
                urls,
                simulate_user,
                device=options.device)
            if options.pregenerated_profiles:
                self._profiler.SetPregeneratedProfiles(
                    glob.glob(options.pregenerated_profiles))
        else:
            assert not options.pregenerated_profiles, (
                '--pregenerated-profiles cannot be used with --skip-profile')
            assert not options.profile_save_dir, (
                '--profile-save-dir cannot be used with --skip-profile')

        # Outlined function handling enabled by default for all architectures.
        self._order_outlined_functions = not options.noorder_outlined_functions

        self._output_data = {}
        self._step_recorder = StepRecorder(options.buildbot)
        self._compiler = None
        assert issubclass(orderfile_updater_class, OrderfileUpdater)
        self._orderfile_updater = orderfile_updater_class(
            self._CLANK_REPO, self._step_recorder, options.branch,
            options.netrc)
        assert os.path.isdir(
            constants.DIR_SOURCE_ROOT), 'No src directory found'
        symbol_extractor.SetArchitecture(options.arch)
コード例 #4
0
    def __init__(self, options, orderfile_updater_class):
        self._options = options

        self._instrumented_out_dir = os.path.join(
            self._BUILD_ROOT, self._options.arch + '_instrumented_out')
        self._uninstrumented_out_dir = os.path.join(
            self._BUILD_ROOT, self._options.arch + '_uninstrumented_out')

        if options.profile:
            output_directory = os.path.join(self._instrumented_out_dir,
                                            'Release')
            host_cyglog_dir = os.path.join(output_directory, 'cyglog_data')
            # Only override the defaults when using lightweight instrumentation,
            # as the regular profiling code is likely too slow for these.
            urls = [profile_android_startup.AndroidProfileTool.TEST_URL]
            use_wpr = True
            simulate_user = False
            if options.simulate_user and not options.lightweight_instrumentation:
                logging.error(
                    '--simulate-user required --lightweight-instrumentation, ignoring.'
                )
            if options.lightweight_instrumentation:
                urls = options.urls
                use_wpr = not options.no_wpr
                simulate_user = options.simulate_user
            self._profiler = profile_android_startup.AndroidProfileTool(
                output_directory, host_cyglog_dir, use_wpr, urls,
                simulate_user)

        self._output_data = {}
        self._step_recorder = StepRecorder(options.buildbot)
        self._compiler = None
        assert issubclass(orderfile_updater_class, OrderfileUpdater)
        self._orderfile_updater = orderfile_updater_class(
            self._CLANK_REPO, self._step_recorder, options.branch,
            options.netrc)
        assert os.path.isdir(
            constants.DIR_SOURCE_ROOT), 'No src directory found'
        symbol_extractor.SetArchitecture(options.arch)