Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp219792pxb; Fri, 15 Oct 2021 04:16:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1OptL2pBF0p35DmixQSpajW/CW1K0yr4Qjmn52TBDT8qgWZvnjiRTvPw4MA+ik3kvKNrx X-Received: by 2002:a17:90b:38c3:: with SMTP id nn3mr13258518pjb.110.1634296596729; Fri, 15 Oct 2021 04:16:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634296596; cv=none; d=google.com; s=arc-20160816; b=GhMUdNeVp9JWJjP1oBrM4VcCCP7CbkkW+In0kjT2bm04bUVNPxyHzcTKyBhKEPgFx8 Sqh6JvCeCtidcgV3DsP4yqRPbXzL9xPjWsKVGNyn8s8rmTuRnz68jl+iea1ZbY+NgKj/ +oKxPLlhcHOboLfJyZxnQsiicl80CtyQoVDeMcz487YVXrYP0o4sFw1MVNH7Hg9H0ywz K+xlwfkUJfAKzIkM0g1pjr3c9L3YPDAHaDppDwQMGN0zTptseeErCuKgHcOVu2ygdFfP mtAnd2AHb9Lz6UeTmds2d7n+Uu3gV2xiOSVrM8MRNfQBsW4EIEOOvDAV6Mzwo9+T5R9H 37Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature:dkim-filter; bh=FmJbGXiSP+JGonZTp90DkLqCm4FVOelAbFqDoqqHdv4=; b=uJvR1YJQYJb0rHnbyKwFqDPQpDAnFManhhIP4lWZq8XNeKAXVpbhjD36SmjEE+OSQ7 iue0I2lsfv3Ob/le7fZFonKgbOcMpwAqR9VCA/KhCoBL9428E+cyjc3mMNYdiqfOAJDH 4AII8S7HbJOnbDUv5Esrw8t3zc9R0j5gMb+nPrjWFAufPEz1GSPF4M3bEggRGU6JyHkA sTu94kbCXFUx9IDm85pufIGDxzS9XR2NOO0ac6fcNG0JA1+n66vq7mqx2vn9nk6geq6J ee0KDGzoxVcqR0DBCVP6dtjA37q4UnxxnVeMbEEhY4F6pWj2kZO3jzdKvBD6Nl1Jezd9 fgUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=jQJyeDSJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k37si8008353pgb.609.2021.10.15.04.16.24; Fri, 15 Oct 2021 04:16:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=jQJyeDSJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235137AbhJODBR (ORCPT + 99 others); Thu, 14 Oct 2021 23:01:17 -0400 Received: from linux.microsoft.com ([13.77.154.182]:58140 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235087AbhJODBL (ORCPT ); Thu, 14 Oct 2021 23:01:11 -0400 Received: from x64host.home (unknown [47.187.212.181]) by linux.microsoft.com (Postfix) with ESMTPSA id 7F5A420B9D1D; Thu, 14 Oct 2021 19:59:04 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7F5A420B9D1D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1634266745; bh=FmJbGXiSP+JGonZTp90DkLqCm4FVOelAbFqDoqqHdv4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jQJyeDSJfrGu1E7fZCFEcbQi17sqEQX79kndyh/soGySHlYPvUbls+j8Wpoi+UPDp 82F2nET8zGft4Qy33YxYAVyTH01LJN1BcNgYcRGh50IWqv9BbWJvspDUT3NcoCEQaV 0ICRK7MVeMFk1ZGsWjn/5Z8bHoxCRElk0jrm/0Ks= 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 v10 02/11] arm64: Make perf_callchain_kernel() use arch_stack_walk() Date: Thu, 14 Oct 2021 21:58:38 -0500 Message-Id: <20211015025847.17694-3-madvenka@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211015025847.17694-1-madvenka@linux.microsoft.com> References: <20211015025847.17694-1-madvenka@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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) -- 2.25.1