From: Kris Van Hees Date: Wed, 14 Sep 2016 10:40:19 +0000 (-0400) Subject: dtrace: ensure new SDT info generation works on sparc64 X-Git-Tag: v4.1.12-92~59^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0cfa93f7150627f850f2d5af2a5133ffb17fd07c;p=users%2Fjedix%2Flinux-maple.git dtrace: ensure new SDT info generation works on sparc64 Due to addresses on sparc64 being in the lower range of the memory map, the calculated addresses for SDT probe points were represented with less hex characters then their function base address counterparts (obtained from objdump output). This messed up the sorting based on address values, and resulted in all probe points being associated with the last function in the list. This commit ensures that all addresses are 16 hex characters long. Orabug: 24655168 Signed-off-by: Kris Van Hees Acked-by: Nick Alcock --- diff --git a/scripts/dtrace_sdt.sh b/scripts/dtrace_sdt.sh index beeef8102ae5..bcff44aa0feb 100755 --- a/scripts/dtrace_sdt.sh +++ b/scripts/dtrace_sdt.sh @@ -138,7 +138,7 @@ if [ "$tok" = "kmod" ]; then if (v0l > v1l) { if (v0h >= v1h) { - d = sprintf("%x%x", v0h - v1h, v0l - v1l); + d = sprintf("%08x%08x", v0h - v1h, v0l - v1l); } else { printf "#error Invalid addresses: %x vs %x", v0, v1 \ >"/dev/stderr"; @@ -152,7 +152,7 @@ if [ "$tok" = "kmod" ]; then } else { v0 = strtonum("0x"v0); v1 = strtonum("0x"v1); - d = sprintf("%x", v0 - v1); + d = sprintf("%016x", v0 - v1); } $0 = tmp; @@ -279,11 +279,11 @@ else if (length(d) > 8) v0h++; - d = sprintf("%x%x", v0h, v0l); + d = sprintf("%08x%08x", v0h, v0l); } else { v0 = strtonum("0x"v0); v1 = strtonum("0x"v1); - d = sprintf("%x", v0 + v1); + d = sprintf("%016x", v0 + v1); } $0 = tmp; @@ -327,7 +327,7 @@ else if (v0l > v1l) { if (v0h >= v1h) { - d = sprintf("%x%x", v0h - v1h, v0l - v1l); + d = sprintf("%08x%08x", v0h - v1h, v0l - v1l); } else { printf "#error Invalid addresses: %x vs %x", v0, v1 \ >"/dev/stderr"; @@ -341,7 +341,7 @@ else } else { v0 = strtonum("0x"v0); v1 = strtonum("0x"v1); - d = sprintf("%x", v0 - v1); + d = sprintf("%016x", v0 - v1); } $0 = tmp;