

def setup(self, context):
    self.cyclictest_on_device = 'cyclictest'
    self.cyclictest_result = os.path.join(self.device.working_directory, TXT_RESULT_NAME)
    self.cyclictest_command = '{} --clock={} --duration={}s --thread={} --latency={} {} {} > {}'
    self.device_binary = None
    if (not self.device.is_rooted):
        raise WorkloadError('This workload requires a device with root premissions to run')
    host_binary = context.resolver.get(Executable(self, self.device.abi, 'cyclictest'))
    self.device_binary = self.device.install(host_binary)
    self.cyclictest_command = self.cyclictest_command.format(self.device_binary, (0 if (self.clock == 'monotonic') else 1), self.duration, self.thread, self.latency, ('--quiet' if self.quiet else ''), self.extra_parameters, self.cyclictest_result)
    if self.clear_file_cache:
        self.device.execute('sync')
        self.device.set_sysfile_value('/proc/sys/vm/drop_caches', 3)
    if (self.device.platform == 'android'):
        if (self.screen_off and self.device.is_screen_on):
            self.device.execute('input keyevent 26')

dataset/ETHPy150Open ARM-software/workload-automation/wlauto/workloads/cyclictest/__init__.py Cyclictest.setup/original