linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH 0/2] scripts/decode{code,_stacktrace} fixes
@ 2018-12-10 17:46 Marc Zyngier
  2018-12-10 17:46 ` [RESEND PATCH 1/2] scripts/decodecode: Set ARCH when running natively on arm/arm64 Marc Zyngier
  2018-12-10 17:46 ` [RESEND PATCH 2/2] scripts/decode_stacktrace: Only strip base path when a prefix of the path Marc Zyngier
  0 siblings, 2 replies; 3+ messages in thread
From: Marc Zyngier @ 2018-12-10 17:46 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Will Deacon

Resending this, as there was hardly any feedback except for Will's
Ack. Andrew, can you please consider this?

Here's a couple of fixes that have been languishing in my tree for a
few months.

The first one is for an issue that can only be observed using
decodecode natively on arm/arm64m and resulting in a pretty useless
disassembly. The second one fixes the path trimming in
decode_stacktrace, and probably affects everyone.

Marc Zyngier (2):
  scripts/decodecode: Set ARCH when running natively on arm/arm64
  scripts/decode_stacktrace: Only strip base path when a prefix of the
    path

 scripts/decode_stacktrace.sh | 2 +-
 scripts/decodecode           | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

-- 
2.19.1


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

* [RESEND PATCH 1/2] scripts/decodecode: Set ARCH when running natively on arm/arm64
  2018-12-10 17:46 [RESEND PATCH 0/2] scripts/decode{code,_stacktrace} fixes Marc Zyngier
@ 2018-12-10 17:46 ` Marc Zyngier
  2018-12-10 17:46 ` [RESEND PATCH 2/2] scripts/decode_stacktrace: Only strip base path when a prefix of the path Marc Zyngier
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2018-12-10 17:46 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Will Deacon

When running decodecode natively on arm64, ARCH is likely not to be set,
and we end-up with .4byte instead of .inst when generating the disassembly.

Similar effects would occur if running natively on a 32bit ARM platform,
although that's even less popular.

A simple workaround is to populate ARCH when it is not set and that we're
running on an arm/arm64 system.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 scripts/decodecode | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/decodecode b/scripts/decodecode
index 9cef558528aa..ba8b8d5834e6 100755
--- a/scripts/decodecode
+++ b/scripts/decodecode
@@ -60,6 +60,13 @@ case $width in
 4) type=4byte ;;
 esac
 
+if [ -z "$ARCH" ]; then
+    case `uname -m` in
+	aarch64*) ARCH=arm64 ;;
+	arm*) ARCH=arm ;;
+    esac
+fi
+
 disas() {
 	${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s > /dev/null 2>&1
 
-- 
2.19.1


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

* [RESEND PATCH 2/2] scripts/decode_stacktrace: Only strip base path when a prefix of the path
  2018-12-10 17:46 [RESEND PATCH 0/2] scripts/decode{code,_stacktrace} fixes Marc Zyngier
  2018-12-10 17:46 ` [RESEND PATCH 1/2] scripts/decodecode: Set ARCH when running natively on arm/arm64 Marc Zyngier
@ 2018-12-10 17:46 ` Marc Zyngier
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2018-12-10 17:46 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Will Deacon

Running something like:

	decodecode vmlinux .

leads to interested results where not only the leading "." gets stripped
from the displayed paths, but also anywhere in the string, displaying
something like:

	kvm_vcpu_check_block (arch/arm64/kvm/virt/kvm/kvm_mainc:2141)

which doesn't help further processing.

Fix it by only stripping the base path if it is a prefix of the path.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 scripts/decode_stacktrace.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
index 64220e36ce3b..98a7d63a723e 100755
--- a/scripts/decode_stacktrace.sh
+++ b/scripts/decode_stacktrace.sh
@@ -78,7 +78,7 @@ parse_symbol() {
 	fi
 
 	# Strip out the base of the path
-	code=${code//$basepath/""}
+	code=${code//^$basepath/""}
 
 	# In the case of inlines, move everything to same line
 	code=${code//$'\n'/' '}
-- 
2.19.1


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

end of thread, other threads:[~2018-12-10 17:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 17:46 [RESEND PATCH 0/2] scripts/decode{code,_stacktrace} fixes Marc Zyngier
2018-12-10 17:46 ` [RESEND PATCH 1/2] scripts/decodecode: Set ARCH when running natively on arm/arm64 Marc Zyngier
2018-12-10 17:46 ` [RESEND PATCH 2/2] scripts/decode_stacktrace: Only strip base path when a prefix of the path Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).