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 6C096C433EF for ; Mon, 6 Dec 2021 10:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233085AbhLFKVS (ORCPT ); Mon, 6 Dec 2021 05:21:18 -0500 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:28463 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbhLFKVR (ORCPT ); Mon, 6 Dec 2021 05:21:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1638785869; x=1670321869; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=PVV29sV4We6F1jIZFYY+8jqv0ousRDeLGhpOB6Yv/TY=; b=upeC+o4aYGBDmvYCZSlS3S0fQI9Yh3w1C9AAUMYiS6NWyqWfIzClyWIi dNGPJzU/KBneXpcnR6Z6bqInI9cxWFM096Ukj3RaOSkwnDo/DpJ28T82i w84txLnFbNqAskW09FjEZ71N61YW24VSUPyvdP2TzKSaw4kFq5yONoLG5 Q=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 06 Dec 2021 02:17:49 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 02:17:48 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Mon, 6 Dec 2021 02:14:31 -0800 Received: from [10.50.43.186] (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.922.19; Mon, 6 Dec 2021 02:13:54 -0800 Message-ID: <429d1354-f128-205a-ae27-3eadd8929209@quicinc.com> Date: Mon, 6 Dec 2021 15:43:50 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCHv5 3/4] tracing: Add register read/write tracing support Content-Language: en-US To: Arnd Bergmann CC: Will Deacon , Catalin Marinas , Steven Rostedt , Marc Zyngier , gregkh , Linux Kernel Mailing List , Linux ARM , linux-arm-msm , , Prasad Sodagudi References: From: Sai Prakash Ranjan In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 12/6/2021 2:29 PM, Arnd Bergmann wrote: > On Mon, Dec 6, 2021 at 9:28 AM Sai Prakash Ranjan > wrote: >> diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig >> index 420ff4bc67fd..9f55bcc51de1 100644 >> --- a/kernel/trace/Kconfig >> +++ b/kernel/trace/Kconfig >> @@ -95,6 +95,13 @@ config RING_BUFFER_ALLOW_SWAP >> Allow the use of ring_buffer_swap_cpu. >> Adds a very slight overhead to tracing when enabled. >> >> +config TRACE_MMIO_ACCESS >> + bool "Register read/write tracing" >> + depends on TRACING >> + help >> + Create tracepoints for MMIO read/write operations. These trace events >> + can be used for logging all MMIO read/write operations. > I think this needs a 'depends on ARCH_HAVE_TRACE_MMIO_ACCESS' > or similar. Sure, will add it. >> +void log_read_mmio(u8 width, const volatile void __iomem *addr) >> +{ >> + trace_rwmmio_read(CALLER_ADDR0, CALLER_ADDR1, width, addr); >> +} > Here, it may be better to pass the caller address as an argument, I think > CALLER_ADDR1 is not always reliable, though it's possible that it is > in the configurations when this file gets enabled. > > Do you mean that we use __builtin_return_address(0,1) directly here or that I pass __func__ as the argument to log_read/write_mmio or is there some other way to pass the caller address? Thanks, Sai 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 897EDC433EF for ; Mon, 6 Dec 2021 10:19:29 +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:From:References:CC:To: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=bJEtkLuH3Rl9PJDeHotd3HwqlGqaf3KI5xSZ9PxjDn4=; b=DVkgP8a1f7iorz 0jkXtyuKtVL8JkgZmleUpZzEfK4uL4gUqhFEhO4qxaxVxrVRbACeIQuxmoOt3r4EtjAKTWCyqNyS1 oFErdz38ewjcCsucTByBu7Dmubr+Z1hApitCehBT9rtK4AoRYZsEd0holOTAXaAjy2PFDvsKcuZmc jP7wvOyV5x3x1lhDn6L0B7MwQF5SH41dH5A1rlK5e9eMh7zH8HZR68Ub/sklK4ZVH66bVwhQM6AAP bHRofDlbxGGHGMpTJ64z4Sn8sfEa5kijQ6nIgb8yJvcoVFDo3Yu1gqhZYnUbNCs+O0qpZqZa9VD4C QQgKYfYp76U7QlxQWjow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muB4E-003JI4-1G; Mon, 06 Dec 2021 10:17:54 +0000 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muB4A-003JGx-3t for linux-arm-kernel@lists.infradead.org; Mon, 06 Dec 2021 10:17:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1638785870; x=1670321870; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=PVV29sV4We6F1jIZFYY+8jqv0ousRDeLGhpOB6Yv/TY=; b=IvYETjqXAdfPwAdP60HLx1VOgjQI8Dvab+VJXd7wyIREkOCk85ijj2On /mXGm0X/K0hRJaJhkkqaz63aEUfvaTJKbZMTtMQAUcbmpU2velWJ3pE9l zssIuTr/VfJTIYBpHpnxbALTG9GzNsC4j8ibwrrJ1lCnxz85+MRjU5T0u 8=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 06 Dec 2021 02:17:49 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 02:17:48 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Mon, 6 Dec 2021 02:14:31 -0800 Received: from [10.50.43.186] (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.922.19; Mon, 6 Dec 2021 02:13:54 -0800 Message-ID: <429d1354-f128-205a-ae27-3eadd8929209@quicinc.com> Date: Mon, 6 Dec 2021 15:43:50 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCHv5 3/4] tracing: Add register read/write tracing support Content-Language: en-US To: Arnd Bergmann CC: Will Deacon , Catalin Marinas , Steven Rostedt , Marc Zyngier , gregkh , Linux Kernel Mailing List , Linux ARM , linux-arm-msm , , Prasad Sodagudi References: From: Sai Prakash Ranjan In-Reply-To: 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_021750_224420_417E6F69 X-CRM114-Status: GOOD ( 14.22 ) 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 On 12/6/2021 2:29 PM, Arnd Bergmann wrote: > On Mon, Dec 6, 2021 at 9:28 AM Sai Prakash Ranjan > wrote: >> diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig >> index 420ff4bc67fd..9f55bcc51de1 100644 >> --- a/kernel/trace/Kconfig >> +++ b/kernel/trace/Kconfig >> @@ -95,6 +95,13 @@ config RING_BUFFER_ALLOW_SWAP >> Allow the use of ring_buffer_swap_cpu. >> Adds a very slight overhead to tracing when enabled. >> >> +config TRACE_MMIO_ACCESS >> + bool "Register read/write tracing" >> + depends on TRACING >> + help >> + Create tracepoints for MMIO read/write operations. These trace events >> + can be used for logging all MMIO read/write operations. > I think this needs a 'depends on ARCH_HAVE_TRACE_MMIO_ACCESS' > or similar. Sure, will add it. >> +void log_read_mmio(u8 width, const volatile void __iomem *addr) >> +{ >> + trace_rwmmio_read(CALLER_ADDR0, CALLER_ADDR1, width, addr); >> +} > Here, it may be better to pass the caller address as an argument, I think > CALLER_ADDR1 is not always reliable, though it's possible that it is > in the configurations when this file gets enabled. > > Do you mean that we use __builtin_return_address(0,1) directly here or that I pass __func__ as the argument to log_read/write_mmio or is there some other way to pass the caller address? Thanks, Sai _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel