From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5385CC32751 for ; Wed, 7 Aug 2019 16:34:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 31EBD2235B for ; Wed, 7 Aug 2019 16:34:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388661AbfHGQe4 (ORCPT ); Wed, 7 Aug 2019 12:34:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:33044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729891AbfHGQe4 (ORCPT ); Wed, 7 Aug 2019 12:34:56 -0400 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 Cc: Joel Fernandes , Jiping Ma , mingo@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/2] tracing/arm: Fix the stack tracer when LR is saved after local storage Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+)