All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts: objdiff: Ignore debug info when comparing
@ 2017-02-16 21:18 Stephen Boyd
  2017-02-17 13:58 ` Jason Cooper
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stephen Boyd @ 2017-02-16 21:18 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kernel, linux-kbuild, Masahiro Yamada, Jason Cooper

If the kernel is configured to be built with debug symbols, or
has bug tables, comparing files may not work if line numbers
change. This makes comparing object files with these options
harder to do. Let's strip out the debug info and drop the
__bug_table here so that we don't see false positives. There may
be other things to drop later, and it may be architecture
specific, but this works for me with my ARM64 build.

Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
---
 scripts/objdiff | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/objdiff b/scripts/objdiff
index 62e51dae2138..4fb5d6796893 100755
--- a/scripts/objdiff
+++ b/scripts/objdiff
@@ -57,13 +57,15 @@ get_output_dir() {
 do_objdump() {
 	dir=$(get_output_dir $1)
 	base=${1##*/}
+	stripped=$dir/${base%.o}.stripped
 	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
+	$STRIP -g $1 -R __bug_table -R .note -R .comment -o $stripped
+	$OBJDUMP -D $stripped | sed -e "s/^[[:space:]]\+[0-9a-f]\+//" -e "s:^$stripped:$1:" > $dis
 }
 
 dorecord() {
@@ -73,6 +75,7 @@ dorecord() {
 
 	CMT="`git rev-parse --short HEAD`"
 
+	STRIP="${CROSS_COMPILE}strip"
 	OBJDUMP="${CROSS_COMPILE}objdump"
 
 	for d in $FILES; do
-- 
2.10.0.297.gf6727b0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] scripts: objdiff: Ignore debug info when comparing
  2017-02-16 21:18 [PATCH] scripts: objdiff: Ignore debug info when comparing Stephen Boyd
@ 2017-02-17 13:58 ` Jason Cooper
  2017-02-26  6:12 ` Masahiro Yamada
  2017-03-11  5:48 ` Masahiro Yamada
  2 siblings, 0 replies; 4+ messages in thread
From: Jason Cooper @ 2017-02-17 13:58 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: Michal Marek, linux-kernel, linux-kbuild, Masahiro Yamada

Hi Stephen,

On Thu, Feb 16, 2017 at 01:18:20PM -0800, Stephen Boyd wrote:
> If the kernel is configured to be built with debug symbols, or
> has bug tables, comparing files may not work if line numbers
> change. This makes comparing object files with these options
> harder to do. Let's strip out the debug info and drop the
> __bug_table here so that we don't see false positives. There may
> be other things to drop later, and it may be architecture
> specific, but this works for me with my ARM64 build.
> 
> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>

Reviewed-by: Jason Cooper <jason@lakedaemon.net>

I'm glad it's useful!

thx,

Jason.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scripts: objdiff: Ignore debug info when comparing
  2017-02-16 21:18 [PATCH] scripts: objdiff: Ignore debug info when comparing Stephen Boyd
  2017-02-17 13:58 ` Jason Cooper
@ 2017-02-26  6:12 ` Masahiro Yamada
  2017-03-11  5:48 ` Masahiro Yamada
  2 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2017-02-26  6:12 UTC (permalink / raw)
  To: Stephen Boyd, Michal Marek
  Cc: Linux Kernel Mailing List, Linux Kbuild mailing list, Jason Cooper

Hi.

2017-02-17 6:18 GMT+09:00 Stephen Boyd <stephen.boyd@linaro.org>:
> If the kernel is configured to be built with debug symbols, or
> has bug tables, comparing files may not work if line numbers
> change. This makes comparing object files with these options
> harder to do. Let's strip out the debug info and drop the
> __bug_table here so that we don't see false positives. There may
> be other things to drop later, and it may be architecture
> specific, but this works for me with my ARM64 build.
>
> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>


Great!

Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>


BTW, I left Panasonic two years ago,
so the old address yamada.m@jp.panasonic.com
is not working any more.

Please drop the "Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>"
when this patch is applied.


Thanks!



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scripts: objdiff: Ignore debug info when comparing
  2017-02-16 21:18 [PATCH] scripts: objdiff: Ignore debug info when comparing Stephen Boyd
  2017-02-17 13:58 ` Jason Cooper
  2017-02-26  6:12 ` Masahiro Yamada
@ 2017-03-11  5:48 ` Masahiro Yamada
  2 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2017-03-11  5:48 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Michal Marek, Linux Kernel Mailing List,
	Linux Kbuild mailing list, Jason Cooper

2017-02-17 6:18 GMT+09:00 Stephen Boyd <stephen.boyd@linaro.org>:
> If the kernel is configured to be built with debug symbols, or
> has bug tables, comparing files may not work if line numbers
> change. This makes comparing object files with these options
> harder to do. Let's strip out the debug info and drop the
> __bug_table here so that we don't see false positives. There may
> be other things to drop later, and it may be architecture
> specific, but this works for me with my ARM64 build.
>
> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>


Applied to linux-kbuild/misc with Jason's Reviewed-by.


Thanks!


Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-11  5:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-16 21:18 [PATCH] scripts: objdiff: Ignore debug info when comparing Stephen Boyd
2017-02-17 13:58 ` Jason Cooper
2017-02-26  6:12 ` Masahiro Yamada
2017-03-11  5:48 ` Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.