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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE027C67871 for ; Mon, 24 Oct 2022 20:06:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232864AbiJXUGC (ORCPT ); Mon, 24 Oct 2022 16:06:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232828AbiJXUFX (ORCPT ); Mon, 24 Oct 2022 16:05:23 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 856B121E101; Mon, 24 Oct 2022 11:26:02 -0700 (PDT) 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 sin.source.kernel.org (Postfix) with ESMTPS id 4F0F2CE16BB; Mon, 24 Oct 2022 16:09:22 +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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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