Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp244166pxf; Wed, 31 Mar 2021 23:17:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhaUWg/P5QDdpzviNMnRWp8guNg7blSmSicdfE6TEvnwY6WUYmY0kcqifJ623mztLdUw2D X-Received: by 2002:a17:907:ea3:: with SMTP id ho35mr7568585ejc.219.1617257877659; Wed, 31 Mar 2021 23:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617257877; cv=none; d=google.com; s=arc-20160816; b=Gp3rV3m4GTwaOGXZJ08543fXf6UtI9A1iikQDIcJYa8BgahaEyQbJUfG8V+KOir9wf EGVQ/NiZm6LsV9IHgakEa58zdlyNSsRvHa3Wqc+J+F3vU9FKdeEZZUbFFXECqoJecq+d JOkEwMLwNyhb0dw46F8eatJ9kZStdFv+tJpfnYSwOzhlbhD23h/UnG8xNIAKqTA21aFk tSy7uu00nW6DGTpuWcVYVMcAzLIp8z7g7qyYXi9r6aLSYvz1e2sVjzfu3BPyj+flP1u2 dCai9wp+RLA1/0e1jCiYqmABmYMstCNdfLLUckeM3lQ8Q4G9DFNSus9AEQrLzNSfwFu1 HEtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr; bh=Rz9TpV/RI+eSc/V9E1myR+0/bfhR1mXB5gpioIPmAtM=; b=KfeJXsopKFQSKNxr/ObRJeEtogZNVVaDzJVkRFObnzZocTSLu5gjKSutOHlwpgACAH WLo7Dp5u3Jh24itXXMIrGLofyE+1lDBeqV5nhD0lhpyk+P7/Ma5Ocl73i7KNIHPKfPP+ PZDS+ANDYWcv6TgPDsjj2VPBDTAXkFMsvV9YJbVYuZ+ItU16tXIMtqy22+xWD0NwetBD v8mu06A5hK9E8IH916EiqiSg+rbHPlrwkEddv9ZIDo4W2FzthZSNbaJ5csosscFsEd0D +WKWa1n93nTM6FUjlnBGXwkOGb8LAP2o0eDxHBnaClxt9iBNKmmBpuvF+EGjRNx/kuSm 9/fw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ju22si3332338ejc.514.2021.03.31.23.17.35; Wed, 31 Mar 2021 23:17:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233374AbhDAGP3 (ORCPT + 99 others); Thu, 1 Apr 2021 02:15:29 -0400 Received: from labrats.qualcomm.com ([199.106.110.90]:4666 "EHLO labrats.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233227AbhDAGPP (ORCPT ); Thu, 1 Apr 2021 02:15:15 -0400 IronPort-SDR: /VfosNVVmtyfg2jHLAEFA+T/PyUpLYFLuFnPvcgjUAxB/oZVA64xJuaG5/dWc7WWbuTcGgsgKC IhRvetYF9dKt+TOwCCqyxqWIbHj3IP9eDTbx3pj7F7JbqGC/jRtrRSNjSZPDq473M2Ko0vJfa4 qwWbwhTLWC4DdPwMOe061QGLg5mu8CEZgTqpjsXBae2QzHiix09smrBdtYTo8zSTsBKaHpUtxa xJWNtJM1QweXsWT5j/hGZXhtV3Hnp7sb8UaobJ8qVZseLRrA8stLmg9iVMBWSA1Yy4ARksgMdZ AT4= X-IronPort-AV: E=Sophos;i="5.81,296,1610438400"; d="scan'208";a="29736607" Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by labrats.qualcomm.com with ESMTP; 31 Mar 2021 23:15:15 -0700 X-QCInternal: smtphost Received: from wsp769891wss.qualcomm.com (HELO stor-presley.qualcomm.com) ([192.168.140.85]) by ironmsg05-sd.qualcomm.com with ESMTP; 31 Mar 2021 23:15:14 -0700 Received: by stor-presley.qualcomm.com (Postfix, from userid 359480) id 7E9BA210A9; Wed, 31 Mar 2021 23:15:14 -0700 (PDT) From: Can Guo To: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, cang@codeaurora.org Cc: "Martin K. Petersen" , Adrian Hunter , Suzuki K Poulose , Tom Rix , Ilya Dryomov , Bean Huo , Mauro Carvalho Chehab , Lukas Bulwahn , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/2] scsi: ufs: Add support for hba performance monitor Date: Wed, 31 Mar 2021 23:15:03 -0700 Message-Id: <1617257704-1154-3-git-send-email-cang@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617257704-1154-1-git-send-email-cang@codeaurora.org> References: <1617257704-1154-1-git-send-email-cang@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a new sysfs group which has nodes to monitor data/request transfer performance. This sysfs group has nodes showing total sectors/requests transferred, total busy time spent and max/min/avg/sum latencies. Signed-off-by: Can Guo diff --git a/Documentation/ABI/testing/sysfs-driver-ufs b/Documentation/ABI/testing/sysfs-driver-ufs index d1bc23c..8380866 100644 --- a/Documentation/ABI/testing/sysfs-driver-ufs +++ b/Documentation/ABI/testing/sysfs-driver-ufs @@ -995,6 +995,132 @@ Description: This entry shows the target state of an UFS UIC link The file is read only. +What: /sys/bus/platform/drivers/ufshcd/*/monitor/monitor_enable +Date: January 2021 +Contact: Can Guo +Description: This file shows the status of performance monitor enablement + and it can be used to start/stop the monitor. When the monitor + is stopped, the performance data collected is also cleared. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/monitor_chunk_size +Date: January 2021 +Contact: Can Guo +Description: This file tells the monitor to focus on requests transferring + data of specific chunk size (in Bytes). 0 means any chunk size. + It can only be changed when monitor is disabled. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_total_sectors +Date: January 2021 +Contact: Can Guo +Description: This file shows how many sectors (in 512 Bytes) have been + sent from device to host after monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_total_busy +Date: January 2021 +Contact: Can Guo +Description: This file shows how long (in micro seconds) has been spent + sending data from device to host after monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_nr_requests +Date: January 2021 +Contact: Can Guo +Description: This file shows how many read requests have been sent after + monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_req_latency_max +Date: January 2021 +Contact: Can Guo +Description: This file shows the maximum latency (in micro seconds) of + read requests after monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_req_latency_min +Date: January 2021 +Contact: Can Guo +Description: This file shows the minimum latency (in micro seconds) of + read requests after monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_req_latency_avg +Date: January 2021 +Contact: Can Guo +Description: This file shows the average latency (in micro seconds) of + read requests after monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_req_latency_sum +Date: January 2021 +Contact: Can Guo +Description: This file shows the total latency (in micro seconds) of + read requests sent after monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_total_sectors +Date: January 2021 +Contact: Can Guo +Description: This file shows how many sectors (in 512 Bytes) have been sent + from host to device after monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_total_busy +Date: January 2021 +Contact: Can Guo +Description: This file shows how long (in micro seconds) has been spent + sending data from host to device after monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_nr_requests +Date: January 2021 +Contact: Can Guo +Description: This file shows how many write requests have been sent after + monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_req_latency_max +Date: January 2021 +Contact: Can Guo +Description: This file shows the maximum latency (in micro seconds) of write + requests after monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_req_latency_min +Date: January 2021 +Contact: Can Guo +Description: This file shows the minimum latency (in micro seconds) of write + requests after monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_req_latency_avg +Date: January 2021 +Contact: Can Guo +Description: This file shows the average latency (in micro seconds) of write + requests after monitor gets started. + + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_req_latency_sum +Date: January 2021 +Contact: Can Guo +Description: This file shows the total latency (in micro seconds) of write + requests after monitor gets started. + + The file is read only. + What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/wb_presv_us_en Date: June 2020 Contact: Asutosh Das -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.