Skip to content

Commit

Permalink
powerpc: unrel_branch_check.sh: simplify objdump's asm output
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
sfrothwell authored and mpe committed Sep 2, 2020
1 parent 20ff8ec commit 4e71106
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions arch/powerpc/tools/unrel_branch_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e71106

Please sign in to comment.