Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp242759pxf; Wed, 31 Mar 2021 23:14:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxCKKmq0PF/xJYgn897/WgS1KC+SC3+24mv3u/ETseSz2sbWz9R056RU778drNC46OfWdA X-Received: by 2002:a05:6402:1157:: with SMTP id g23mr8053689edw.303.1617257694725; Wed, 31 Mar 2021 23:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617257694; cv=none; d=google.com; s=arc-20160816; b=aDtJqwO2W0PQF9Qed1S6MvKuKlkmhViEjU7MPo5EUXjh+NiTvGsNlmWYxDqTK7fwd9 spWhypTeuMbjwsFyquaBOe0vZB3RSmNWT1+gHUcxY4BklOirC31nsfyP8J4vIOGtIcEA h/x/M3ndQ1b0mSMaJF4ujYFP5V2xFwRSYzFUHzHEmQusW+mC6y32NwXmiBnIUX/7KY/U S8p0aIRNcpTG7O7U8H6dC+O+Ja0kw7j7ayFBbLGj/w14B9WNpJuXQrRvFi09nUf2ZPJQ DR8twVcpMw40Hwc7Dwgv/Bl5ugal3jVkNa6mxDp4yWxhG29KSahzf3VVNQ5aorw24YpW mdOw== 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=BRrPdMDnefONZlFv88cCS7rSnNlWpQEh/wPA0UXWKvLFd06WkWGKWFVYjAhxPFQEuF gLIRdPQ1R2E7SP5iS6N8R7A367XKa0mUuKuEFml2Bp/Q3YZW7IeLcG4EWU7RWovKPGw8 ylzN69lUl7paAnbrfoqK+Xa1sP0I1KEvBdu8uQb2N+mKJ1SK6jHHwDeNoc5b9WW/7Hkj zcF0ySx8lNflC3TZFkRGzIAkJHOxLht6/71BzPgNXFQno/vsTw9Fa/gMiajLEke4g8Uu MRVKVsUCyJetWXyb7uy/bAMVjfsU9mp6AqI/b7FkwQcb83qNtxwyMBC2GwqwrsdmijcU AM8g== 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 g21si3265872edu.536.2021.03.31.23.14.29; Wed, 31 Mar 2021 23:14:54 -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 S233328AbhDAGMN (ORCPT + 99 others); Thu, 1 Apr 2021 02:12:13 -0400 Received: from labrats.qualcomm.com ([199.106.110.90]:26806 "EHLO labrats.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232994AbhDAGLz (ORCPT ); Thu, 1 Apr 2021 02:11:55 -0400 IronPort-SDR: ca9twiqKulQAzBUC6YO7RY/dWsrnhcsupaDqHE+2HFWFEQjTtcnEm8KQIpZIvd3bUZy9hpIkdH ZIxrjPhm1SHu59FiGjAhquaRh3r61zRHZxjahUxQRbnEiPxYYTVmjc7KyWq+uNhHJrU40tKlYw TUtM7vh/gXfrOgUDyCSFsB5O1kgpdQ7IaY1phUnE0MrM5BBBqdF43eE6WSq3hcyeWD1KF0DsDc NO2lFGjqQxpxlu1lrP/Pjx/fhjft2xbBLQ0HJSK+vH3BL/NhBuZ62Nk5yMpBbIo4GpK6uliyjk ykE= X-IronPort-AV: E=Sophos;i="5.81,296,1610438400"; d="scan'208";a="47836544" Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by labrats.qualcomm.com with ESMTP; 31 Mar 2021 23:11:55 -0700 X-QCInternal: smtphost Received: from wsp769891wss.qualcomm.com (HELO stor-presley.qualcomm.com) ([192.168.140.85]) by ironmsg03-sd.qualcomm.com with ESMTP; 31 Mar 2021 23:11:54 -0700 Received: by stor-presley.qualcomm.com (Postfix, from userid 359480) id 3907C210A9; Wed, 31 Mar 2021 23:11:54 -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 , Jonathan Cameron , Ilya Dryomov , 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:11:42 -0700 Message-Id: <1617257503-669-3-git-send-email-cang@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617257503-669-1-git-send-email-cang@codeaurora.org> References: <1617257503-669-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.