aboutsummaryrefslogtreecommitdiff
path: root/crosperf
diff options
context:
space:
mode:
authorChromeOS Developer <inglorion@chromium.org>2021-07-16 20:19:24 +0000
committerJian Cai <jiancai@google.com>2021-07-27 16:45:57 +0000
commit8fe5e65c0f7b3711cbeb6326a79eaaf797a5ae9e (patch)
tree8f87efd4001459644a1fae54680ce860b00b4f64 /crosperf
parent3796acfe14d0493ebc14db93f0ca8dbd39e17b75 (diff)
downloadtoolchain-utils-8fe5e65c0f7b3711cbeb6326a79eaaf797a5ae9e.tar.gz
crosperf: update location debug info
This fix the missing symbols in perf report due to the misplaced debug information. BUG=b:194540821 TEST=Ran crosperf and verified all the symbols are present in the perf report. Change-Id: Ifed66ac6073d175d99a71e64f5e89925fabdaa92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3050514 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Jian Cai <jiancai@google.com>
Diffstat (limited to 'crosperf')
-rw-r--r--crosperf/download_images.py34
-rw-r--r--crosperf/results_cache.py15
-rwxr-xr-xcrosperf/results_cache_unittest.py41
3 files changed, 45 insertions, 45 deletions
diff --git a/crosperf/download_images.py b/crosperf/download_images.py
index 9bd4a8bf..8e1bad11 100644
--- a/crosperf/download_images.py
+++ b/crosperf/download_images.py
@@ -137,8 +137,8 @@ class ImageDownloader(object):
def DownloadSingleFile(self, chromeos_root, build_id, package_file_name):
# Verify if package files exist
status = 0
- gs_package_name = (
- 'gs://chromeos-image-archive/%s/%s' % (build_id, package_file_name))
+ gs_package_name = ('gs://chromeos-image-archive/%s/%s' %
+ (build_id, package_file_name))
gsutil_cmd = os.path.join(chromeos_root, GS_UTIL)
if not test_flag.GetTestMode():
cmd = '%s ls %s' % (gsutil_cmd, gs_package_name)
@@ -171,8 +171,8 @@ class ImageDownloader(object):
uncompress_cmd):
# Uncompress file
download_path = os.path.join(chromeos_root, 'chroot/tmp', build_id)
- command = (
- 'cd %s ; %s %s' % (download_path, uncompress_cmd, package_file_name))
+ command = ('cd %s ; %s %s' %
+ (download_path, uncompress_cmd, package_file_name))
if self.log_level != 'verbose':
self._logger.LogOutput('CMD: %s' % command)
@@ -193,8 +193,8 @@ class ImageDownloader(object):
def VerifyFileExists(self, chromeos_root, build_id, package_file):
# Quickly verify if the files are there
status = 0
- gs_package_name = (
- 'gs://chromeos-image-archive/%s/%s' % (build_id, package_file))
+ gs_package_name = ('gs://chromeos-image-archive/%s/%s' %
+ (build_id, package_file))
gsutil_cmd = os.path.join(chromeos_root, GS_UTIL)
if not test_flag.GetTestMode():
cmd = '%s ls %s' % (gsutil_cmd, gs_package_name)
@@ -227,9 +227,9 @@ class ImageDownloader(object):
autotest_packages_name)
if status != 0:
default_autotest_dir = '/mnt/host/source/src/third_party/autotest/files'
- print(
- '(Warning: Could not find autotest packages .)\n'
- '(Warning: Defaulting autotest path to %s .' % default_autotest_dir)
+ print('(Warning: Could not find autotest packages .)\n'
+ '(Warning: Defaulting autotest path to %s .' %
+ default_autotest_dir)
return default_autotest_dir
# Files exist on server, download and uncompress them
@@ -281,22 +281,26 @@ class ImageDownloader(object):
self.UncompressSingleFile(chromeos_root, build_id, debug_archive_name,
'tar -xf ')
- # Rename created autotest directory to autotest_files
- command = ('cd %s ; mv debug debug_files' % download_path)
+ # Extract and move debug files into the proper location.
+ debug_dir = 'debug_files/usr/lib'
+ command = ('cd %s ; mkdir -p %s; mv debug %s' %
+ (download_path, debug_dir, debug_dir))
if self.log_level != 'verbose':
self._logger.LogOutput('CMD: %s' % command)
- print('(Moving downloaded debug files to debug_files)')
+ print('Moving downloaded debug files to %s' % debug_dir)
retval = self._ce.RunCommand(command)
if retval != 0:
- raise MissingFile('Could not create directory debug_files')
+ raise MissingFile('Could not create directory %s' %
+ os.path.join(debug_dir, 'debug'))
return debug_rel_path
def Run(self, chromeos_root, xbuddy_label, autotest_path, debug_path,
download_debug):
build_id = self.GetBuildID(chromeos_root, xbuddy_label)
- image_name = ('gs://chromeos-image-archive/%s/chromiumos_test_image.tar.xz'
- % build_id)
+ image_name = (
+ 'gs://chromeos-image-archive/%s/chromiumos_test_image.tar.xz' %
+ build_id)
# Verify that image exists for build_id, before attempting to
# download it.
diff --git a/crosperf/results_cache.py b/crosperf/results_cache.py
index 3342f93a..c1cc8720 100644
--- a/crosperf/results_cache.py
+++ b/crosperf/results_cache.py
@@ -351,11 +351,11 @@ class Result(object):
result = self.FindFilesInResultsDir('-name perf_measurements').splitlines()
if not result:
if self.suite == 'telemetry_Crosperf':
- result = \
- self.FindFilesInResultsDir('-name histograms.json').splitlines()
+ result = (
+ self.FindFilesInResultsDir('-name histograms.json').splitlines())
else:
- result = \
- self.FindFilesInResultsDir('-name results-chart.json').splitlines()
+ result = (
+ self.FindFilesInResultsDir('-name results-chart.json').splitlines())
return result
def GetTurbostatFile(self):
@@ -413,7 +413,8 @@ class Result(object):
if debug_path:
symfs = '--symfs ' + debug_path
- vmlinux = '--vmlinux ' + os.path.join(debug_path, 'boot', 'vmlinux')
+ vmlinux = '--vmlinux ' + os.path.join(debug_path, 'usr', 'lib', 'debug',
+ 'boot', 'vmlinux')
kallsyms = ''
print('** WARNING **: --kallsyms option not applied, no System.map-* '
'for downloaded image.')
@@ -1204,8 +1205,8 @@ class TelemetryResult(Result):
self.err = pickle.load(f)
self.retval = pickle.load(f)
- self.chrome_version = \
- super(TelemetryResult, self).GetChromeVersionFromCache(cache_dir)
+ self.chrome_version = (
+ super(TelemetryResult, self).GetChromeVersionFromCache(cache_dir))
self.ProcessResults()
diff --git a/crosperf/results_cache_unittest.py b/crosperf/results_cache_unittest.py
index e2730e5f..2eeea71c 100755
--- a/crosperf/results_cache_unittest.py
+++ b/crosperf/results_cache_unittest.py
@@ -188,8 +188,8 @@ PERF_DATA_HEADER = """
#
"""
-TURBOSTAT_LOG_OUTPUT = \
-"""CPU Avg_MHz Busy% Bzy_MHz TSC_MHz IRQ CoreTmp
+TURBOSTAT_LOG_OUTPUT = (
+ """CPU Avg_MHz Busy% Bzy_MHz TSC_MHz IRQ CoreTmp
- 329 12.13 2723 2393 10975 77
0 336 12.41 2715 2393 6328 77
2 323 11.86 2731 2393 4647 69
@@ -217,7 +217,7 @@ CPU Avg_MHz Busy% Bzy_MHz TSC_MHz IRQ CoreTmp
- 843 29.83 2832 2393 28161 47
0 827 29.35 2826 2393 16093 47
2 858 30.31 2838 2393 12068 46
-"""
+""")
TURBOSTAT_DATA = {
'cpufreq': {
'all': [2723, 2884, 2927, 2937, 2932, 2933, 2832]
@@ -227,8 +227,7 @@ TURBOSTAT_DATA = {
},
}
-TOP_LOG = \
-"""
+TOP_LOG = ("""
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4102 chronos 12 -8 3454472 238300 118188 R 41.8 6.1 0:08.37 chrome
4204 chronos 12 -8 2492716 205728 179016 S 11.8 5.3 0:03.89 chrome
@@ -250,7 +249,7 @@ TOP_LOG = \
5713 chronos 20 0 5178652 103120 50372 S 17.8 2.6 0:01.13 chrome
7 root 20 0 0 0 0 S 1.0 0.0 0:00.73 rcu_preempt
855 root 20 0 0 0 0 S 1.0 0.0 0:00.01 kworker/4:2
-"""
+""")
TOP_DATA = [
{
'cmd': 'chrome-5745',
@@ -301,8 +300,7 @@ TOP_DATA = [
'top5_cpu_use': [1.0],
},
]
-TOP_OUTPUT = \
-""" COMMAND AVG CPU% SEEN HIGHEST 5
+TOP_OUTPUT = (""" COMMAND AVG CPU% SEEN HIGHEST 5
chrome 128.250000 6 [122.8, 107.9, 17.8, 5.0, 2.0]
irq/230-cros-ec 1.000000 1 [2.0]
sshd 0.500000 1 [1.0]
@@ -310,10 +308,9 @@ TOP_OUTPUT = \
spi5 0.500000 1 [1.0]
rcu_preempt 0.500000 1 [1.0]
kworker/4:2 0.500000 1 [1.0]
-"""
+""")
-CPUSTATS_UNIQ_OUTPUT = \
-"""
+CPUSTATS_UNIQ_OUTPUT = ("""
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq 1512000
/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq 1512000
/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_cur_freq 2016000
@@ -326,7 +323,7 @@ big-cpu 51234
soc-thermal 45456
little-cpu 42555
big-cpu 61724
-"""
+""")
CPUSTATS_UNIQ_DATA = {
'cpufreq': {
'cpu0': [1512, 1500],
@@ -339,8 +336,7 @@ CPUSTATS_UNIQ_DATA = {
'big-cpu': [51.2, 61.7]
}
}
-CPUSTATS_DUPL_OUTPUT = \
-"""
+CPUSTATS_DUPL_OUTPUT = ("""
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq 1512000
/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq 1512000
/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_cur_freq 1512000
@@ -353,7 +349,7 @@ CPUSTATS_DUPL_OUTPUT = \
/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq 1614000
/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_cur_freq 1614000
/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_cur_freq 1982000
-"""
+""")
CPUSTATS_DUPL_DATA = {
'cpufreq': {
'cpu0': [1512, 1500, 1614],
@@ -363,8 +359,7 @@ CPUSTATS_DUPL_DATA = {
TMP_DIR1 = '/tmp/tmpAbcXyz'
-HISTOGRAMSET = \
-"""
+HISTOGRAMSET = ("""
[
{
"values": [
@@ -436,7 +431,7 @@ HISTOGRAMSET = \
}
]
-"""
+""")
# pylint: enable=line-too-long
@@ -1262,7 +1257,7 @@ class ResultTest(unittest.TestCase):
self.assertEqual(mock_chrootruncmd.call_args_list[0][0],
(self.result.chromeos_root,
('/usr/sbin/perf report -n --symfs /tmp/debug '
- '--vmlinux /tmp/debug/boot/vmlinux '
+ '--vmlinux /tmp/debug/usr/lib/debug/boot/vmlinux '
'-i %s --stdio > %s') % (fake_file, fake_file)))
@mock.patch.object(misc, 'GetOutsideChrootPath')
@@ -1940,8 +1935,8 @@ class ResultsCacheTest(unittest.TestCase):
mock_checksum.return_value = 'FakeImageChecksumabc123'
self.results_cache.machine_manager.GetMachines = FakeGetMachines
- self.results_cache.machine_manager.machine_checksum['mock_label'] = \
- 'FakeMachineChecksumabc987'
+ self.results_cache.machine_manager.machine_checksum['mock_label'] = (
+ 'FakeMachineChecksumabc987')
# Based on the label, benchmark and machines, get the directory in which
# to store the cache information for this test run.
result_path = self.results_cache.GetCacheDirForWrite()
@@ -1987,8 +1982,8 @@ class ResultsCacheTest(unittest.TestCase):
mock_checksum.return_value = 'FakeImageChecksumabc123'
self.results_cache.machine_manager.GetMachines = FakeGetMachines
- self.results_cache.machine_manager.machine_checksum['mock_label'] = \
- 'FakeMachineChecksumabc987'
+ self.results_cache.machine_manager.machine_checksum['mock_label'] = (
+ 'FakeMachineChecksumabc987')
# Test 1. Generating cache name for reading (not writing).
key_list = self.results_cache.GetCacheKeyList(True)