From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5831131A07F for ; Tue, 10 Mar 2026 18:40:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773168041; cv=none; b=E6eGiYF8vi8bCjNXkbhtkdGJLQQSx2w191NtpyFbK/XXZ/77FnJL7AhjdZ8eS/o9moIguTXe3pi525q3e1mgmAJ3Gkw/yV8p3koPmm2u1jMwjQJkFj6K8+FwLSUAJMz4ruj2Q2A3s4UovrHBrPly5jVNsNzNZU0bQB5/7/AnJGE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773168041; c=relaxed/simple; bh=LQhIMQALqpH5cG10ma0U3GcZpMEMl2SUl7tkRtxyi20=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:To:From:Subject: References:In-Reply-To; b=k1o7IsakThZV4JL9L6k09tpK4M6gzlraHtDVBGDEOB3SPgOOhaUluo9TVwV6QLbOJq6gK6emU8XLtka4os0StaPuo95tj25YwQUS8DvDxEScrK+KevLF384vVmuy+08xbQDCJSnkmYnAii4xKnlTwmiTnb727vyC3/8YP4KXdQY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=n5WgxMDn; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="n5WgxMDn" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id C512C4E425F3; Tue, 10 Mar 2026 18:40:36 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8453C60002; Tue, 10 Mar 2026 18:40:36 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id DE3A110369AB3; Tue, 10 Mar 2026 19:40:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773168036; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=YjIc1UzNgobcQvOwLBCBwuWeM/B6jEiELGXtiNkSlH4=; b=n5WgxMDnDyxnoob2dfyCQQGpnBOA9FanvhGcs7mPE88BnYMXTNkvqVLSmgyGoSGAO8hyF7 7JdU1d5hmTNgnLEGyHHHRIT+5Ga3nSESr0BiNW8RFJgdvHKTLKImkGwAb7QEKH6GtOZQ9A jGQVdTJUxrkR0rJaHc5BdAhTbMMxiLOHRntTMrP8JtOAkKXsRN6VwkO90sw7Rtq/WLLzG6 02Tfn6E0q4GHj8rIIfp5Sp8LY/ra0IHSmz/qHbM7IWa0z6yNIryczqDsIZnhzGZ34GLz2N w1QEf8SVFO2SbeDl+/rRqqRTOy5XNKqp67qttU+dunGKnTHxwBVGaSLhe0ie/A== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 10 Mar 2026 19:40:33 +0100 Message-Id: Cc: "Carlos Llamas" , To: "Masami Hiramatsu (Google)" , "Matthieu Baerts" , "Andrew Morton" , "Sasha Levin" From: "Luca Ceresoli" Subject: Re: [PATCH v3] decode_stacktrace: Decode caller address X-Mailer: aerc 0.20.1 References: <177275821652.1557019.18367881408364381866.stgit@mhiramat.tok.corp.google.com> In-Reply-To: <177275821652.1557019.18367881408364381866.stgit@mhiramat.tok.corp.google.com> X-Last-TLS-Session-Version: TLSv1.3 Hello Masami, On Fri Mar 6, 2026 at 1:50 AM CET, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > Decode the caller address instead of the return address by default. > This also introduced -R option to provide return address decoding > mode. > > This changes the decode_stacktrace.sh to decode the line info 1byte > before the return address which will be the call(branch) instruction > address. If the return address is a symbol address (zero offset from > it), it falls back to decoding the return address. > > This improves results especially when optimizations have changed the > order of the lines around the return address, or when the return > address does not have the actual line information. > > With this change; > Call Trace: > > dump_stack_lvl (lib/dump_stack.c:94 lib/dump_stack.c:120) > lockdep_rcu_suspicious (kernel/locking/lockdep.c:6876) > event_filter_pid_sched_process_fork (kernel/trace/trace_events.c:1057) > kernel_clone (include/trace/events/sched.h:396 include/trace/events/sch= ed.h:396 kernel/fork.c:2664) > __x64_sys_clone (kernel/fork.c:2795 kernel/fork.c:2779 kernel/fork.c:27= 79) > do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64= .c:94) > ? entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121) > ? trace_irq_disable (include/trace/events/preemptirq.h:36) > entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121) > > > Without this (or give -R option); > Call Trace: > > dump_stack_lvl (lib/dump_stack.c:122) > lockdep_rcu_suspicious (kernel/locking/lockdep.c:6877) > event_filter_pid_sched_process_fork (kernel/trace/trace_events.c:?) > kernel_clone (include/trace/events/sched.h:? include/trace/events/sched= .h:396 kernel/fork.c:2664) > __x64_sys_clone (kernel/fork.c:2779) > do_syscall_64 (arch/x86/entry/syscall_64.c:?) > ? entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) > ? trace_irq_disable (include/trace/events/preemptirq.h:36) > entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) > > Signed-off-by: Masami Hiramatsu (Google) An oops just happened on some code I'm working on on ARM64 (i.MX8MP) and decode_stacktrace produced a way more precise output with the patch applied. Tested-by: Luca Ceresoli # arm64 -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com