Ejemplo n.º 1
0
    def execute(self, args):  # NOQA
        self.set_up_output_directory(args)
        add_log_file(settings.log_file)

        if os.path.isfile(args.agenda):
            agenda = Agenda(args.agenda)
            settings.agenda = args.agenda
            shutil.copy(args.agenda, settings.meta_directory)
        else:
            self.logger.debug('{} is not a file; assuming workload name.'.format(args.agenda))
            agenda = Agenda()
            agenda.add_workload_entry(args.agenda)

        if args.instruments_to_disable:
            if 'instrumentation' not in agenda.config:
                agenda.config['instrumentation'] = []
            for itd in args.instruments_to_disable:
                self.logger.debug('Updating agenda to disable {}'.format(itd))
                agenda.config['instrumentation'].append('~{}'.format(itd))

        basename = 'config_'
        for file_number, path in enumerate(settings.get_config_paths(), 1):
            file_ext = os.path.splitext(path)[1]
            shutil.copy(path, os.path.join(settings.meta_directory,
                                           basename + str(file_number) + file_ext))

        executor = Executor()
        executor.execute(agenda, selectors={'ids': args.only_run_ids})
Ejemplo n.º 2
0
    def execute(self, args):
        self.validate_args(args)
        self.logger.info("Connecting to device...")

        ext_loader = ExtensionLoader(packages=settings.extension_packages,
                                     paths=settings.extension_paths)

        # Setup config
        self.config = RunConfiguration(ext_loader)
        for filepath in settings.get_config_paths():
            self.config.load_config(filepath)
        self.config.set_agenda(Agenda())
        self.config.finalize()

        context = LightContext(self.config)

        # Setup device
        self.device = ext_loader.get_device(settings.device,
                                            **settings.device_config)
        self.device.validate()
        self.device.dynamic_modules = []
        self.device.connect()
        self.device.initialize(context)

        host_binary = context.resolver.get(
            Executable(NO_ONE, self.device.abi, 'revent'))
        self.target_binary = self.device.install_executable(host_binary)

        self.run(args)
Ejemplo n.º 3
0
 def test_instrumentation_specification(self):
     a = Agenda(INSTRUMENTATION_AGENDA_TEXT)
     self.config.set_agenda(a)
     self.config.finalize()
     assert_equal(self.config.workload_specs[0].instrumentation,
                  ['execution_time'])
     assert_equal(self.config.workload_specs[1].instrumentation,
                  ['fsp', 'execution_time'])
Ejemplo n.º 4
0
    def execute(self, args):  # NOQA
        self.set_up_output_directory(args)
        add_log_file(settings.log_file)

        if os.path.isfile(args.agenda):
            agenda = Agenda(args.agenda)
            settings.agenda = args.agenda
            shutil.copy(args.agenda, settings.meta_directory)
        else:
            self.logger.debug(
                '{} is not a file; assuming workload name.'.format(
                    args.agenda))
            agenda = Agenda()
            agenda.add_workload_entry(args.agenda)

        if args.instruments_to_disable:
            if 'instrumentation' not in agenda.config:
                agenda.config['instrumentation'] = []
            for itd in args.instruments_to_disable:
                self.logger.debug('Updating agenda to disable {}'.format(itd))
                agenda.config['instrumentation'].append('~{}'.format(itd))

        basename = 'config_'
        for file_number, path in enumerate(settings.get_config_paths(), 1):
            file_ext = os.path.splitext(path)[1]
            shutil.copy(
                path,
                os.path.join(settings.meta_directory,
                             basename + str(file_number) + file_ext))

        executor = Executor()
        executor.execute(agenda, selectors={'ids': args.only_run_ids})
Ejemplo n.º 5
0
    def execute(self, args):  # NOQA
        self.set_up_output_directory(args)
        add_log_file(settings.log_file)

        if os.path.isfile(args.agenda):
            agenda = Agenda(args.agenda)
            settings.agenda = args.agenda
            shutil.copy(args.agenda, settings.meta_directory)
        else:
            self.logger.debug('{} is not a file; assuming workload name.'.format(args.agenda))
            agenda = Agenda()
            agenda.add_workload_entry(args.agenda)

        file_name = 'config_{}.py'
        for file_number, path in enumerate(settings.get_config_paths(), 1):
            shutil.copy(path, os.path.join(settings.meta_directory, file_name.format(file_number)))

        executor = Executor()
        executor.execute(agenda, selectors={'ids': args.only_run_ids})
Ejemplo n.º 6
0
 def test_bad_syntax(self):
     Agenda(bad_syntax_agenda)
Ejemplo n.º 7
0
 def test_dup_sections(self):
     Agenda(dup_sectioned_agenda)
Ejemplo n.º 8
0
 def test_sections(self):
     agenda = Agenda(sectioned_agenda)
     assert_equal(agenda.sections[0].workloads[0].workload_name, 'antutu')
     assert_equal(agenda.sections[1].runtime_parameters['dp'], 'three')
Ejemplo n.º 9
0
 def test_default_id_assignment(self):
     agenda = Agenda(default_ids_agenda)
     assert_equal(agenda.workloads[0].id, '2')
     assert_equal(agenda.workloads[3].id, '3')
Ejemplo n.º 10
0
 def test_defaults(self):
     agenda = Agenda(short_agenda)
     assert_equal(len(agenda.workloads), 3)
     assert_equal(agenda.workloads[0].workload_name, 'antutu')
     assert_equal(agenda.workloads[0].id, '1')
Ejemplo n.º 11
0
 def test_yaml_missing_field(self):
     try:
         Agenda(invalid_agenda_text)
     except ConfigError, e:
         assert_in('workload name', e.message)
Ejemplo n.º 12
0
 def test_duplicate_id(self):
     try:
         Agenda(duplicate_agenda)
     except ConfigError, e:
         assert_in('duplicate', e.message.lower())  # pylint: disable=E1101
Ejemplo n.º 13
0
 def test_yaml_load(self):
     agenda = Agenda(YAML_TEST_FILE)
     assert_equal(len(agenda.workloads), 4)
Ejemplo n.º 14
0
 def test_remove_instrument(self):
     self.config.load_config({'instrumentation': ['list_params']})
     a = Agenda('{config: {instrumentation: [~list_params] }}')
     self.config.set_agenda(a)
     self.config.finalize()
     assert_equal(self.config.instrumentation, {})
Ejemplo n.º 15
0
 def test_exetension_params_lists(self):
     a = Agenda(LIST_PARAMS_AGENDA_TEXT)
     self.config.set_agenda(a)
     self.config.finalize()
     assert_equal(self.config.instrumentation['list_params']['param'],
                  [0.1, 0.1, 0.1])