diff --git a/external/devlib/devlib/instrument/acmecape.py b/external/devlib/devlib/instrument/acmecape.py index 42728e69e52c890a15c8a11099a0a5fccc53675e..f0bb11f459732e050b13a713cabbe1cd0c49acb2 100644 --- a/external/devlib/devlib/instrument/acmecape.py +++ b/external/devlib/devlib/instrument/acmecape.py @@ -87,7 +87,8 @@ class AcmeCapeInstrument(Instrument): params = dict( iio_capture=self.iio_capture, host=self.host, - buffer_size=self.buffer_size, + # This must be a string for quote() + buffer_size=str(self.buffer_size), iio_device=self.iio_device, outfile=self.raw_data_file ) diff --git a/external/devlib/devlib/utils/android.py b/external/devlib/devlib/utils/android.py index 153d1b09f51025ffebc7f9a63211f2741af2bd1f..1b1c146519b7a7f7558056fc6fa4dddbb5205461 100755 --- a/external/devlib/devlib/utils/android.py +++ b/external/devlib/devlib/utils/android.py @@ -308,7 +308,7 @@ class AdbConnection(object): raise def background(self, command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, as_root=False): - return adb_background_shell(self.device, command, stdout, stderr, as_root) + return adb_background_shell(self.device, command, stdout, stderr, as_root, adb_server=self.adb_server) def close(self): AdbConnection.active_connections[self.device] -= 1 @@ -479,12 +479,15 @@ def adb_shell(device, command, timeout=None, check_exit_code=False, def adb_background_shell(device, command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - as_root=False): + as_root=False, + adb_server=None): """Runs the sepcified command in a subprocess, returning the the Popen object.""" _check_env() if as_root: command = 'echo {} | su'.format(quote(command)) - device_string = ' -s {}'.format(device) if device else '' + + device_string = ' -H {}'.format(adb_server) if adb_server else '' + device_string += ' -s {}'.format(device) if device else '' full_command = 'adb{} shell {}'.format(device_string, quote(command)) logger.debug(full_command) return subprocess.Popen(full_command, stdout=stdout, stderr=stderr, shell=True) diff --git a/external/devlib/devlib/utils/ssh.py b/external/devlib/devlib/utils/ssh.py index 27898b68390f454f0dc030851d37996a0dd812cc..a4811a00007f51a82b2dc7eea6b1d328eebd2b79 100644 --- a/external/devlib/devlib/utils/ssh.py +++ b/external/devlib/devlib/utils/ssh.py @@ -63,7 +63,7 @@ def ssh_get_shell(host, username, password=None, keyfile=None, port=None, timeou raise ValueError('keyfile may not be used with a telnet connection.') conn = TelnetPxssh(original_prompt=original_prompt) else: # ssh - conn = pxssh.pxssh() + conn = pxssh.pxssh(echo=False) try: if keyfile: @@ -278,15 +278,11 @@ class SshConnection(object): logger.debug(command) self._sendline(command) timed_out = self._wait_for_prompt(timeout) - # the regex removes line breaks potential introduced when writing - # command to shell. if sys.version_info[0] == 3: output = process_backspaces(self.conn.before.decode(sys.stdout.encoding or 'utf-8', 'replace')) else: output = process_backspaces(self.conn.before) - output = re.sub(r'\r([^\n])', r'\1', output) - if '\r\n' in output: # strip the echoed command - output = output.split('\r\n', 1)[1] + if timed_out: self.cancel_running_command() raise TimeoutError(command, output) diff --git a/external/trappy/tests/test_ftrace.py b/external/trappy/tests/test_ftrace.py index 75cdde6f2777574f0b84162ef4355fad3d01cea8..deb10bcdfbffc3a2abdd2053142a202ae50449b9 100644 --- a/external/trappy/tests/test_ftrace.py +++ b/external/trappy/tests/test_ftrace.py @@ -237,15 +237,15 @@ class TestFTrace(BaseTestThermal): def test_get_all_freqs_data(self): """Test get_all_freqs_data()""" - allfreqs = trappy.FTrace().get_all_freqs_data(self.map_label) + allfreqs = dict(trappy.FTrace().get_all_freqs_data(self.map_label)) - self.assertEqual(allfreqs[1][1]["A53_freq_out"].iloc[3], 850) - self.assertEqual(allfreqs[1][1]["A53_freq_in"].iloc[1], 850) - self.assertEqual(allfreqs[0][1]["A57_freq_out"].iloc[2], 1100) - self.assertTrue("gpu_freq_in" in allfreqs[2][1].columns) + self.assertEqual(allfreqs["A53"]["A53_freq_out"].iloc[3], 850) + self.assertEqual(allfreqs["A53"]["A53_freq_in"].iloc[1], 850) + self.assertEqual(allfreqs["A57"]["A57_freq_out"].iloc[2], 1100) + self.assertTrue("gpu_freq_in" in allfreqs["GPU"].columns) # Make sure there are no NaNs in the middle of the array - self.assertTrue(allfreqs[0][1]["A57_freq_in"].notnull().all()) + self.assertTrue(allfreqs["A57"]["A57_freq_in"].notnull().all()) def test_apply_callbacks(self): """Test apply_callbacks()""" diff --git a/external/workload-automation/doc/source/api/output.rst b/external/workload-automation/doc/source/api/output.rst index 5aea51ece6cf39acf2e5b203887365f8266088d3..34c8b1ffbac16c703d2087faa95c34e57fe6ca71 100644 --- a/external/workload-automation/doc/source/api/output.rst +++ b/external/workload-automation/doc/source/api/output.rst @@ -497,6 +497,11 @@ A :class:`Metric` has the following attributes: or they may have been added by the workload to help distinguish between otherwise identical metrics. +``label`` + This is a string constructed from the name and classifiers, to provide a + more unique identifier, e.g. for grouping values across iterations. The + format is in the form ``name/cassifier1=value1/classifier2=value2/...``. + :class:`Artifact` ----------------- diff --git a/external/workload-automation/wa/framework/output.py b/external/workload-automation/wa/framework/output.py index 8ab10b6776726dfd162df2c1be3d80f52ca13aa2..3cf1f5ee000023a2b559186b1c9b5988873e0dd6 100644 --- a/external/workload-automation/wa/framework/output.py +++ b/external/workload-automation/wa/framework/output.py @@ -602,6 +602,12 @@ class Metric(Podable): instance._pod_version = pod_version # pylint: disable =protected-access return instance + @property + def label(self): + parts = ['{}={}'.format(n, v) for n, v in self.classifiers.items()] + parts.insert(0, self.name) + return '/'.join(parts) + def __init__(self, name, value, units=None, lower_is_better=False, classifiers=None): super(Metric, self).__init__() diff --git a/external/workload-automation/wa/instruments/poller/bin/arm64/poller b/external/workload-automation/wa/instruments/poller/bin/arm64/poller index b06c54ddf29b266d678496ed2e5fe3c36231b0f5..d64ddc41fd1c0aa6534f9cbc35ca4b52307b1127 100755 Binary files a/external/workload-automation/wa/instruments/poller/bin/arm64/poller and b/external/workload-automation/wa/instruments/poller/bin/arm64/poller differ diff --git a/external/workload-automation/wa/instruments/poller/bin/armeabi/poller b/external/workload-automation/wa/instruments/poller/bin/armeabi/poller index 2808007fea1a09dcece410550389fc639bf390d7..8a9e0c4d2ccfae41b5a4a90f01699ce4ca0c3786 100755 Binary files a/external/workload-automation/wa/instruments/poller/bin/armeabi/poller and b/external/workload-automation/wa/instruments/poller/bin/armeabi/poller differ diff --git a/external/workload-automation/wa/instruments/poller/poller.c b/external/workload-automation/wa/instruments/poller/poller.c index 084007549ab107d215be3435d8152632a817c0eb..85df4c6f69b1eb9ab55b75655a83611b3d5d1103 100644 --- a/external/workload-automation/wa/instruments/poller/poller.c +++ b/external/workload-automation/wa/instruments/poller/poller.c @@ -196,7 +196,7 @@ int main(int argc, char ** argv) { strip(buf); printf(",%s", buf); - buf[0] = '\0'; // "Empty" buffer + memset(buf, 0, sizeof(buf)); // "Empty" buffer } printf("\n"); usleep(interval);