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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1B8BEECAAA1 for ; Mon, 24 Oct 2022 16:10:28 +0000 (UTC) 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:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xKZ1h16gKg9pbUfnMMoSpP7GrFrNJWZ9mbfmxnKTtec=; b=L2lgsKn41pxy0J YxyfkhPId+9D2p/Qa6qLdLtswqZZSOBEAqZiPCfP3MHZqQUsGmvYNHRy2qrnsJzvCAjjjMe6cYjuS 6m8xLdeUUunTaABcUCslYC14YR3l2VXfqa3B9D1sooSw7oGHfnjjGoix6E8odvf8AoGd3YgLN317/ JRQCFj67FtQknseRpBlL9moYl3NQRDHXzmmjDLW+5q0T6YumDk4zWJtFr2oSLRUO5jWXDfLQSMoas 4YXP/8uy89PjENwFb/rKyFiW5OqWqs4Wc2UPgKSb/wYBql2wCPUqZY1NpM2e9T/1bueLH88HKjrS7 GVFBFyKZczxIgi3zDjuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1on00z-002GUY-BS; Mon, 24 Oct 2022 16:09:25 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1on00w-002GTt-0X for linux-arm-kernel@lists.infradead.org; Mon, 24 Oct 2022 16:09:24 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 30F406148E; Mon, 24 Oct 2022 16:09:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB5DCC433C1; Mon, 24 Oct 2022 16:09:19 +0000 (UTC) Date: Mon, 24 Oct 2022 12:09:29 -0400 From: Steven Rostedt To: Sai Prakash Ranjan Cc: Arnd Bergmann , Masami Hiramatsu , , , , , Subject: Re: [PATCH] asm-generic/io: Add _RET_IP_ to MMIO trace for more accurate debug info Message-ID: <20221024120929.41241e07@gandalf.local.home> In-Reply-To: <20221017143450.9161-1-quic_saipraka@quicinc.com> References: <20221017143450.9161-1-quic_saipraka@quicinc.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221024_090922_120239_5D2FCF59 X-CRM114-Status: GOOD ( 16.55 ) 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 On Mon, 17 Oct 2022 20:04:50 +0530 Sai Prakash Ranjan wrote: > Due to compiler optimizations like inlining, there are cases where > MMIO traces using _THIS_IP_ for caller information might not be > sufficient to provide accurate debug traces. > > 1) With optimizations (Seen with GCC): > > In this case, _THIS_IP_ works fine and prints the caller information > since it will be inlined into the caller and we get the debug traces > on who made the MMIO access, for ex: > > rwmmio_read: qcom_smmu_tlb_sync+0xe0/0x1b0 width=32 addr=0xffff8000087447f4 > rwmmio_post_read: qcom_smmu_tlb_sync+0xe0/0x1b0 width=32 val=0x0 addr=0xffff8000087447f4 > > 2) Without optimizations (Seen with Clang): > > _THIS_IP_ will not be sufficient in this case as it will print only > the MMIO accessors itself which is of not much use since it is not > inlined as below for example: > > rwmmio_read: readl+0x4/0x80 width=32 addr=0xffff8000087447f4 > rwmmio_post_read: readl+0x48/0x80 width=32 val=0x4 addr=0xffff8000087447f4 > > So in order to handle this second case as well irrespective of the compiler > optimizations, add _RET_IP_ to MMIO trace to make it provide more accurate > debug information in all these scenarios. > > Before: > > rwmmio_read: readl+0x4/0x80 width=32 addr=0xffff8000087447f4 > rwmmio_post_read: readl+0x48/0x80 width=32 val=0x4 addr=0xffff8000087447f4 > > After: > > rwmmio_read: qcom_smmu_tlb_sync+0xe0/0x1b0 -> readl+0x4/0x80 width=32 addr=0xffff8000087447f4 > rwmmio_post_read: qcom_smmu_tlb_sync+0xe0/0x1b0 -> readl+0x4/0x80 width=32 val=0x0 addr=0xffff8000087447f4 > > Fixes: 210031971cdd ("asm-generic/io: Add logging support for MMIO accessors") > Signed-off-by: Sai Prakash Ranjan Acked-by: Steven Rostedt (Google) What tree should this go through? -- Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel