diff options
author | Jacob Keller <jacob.e.keller@intel.com> | 2014-11-13 10:27:23 -0800 |
---|---|---|
committer | Jacob Keller <jacob.e.keller@intel.com> | 2014-11-13 10:27:23 -0800 |
commit | 6b916dbae65a2ea9ffb7f1519fadf600d441472c (patch) | |
tree | 93f30c6291fd3e6200bca154911910e99571eac0 | |
parent | aee7e5d9877e4a1913b6ce5679e5baf8e9b35589 (diff) | |
parent | c39ed20655e0d11cb5e04452f5b1a6492c3af71e (diff) | |
download | aiaiai-6b916dbae65a2ea9ffb7f1519fadf600d441472c.tar.gz |
aiaiai: merge development work
The development branch has been stable in my test environment for a
while now. I think now is a good time to get these changes back into
master.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
-rwxr-xr-x | aiaiai-test-patchset | 75 | ||||
-rw-r--r-- | doc/README | 8 | ||||
-rw-r--r-- | doc/TODO.txt | 1 | ||||
-rwxr-xr-x | email/aiaiai-email-test-patchset | 4 | ||||
-rwxr-xr-x | helpers/aiaiai-diff-log-helper | 4 | ||||
-rwxr-xr-x | helpers/aiaiai-test-bisectability | 7 |
6 files changed, 77 insertions, 22 deletions
diff --git a/aiaiai-test-patchset b/aiaiai-test-patchset index d65f699..dee9f80 100755 --- a/aiaiai-test-patchset +++ b/aiaiai-test-patchset @@ -39,25 +39,38 @@ The configurations are specified as follows: where - * "defconfig" is the name kernel defconfig file to test + * "defconfig" is the name kernel defconfig file to test (or "randconfig") * "arch" is the architecture (translates to Kbuild's ARCH variable value) * "cross" is the cross-compiler prefix (translates to Kbuild's CROSS_COMPILE variable value). For example, the following list of configurations: - omap2_defconfig,arm,arm-eabi- i386_defconfig,i386 defconfig,s390,s390x-linux- + omap2_defconfig,arm,arm-eabi- i386_defconfig,i386 defconfig,s390,s390x-linux- randconfig,arm will make $PROG to test the patch in 3 configurations: 1. defconfig "omap2_defconfig" with ARCH=arm and CROSS_COMPILE=arm-eabi- 2. defconfig "i386_defconfig" with ARCH=arm and the default CROSS_COMPILE 3. defconfig "defconfig" with ARCH=s390 and CROSS_COMPILE=s390x-linux- + 4. a randomly generated configuration with ARCH=arm + +Note that randconfig pre-generates a single random configuration rather than +using randconfig for each kernel compile. In this way, we guarantee that the +same kernel configuration is used each build, rather than completely random +each time. By default, $PROG assumes that defconfigs are part of the kernel tree, unless --confdir option is specified, in which case the defconfig files will be searched for only in the specified directory. +Several static checking utilities can be enabled to provide enhanced +information, if desired. These include sparse, smatch, cppcheck, and +coccinelle. In addition scripts/checkpatch.pl is run if found in the project +tree. You can disable a checker with --no[checker] or enable it with +--[checker]. The last provided option on the command line wins, and supersedes +other settings. + Options: -j, --jobs=N allow to run N jobs simultaneously (default is 1); -c, --commit-id=ID the commit id to test against (default is the head of @@ -77,10 +90,11 @@ Options: stand-alone defconfig files instead; -p, --preserve preserve all the temporary files - do not clean up; --bisectability test bisectability; - --sparse check with sparse while building; - --smatch check with smatch while building; - --cppcheck check with cppcheck while building; - --coccinelle check with coccinelle (spatch) while building; + --[no]sparse check with sparse while building; + --[no]smatch check with smatch while building; + --[no]cppcheck check with cppcheck while building; + --[no]coccinelle check with coccinelle (spatch) while building; + --[no]checkpatch run scripts/checkpatch.pl, if found in the project; -Q --quick-fixes=F sometimes it is necessary to carry out-of-tree patches like quick build fixes and this option allows to pass an mbox file with quick fixes which will be applied @@ -160,11 +174,6 @@ test_configuration() [ -z "$arch" ] || arch_opt="-a $arch${cross:+",$cross"}" - if [ -n "$confdir" ]; then - defconfig="$confdir/$defconfig" - [ -f "$defconfig" ] || die "$defconfig is not available" - fi - if [ -n "$bisectability" ]; then # We share the same source tree with 'aiaiai-test-bisectability', so # wait for it (it could be run at the previous iteration) @@ -179,6 +188,26 @@ test_configuration() git --git-dir="$(git_dir "$cloned_kernel1")" reset $quiet --hard "$commit_id1" >&2 + # Enable use of a random condiguration that is stable between the + # before and after tests. If we just used 'randconfig' by default, then + # we wouldn't be testing the before and after kernels with the same + # configuration. We do this even if we have specified a confdir. + if [ "$defconfig" = "randconfig" ]; then + # Generate a random configuration + make -C "$cloned_kernel1" ${arch:+ARCH="$arch"} \ + ${cross:+CROSS_COMPILE="$cross"} -- "$defconfig" >&2 + + # Store this configuration in our temporary work dir + defconfig="$tmpdir/$config.random" + verbose "Copying random configuration to $defconfig" + cp .config "$defconfig" >&2 + + make -C "$cloned_kernel1" mrproper >&2 + elif [ -n "$confdir" ]; then + defconfig="$confdir/$defconfig" + [ -f "$defconfig" ] || die "$defconfig is not available" + fi + verbose "Build non-patched kernel (\"$cloned_kernel1\", configuration \"$config\")" local log1="$logdir1/$config" @@ -253,7 +282,7 @@ sparse= smatch= cppcheck= coccinelle= -checkpatch= +checkpatch="yes" # Keep enabled by default for backwards compatibility quick_fixes= targets="all" keywords= @@ -310,6 +339,24 @@ while true; do coccinelle="yes" program_required "spatch" "Usually Linux distribution provide a 'spatch' or 'coccinelle' package" ;; + --checkpatch) + checkpatch="yes" + ;; + --nosparse) + sparse= + ;; + --nosmatch) + smatch= + ;; + --nocppcheck) + cppcheck= + ;; + --nococcinelle) + coccinelle= + ;; + --nocheckpatch) + checkpatch= + ;; -Q|--quick-fixes) quick_fixes="$(opt_check_read "$1" "$2")" shift @@ -318,9 +365,6 @@ while true; do targets="$2" shift ;; - --checkpatch) - checkpatch="yes" - ;; -K|--keywords) keywords="$(opt_check_read "$1" "$2")" shift @@ -524,6 +568,7 @@ for defconfig in $defconfigs; do fi cat "$tmpdir/$defconfig.stderr.diff" + else printf "\n%s\n" "Successfully built configuration \"$defconfig\", no issues." fi @@ -257,6 +257,14 @@ Here are some examples. IOW, just specify defconfigs, architectures, and cross-compiler prefixes at the end. +4. Test a patch or a patch-set p.mbox against the net-next kernel tree, + against the 'origin/master' branch, using a randomly generated config, the + architecture is i386 (translates to 'make ARCH=i386'). Use 16 jobs. + + cat p.mbox | ./aiaiai-test-patchset --bisectability --sparse --smatch \ + --cppcheck --coccinelle -j 16 -c origin/master \ + /<path>/net-next randconfig,i386 + Note, the 'aiaiai-test-patchset' script accepts one mbox file via stdio or the '-i' option. If you have several files belonging to one patch-set and you want to test them all, you need to concatenate them. Use the 'aiaiai-concat-mboxes' diff --git a/doc/TODO.txt b/doc/TODO.txt index f5a879d..ee15db7 100644 --- a/doc/TODO.txt +++ b/doc/TODO.txt @@ -5,6 +5,7 @@ implementing them. * Improve user-friendliness. + * Append random configuration to email when it fails to build. * Separate all the e-mail front-end stuff to "doc/email". * Improve the the e-mail front-end configuration file. Make all the variables containing the text for end-users to refer instead. Just like diff --git a/email/aiaiai-email-test-patchset b/email/aiaiai-email-test-patchset index dba6b0c..8270e04 100755 --- a/email/aiaiai-email-test-patchset +++ b/email/aiaiai-email-test-patchset @@ -330,13 +330,13 @@ sparse= smatch= cppcheck= coccinelle= -checkpatch= +checkpatch= # Note, checkpatch is enabled by default [ "$pcfg_bisectability" != "1" ] || bisectability="--bisectability" [ "$pcfg_sparse" != "1" ] || sparse="--sparse" [ "$pcfg_smatch" != "1" ] || smatch="--smatch" [ "$pcfg_cppcheck" != "1" ] || cppcheck="--cppcheck" [ "$pcfg_coccinelle" != "1" ] || coccinelle="--coccinelle" -[ "$pcfg_checkpatch" != "1" ] || checkpatch="--checkpatch" +[ "$pcfg_checkpatch" = "1" ] || checkpatch="--nocheckpatch" # Create the Cc list for replies that we'll be sending if [ "$pcfg_reply_to_all" = "1" ]; then diff --git a/helpers/aiaiai-diff-log-helper b/helpers/aiaiai-diff-log-helper index 93623e2..f0bda08 100755 --- a/helpers/aiaiai-diff-log-helper +++ b/helpers/aiaiai-diff-log-helper @@ -10,7 +10,7 @@ Licence: GPLv2 # Sorts 2 build logs and compares them. Blocks can be as follows. # -# 1a. All consequitive lines starting with the same file prefix belong to one +# 1a. All consecutive lines starting with the same file prefix belong to one # block, e.g.: # # drivers/s.c:472:22: warning: incorrect type in assignment (different address spaces) [sparse] @@ -19,7 +19,7 @@ Licence: GPLv2 # # (the prefix is "drivers/s.c:472") # -# 1b. All consequitive lines starting with prefix "make:", "make[1]:", etc. +# 1b. All consecutive lines starting with prefix "make:", "make[1]:", etc. # These usually belong to build failures. # # 2. GCC 'In file included from' blocks look like this: diff --git a/helpers/aiaiai-test-bisectability b/helpers/aiaiai-test-bisectability index 66d5cc5..b5e0f43 100755 --- a/helpers/aiaiai-test-bisectability +++ b/helpers/aiaiai-test-bisectability @@ -251,6 +251,7 @@ if build_failed "$base_stderr_log"; then fi n=0 +series_failed_bisect= while [ "$n" -lt "$patch_cnt" ]; do formail +$n -1 -s < "$mbox" > "$tmp_mbox" compile_patch "$tmp_mbox" "$stdout_log" "$stderr_log" @@ -264,10 +265,10 @@ while [ "$n" -lt "$patch_cnt" ]; do printf "\n\n" fi build_failure "$defconfig_orig" "HEAD" "patch #$n"< "$stderr_log" - exit 0 + series_failed_bisect="yes" fi done -if [ -n "$base_commit_failed" ]; then - printf "%s\n" "Base commit build failed, but the first patch fixed the build failure." +if [ -n "$base_commit_failed" ] && [ -z "$series_failed_bisect" ]; then + printf "%s\n" "Base commit build failed, but the series fixed the build failure." fi |