diff --git a/wlauto/workloads/ebizzy/__init__.py b/wlauto/workloads/ebizzy/__init__.py new file mode 100644 index 00000000..bd2b65a2 --- /dev/null +++ b/wlauto/workloads/ebizzy/__init__.py @@ -0,0 +1,92 @@ +# Copyright 2012-2015 ARM Limited +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=W0201, C0103 + +from wlauto import Workload, Parameter, Executable + +import os +import re + +results_txt = 'ebizzy_results.txt' +record_regex = re.compile(r'(?P\d+) records/s') +result_regex = re.compile(r'(?P\D+)(?P\d+.*\b)(?P\S+)') + +class Ebizzy(Workload): + + name = 'ebizzy' + description = """ + ebizzy is designed to generate a workload resembling common web + application server workloads. It is highly threaded, has a large in-memory + working set with low locality, and allocates and deallocates memory frequently. + When running most efficiently, it will max out the CPU. + + ebizzy description taken from the source code at + https://github.com/linux-test-project/ltp/tree/master/utils/benchmark/ebizzy-0.3 + + """ + + parameters = [ + # Workload parameters go here e.g. + Parameter('threads', kind=int, default=2, description='Number of threads to execute.'), + Parameter('seconds', kind=int, default=10, description='Number of seconds.'), + Parameter('chunks', kind=int, default=10, + description='Number of memory chunks to allocate.'), + Parameter('extra_params', kind=str, default='', + description='Extra parameters to pass in (e.g. -M to disable mmap).' + ' See ebizzy -? for full list of options.') + ] + + def setup(self, context): + timeout_buf = 10 + self.command = '{} -t {} -S {} -n {} {} > {}' + self.ebizzy_results = os.path.join(self.device.working_directory, results_txt) + self.device_binary = None + self.run_timeout = self.seconds + timeout_buf + + self.binary_name = 'ebizzy' + if not self.device.is_installed(self.binary_name): + host_binary = context.resolver.get(Executable(self, self.device.abi, self.binary_name)) + self.device_binary = self.device.install(host_binary) + else: + self.device_binary = self.binary_name + + self.command = self.command.format(self.device_binary, self.threads, self.seconds, + self.chunks, self.extra_params, self.ebizzy_results) + + + def run(self, context): + self.device.execute(self.command, timeout=self.run_timeout) + + def update_result(self, context): + self.device.pull_file(self.ebizzy_results, context.output_directory) + + with open(os.path.join(context.output_directory, results_txt)) as ebizzy_file: + for line in ebizzy_file: + record_match = record_regex.search(line) + if record_match: + context.result.add_metric('total_recs', record_match.group('record'), + 'records/s') + + results_match = result_regex.search(line) + if results_match: + context.result.add_metric(results_match.group('metric'), + results_match.group('value'), + results_match.group('unit')) + + def teardown(self, context): + self.device.uninstall_executable(self.device_binary) + + def validate(self): + pass diff --git a/wlauto/workloads/ebizzy/bin/arm64/ebizzy b/wlauto/workloads/ebizzy/bin/arm64/ebizzy new file mode 100755 index 00000000..d74ffe27 Binary files /dev/null and b/wlauto/workloads/ebizzy/bin/arm64/ebizzy differ diff --git a/wlauto/workloads/ebizzy/bin/armeabi/ebizzy b/wlauto/workloads/ebizzy/bin/armeabi/ebizzy new file mode 100755 index 00000000..acc0e18b Binary files /dev/null and b/wlauto/workloads/ebizzy/bin/armeabi/ebizzy differ diff --git a/wlauto/workloads/ebizzy/src/LICENSE b/wlauto/workloads/ebizzy/src/LICENSE new file mode 100644 index 00000000..eb84b5ff --- /dev/null +++ b/wlauto/workloads/ebizzy/src/LICENSE @@ -0,0 +1,3 @@ +ebizzy binary source code can be found here: + +https://github.com/linux-test-project/ltp/tree/master/utils/benchmark/ebizzy-0.3