diff options
author | Masahiro Yamada <yamada.m@jp.panasonic.com> | 2014-06-09 11:16:40 +0900 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2014-06-10 14:59:33 +0200 |
commit | 7fa0e6db3cedc9b70d68a4170f1352e2b1aa0f90 (patch) | |
tree | 7e558805d12d154423ae494d4e9c3bdac37b2d74 /scripts | |
parent | 8ac28bee76eec006aac5ba5c418878a607d53a9b (diff) | |
download | linux-exynos-7fa0e6db3cedc9b70d68a4170f1352e2b1aa0f90.tar.gz linux-exynos-7fa0e6db3cedc9b70d68a4170f1352e2b1aa0f90.tar.bz2 linux-exynos-7fa0e6db3cedc9b70d68a4170f1352e2b1aa0f90.zip |
scripts: objdiff: support directories for the augument of record command
For example,
$ scripts/objdiff record init drivers/usb
disassembles all the objects under init and drivers/usb directories.
This feature would be useful when we change various files under the
specific directory.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/objdiff | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/scripts/objdiff b/scripts/objdiff index 0644898d5fab..62e51dae2138 100755 --- a/scripts/objdiff +++ b/scripts/objdiff @@ -36,7 +36,7 @@ TMPD=$SRCTREE/.tmp_objdiff usage() { echo >&2 "Usage: $0 <command> <args>" - echo >&2 " record <list of object files>" + echo >&2 " record <list of object files or directories>" echo >&2 " diff <commitA> <commitB>" echo >&2 " clean all | <commit>" exit 1 @@ -54,6 +54,18 @@ get_output_dir() { echo $TMPD/$CMT${dir#$SRCTREE} } +do_objdump() { + dir=$(get_output_dir $1) + base=${1##*/} + dis=$dir/${base%.o}.dis + + [ ! -d "$dir" ] && mkdir -p $dir + + # remove addresses for a cleaner diff + # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and + $OBJDUMP -D $1 | sed "s/^[[:space:]]\+[0-9a-f]\+//" > $dis +} + dorecord() { [ $# -eq 0 ] && usage @@ -63,16 +75,15 @@ dorecord() { OBJDUMP="${CROSS_COMPILE}objdump" - for f in $FILES; do - dir=$(get_output_dir $f) - base=${f##*/} - dis=$dir/${base%.o}.dis - - [ ! -d "$dir" ] && mkdir -p $dir - - # remove addresses for a cleaner diff - # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and - $OBJDUMP -D $f | sed "s/^[[:space:]]\+[0-9a-f]\+//" > $dis + for d in $FILES; do + if [ -d "$d" ]; then + for f in $(find $d -name '*.o') + do + do_objdump $f + done + else + do_objdump $d + fi done } |