aboutsummaryrefslogtreecommitdiff
path: root/crosperf
diff options
context:
space:
mode:
authorDenis Nikitin <denik@chromium.org>2021-01-09 22:04:36 -0800
committerDenis Nikitin <denik@chromium.org>2021-01-12 01:24:04 +0000
commitd4821af88d2a8222eabeeda32752695f649edd0d (patch)
tree17500e5ea3f94ed655a8944ec4f9bf8c4bd3cdd1 /crosperf
parent9f99f6cc358c315eb5cffbf4614852bcd7ff7ced (diff)
downloadtoolchain-utils-d4821af88d2a8222eabeeda32752695f649edd0d.tar.gz
crosperf: Fix index incrementing
Increment a file index when copying multiple files. This fixes the issue when multiple perf.data files are copied from the system_health.memory_desktop benchmark with profiling. BUG=None TEST=crosperf with system_health.memory_desktop and profiling enabled. Change-Id: I7d00ec23a4fa595d6cd0df8fcc8b64cf7181f5dd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2622963 Tested-by: Denis Nikitin <denik@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Diffstat (limited to 'crosperf')
-rw-r--r--crosperf/results_cache.py1
-rwxr-xr-xcrosperf/results_cache_unittest.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/crosperf/results_cache.py b/crosperf/results_cache.py
index c5c85942..3342f93a 100644
--- a/crosperf/results_cache.py
+++ b/crosperf/results_cache.py
@@ -129,6 +129,7 @@ class Result(object):
ret = self.ce.CopyFiles(file_to_copy, dest_file, recursive=False)
if ret:
raise IOError('Could not copy results file: %s' % file_to_copy)
+ file_index += 1
def CopyResultsTo(self, dest_dir):
self.CopyFilesTo(dest_dir, self.results_file)
diff --git a/crosperf/results_cache_unittest.py b/crosperf/results_cache_unittest.py
index 91ceed22..e2730e5f 100755
--- a/crosperf/results_cache_unittest.py
+++ b/crosperf/results_cache_unittest.py
@@ -523,8 +523,8 @@ class ResultTest(unittest.TestCase):
second_args = mock_copyfiles.call_args_list[1][0]
third_args = mock_copyfiles.call_args_list[2][0]
self.assertEqual(first_args, ('src_file_1', '/tmp/test/src_file_1.0'))
- self.assertEqual(second_args, ('src_file_2', '/tmp/test/src_file_2.0'))
- self.assertEqual(third_args, ('src_file_3', '/tmp/test/src_file_3.0'))
+ self.assertEqual(second_args, ('src_file_2', '/tmp/test/src_file_2.1'))
+ self.assertEqual(third_args, ('src_file_3', '/tmp/test/src_file_3.2'))
mock_runcmd.reset_mock()
mock_copyfiles.reset_mock()