From patchwork Fri Oct 15 02:34:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhavan T. Venkataraman" X-Patchwork-Id: 12559747 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF0B2C433F5 for ; Fri, 15 Oct 2021 02:36:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B90A3610D1 for ; Fri, 15 Oct 2021 02:36:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B90A3610D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KzSXfdsdQBR4Ojz09sbnj85VbMFjsZCHI0eIgMVQ9/g=; b=ZbEv6p0u8kcpn5 hNfRxvGQfWZUEIQryGuqSEB8u4vW6U7gNe5QLDmEuiDv37dPwgRBt8DgZ5Ya0+sIscbxyQch/ZwAB /+LoIMfvw7eVSun4pxkwv2UVXMAXfHwqwlY/vJuk7Jo3MJt7aVPSQ2OGH+472fhKARQKZ8dR6ifSX 2Df3k4tSQO6Ad8Ef6BEYo+gCYWofZ5UFHM5nFAh+Yf3s0lBz9uQhNzPnIqUVOclGTL5kv1JBifC4Z bP0PsjqJTx2T1Rv4+v5CnYi45XVRGyqhEt+XwlxZF4CFGPHnew0pSSdIyphEW1K92AJAHI5Jwc+Pr t86M0x12/BLZCaqEC1uQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbD4Q-0054dU-4F; Fri, 15 Oct 2021 02:35:42 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbD3g-0054MR-CT for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 02:34:57 +0000 Received: from x64host.home (unknown [47.187.212.181]) by linux.microsoft.com (Postfix) with ESMTPSA id 4AAAC20B9D20; Thu, 14 Oct 2021 19:34:55 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4AAAC20B9D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1634265296; bh=FmJbGXiSP+JGonZTp90DkLqCm4FVOelAbFqDoqqHdv4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VwZFmiQp0tA/bogXQs+nNJUxiSpIgDFSq6xS5hehRanndLGGpQ7XPt7Pj64SKCwgd JVikcRCcstvrpHrc8OuQoaCqdWHR6OCevI3gdDEDFhaLoGjSxhGXRVjy+nlHCMsvwR Ton0mwr5oSnVE10tSnnK/4fzZkFYhLJUBurWWX+w= From: madvenka@linux.microsoft.com To: mark.rutland@arm.com, broonie@kernel.org, jpoimboe@redhat.com, ardb@kernel.org, nobuta.keiya@fujitsu.com, sjitindarsingh@gmail.com, catalin.marinas@arm.com, will@kernel.org, jmorris@namei.org, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, madvenka@linux.microsoft.com Subject: [PATCH v9 02/11] arm64: Make perf_callchain_kernel() use arch_stack_walk() Date: Thu, 14 Oct 2021 21:34:06 -0500 Message-Id: <20211015023413.16614-5-madvenka@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211015023413.16614-1-madvenka@linux.microsoft.com> References: <20211015023413.16614-1-madvenka@linux.microsoft.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211014_193456_475030_56D46365 X-CRM114-Status: UNSURE ( 8.73 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Madhavan T. Venkataraman" Currently, perf_callchain_kernel() in ARM64 code walks the stack using start_backtrace() and walk_stackframe(). Make it use arch_stack_walk() instead. This makes maintenance easier. Signed-off-by: Madhavan T. Venkataraman --- arch/arm64/kernel/perf_callchain.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm64/kernel/perf_callchain.c b/arch/arm64/kernel/perf_callchain.c index 4a72c2727309..f173c448e852 100644 --- a/arch/arm64/kernel/perf_callchain.c +++ b/arch/arm64/kernel/perf_callchain.c @@ -140,22 +140,18 @@ void perf_callchain_user(struct perf_callchain_entry_ctx *entry, static bool callchain_trace(void *data, unsigned long pc) { struct perf_callchain_entry_ctx *entry = data; - perf_callchain_store(entry, pc); - return true; + return perf_callchain_store(entry, pc) == 0; } void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs) { - struct stackframe frame; - if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { /* We don't support guest os callchain now */ return; } - start_backtrace(&frame, regs->regs[29], regs->pc); - walk_stackframe(current, &frame, callchain_trace, entry); + arch_stack_walk(callchain_trace, entry, current, regs); } unsigned long perf_instruction_pointer(struct pt_regs *regs)