aboutsummaryrefslogtreecommitdiff
path: root/binary_search_tool
AgeCommit message (Collapse)Author
2021-05-19Bisection: add better support for Chrome.Jian Cai
This adds custom path for Chrome, and calls deploy_chrome instead of cros_deploy. Also adds --use_flags and --noreboot options. BUG=b:188061539 TEST=Verified locally Change-Id: Id7ca51199ac7877df57632258e87dab3612113c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2894357 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Jian Cai <jiancai@google.com>
2021-04-07bisection: support hostname:port form device in kernel bisectionJian Cai
This could be useful when SSH port forwarding is used to access a test device. BUG=chromium:1191682 TEST=verified locally. Change-Id: I5c0c84c7493ee90677c6e32e95c52172cba6b284 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2782073 Tested-by: Jian Cai <jiancai@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2020-09-17bisection: exit after updating kernelJian Cai
Exit after running update_kernel.sh as all the following code is irrelevant to kernels. BUG=chromium:1042452 TEST=verified locally. Change-Id: I9d6fc6f6c319c7a825585868978911806f07a629 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2053243 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Jian Cai <jiancai@google.com>
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-14toolchain-utils: fix python3 errors in go scriptsZhizhou Yang
There are several places go scrtips launching and generating python related code. This patch makes sure they are python 3 compatible. BUG=chromium:1042452, chromium:1011676 TEST=Passed all python and go tests. Change-Id: Ie531ceedb14ca2af94bd26f59ba4cab399ef1e6a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2054081 Reviewed-by: Manoj Gupta <manojgupta@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-12bisection: fix an error messageJian Cai
BUG=chromium:1042452 TEST=verified locally Change-Id: Idded43332b2f6a71a3d21d8fd06cee98550f0d09 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2050968 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Jian Cai <jiancai@google.com>
2020-02-10toolchain-utils: port binary_search_tool to python3Zhizhou Yang
This patch migrates bisect tool in toolchain-utils to python 3. BUG=chromium:1011676 TEST=Passed all unittests and run_bisect_tests.py Change-Id: Ia6dd48d927eddcbb2118058f63b33be843d3eb7a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2042219 Tested-by: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-02-06binary_search_tool: fix failures in presubmitZhizhou Yang
This patch is to make binary_search_tool in toolchain-utils pass all presbumit checks, as a prerequisite for python 3 migration. BUG=chromium:1011676 TEST=Passed all unittests. Change-Id: Ie7880982f1ca3ae7e6c3d3f342a7a7c076fa9de9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2037142 Tested-by: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com> Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-02-04bisection: add support of kernelJian Cai
Fix issues and add support to kernel bisection. BUG=chromium:1042452 TEST=verified locally Change-Id: I1103aea0302a3f365c450aabbb8cabc097b2bd52 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2016158 Tested-by: Jian Cai <jiancai@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Luis Lozano <llozano@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-03-08Swap READMEs to markdownGeorge Burgess IV
Suggested by vapier@ in I7daf1cbe93f8809e469698d7772a6c68baf9e194 This ignores README.chromium, since I'm unsure if that's a special name that some tool somewhere relies on. I skimmed over all of these in gitiles (as you can probably tell by the 35 patch sets :) ) and fixed the issues that jumped out at me. I'm sure that some remain somewhere, but I think I got the majority of them. An attempt has been made to make all files roughly follow the rules here: https://github.com/google/styleguide/blob/gh-pages/docguide/style.md Note that not all of them have super meaningful introductions with ToCs/etc, but the rest should be relatively consistent with that guide. BUG=None TEST=Manual inspection Change-Id: I158048d972d49966e3b8ff1e07e5429928edb339 Reviewed-on: https://chromium-review.googlesource.com/1504893 Commit-Ready: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2018-10-30bisect tool: Adding unit tests for pass/transform level bisectZhizhou Yang
This patch added unit tests for pass and transformation level bisect to the bisecting tool. Since no compiler is involved in unit test, it used cmd_script.py to simulate the output of compiler (to stderr). BUG=chromium:878954 TEST=Passed all unit tests. Change-Id: I599c079497333ec24f08f37c3315a16f28c0f887 Reviewed-on: https://chromium-review.googlesource.com/1298384 Commit-Ready: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2018-10-05Bisect tool: Use symbolic link for replacing object files on AndroidZhizhou Yang
The bisection tool used hard link to replace object files from good/bad set on Android. I do not see why it is necessary to use hard link than symbolic one, and it will introduce hidden bug if try to link one obj from one disk to the other. Test=Tested with Android and succeeded. Bug=None Change-Id: If0a1f7f0736052547462fadc955587092dada722 Reviewed-on: https://chromium-review.googlesource.com/1260251 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2018-09-24Bisect tool: Support print IR differences before and after bisectionZhizhou Yang
This patch provides an option to print out IR differences before and after pass/transformation level bisection. This feature will help if user want to know what exactly does the bad pass/transformation do to IR. It added two extra run with `-S` and `-emit-llvm` to generate two IR files and use `diff` to compare them. Note: `--ir_diff` option only works when pass_bisect is enabled. BUG=chromium:878954 TEST=Ran test successfully with Android compiler wrapper. Change-Id: Ia691dc6f23331a3e584eaf9e390edeeb990f3c87 Reviewed-on: https://chromium-review.googlesource.com/1220015 Commit-Ready: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2018-09-20Fix bisect_driver.py for Android pylint.Caroline Tice
The Android toolchain team has requested that we make this small pylint change to bisect_driver.py BUG=886968 TEST=None. This does not affect executable code. Change-Id: Ia6dc37fc1e204c67b260334b19d1a4ec842924ad Reviewed-on: https://chromium-review.googlesource.com/1234713 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2018-09-19bisect tool: Add README file for pass level bisectionZhizhou Yang
Added a readme file for the user to know how to use the bisection tool for pass/transformation level debugging. Also added some description of default script generate_cmd.sh under android specific directory. BUG=chromium:878954 TEST=None Change-Id: I1d683704e0e4de9f7d1874632c2c241e3aea4fb9 Reviewed-on: https://chromium-review.googlesource.com/1229253 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2018-09-17bisect tool: Symbolic link re-generated bad item to original oneZhizhou Yang
This patch modifies the way to genearte bad item while pass level bisection. Rather than directly overwrite the old object, we generate it to a tmp file and symblic link it to original one to satisfy building tool. BUG=chromium:878954 TEST=Ran test successfully with Android compiler wrapper. Change-Id: If152742e0a2088e9d8c2456bf046cede938d88d3 Reviewed-on: https://chromium-review.googlesource.com/1220016 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2018-09-10Bisect tool: Pass/Transformation level bisection for bad itemZhizhou Yang
This patch provides pass and transformation level bisection support for existing bisection tool. Usage: When `--pass_bisect=script_path` is set, pass/transformation level bisection will be turned on. It only works when prune is set to False. Orignial bisection will end with the first bad item it find. This patch then will rebuild and bisect the bad item using bad compiler with pass/transformation level bisect limit. It will end up with the bad pass name/index and bad transformation index for that pass. Notice that this patch still need support from LLVM with this review: https://reviews.llvm.org/D50031, which allows debugcounter to print info we need. The patch eventally add a new binary search process, and two build function to saparately build with pass and transformation level limit. A new BinarySearcherForPass is also introduced for pass level bisect. The workflow is: 1) get bad item and command to build it with existing bisection. 2) rebuild bad item with pass level limit to -1 to get total pass count. 3) binary search pass index until we got bad pass. 4) rebuild bad item with pass limit we get and also set transformation level limit to -1 to get total number of transforamtion. 5) binary search transformation index until we got bad transformation. BUG=chromium:878954 TEST=Ran test successfully with Android compiler wrapper. Will add unittests once new patch in LLVM applied. Change-Id: I08f376f15d12eea232da5887981c44184ffb9568 Reviewed-on: https://chromium-review.googlesource.com/1208855 Commit-Ready: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2018-09-04Bisect tool: Add pass level bisection command option helperZhizhou Yang
This patch introduces a new option for bisection tool which is `--pass_bisect`. When it is set to android/generate_cmd.sh, bisection tool will create a new script which extracts command line options to build the bad item (We now only support pass level bisecting for single bad item, so prune need to be turned off with this option on). Another python wrapper script will come soon and it will take the generated script as one argument, indicating how the compiler will build the bad item at certain limit. BUG=chromium:878954 TEST=Ran test successfully with Android compiler wrapper. Will add unittests once verified ChromeOS. Change-Id: Iaa972e9e1a364143b59a89e6518bbb2bba6e3522 Reviewed-on: https://chromium-review.googlesource.com/1195595 Commit-Ready: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2017-10-03[bisection tool] Fix bisect_driver.py and udpate for host bisection.Caroline Tice
This CL udpates bisect_driver.py to consolidate all the various versions we have into one "source of truth" bisect_driver.py. It also updates bisect_driver.py to ignore .o files generated during the 'configure' stage of Makefile/Autoconf packages (such as GCC & LLVM). And it adds two scripts to help with host package bisection. BUG=chromium:697995 TEST=Successfully ran unit tests; successfully bisected LLVM inside ChromeOS. Change-Id: I2e766299dadf9bf3c7de6496f507c863d446d00d Reviewed-on: https://chromium-review.googlesource.com/696031 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2017-07-13[bisect tool] Fix full test to work with ChromeOS as well as Android.Caroline Tice
The run_bisect_test.py script worked well for Android but had a few hiccups for testing the ChromeOS compiler wrapper. This CL fixes that. BUG=chromium:741812 TEST=Ran test successfully outside the chroot with Android compiler wrapper; ran test succesfully inside chroot with ChromeOS compiler wrapper. Change-Id: Id5f737932064497e0dfaff9ba3ac53b4c1c87373 Reviewed-on: https://chromium-review.googlesource.com/568407 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2017-07-11Fix compiler bisection tests nowrapper script.Manoj Gupta
SAVE_DIR was being overwritten. Inside the condition, SAVE_DIR is not needed. Just use DIR directly. BUG=chromium:740230 TEST= ./full_bisect_test/run-test-nowrapper.sh works. Change-Id: Ic35d3039f6fd31f2a5f3a0d4812568eaceda4742 Reviewed-on: https://chromium-review.googlesource.com/567364 Reviewed-by: Caroline Tice <cmtice@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2017-06-06Add scripts for usb-only flashing for cros package bisecting.Caroline Tice
BUG=None TEST=None Change-Id: I0927bdb69d80c55cfccf0ea9c0ae3ad4ef554f2f Reviewed-on: https://chromium-review.googlesource.com/525840 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Rahul Chaudhry <rahulchaudhry@chromium.org>
2017-04-08[toolchain-utils] Fix remaining lint errors in toolchain-utils.Caroline Tice
In addition to fixing the lint errors, this also fixes the Python formatting issues (ran tc_pyformat on nearly all the files). BUG=chromium:570450 TEST=Ran all crosperf & bisect tool unit tests. Ran afe_lock_machine.py (check machine status) Ran full crosperf test (octane, speedometer, BootPerf) on alex. Change-Id: Ic86f9192801ac67769f3de30f1c5f0d203ce0831 Reviewed-on: https://chromium-review.googlesource.com/471886 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2017-02-27[binary_search_tool] Add documentation for running bisection tests.Caroline Tice
BUG=b:34888940 TEST=Not applicable. Change-Id: Id7efbb3b05c15927e2abcb9156a3b0ec5c165e76 Reviewed-on: https://chromium-review.googlesource.com/446997 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
2017-02-14[binary search tool] Add bisecting tests.Caroline Tice
Add real bisection testing, for use with or without compiler wrapper script. BUG=https://b.corp.google.com/issues/34888940 TEST=Tested wtih & without the compiler wrapper in my source tree. Change-Id: I72329b458b5c93f8e7f03f9970c755018390cc3c Reviewed-on: https://chromium-review.googlesource.com/438666 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
2016-12-01[binary search tool] Allow non-flashing images to be fails.Caroline Tice
Currently if an image is so bad that it can't be flashed, it gets marked as 'skipped', which is different from bad/failed. This can cause the binary search to never find the bad image. We need an option to treat a non-flashing image as a failure. That's what this CL does. BUG=None TEST=Tested by Manoj: without this change, binary search failed to find any bad packages, but with this change it worked. Change-Id: Ib223338a1820314e85352827857fb8f3ba1ed73a Reviewed-on: https://chrome-internal-review.googlesource.com/307824 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Manoj Gupta <manojgupta@google.com>
2016-09-28[bisection tool] Don't make failure to flash bad image fatal error.Caroline Tice
Currently during initial setup, if the known 'bad' image fails to flash onto the device, the user is given the option to 'skip'. This causes the entire bisection to fail/stop. This CL changes the skip to allow bisection to continue (it is not unreasonable for a bad image to fail to flash). BUG=chromium:641539 TEST=None Change-Id: Iddc5312ecf593192d563766d677e8d401824ae7d Reviewed-on: https://chrome-internal-review.googlesource.com/290617 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Yunlian Jiang <yunlian@google.com> Reviewed-by: Ting-Yuan Huang <laszio@google.com>
2016-09-14[bisection] Fix various minor bugs in Android bisection.Caroline Tice
Recent testing has found a few minor bugs in the Android bisection tool. This CL fixes those bugs. BUG=chromium:646948 TEST=Ran full Android bisection. Change-Id: I5b228105ec719db89f0ab34b29fde11dbb1e5074 Reviewed-on: https://chrome-internal-review.googlesource.com/287195 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Yunlian Jiang <yunlian@google.com>
2016-08-18binary search tool: Update ChromeOS Object bisectorCassidy Burden
Update ChromeOS Object bisector to work with new compiler wrapper. This new compiler wrapper means we can now do incremental switches and triage builds that skip compiler calls. TEST=Run full bisection CQ-DEPEND=CL:368231 Change-Id: If34877519ad6dfe3189a5e934e174fd13dae5c89 Reviewed-on: https://chrome-internal-review.googlesource.com/274236 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-16binary search tool: Run tc_pyformat on all python scriptsCassidy Burden
REFACTOR WARNING! Run tc_pyformat on all python scripts. TEST=Run unit tests, Android bisection Change-Id: I9624e7be2670bdb29bcdb59404bf9e8c2f7d81c5 Reviewed-on: https://chrome-internal-review.googlesource.com/274615 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-12binary search tool: Add sample NDK bisectionCassidy Burden
Add sample NDK bisection that can be given to those inside or outside of Google. This sample includes a compressed source tree of the Teapot sample NDK app, and a script showing the full setup and process for running the bisection tool. It also includes a couple patches that show the necessary changes to the build system, and the "compiler error" that we will be bisecting. TEST=Run DO_BISECTION.sh Change-Id: I11279fe33e833b0dfe2fb147fde6f46b347d62be Reviewed-on: https://chrome-internal-review.googlesource.com/274145 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
2016-08-11binary search tool: Make 1st resumed iteration non-incrementalCassidy Burden
If resuming a bisection, we want to make sure all current good items are switched to good and all current bad items are switched to bad. This is so the bisection tool will resume in a known, stable state. Incremental builds are essentially diffs from previous builds, and the base environment may have changed since the last execution. TEST=Add test code, run unit tests Change-Id: I9ac855efbcfb48bc86f245f33ee29d0c38aa7af9 Reviewed-on: https://chrome-internal-review.googlesource.com/274175 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-10binary search tool: Add maintenance documentCassidy Burden
Change-Id: I2c7e10f4f0622569490f97fd9406e1deb5940041 Reviewed-on: https://chrome-internal-review.googlesource.com/273451 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-09binary search tool: Fix edge cases in compiler wrapperCassidy Burden
Fix compiler wrapper edge cases that exist with the NDK and ChromeOS build systems. For ChromeOS we support the -MMD flag when caching dependency files. For NDK we support calls to compiler that give no output file (these calls are meant to check compiler capabilities). TEST=NDK bisection and ChromeOS population Change-Id: Ic23bc7876e9844eacb106d49082e0509ea1ee31b Reviewed-on: https://chrome-internal-review.googlesource.com/273985 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-09binary search tool: Rename install to test_setupCassidy Burden
Refactor warning! Rename install script to be test_setup script. TEST=Run unit tests Change-Id: Iab7e01136fdcf2dedbfc94ece6ddb4b4fa3c0f68 Reviewed-on: https://chrome-internal-review.googlesource.com/273484 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-05binary search tool: Add option to always run compilerCassidy Burden
Similar to sysroot_wrapper, add option that will always call compiler during triage stage. This option is safer, but much slower. TEST=Test with NDK app with missing side effects Change-Id: I242d7267c52e50989bcc5968f132956ba1cd3105 Reviewed-on: https://chrome-internal-review.googlesource.com/273457 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-05binary search tool: Clean up outputCassidy Burden
Make output of binary search tool less confusing, provide PROGRESS output for each verification run, make output for found items cleaner. TEST=Run unit tests Change-Id: I65628fb7147419ad5381726217e649a3e16a1cab Reviewed-on: https://chrome-internal-review.googlesource.com/273446 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-05binary search tool: Show how to reconstruct bisection envCassidy Burden
When bisect.py finishes, give users instructions on how to reconstruct bisection environment. This essentially gives the same setup.sh call that bisect.py uses. Change-Id: I060a4f3397e7d83d83321d25e751d6c47951436b Reviewed-on: https://chrome-internal-review.googlesource.com/273407 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-04binary search tool: Properly cache all side effectsCassidy Burden
Properly cache all side effects in compiler wrapper. Extract some common caching logic to their own functions (cache_file/restore_file). TEST=Full Android bisection, and full NDK bisection with dwo files Change-Id: I4c3be2cb5dae1922c145ba6be85ae65d1ed5cda2 Reviewed-on: https://chrome-internal-review.googlesource.com/273115 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-04binary search tool: Support @file compiler argumentsCassidy Burden
Gradle passes arguments to gcc/clang by using the @file argument. Implement expansion of this argument so that bisect_driver can analyze all arguments being sent to the compiler. TEST=Tested with NDK sample app Change-Id: I1e1dae001a062c118b6d5c36e367612c9e4116b7 Reviewed-on: https://chrome-internal-review.googlesource.com/272935 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-03binary search tool: Change verify_level to booleanCassidy Burden
Previously, the user could run multiple levels of verification. This would essentially repeat verification multiple times. It's unsure why a user would want to set verify_level to any value other than 0 or 1. Thus verify_level is more appropriate as a boolean. TEST=Run unit tests Change-Id: Id8832c54e2733881bf23f48af2a3b4c294117d1c Reviewed-on: https://chrome-internal-review.googlesource.com/272766 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-03binary search tool: Use full obj path with compiler wrapperCassidy Burden
In order to support the NDK, use absolute paths for object files. TEST=Run full Android bisection Change-Id: I588230fa5cd521cd7c7d48b87e8bab3e3b09b1aa Reviewed-on: https://chrome-internal-review.googlesource.com/272756 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-02binary search tool: Add android bisector documentationCassidy Burden
Change-Id: I8f9c954accdac769d2a696f31fb1d90d50264eaa Reviewed-on: https://chrome-internal-review.googlesource.com/272011 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-01binary search tool: Add android bisector to bisect.pyCassidy Burden
Add android bisector implementation to bisect.py. Additionally add simple cleanup.sh script. TEST=Tested with full android bisection Change-Id: Ib6c6ea85614dbe3d54865d9695863ee625588a2d Reviewed-on: https://chrome-internal-review.googlesource.com/272166 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-01binary search tool: Change skip exit status to 125Cassidy Burden
Because exit status 2 means syntax error, it is confusing to also use exit status 2 to mean "skip image". Change uses of status 2 to status 125. Change-Id: I3620e3eb6e52523dc51804076284abf1e023d14f Reviewed-on: https://chrome-internal-review.googlesource.com/272241 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-01binary search tool: Fix off by one bug, add stress testsCassidy Burden
Revert change that introduced bug when bad item is very last item in list. Add tests that stress limits of binary search tool and try to look for these off-by-one errors. Specifically one test checks for the bad item being in every index of the binary search. Another tests checks for if every single item is bad. TEST=Add two new stress tests, run all unit tests Change-Id: I2d5a0bda035b2c2b4994b0378aa416da19db651d Reviewed-on: https://chrome-internal-review.googlesource.com/271916 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-08-01binary search tool: export TRIAGE stage for object bisectorCassidy Burden
Change-Id: I3c026f070f702cad1ab061a3ec20f19668775e8e Reviewed-on: https://chrome-internal-review.googlesource.com/272009 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-07-29binary search tool: Add file locking to compiler wrapperCassidy Burden
Because make can run with arbitrary number of jobs, there's potential race conditions with the compiler wrapper's file operations. Replace all open calls with function that locks files using fnctl module. Additionally fix small formatting errors CQ-DEPEND=CL:*270783 Change-Id: I4b94bfe3c0a5d7203f78e87130b7c4d71bc8e1c0 Reviewed-on: https://chrome-internal-review.googlesource.com/271747 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
2016-07-29binary search tool: Add compiler wrapper for Android bisectionCassidy Burden
Add compiler wrapper similar to ChromeOS object bisector's compiler wrapper. bisect_driver.py is a modified version of bisect.py from the ChromeOS sysroot_wrapper. compiler_wrapper.py is a simple skeleton script used to invoke bisect_driver, and it is meant to be replaced by a more robust compiler wrapper. TEST=Populated android objects and triaged CQ-DEPEND=CL:*270730 Change-Id: I4dfc676f6b659c2da8dbd01fd858c477ffbdeb9f Reviewed-on: https://chrome-internal-review.googlesource.com/270783 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>