From: Stephen Rothwell Date: Tue, 11 Aug 2020 14:04:31 +0000 (+1000) Subject: powerpc: unrel_branch_check.sh: convert grep | sed | awk to just sed X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3d97abbc9f6fe90973551f3e3eef47ffef863114;p=linux.git powerpc: unrel_branch_check.sh: convert grep | sed | awk to just sed Also start using sed -E and make all the separate expressions into a single one with comments. Pull the stripping of condition registers back into the sed command. Signed-off-by: Stephen Rothwell Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200811140435.20957-5-sfr@canb.auug.org.au --- diff --git a/arch/powerpc/tools/unrel_branch_check.sh b/arch/powerpc/tools/unrel_branch_check.sh index 7e936e2cf70d0..dc82289b22526 100755 --- a/arch/powerpc/tools/unrel_branch_check.sh +++ b/arch/powerpc/tools/unrel_branch_check.sh @@ -27,21 +27,31 @@ awk '$2 == "<__end_interrupts>:" { print $1 }' BRANCHES=$( $objdump -R -D --no-show-raw-insn --start-address="$kstart" --stop-address="$end_intr" "$vmlinux" | -grep -e "^c[0-9a-f]*:\s*b" | -sed -e '/\<__start_initialization_multiplatform>/d' \ - -e '/b.\?.\?ctr/d' \ - -e '/b.\?.\?lr/d' \ - -e 's/\bbt.\?\s*[[:digit:]][[:digit:]]*,/beq/' \ - -e 's/\bbf.\?\s*[[:digit:]][[:digit:]]*,/bne/' \ - -e 's/\s0x/ /' \ - -e 's/://' | -awk '{ print $1 ":" $2 ":0x" $3 ":" $4 " "}' +sed -E -n ' +# match lines that start with a kernel address +/^c[0-9a-f]*:\s*b/ { + # drop a target that we do not care about + /\<__start_initialization_multiplatform>/d + # drop branches via ctr or lr + /\ end_intr )); then