aboutsummaryrefslogtreecommitdiff
path: root/crosperf/experiment_factory.py
diff options
context:
space:
mode:
authorZhizhou Yang <zhizhouy@google.com>2019-04-10 14:04:05 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-18 19:52:03 -0700
commitced8957f7a858d5cca66352522e916705f004944 (patch)
tree7777bb88cd76c4d6c97442b8cbe91c39754042cd /crosperf/experiment_factory.py
parent5ed02e0990d636f4220ac3259cfe541a296275b6 (diff)
downloadtoolchain-utils-ced8957f7a858d5cca66352522e916705f004944.tar.gz
crosperf: generate perf report with correct debug files
This patch fixes the issue in chromium:946588. This patch makes perf report no longer use hard code debug directories. There are several different situations: 1) When running tests on a downloaded image, it will download debug.tgz from gs, extract it to debug_files in /tmp. Options --symfs and --vmlinux will depend on this directory, and throw a warning to user that --kallsyms cannot be applied. 2) If running with downloaded image and debug.tgz could not work, then we will try to use local build, but give user a warning that it may not match real symbols well. 3) When running tests with local build, try to find debug info from /build/$board directory. Thus, this patch added a new field in label, called 'debug_path', if this is manually set in experiment file, then crosperf will directly use the location. Downloading of debug.tgz will only happen when perf_args is set in global settings. TEST=Passed all unit tests, tested with eve and sand. BUG=chromium:946588 Change-Id: I7f35d1216d912c8526d5501748f951face1273aa Reviewed-on: https://chromium-review.googlesource.com/1561780 Commit-Ready: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Diffstat (limited to 'crosperf/experiment_factory.py')
-rw-r--r--crosperf/experiment_factory.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/crosperf/experiment_factory.py b/crosperf/experiment_factory.py
index b1e12be9..81b5e544 100644
--- a/crosperf/experiment_factory.py
+++ b/crosperf/experiment_factory.py
@@ -2,6 +2,7 @@
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+
"""A module to generate experiments."""
from __future__ import print_function
@@ -322,6 +323,7 @@ class ExperimentFactory(object):
label_name = label_settings.name
image = label_settings.GetField('chromeos_image')
autotest_path = label_settings.GetField('autotest_path')
+ debug_path = label_settings.GetField('debug_path')
chromeos_root = label_settings.GetField('chromeos_root')
my_remote = label_settings.GetField('remote')
compiler = label_settings.GetField('compiler')
@@ -335,8 +337,9 @@ class ExperimentFactory(object):
build = label_settings.GetField('build')
if len(build) == 0:
raise RuntimeError("Can not have empty 'build' field!")
- image, autotest_path = label_settings.GetXbuddyPath(
- build, autotest_path, board, chromeos_root, log_level)
+ image, autotest_path, debug_path = label_settings.GetXbuddyPath(
+ build, autotest_path, debug_path, board, chromeos_root, log_level,
+ perf_args)
cache_dir = label_settings.GetField('cache_dir')
chrome_src = label_settings.GetField('chrome_src')
@@ -354,13 +357,14 @@ class ExperimentFactory(object):
image_args = label_settings.GetField('image_args')
if test_flag.GetTestMode():
# pylint: disable=too-many-function-args
- label = MockLabel(label_name, image, autotest_path, chromeos_root,
- board, my_remote, image_args, cache_dir, cache_only,
- log_level, compiler, chrome_src)
+ label = MockLabel(label_name, image, autotest_path, debug_path,
+ chromeos_root, board, my_remote, image_args,
+ cache_dir, cache_only, log_level, compiler,
+ chrome_src)
else:
- label = Label(label_name, image, autotest_path, chromeos_root, board,
- my_remote, image_args, cache_dir, cache_only, log_level,
- compiler, chrome_src)
+ label = Label(label_name, image, autotest_path, debug_path,
+ chromeos_root, board, my_remote, image_args, cache_dir,
+ cache_only, log_level, compiler, chrome_src)
labels.append(label)
if not labels: