aboutsummaryrefslogtreecommitdiff
path: root/cros_utils
AgeCommit message (Collapse)Author
2020-09-25rephrase some language in code and commentsBob Haarman
This rephrases some code and comments to avoid unclear and non-inclusive wording. For the remaining terms in unblocked_terms.txt, comments are added to explain why these terms are present in the code. BUG=chromium:1099035 TEST=repo hooks Change-Id: I985613d811836b6fb6351eadcf3e08a3290db97f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2419656 Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: Manoj Gupta (OoO) <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-09-17crosperf: Add support to run tests with ssh forwardingTiancong Wang
The change allows running crosperf with local DUT with port forwarding. Experiment file can define a local DUT with: remote: 127.0.0.1:<local-port> BUG=chromium:1064988 TEST=Tested with crosperf on local and remote DUT. Change-Id: I62446821f83e8ae39d610ca9ed60c9b37af9852c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2158122 Reviewed-by: Denis Nikitin <denik@chromium.org> Reviewed-by: Tiancong Wang <tcwang@google.com> Tested-by: Denis Nikitin <denik@chromium.org>
2020-08-27crosperf: replace statistics stdev with pstdevDenis Nikitin
Behavior and results of statistics.stdev(data) are slightly different from numpy.std(data) with default "ddof". The main difference is the divisor which is "N - 1" in stdev vs. "N" in numpy.std. As a consequence stdev fails with "N=1". The change replaces stdev with pstdev (population standard deviation) which is equivalent to numpy.std with default arguments that we were using. Added unittest with StdResult testing. BUG=None TEST=unittest and crosperf with one iteration passes. Change-Id: I70c7105e6cabc27437504de16ea27afdd719e552 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2376880 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Denis Nikitin <denik@chromium.org> Commit-Queue: Denis Nikitin <denik@chromium.org>
2020-08-19cros_utils: clean up namingJian Cai
Also fixed format to comply with yapf. BUG=chromium:1099035 TEST=None. Change-Id: I341ee97c2270f33548590daadb36050c2a6baaf6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2364722 Reviewed-by: Tiancong Wang <tcwang@google.com> Tested-by: Jian Cai <jiancai@google.com>
2020-08-12crosperf: remove uses of numpyGeorge Burgess IV
New in python3 (compared to python2) is a `statistics` module, which provides all of the functionality we wanted from numpy here. Use that instead. BUG=chromium:980719 TEST=Unittests Change-Id: I5eaa53744142c402d1e71d6b867e434940d41aec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2353422 Reviewed-by: Tiancong Wang <tcwang@google.com> Tested-by: George Burgess <gbiv@chromium.org>
2020-07-20Put reference filters on 'git ls-remote'.Allen Webb
This saves time and bandwidth expecially as the number of references scale up with uploaded CLs. BUG=None TEST=CQ passes Change-Id: Idf0e9eea97bc533ec21f29cfd8267a260f7322ef Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2302949 Reviewed-by: Tiancong Wang <tcwang@google.com> Commit-Queue: Allen Webb <allenwebb@google.com> Tested-by: Allen Webb <allenwebb@google.com>
2020-06-29cros_util: fix up namingTiancong Wang
Since these two scripts are tracking upstream Chrome OS repos, fixing naming is a bit harder. This patch creates a variable to hold the name of the main branch, so it's easier to fix these files in case any future name fixing on upstream. Also run `yapf` during presubmit. BUG=chromium:1099035 TEST=None Change-Id: Ic72a213dadf12b382a76fe50d48cde6fcecc3b25 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2270728 Reviewed-by: Caroline Tice <cmtice@chromium.org> Commit-Queue: Tiancong Wang <tcwang@google.com> Tested-by: Tiancong Wang <tcwang@google.com>
2020-06-29cros_utils: clean up unused file/codeTiancong Wang
As an effort to fix up naming in crbug.com/1099035, we can just remove the unused code and variable in these two files. BUG=chromium:1099035 TEST=buildbot_utils_unittest.py pass after the removal. Change-Id: Id4c12aeab9bf44b67e58b11c4297ceafe441421d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2270723 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org> Commit-Queue: Tiancong Wang <tcwang@google.com> Tested-by: Tiancong Wang <tcwang@google.com>
2020-05-28crosperf: do not pass -p for ssh by defaultzhizhouy
The default value of FLAGS_ssh_port has been changed in an earlier CL:2202616, causing crosperf failures when running ssh. According to CL:2209173, the system will help decide the port to use for ssh, so we don't need to specify it explicitly in our command. BUG=None TEST=tested with lab machines with crosperf Change-Id: Ie40dc1a21452b01cb0643e191110f03e009b7c73 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2218540 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com>
2020-05-04cros_utils: fix a bad format stringGeorge Burgess IV
`'%s' + 'bar' % baz` == `'%s' + ('bar' % baz)`, which raises an exception. OTOH, `'%s' 'bar' % baz` == `('%s' 'bar') % baz`, so do that instead. BUG=None TEST=Unittests Change-Id: I83313e8fcb34d4ca923f3730133eec528ea6f9eb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2177144 Tested-by: George Burgess <gbiv@chromium.org> Reviewed-by: Tiancong Wang <tcwang@google.com>
2020-04-28cros_utils: import tiny_render + some (new) tests from google3George Burgess IV
Purely plaintext emails are nice, but HTML can be way easier to deal with. `tiny_render` is a super simple way of being able to render text and HTML from the same structure, so we can send out descriptive emails accessible to people with various kinds of email clients. tiny_render was imported with slight modifications from //wireless/android/llvm/monitoring/commits/tiny_render.py . Tests are new. BUG=chromium:1046988 TEST=unittests Change-Id: Ic94064d0125d3e7655498c9c2b8501f1448420d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2169009 Reviewed-by: Tiancong Wang <tcwang@google.com> Tested-by: George Burgess <gbiv@chromium.org>
2020-04-23crosperf: add support to run tast benchmarkszhizhouy
Crosperf used to only support autotest server/client tests, and was limiting us from running and collecting tast benchmarks. This patch introduces a simple support for crosperf to run tast. Note that currently we do not support passing arguments or running tast with local changes. It basically launches `tast run <ip> <tast_test>` and collects chart json result and parses it. BUG=chromium:1071937 TEST=tested with tast.platform.ReportDiskUsage Change-Id: I1980a48c4ca8e02548e5313d32b8c5ddcf5e3e60 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2160128 Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-04-16toolchain-utils: provide option to migrate nightly tests to recipezhizhouy
This patch provides two new options to buildbot_test_toolchain script, which launches nightly performance tests for toolchain. Option `--recipe` introduces new location and mechanism to find latest image from recipe bucket. The recipe builder for each board monitored by toolchain team builds an image every day and store results to certain gs locaton. When this option specified, the script no longer launches tryjob to get a new image but tries to access the lastest existing image in the last two days from the gs location. Option `--test` makes it easier to test locally, it blocks all locations in chrotomation machine and do not send or store unnecessary results after tests finish. A small change to lock_machine.py fixes an issue while related to swarming when testing this change. BUG=chromium:1071271 TEST=./buildbot_test_toolchains.py --board=lulu --remote=chromeos2-row9-rack8-host7.cros --chromeos_root=$chromiumos --test=True --recipe=True Change-Id: I724a31ce174955c1f002bb7e330919f23535e105 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2151717 Reviewed-by: Tiancong Wang <tcwang@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com> Commit-Queue: Zhizhou Yang <zhizhouy@google.com>
2020-03-20cros_utils: Do not sort keys by defaultDenis Nikitin
Add a sort option NO_SORT in TableGenerator and make it default. Before we had rows in the table sorted by key-name which mixed up the test scores with cpufreq_*, cputemp_* data and made it hard to locate the most important information. The change solves the problem by leaving the keys in the original order which will guarantee that retval and cpu stats will always be at the end of the table. BUG=None TEST=rendering.desktop and loading.desktop show scores in the beginning of the table. Change-Id: I5b2d75db20549eae264db9ca809ccd634e743510 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2108572 Tested-by: Denis Nikitin <denik@chromium.org> Commit-Queue: Denis Nikitin <denik@chromium.org> Reviewed-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-03-02toolchain-utils: Increase buildbot timeout to 15 hours.Caroline Tice
Our nightly performance tryjobs are consistently taking more than 12 hours to complete, and our script is timing out. This CL increases the timeout limit to 14 hours. BUG=chromium:1057137 TEST=None Change-Id: Ief6bdb51f35d62ed6ad405a3f7369e58411ce9a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2082174 Tested-by: Caroline Tice <cmtice@chromium.org> Commit-Queue: Caroline Tice <cmtice@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-02-14toolchain-utils: fix cros lint and some random errorsZhizhou Yang
We have enabled --py3 for cros lint and thus reveals some new linting errors in migrated scripts. This patch fixes them and some other random errors. BUG=chromium:1011676 TEST=Passed unittests. Change-Id: If129e01c21845e1b944a2b64e50e9fed7138c845 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2055972 Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com>
2020-02-14Revert "cros_utils: Do not use encoding in NamedTemporaryFile"Zhizhou Yang
This reverts commit e013418dade906a2828b33fcb6432010953de847. Reason for revert: All dependencies of cros_utils have been migrated to python3. Original change's description: > cros_utils: Do not use encoding in NamedTemporaryFile > > This parameter is introduced in python 3 and there are many scripts > calling cros_utils with python 2. > > TEST=passed all unittests. > BUG=chromium:1048938, chromium:1048884 > > Change-Id: If4a8b9f9e9ef5a1720647c7187d7d08e1d6655b0 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2037144 > Reviewed-by: George Burgess <gbiv@chromium.org> > Commit-Queue: Zhizhou Yang <zhizhouy@google.com> > Tested-by: Zhizhou Yang <zhizhouy@google.com> Bug: chromium:1048938, chromium:1048884 Change-Id: Iff7d1e7ff1c0e843602192a3152a29d0f62073d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2054075 Reviewed-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com>
2020-02-12toolchain-utils: Partially port scripts to python 3Zhizhou Yang
This patch ports some still-in-use python scripts under root directory of toolchain-utils to python 3. BUG=chromium:1011676 TEST=Passed unittests and tested with manually launching. Change-Id: Id6066944780a7204fe4746cd271f41ac20f2274d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2049103 Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-02-10cros_utils: fix imports in cros_utilsZhizhou Yang
There are several non-relative imports in cros_utils and were not caught by cros lint. This patch fixes them. BUG=chromium:1011676 TEST=Passed all unittests. Change-Id: I92880cc00fc7bf7e6af47b2e1452a8c4b3dc00d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2048584 Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-02-06cros_utils: add x20 email sending functionalityGeorge Burgess IV
This CL lets us easily queue up an email for our email sending bits. BUG=b:148609329 TEST=Unittests + ran SendX20Email. It made an email that seemed valid. Change-Id: I2a2b5133fe7b154222ea93cf7121bee420db3dac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2032224 Tested-by: George Burgess <gbiv@chromium.org> Reviewed-by: Tiancong Wang <tcwang@google.com>
2020-02-05cros_utils: Do not use encoding in NamedTemporaryFileZhizhou Yang
This parameter is introduced in python 3 and there are many scripts calling cros_utils with python 2. TEST=passed all unittests. BUG=chromium:1048938, chromium:1048884 Change-Id: If4a8b9f9e9ef5a1720647c7187d7d08e1d6655b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2037144 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com>
2020-01-30crosperf: migration to python 3Zhizhou Yang
This patch migrates crosperf and its utils to python 3. TEST=Passed presubmit check; tested with simple experiment locally. BUG=chromium:1011676 Change-Id: Ib2a9f9c7cf6a1bb1d0b42a1dd3d9e3cbb4d70a36 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2003796 Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org> Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com>
2020-01-09toolchain-utils: Migrate cros_utils to python3Zhizhou Yang
This patch fixes all presubmit checks in cros_utils and migrated it from python2 to python3. TEST=Passed all unittests and presubmit checks. BUG=chromium:1011676 Change-Id: I3a7097d6570fb2cb4e5dcdd5ae22f30c5c5762e9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1981087 Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-12-11crosperf: migrate device setup functions for telemetry_CrosperfZhizhou Yang
This is a patch working together with crrev.com/c/1949606 to migrate device setup functions from suite_runner to autotest telmetry_Crosperf. In this patch, we modified the logic of different suite types along with skylab mode for suite_runner. In result_cache, we handle the wait time log file to accumulate cool down time per machine. We also move intel_pstate kernel updating code into SetupDevice() since it doesn't increase overhead by checking every iteration. TEST=Passed all unittests; tested with different benchmark modes (Note that currently skylab server tests cannot be tested because of regression: crbug.com/984103). BUG=chromium:1020655 Cq-Depend: chromium:1949606 Change-Id: If8e5099d096d2568d4f54584a8fcfd3c0f99c8f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1949626 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Denis Nikitin <denik@chromium.org> Tested-by: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com> Commit-Queue: Denis Nikitin <denik@chromium.org>
2019-12-03crosperf: Make StopUI/StartUI more robustDenis Nikitin
There was a bug when crosperf failed due to StopUI failure. This happened when in a preceding run crosperf exits with an exception in DeviceSetup (for example Keyboard interrupt) and fails to call StartUI. Current change fixes this problem and includes a unittest case testing the exception case. BUG=None TEST=unittest and HW test on DUT with stopped ui pass Change-Id: Id6c69aebefe21b12ec7ee3a7c7f9dff92d143908 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1941036 Commit-Queue: Denis Nikitin <denik@chromium.org> Tested-by: Denis Nikitin <denik@chromium.org> Reviewed-by: Zhizhou Yang <zhizhouy@google.com>
2019-11-12crosperf: migrate all device setup code to a separate utils fileZhizhou Yang
This patch extracts all the device setup code which interacts with DUT to a single utils file, and be put into a wrapper class. This will help migrating all related code to telemetry_Crosperf for skylab runs. BUG=chromium:1020655 TEST=Passed all unittests; tested with simple experiment on kevin. Change-Id: I2edcd7bb2d8cd0255d3ae6d380a5983c24427d98 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1895500 Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Denis Nikitin <denik@chromium.org> Commit-Queue: Zhizhou Yang <zhizhouy@google.com>
2019-10-16toolchain-utils: fix a unittest failure in cros_utilsZhizhou Yang
no_pseudo_terminal_test always failed when running tests in toolchain-utils. This is caused by that strace cannot run without sudo permision. This patch fixes it. TEST=Passed unittest. BUG=None Change-Id: Ife8f13dc04cd515eff207ea73716e04cbdc7b8b2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1863626 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com>
2019-10-15toolchain-utils: change naming related to AFE lockZhizhou Yang
After introducing the new locking mechanism, the behavior of AFELockManager totally changed. This file changed the naming of all related code in toochain-utils. This patch also changed the behavior of locks_dir option, deprecated the use_file_lock option explicitly. TEST=Tested with different DUT types. BUG=chromium:1006434 Change-Id: Ib15efce54ec4d4c5c2a18fecca3f350248462035 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1863530 Reviewed-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Denis Nikitin <denik@chromium.org> Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com>
2019-09-27toolchain-utils: remove AFE local server codeZhizhou Yang
We used to have local server for AFE locking mechanism to lock non-lab machines. But this local server was not supported since long time ago. This patch removes all local server related code from AFE locking. Note that there will be another CLs to deal with issues in http://crbug.com/1006434#c1 TEST=Passed crosperf local tests with different type of machines. BUG=chromium:1006434 Change-Id: I47dbca73edd3e493496fd13ba0b3de705dc11513 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1822029 Reviewed-by: Caroline Tice <cmtice@chromium.org> Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com>
2019-08-16cros_utils: add an ExitStack utilityGeorge Burgess IV
Python3 has a really handy tool called ExitStack. It's meant to make context managers a bit more dynamic in what they can do. Sadly, Python2 doesn't have this. This CL adds a simple implementation of ExitStack to our utilities. We want this feature now, and the hope is that when we move to Python3, we'll be able to just mass-replace contextlib3 with contextlib, and everything will Just Work. BUG=None TEST=Unittest Change-Id: I1e20271da598c86c00531821e1053bc33ecc2f63 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1757218 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2019-08-14cros_utils: Fix blacklisted R79-12384.0.0 imageDenis Nikitin
Replaced comparison of the image revision with list comparison. Added unittest for GetLatestImage. BUG=chromium:992242 TEST=unittest passes Change-Id: I085a2a31ff89f02f71c093e7ac3726250b909229 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1754442 Commit-Queue: Denis Nikitin <denik@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Denis Nikitin <denik@chromium.org>
2019-08-11cros_utils: Add R79-12384.0.0 image to blacklistDenis Nikitin
R79-12384.0.0 image was made by mistake and way ahead of current master revision numbering. This makes the image always the latest one until R79 branch is released. The change blacklists "R79-12384.0.0" image when searching for the latest one in chromeos-image-archive. BUG=chromium:992242 TEST=not tested Change-Id: I45be6441f54d642dd2636b5231114e95faf491a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1745544 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
2019-08-02command_executer: Pass custom env in ChrootRunCommand.Manoj Gupta
Previous CL:1733646 missed the case of ChrootRunCommand. Add the custom env to it as well. BUG=None TEST=unit tests. Change-Id: I3e09d89cb40550d52de3d880c6b6b4d6f0e71d64 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1733649 Reviewed-by: Zhizhou Yang <zhizhouy@google.com> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2019-08-02command_executer: Allow passing custom os env.Manoj Gupta
It is currently tedious to pass custom env variables to command executer e.g. when there is a need to pass an env variable for use inside chroot command. Allow passing an env variable directly to command_executer. Includes formatting changes done by running yapf. BUG=None TEST=unit tests Change-Id: I1bd286b89f3938c1c2e8384c2b9f3bdea05f3dd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1733646 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2019-07-25toolchain-utils: remove all xrangesGeorge Burgess IV
This removes all mention of xrange from toolchain-utils (modulo ones being changed in other CLs that are in flight). It's now an apparent lint error to use xrange, and it hinders our move to python3. As commented on If90d26664c70ccb73750f17573b89933fdb048f4, xrange -> range in python2 is really only a space concern (or speed in pathological cases), so migrations of this nature are generally super straightforward. I glanced at each of these callsites, and none of them appear to be pathological, so my hope is that this should all be Just Fine :) (Also fun to note that this includes a .diff file that has python code embedded in it.) BUG=None TEST=Presubmit tests Change-Id: Ic9f3ac3a5044d7a07da8a249bc505278d98203de Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1717130 Commit-Queue: George Burgess <gbiv@chromium.org> Commit-Queue: Luis Lozano <llozano@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2019-07-09toolchain-utils: migrate Telemetry tests results from chartjson to histogramsJian Cai
Shift to histograms as charjson format is being deprected for Telemtry tests BUG=chromium:967868 TEST=Local tests. Change-Id: I0645c6f10a93a454cc50090d2b790c9f386d9358 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1691318 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Jian Cai <jiancai@google.com>
2019-03-20setup_board: Update usagesAlex Klein
BUG=chromium:893748 TEST=precq CQ-DEPEND=CL:1409763 Change-Id: I661c527c4a53864595d02f3302dbc9047692a042 Reviewed-on: https://chromium-review.googlesource.com/1407709 Commit-Ready: Alex Klein <saklein@chromium.org> Tested-by: Alex Klein <saklein@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
2019-03-15crosperf: Feature to ignore min and max value in resultsZhizhou Yang
This patch provides an option for user to ignore min and max value in the results when generating report. User can use this feature by specifying `ignore_min_max: True` (which by default is False) in experiment file. When values count in a single test is smaller than 3, we automatically ignore this option for it, and print out a warning. BUG=chromium:938758 TEST=Tested with examples in general/cwp mode report generation. Passed all unit tests. Change-Id: I36a4c4d99836c201cdd2f2f9f2a4b1a4ffdaa47d Reviewed-on: https://chromium-review.googlesource.com/1521054 Commit-Ready: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Zhizhou Yang <zhizhouy@google.com>
2019-03-06crosperf: replace cpu cycles in report with samplesZhizhou Yang
What we collected from benchmark run actually are samples from perf tool, so "cpu cycles" is not a accurate name. BUG=chromium:936573 TEST=Tested with cwp and general mode on eve; Passed all unittests. Change-Id: I35533cea0987c4e1b112498cc1b0271eaab665ae Reviewed-on: https://chromium-review.googlesource.com/1495963 Commit-Ready: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2019-02-26toolchain-utils: Launch tryjobs from chroot.Manoj Gupta
This is to workaround a bug in launching tryjobs from outside chroot. BUG=None TEST=can launch tryjobs Change-Id: Ie0d48e9f8f487ef9a9eeebd627948492f65fed31 Reviewed-on: https://chromium-review.googlesource.com/c/1490571 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2019-01-26[toolchain-utils] Increase timeout for tryjobs.Manoj Gupta
Toolchain trybob images are taking longer to build and causing performance jobsto hit a timout limit. This CL increases the timeout limit to 12 hours. BUG=chromium:925534 TEST=None Change-Id: Icbb8c56d70f135a574a7176b2f3b5dd5c4504710 Reviewed-on: https://chromium-review.googlesource.com/c/1436497 Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2019-01-22crosperf: fix bug in perf table generatingZhizhou Yang
This patch fixes a bug in perf table generating, by removing an unused argument from AddLabelName(). TEST=passed local unit tests and a sample test on device. BUG=chromium:923143 Change-Id: I16fb0d1baaa76be523073de1e9768c1b1ee799d6 Reviewed-on: https://chromium-review.googlesource.com/1419298 Commit-Ready: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2018-12-29crosperf: unit test for CPU cycles table generatorZhizhou Yang
This patch added unit test for CPU table generation in tabulator.py TEST=passed all unit tests in cros_utils and crosperf BUG=chromium:917484 CQ-DEPEND=CL:1389035 Change-Id: Ib10bea1470fca1c5dbab8ad39b9684dd473a6183 Reviewed-on: https://chromium-review.googlesource.com/1392428 Commit-Ready: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
2018-12-29crosperf: Fix bugs and nit in report generationZhizhou Yang
Fixed two parts in source code to make unit test pass: 1) Without unit, cpu cycles still should multiply by weight 2) Do not try to access cwp_dso from experiment in BenchmarkResult object, because there is method to generate report without running experiment. One nit to change the name of TableGenerator used for CPU cycle report. TEST=passed all unit tests in crosperf BUG=chromium:902785 CQ-DEPEND=CL:1376571 Change-Id: I8308b0287d60e77542ac60f5ecd5734907e51e01 Reviewed-on: https://chromium-review.googlesource.com/1389035 Commit-Ready: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
2018-12-28crosperf: Generate report for cwp approximationZhizhou Yang
TODO: unit tests needed. This patch trys to generate a new type of report when cwp_dso is specified. The report will: 1) Generate a new summary table at benchmark level with weighted cpu cycle data. 2) Do not generate perf table. 3) Generate a full table with only cpu cycles in it. TEST=generated correct report with a normal run and two cwp_dso runs: one succeeded run and one with failures. BUG=chromium:902785 Change-Id: I0c62000c6690c66d50a7a4de3cfc280853b134e2 Reviewed-on: https://chromium-review.googlesource.com/1376571 Commit-Ready: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2018-12-12Revert "[toolchain-utils] Add tryjob flags to build Chrome from 9999 ebuild."Manoj Gupta
This reverts commit 115acfa5fc88d4aa4eb9158e41be534439952a33. Reason for revert: No need to test chrome 9999 ebuild anymore. Original change's description: > [toolchain-utils] Add tryjob flags to build Chrome from 9999 ebuild. > > This CL updates the nightly tryjobs to build Chrome using the > 9999 ebuild, to work with the CL that updates Chrome to not use > ThinLTO caching, so we can test LLD with our nightly builders. > > BUG=None > TEST=Tested a tryjob with those flags and that CL, and it worked. > > Change-Id: I3b1e77de6d1ead54f1696dc49987a37dd8db50ad > Reviewed-on: https://chromium-review.googlesource.com/1345889 > Commit-Ready: Caroline Tice <cmtice@chromium.org> > Tested-by: Caroline Tice <cmtice@chromium.org> > Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Bug: chromium:701659 Change-Id: I1138ed7ed0dd23103f6202140f4eb5385ae567b4 Reviewed-on: https://chromium-review.googlesource.com/1372264 Commit-Ready: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2018-12-08toolchain-utils: Handle the missing artifact_url error more gracefully.Manoj Gupta
Mark status as fail if artifact_url field is null. This will make the builder errors easier to spot. BUG=chromium:912617 TEST=Tested a dummy job. Change-Id: I5896ce00a7b9f9a9b27329e1f509560b8e27d56f Reviewed-on: https://chromium-review.googlesource.com/1366375 Commit-Ready: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2018-11-24[toolchain-utils] Increase timeout for buildbot tryjobs.Caroline Tice
Recent infrastructure changes have added some stages to our trybot jobs making them take longer, and causing them to hit our timeout limit. This CL increases the timeout limit. BUG=chromium:908188 TEST=None Change-Id: I19bab9d5ee8d0d4074575a1a719fa23fe5de6704 Reviewed-on: https://chromium-review.googlesource.com/1349479 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2018-11-22[toolchain-utils] Add tryjob flags to build Chrome from 9999 ebuild.Caroline Tice
This CL updates the nightly tryjobs to build Chrome using the 9999 ebuild, to work with the CL that updates Chrome to not use ThinLTO caching, so we can test LLD with our nightly builders. BUG=None TEST=Tested a tryjob with those flags and that CL, and it worked. Change-Id: I3b1e77de6d1ead54f1696dc49987a37dd8db50ad Reviewed-on: https://chromium-review.googlesource.com/1345889 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2018-09-27Fix 'from' field for sendgmr emails.Caroline Tice
The from field will now be the user who runs the tool, rather than the file name (required due to changing rules for sendgmr). BUG=chromium:889540 TEST=Successfully ran crosperf and received email. Change-Id: I273b9e229a80f5cc61447a0e844abda71c3d0f99 Reviewed-on: https://chromium-review.googlesource.com/1246477 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>