From 759f8db1bcdaa6cedaac50d93d3cf2176a7e3e6b Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Thu, 11 Feb 2016 08:15:20 +0000 Subject: [PATCH 1/2] lmbench: adding taskset support lmbench can now be run pinned to specific CPUs. --- wlauto/workloads/lmbench/__init__.py | 74 +++++++++++++++++++--------- 1 file changed, 51 insertions(+), 23 deletions(-) diff --git a/wlauto/workloads/lmbench/__init__.py b/wlauto/workloads/lmbench/__init__.py index 87a6404d..05a43402 100644 --- a/wlauto/workloads/lmbench/__init__.py +++ b/wlauto/workloads/lmbench/__init__.py @@ -29,42 +29,64 @@ class lmbench(Workload): test_names = ['lat_mem_rd', 'bw_mem'] description = """ - Run a subtest from lmbench, a suite of portable ANSI/C microbenchmarks for UNIX/POSIX. + Run a subtest from lmbench, a suite of portable ANSI/C microbenchmarks for + UNIX/POSIX. - In general, lmbench measures two key features: latency and bandwidth. This workload supports a subset - of lmbench tests. lat_mem_rd can be used to measure latencies to memory (including caches). bw_mem - can be used to measure bandwidth to/from memory over a range of operations. + In general, lmbench measures two key features: latency and bandwidth. This + workload supports a subset of lmbench tests. lat_mem_rd can be used to + measure latencies to memory (including caches). bw_mem can be used to + measure bandwidth to/from memory over a range of operations. - Further details, and source code are available from: - http://sourceforge.net/projects/lmbench/. - See lmbench/bin/README for license details. - """ + Further details, and source code are available from: + + http://sourceforge.net/projects/lmbench/. + + See lmbench/bin/README for license details. + """ parameters = [ Parameter('test', default='lat_mem_rd', allowed_values=test_names, - description="Specifies an lmbench test to run."), + description=''' + Specifies an lmbench test to run. + '''), Parameter('stride', kind=list_or_integer, default=[128], - description='Stride for lat_mem_rd test. Workload will iterate over one or more integer values.'), - Parameter('thrash', kind=bool, default=True, description='Sets -t flag for lat_mem_rd_test'), + description=''' + Stride for lat_mem_rd test. Workload will iterate over one or + more integer values. + '''), + Parameter('thrash', kind=bool, default=True, + description='Sets -t flag for lat_mem_rd_test'), Parameter('size', kind=list_or_string, default="4m", description='Data set size for lat_mem_rd bw_mem tests.'), Parameter('mem_category', kind=list_or_string, default=('rd', 'wr', 'cp', 'frd', 'fwr', 'fcp', 'bzero', 'bcopy'), description='List of memory catetories for bw_mem test.'), - Parameter('parallelism', kind=int, default=None, description='Parallelism flag for tests that accept it.'), - Parameter('warmup', kind=int, default=None, description='Warmup flag for tests that accept it.'), - Parameter('repetitions', kind=int, default=None, description='Repetitions flag for tests that accept it.'), + Parameter('parallelism', kind=int, default=None, + description='Parallelism flag for tests that accept it.'), + Parameter('warmup', kind=int, default=None, + description='Warmup flag for tests that accept it.'), + Parameter('repetitions', kind=int, default=None, + description='Repetitions flag for tests that accept it.'), Parameter('force_abi', kind=str, default=None, - description='Override device abi with this value. Can be used to force arm32 on 64-bit devices.'), + description=''' + Override device abi with this value. Can be used to force + arm32 on 64-bit devices. + '''), Parameter('run_timeout', kind=int, default=900, description=""" Timeout for execution of the test. """), Parameter('times', kind=int, default=1, constraint=lambda x: x > 0, description=""" - Specifies the number of times the benchmark will be run in a "tight loop", - i.e. without performaing setup/teardown inbetween. This parameter is distinct from - "repetitions", as the latter takes place within the benchmark and produces a single result. + Specifies the number of times the benchmark will be run in a + "tight loop", i.e. without performaing setup/teardown + inbetween. This parameter is distinct from "repetitions", as + the latter takes place within the benchmark and produces a + single result. + """), + Parameter('taskset_mask', kind=int, + description=""" + Specifies the CPU mask the benchmark process will be pinned to. """), ] @@ -124,11 +146,17 @@ class lmbench(Workload): self.commands.append(command + what) def _setup_common(self): - command = self.device_exe + " " + parts = [] + if self.taskset_mask: + parts.append('{} taskset 0x{:x} {}'.format(self.device.busybox, + self.taskset_mask, + self.device_exe)) + else: + parts.append(self.device_exe) if self.parallelism is not None: - command = command + '-P {} '.format(self.parallelism) + parts.append('-P {}'.format(self.parallelism)) if self.warmup is not None: - command = command + '-W {} '.format(self.warmup) + parts.append('-W {}'.format(self.warmup)) if self.repetitions is not None: - command = command + '-N {} '.format(self.repetitions) - return command + parts.append('-N {}'.format(self.repetitions)) + return ' '.join(parts) From 13ebc8ad558b4be25dfd37d4d7b2d8d7a755e411 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Thu, 11 Feb 2016 08:18:05 +0000 Subject: [PATCH 2/2] pep8: removed trailling spaces --- wlauto/workloads/dhrystone/__init__.py | 2 +- wlauto/workloads/googlemap/__init__.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wlauto/workloads/dhrystone/__init__.py b/wlauto/workloads/dhrystone/__init__.py index 8e60a10a..5ead67c0 100644 --- a/wlauto/workloads/dhrystone/__init__.py +++ b/wlauto/workloads/dhrystone/__init__.py @@ -61,7 +61,7 @@ class Dhrystone(Workload): 'threads (if ``threads`` > 1).')), Parameter('taskset_mask', kind=int, default=0, description=''' - The processes spawned by the workload will be pinned to cores + The processes spawned by the workload will be pinned to cores as specified by this parameter '''), ] diff --git a/wlauto/workloads/googlemap/__init__.py b/wlauto/workloads/googlemap/__init__.py index e424fa47..59c50cc7 100644 --- a/wlauto/workloads/googlemap/__init__.py +++ b/wlauto/workloads/googlemap/__init__.py @@ -24,10 +24,10 @@ class GoogleMap(GameWorkload): Navigation app. Stock map provided by Google Inc. - Based on revent, we can use this workload to - do multiple tasks such as navigation usecases, + Based on revent, we can use this workload to + do multiple tasks such as navigation usecases, swipe & pinch etc. - + Provided revent is for Odriod XU3 for navigation use case. For running on other devices, we need to build revent.