aboutsummaryrefslogtreecommitdiff
path: root/llvm_tools/llvm_bisection.py
AgeCommit message (Collapse)Author
2021-10-27llvm_tools: fix yapf warningsRyan Beltran
This CL applies fixes automatically generated by yapf during presubmit hook as well as a few manual fixes: * Removing erroneous `verbose` argument from call to RunTryJobs * Replacing / with parenthsis for long lines * Shortened some variable names to fix lines that were too long BUG=None TEST=rerean unit tests Change-Id: Ic6ed4bb74f067dd5c67991481caf75d8829bf86e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3248930 Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Auto-Submit: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2021-10-27llvm_tools: Add lldb_server to updated_packagesRyan Beltran
This CL adds dev-util/lldb-server to the list of packages updated by various tools. Additionally, it updates the default packages in update_chromeos_llvm_hash.py so that we don't have to manually supply them anymore, and refactors other scripts to use that list instead of maintaining their own. BUG=b:196602751 TEST=`python3 -m unittest discover -s . -p '*_unittest.py'` Change-Id: I0856c8f854dc2cbd0f2f21b71db96d3ef000caa8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3248929 Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Auto-Submit: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2020-11-21llvm_tools: pass cl number as str to avoid type errorBob Haarman
llvm_bisection.py invokes the Gerrit CLI to abandon CLs created as part of the bisection. It passes a CL number to the command. Before this change, the CL number was passed as an int, which leads to the following error: Traceback (most recent call last): File "./auto_llvm_bisection.py", line 103, in main bisection_ret = llvm_bisection.main(args_output) File "/usr/local/google/home/inglorion/chromiumos/src/third_party/toolchain-utils/llvm_tools/llvm_bisection.py", line 364, in main subprocess.check_output([gerrit, 'abandon', build['cl']], File "/usr/lib/python3.8/subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.8/subprocess.py", line 489, in run with Popen(*popenargs, **kwargs) as process: File "/usr/lib/python3.8/subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1637, in _execute_child self.pid = _posixsubprocess.fork_exec( TypeError: expected str, bytes or os.PathLike object, not int With this change, we convert the value to an str first, avoiding the type error. BUG=chromium:1151325 TEST=run auto_llvm_bisection.py Change-Id: I2b151c76757067f536712f69b14d6be549ee7c75 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2551789 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Jian Cai <jiancai@google.com> Tested-by: Bob Haarman <inglorion@chromium.org>
2020-10-02llvm_tools: abandon CLs after completing LLVM bisection.Jian Cai
Abandon CLs created for bisection if LLVM bisection successfully found the root cause. BUG=chromium:1081457 TEST=Verified locally. Change-Id: I3702c38432fbaf87f7df62418c0b29cbe4ca722a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2382420 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Jian Cai <jiancai@google.com>
2020-10-02llvm_tools: refactor LLVM bisection toolJian Cai
BUG=chromium:1081457 TEST=Verified locally. Change-Id: Ic662a7bb697efb920a83255d3da87a0031e694ed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2371502 Tested-by: Jian Cai <jiancai@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-04-17llvm_tools: move common functions into standalone modulesJian Cai
Move common functions into separate modules and update dependencies accordingly. BUG=chromium:1057428 TEST=local tests. Change-Id: I40f1b613f0a41f1fc478c811379c851479aff7c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2151708 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Jian Cai <jiancai@google.com>
2019-11-24toolchain-utils: use LLVM git hashes to track version numbers.Jian Cai
LLVM has stopped issuing SVN version numbers in its commits. This patch adds a way to track SVN-style version number based on a LLVM git hash. BUG=Chromium:1027950 TEST=local tests. Change-Id: Idd8055ea7deb3bcd17c18ab5b642ce8b389e446a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1915373 Tested-by: Jian Cai <jiancai@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2019-09-13LLVM tools: Added unittest for llvm_bisection.pySalud Lemus
BUG=None TEST='./llvm_bisection_unittest.py' passes Change-Id: I2689deff7ede41bcfcf5707d4419bd3c816bba39 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1798739 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
2019-09-09LLVM tools: Migrated all scripts to python3Salud Lemus
This CL includes changes such as replacements of `\'` with `"` and adding extra debugging output to some scripts. Currently, the scripts are in python2, so migrating them to python3 so they are more maintainable. BUG=None TEST=Ran each script by itself with various input (e.g. different google3, tot, etc.). Change-Id: Ib72b7744c6f7c13711c2db427f6524ff3cbc6205 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1787738 Tested-by: Salud Lemus <saludlemus@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2019-09-03LLVM tools: Added auto bisection of LLVMSalud Lemus
Similar to 'llvm_bisection.py' script but uses `cros buildresult` to update each tryjob's 'status' field. The script sleeps for X minutes and continues where bisection left off (similar behavior if script terminates). The script is an infinite loop but terminates when there are no more revisions between the new 'start' and new 'end' or if an exception happens. This script is using the scripts such as bisection script and updating a tryjob's status script in a loop. BUG=None TEST=Ran 'auto_llvm_bisection.py' script with a file that was not created and start revision of 369410 and end revision of 369420. Successfully created tryjobs between the start and end and the script went to sleep for X minutes and woke up to resume where bisection left off. Change-Id: I711988b164c41f56ecc2c9478527bdcfe8f5bb88 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1776330 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
2019-08-28LLVM tools: Add extra return value for no tryjobsSalud Lemus
BUG=None TEST=Function returned correctly Change-Id: I568be1b17cc2fda982d4a4fa0d0c15d08475ea45 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1775399 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
2019-08-28LLVM tools: Added support for 'skip' and executing a custom scriptSalud Lemus
If a tryjob's status is set to 'skip', then that tryjob will not be considered when bisecting LLVM. And for executing a custom script, the exit code will be used by a mapping that sets the 'status' to the equivalent value of the exit code. BUG=None TEST=Ran the 'update_tryjob_status.py' with the 'skip' option and successfully set the tryjob's status to 'skip'. Also, created a testing script to serve as the custom script. Successfully set the 'status' value based off of the custom script's exit code. Change-Id: I0ae3a9b53467b13ff5ce26aeff46b31563cfc7e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1772472 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
2019-08-26LLVM tools: Maintain up-to-date LLVM repo in 'llvm_tools'Salud Lemus
Keeps an up-to-date LLVM source tree in 'llvm_tools' directory. Previously, the LLVM repo would be cloned once and then be forgotten. BUG=None TEST=Ran the 'llvm_bisection.py' script on a previously created JSON file (the script created it before). Successfully created tryjobs that were not in the 'jobs' list. Also, successfully kept the LLVM repo up-to-date in 'llvm_tools'. Change-Id: If9038da788eb0fe0fe258274c1942f1d687868b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1769483 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
2019-08-23LLVM tools: Added bisection of LLVMSalud Lemus
Bisects LLVM based using a JSON file and the last good version and the last bad version. The number of tryjobs that are launched in the between the two (good, bad) depends on the 'parallel' command line argument. Added support for modifying a tryjob's status. Added support for removing, relaunching, or adding a tryjob. BUG=None TEST=Ran the script with 'start_rev' as 367590 and 'end_rev' as 367622 and a JSON file that did not exist. Successfully created tryjobs. Ran, the script again after a few hours and also successfully created another set of tryjobs that were not in the 'jobs' list. Change-Id: I71a6d74f62c6f6fc212209c1faa73e729912b086 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1761469 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>