Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

livepatch/klp-build: Add --debug option to show cloning decisions

Add a --debug option which gets passed to "objtool klp diff" to enable
debug output related to cloning decisions.

Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

+13 -3
+13 -3
scripts/livepatch/klp-build
··· 20 20 # This helps keep execution in pipes so pipefail+errexit can catch errors. 21 21 shopt -s lastpipe 22 22 23 - unset SKIP_CLEANUP XTRACE 23 + unset DEBUG_CLONE SKIP_CLEANUP XTRACE 24 24 25 25 REPLACE=1 26 26 SHORT_CIRCUIT=0 ··· 120 120 -v, --verbose Pass V=1 to kernel/module builds 121 121 122 122 Advanced Options: 123 + -d, --debug Show symbol/reloc cloning decisions 123 124 -S, --short-circuit=STEP Start at build step (requires prior --keep-tmp) 124 125 1|orig Build original kernel (default) 125 126 2|patched Build patched kernel ··· 141 140 local long 142 141 local args 143 142 144 - short="hj:o:vS:T" 145 - long="help,jobs:,output:,no-replace,verbose,short-circuit:,keep-tmp" 143 + short="hj:o:vdS:T" 144 + long="help,jobs:,output:,no-replace,verbose,debug,short-circuit:,keep-tmp" 146 145 147 146 args=$(getopt --options "$short" --longoptions "$long" -- "$@") || { 148 147 echo; usage; exit ··· 173 172 ;; 174 173 -v | --verbose) 175 174 VERBOSE="V=1" 175 + shift 176 + ;; 177 + -d | --debug) 178 + DEBUG_CLONE=1 179 + keep_tmp=1 176 180 shift 177 181 ;; 178 182 -S | --short-circuit) ··· 602 596 diff_objects() { 603 597 local log="$KLP_DIFF_LOG" 604 598 local files=() 599 + local opts=() 605 600 606 601 rm -rf "$DIFF_DIR" 607 602 mkdir -p "$DIFF_DIR" 608 603 609 604 find "$PATCHED_DIR" -type f -name "*.o" | mapfile -t files 610 605 [[ ${#files[@]} -eq 0 ]] && die "no changes detected" 606 + 607 + [[ -v DEBUG_CLONE ]] && opts=("--debug") 611 608 612 609 # Diff all changed objects 613 610 for file in "${files[@]}"; do ··· 625 616 cmd=("$SRC/tools/objtool/objtool") 626 617 cmd+=("klp") 627 618 cmd+=("diff") 619 + (( ${#opts[@]} > 0 )) && cmd+=("${opts[@]}") 628 620 cmd+=("$orig_file") 629 621 cmd+=("$patched_file") 630 622 cmd+=("$out_file")