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 6D308C43217 for ; Mon, 21 Nov 2022 15:55:06 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:References:CC:To:From:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Sgf64LPw/ygjHVJlz8IIpedxujqnfXijOjJJL31DiK4=; b=HhsNfIUFek6INm Fca9/luaSksBZ9RTzmeXIYEdupf8PKy1t/G/hMX5PzQydOrNOeEsl2+Z3HylfjPE3zH9WarMb5ioH vWEK8WVwELlJuiAyQTrF/pNWDY39qUVAOsiienfKLOVD4Gi2Qa7wDs9zDiHkve5cvoC3pDyBdP601 /tfaQcWdpI6s/lqkG5dWfr7MtaSEUPxWN/VyiFQJekk/vVCLihyv8BU38UZYEcamTPyRIvRq4vUAu nfLPgG+4FpOCPd1maxdF2rY+qSGb5GHjLr0M5Ujp+LQ1V9TTMMYnQQ0xeCB/koeDrBtW3Qcc46BZZ ClzFq0kLIAbmiBShZpiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ox97M-00FQ3D-OJ; Mon, 21 Nov 2022 15:53:56 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ox97K-00FQ0e-9A for linux-arm-kernel@lists.infradead.org; Mon, 21 Nov 2022 15:53:55 +0000 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AL8Oovb000814; Mon, 21 Nov 2022 15:53:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : from : to : cc : references : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=iTFbOuUq8jlB7FYKsO2QFbHF7KSE3Y+SOGWHJJHHqfk=; b=KxzyqbADG02kEFmBiyRURXOf/c2UXg0Sr7oVX9S88p3EGEoHMKoPmNMYRuUKcuOlVEJN JtIxcMn5hQnapCAji9bR4Y+x0uO2KHlJnHRSeCmNwSAWoWY/XN+uQDZ4PGBGtK2ErLVf q0XGfoRrOZcoiceFekkI2mx3JYYXaI0zjfi+Tc2GgbMjXfq72yTGngxIb/OkyyF2ASdJ CtJ14dbpZKiwJTVj68TgctfraCl78CKyWKBn++93LhU8vl0CaQYazQ2dgwPXE6Ijzd4M rhVmyeWnRnnG43ObvQsmoBiusHb1wJR7UlDMhfOmD/lJ4T6Ufy7QlN0sB65f3b09FH0E HQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3kxrf5myqn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 15:53:45 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2ALFriRc013226 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 15:53:44 GMT Received: from [10.50.44.157] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 21 Nov 2022 07:53:41 -0800 Message-ID: <9e0cebc4-0ee3-c316-01b3-5131298d70ce@quicinc.com> Date: Mon, 21 Nov 2022 21:23:38 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH] asm-generic/io: Add _RET_IP_ to MMIO trace for more accurate debug info From: Sai Prakash Ranjan To: Steven Rostedt , Arnd Bergmann CC: Masami Hiramatsu , , , , , References: <20221017143450.9161-1-quic_saipraka@quicinc.com> <20221024120929.41241e07@gandalf.local.home> <2f19ea9c-10e6-d0f7-2fc9-fb0f896bfc64@quicinc.com> In-Reply-To: <2f19ea9c-10e6-d0f7-2fc9-fb0f896bfc64@quicinc.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: mSf_gyUUoxu3v3oHNGVzsqP78QKun3pf X-Proofpoint-ORIG-GUID: mSf_gyUUoxu3v3oHNGVzsqP78QKun3pf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-21_14,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 mlxlogscore=608 spamscore=0 suspectscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 clxscore=1011 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211210123 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221121_075354_356352_DFF4719E X-CRM114-Status: GOOD ( 17.73 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Arnd, On 10/26/2022 7:17 PM, Sai Prakash Ranjan wrote: > Hi Steve, > > On 10/24/2022 9:39 PM, Steven Rostedt wrote: >> 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 > > > Thanks for the ack, with this I believe Arnd can take it through his > tree like last time. > Can we take this patch atleast for 6.2-rc1? Thanks, Sai _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel