1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-22 04:49:00 +00:00

Added target_config option to telemetry

This commit is contained in:
Sergei Trofimov 2015-07-14 11:26:17 +01:00
parent 65ab86221b
commit 2d3be33bb0

View File

@ -17,13 +17,11 @@
import os import os
import re import re
import csv import csv
import math
import shutil import shutil
import json import json
import urllib import urllib
import stat import stat
from zipfile import is_zipfile, ZipFile from zipfile import is_zipfile, ZipFile
from collections import defaultdict
try: try:
import pandas as pd import pandas as pd
@ -33,7 +31,7 @@ except ImportError:
from wlauto import Workload, Parameter from wlauto import Workload, Parameter
from wlauto.exceptions import WorkloadError, ConfigError from wlauto.exceptions import WorkloadError, ConfigError
from wlauto.utils.misc import check_output, get_null, get_meansd from wlauto.utils.misc import check_output, get_null, get_meansd
from wlauto.utils.types import numeric, identifier from wlauto.utils.types import numeric
RESULT_REGEX = re.compile(r'RESULT ([^:]+): ([^=]+)\s*=\s*' # preamble and test/metric name RESULT_REGEX = re.compile(r'RESULT ([^:]+): ([^=]+)\s*=\s*' # preamble and test/metric name
@ -113,6 +111,12 @@ class Telemetry(Workload):
description=""" description="""
if ``True``, FPS for the run will be computed from the trace (must be enabled). if ``True``, FPS for the run will be computed from the trace (must be enabled).
"""), """),
Parameter('target_config', kind=str, default=None,
description="""
Manually specify target configuration for telemetry. This must contain
--browser option plus any addition options Telemetry requires for a particular
target (e.g. --device or --remote)
"""),
] ]
def validate(self): def validate(self):
@ -177,6 +181,9 @@ class Telemetry(Workload):
def build_command(self): def build_command(self):
device_opts = '' device_opts = ''
if self.target_config:
device_opts = self.target_config
else:
if self.device.platform == 'chromeos': if self.device.platform == 'chromeos':
if '--remote' not in self.run_benchmark_params: if '--remote' not in self.run_benchmark_params:
device_opts += '--remote={} '.format(self.device.host) device_opts += '--remote={} '.format(self.device.host)
@ -188,7 +195,8 @@ class Telemetry(Workload):
if '--browser' not in self.run_benchmark_params: if '--browser' not in self.run_benchmark_params:
device_opts += '--browser=android-webview-shell ' device_opts += '--browser=android-webview-shell '
else: else:
raise WorkloadError('Currently, telemetry workload supports only ChromeOS or Android devices.') raise WorkloadError('Unless you\'re running Telemetry on a ChromeOS or Android device, '
'you mast specify target_config option')
return '{} {} {} {}'.format(self.run_benchmark_path, return '{} {} {} {}'.format(self.run_benchmark_path,
self.test, self.test,
device_opts, device_opts,