powerpc: unrel_branch_check.sh: simplify objdump's asm output
authorStephen Rothwell <sfr@canb.auug.org.au>
Tue, 11 Aug 2020 14:04:30 +0000 (00:04 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 2 Sep 2020 01:00:22 +0000 (11:00 +1000)
We don't use the raw hex instruction dump, so elide it and adjust the
following expressions.

Also use \s instead of [[:space:]] everywhere.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200811140435.20957-4-sfr@canb.auug.org.au
arch/powerpc/tools/unrel_branch_check.sh

index d735e3875b5e796ffb5558527ebdead5186bb9b0..7e936e2cf70d04d516b6d226cbe95153ad810f0a 100755 (executable)
@@ -26,16 +26,16 @@ awk '$2 == "<__end_interrupts>:" { print $1 }'
 )
 
 BRANCHES=$(
-$objdump -R -D --start-address="$kstart" --stop-address="$end_intr" "$vmlinux" |
-grep -e "^c[0-9a-f]*:[[:space:]]*\([0-9a-f][0-9a-f][[:space:]]\)\{4\}[[:space:]]*b" |
+$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.\?[[:space:]]*[[:digit:]][[:digit:]]*,/beq/' \
-       -e 's/\bbf.\?[[:space:]]*[[:digit:]][[:digit:]]*,/bne/' \
-       -e 's/[[:space:]]0x/ /' \
+       -e 's/\bbt.\?\s*[[:digit:]][[:digit:]]*,/beq/' \
+       -e 's/\bbf.\?\s*[[:digit:]][[:digit:]]*,/bne/' \
+       -e 's/\s0x/ /' \
        -e 's/://' |
-awk '{ print $1 ":" $6 ":0x" $7 ":" $8 " "}'
+awk '{ print $1 ":" $2 ":0x" $3 ":" $4 " "}'
 )
 
 for tuple in $BRANCHES; do