From patchwork Wed Aug 7 16:34:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11082433 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33501746 for ; Wed, 7 Aug 2019 16:35:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F4B026BE9 for ; Wed, 7 Aug 2019 16:35:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F2F8285F0; Wed, 7 Aug 2019 16:35:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7D94026BE9 for ; Wed, 7 Aug 2019 16:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:To:From: Date:Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=W+5zdQppxUnLw0EeqDCPpFnOHiKx7y4ZQ4NU08U9+uA=; b=Wse x3hWU2Q1ZZHRp9thko3wQwlHU8XRSk8Nc+kj+3Zj4jgC7mw+86bbjUyOPmrdq7rUHwc1WBYW/ut9M /zjUmGS7J0c5wmJcNF1NilAwKJblA5GXOPZ90lRCiMxdkH/EwaKe3NHOzNSJgwgVRNa0YXFgF2GNC yFiFJqLw1ApPqUrkNV71ieybkQRQekwnmLjaXJoWfcJ6iEgZ641EQuEPI7DrcBLGSdDAkzIMaW2wG +eAlfV1PdbNWXDQ5pv1JNNrMnp0A2GQubHVJfSnlvM1m+hsDi7be1c0r8ALWor9c5tmV1QkAzCT5g 5RjN4s28yXOSJ7Trtnr4OttDSd6HbAg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hvOtx-0001q8-Py; Wed, 07 Aug 2019 16:35:01 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hvOtt-0001of-Hi for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2019 16:34:59 +0000 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5E87B222FC; Wed, 7 Aug 2019 16:34:55 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.92) (envelope-from ) id 1hvOtq-0007mc-4h; Wed, 07 Aug 2019 12:34:54 -0400 Message-Id: <20190807163401.570339297@goodmis.org> User-Agent: quilt/0.65 Date: Wed, 07 Aug 2019 12:34:01 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Subject: [PATCH 0/2] tracing/arm: Fix the stack tracer when LR is saved after local storage X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190807_093457_610499_DE302FD1 X-CRM114-Status: UNSURE ( 8.98 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiping Ma , catalin.marinas@arm.com, will.deacon@arm.com, mingo@redhat.com, Joel Fernandes , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As arm64 saves the link register after a function's local variables are stored, it causes the max stack tracer to be off by one in its output of which function has the bloated stack frame. The first patch fixes this by creating a ARCH_RET_ADDR_BEFORE_LOCAL_VARS define that an achitecture (arm64) may set in asm/ftrace.h, and this will cause the stack tracer to make the shift. As it has been proven that the stack tracer isn't the most trivial algorithm to understand by staring at the code, the second patch adds comments to the code to explain the algorithm with and without the ARCH_RET_ADDR_BEFORE_LOCAL_VARS. Hmm, should this be sent to stable (and for inclusion now?) -- Steve Steven Rostedt (VMware) (2): tracing/arm64: Have max stack tracer handle the case of return address after data tracing: Document the stack trace algorithm in the comments ---- arch/arm64/include/asm/ftrace.h | 1 + kernel/trace/trace_stack.c | 112 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+)