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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EB4AC433EF for ; Fri, 15 Oct 2021 03:02:13 +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 272AB60F70 for ; Fri, 15 Oct 2021 03:02:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 272AB60F70 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=v4JfvkRPJCcdczrWnpd9cvDM2iOrAxDX/IyZfGXeFXA=; b=kwWhS9kk480WmH mWpeeT00lnjbG8BkNnoe11H/JHnpM1bIo2EHSjMfOE1DXwdWTNDWRoNUzeTAhwMnd5D+XtmpoHS5t nFh1Gz0oPAXljpU893I555K8NpdP+MsjSHOY+AMyG+yr3o8Ho8/3rt12g3G2Nxt6PmX+sjd3x0TI8 3MdUaWNQ0zUd0US84k83Hu9JJGDHdUXU94VQszbMWgNhT0QrvS0l/PDjVV8+1yUy31IBp2Z/gHBqX 9NxjKoiK1TLKKrd4LdHyWra6ekM73coWxh+nVsdSswRIug/pP49SEAddDzKrwhkwEC54eUMkDf5PG 6s/OeiM3do5+mNgsYxgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbDSc-005Cx6-N7; Fri, 15 Oct 2021 03:00: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 1mbDR7-005CPJ-Pn for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 02:59:11 +0000 Received: from x64host.home (unknown [47.187.212.181]) by linux.microsoft.com (Postfix) with ESMTPSA id C4ADE20B9D1F; Thu, 14 Oct 2021 19:59:08 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C4ADE20B9D1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1634266749; bh=AbsOg32zRR78sDGzy2GosMMSEjrzSM+M26cFHMLFAG8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=W99bk7UUpwMSkgC1O2Zv4U0eCLxuvDIFVIigzukEQ2lODesesNjQ64Qld6Ns2vDFT GrplwDA0Vp3KBd+Yw6WvNnj2CHh5lBHCX8oKZE1aY2pF5kgMot7dhJciDNBPLCh8o1 P7w0YdslWDZVSHE0lcETyhw/5FV4PyInJLIVLkM0= 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 06/11] arm64: Make profile_pc() use arch_stack_walk() Date: Thu, 14 Oct 2021 21:58:42 -0500 Message-Id: <20211015025847.17694-7-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211014_195909_879497_BBEF161F X-CRM114-Status: UNSURE ( 9.62 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Madhavan T. Venkataraman" Currently, profile_pc() in ARM64 code walks the stack using start_backtrace() and unwind_frame(). Make it use arch_stack_walk() instead. This makes maintenance easier. Signed-off-by: Madhavan T. Venkataraman --- arch/arm64/kernel/time.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/arch/arm64/kernel/time.c b/arch/arm64/kernel/time.c index eebbc8d7123e..671b3038a772 100644 --- a/arch/arm64/kernel/time.c +++ b/arch/arm64/kernel/time.c @@ -32,22 +32,26 @@ #include #include +static bool profile_pc_cb(void *arg, unsigned long pc) +{ + unsigned long *prof_pc = arg; + + if (in_lock_functions(pc)) + return true; + *prof_pc = pc; + return false; +} + unsigned long profile_pc(struct pt_regs *regs) { - struct stackframe frame; + unsigned long prof_pc = 0; if (!in_lock_functions(regs->pc)) return regs->pc; - start_backtrace(&frame, regs->regs[29], regs->pc); - - do { - int ret = unwind_frame(NULL, &frame); - if (ret < 0) - return 0; - } while (in_lock_functions(frame.pc)); + arch_stack_walk(profile_pc_cb, &prof_pc, current, regs); - return frame.pc; + return prof_pc; } EXPORT_SYMBOL(profile_pc); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel