From patchwork Mon Oct 21 16:22:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 177118 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3636558ill; Mon, 21 Oct 2019 09:26:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4skD4+zGxFNsOAQsFnBcbgU2xDxQiQ45J+vy2MOO+axLUy6dJtOosqGUtJnr1Y3Hw/kfy X-Received: by 2002:a17:906:118d:: with SMTP id n13mr2249331eja.229.1571675200694; Mon, 21 Oct 2019 09:26:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571675200; cv=none; d=google.com; s=arc-20160816; b=s57QwjPaFs1TFepEzGIJ0T+o95UnwP4WmjKRQvJtMZ8jj615KxGobDB9oSAQscYg8w oc+ttifHHMmS2sTFrZJC28zcPkw5g6B3GyRLOnnFug+P5VzGRL2DtlylOis2vN6T+VU9 lymJOEGDPvdbU0UYo58HI3YPElaZdjz5SpwF+m4szqk/9BhLjqDE5Sr/QQHaykew22uz Kk9A6os9HI8uOhLYiivzdnhbkuMRfaoHVMRfAvTYo9d/KYWuRjtggmuCJ2ajfwZETb1J 5r1A9nFy5yKPqCvdoiUidMwWUFodVLOwJXkSeRtvPEGXEd6jOjD3dtsYXqyfWikJpTiX C0lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=G2P3hn8+vmRvhKGGAJmggp/kwH2ayjQf2uQdv6Dq+Mo=; b=uEEld/utliBuy92CGLobgcqGAYSLz3rVBhcK+/SKumhidHe29k9j0SP6zMq7J8EzI0 n36meE7RSnj4Vgqt8L/mSYswzy9bRC7UJCSK2ExjmRkfg0Duvcnx02f3PZBo5X+8RvFa +exvgQBxhH1C/c3DQTN/ZYm2z9QfG86rSCP58+DHDNn5Melz651iEuZZB5JU3dHNyKkM Jm9NtzZfAUW/kwaUX+8tm+BsAufd2lEmznlUOWZF50dJfNrYWF5eCE+yS5LDiKJDpbzY 8wHMnoTqWPcKV6WRLuAkFESZ6y7q0x2jz5T81j/UUwRrutD/Xt8cWgjBJ3DqBe9tDFa4 Bivg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w32si1309364edc.443.2019.10.21.09.26.40 for ; Mon, 21 Oct 2019 09:26:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727822AbfJUQ0g (ORCPT ); Mon, 21 Oct 2019 12:26:36 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:33126 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728292AbfJUQZ1 (ORCPT ); Mon, 21 Oct 2019 12:25:27 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 0583C20F66B56A14DC87; Tue, 22 Oct 2019 00:25:25 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Tue, 22 Oct 2019 00:25:18 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , "John Garry" Subject: [PATCH 05/18] scsi: hisi_sas: Add timestamp for a debugfs dump Date: Tue, 22 Oct 2019 00:22:02 +0800 Message-ID: <1571674935-108326-6-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1571674935-108326-1-git-send-email-john.garry@huawei.com> References: <1571674935-108326-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing It's useful to know when the dump occurred, so add a timestamp file for this. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 2 ++ drivers/scsi/hisi_sas/hisi_sas_main.c | 7 +++++++ 2 files changed, 9 insertions(+) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 83232e8472fb..7069dae4cec9 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -410,6 +411,7 @@ struct hisi_hba { struct hisi_sas_iost *debugfs_iost; struct hisi_sas_itct *debugfs_itct; u64 *debugfs_iost_cache; + u64 debugfs_timestamp; u64 *debugfs_itct_cache; struct dentry *debugfs_dir; diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index a7bac5dc389a..a983d08c03aa 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -3194,6 +3194,7 @@ static const struct file_operations hisi_sas_debugfs_itct_cache_fops = { static void hisi_sas_debugfs_create_files(struct hisi_hba *hisi_hba) { + u64 *debugfs_timestamp; struct dentry *dump_dentry; struct dentry *dentry; char name[256]; @@ -3201,10 +3202,14 @@ static void hisi_sas_debugfs_create_files(struct hisi_hba *hisi_hba) int c; int d; + debugfs_timestamp = &hisi_hba->debugfs_timestamp; /* Create dump dir inside device dir */ dump_dentry = debugfs_create_dir("dump", hisi_hba->debugfs_dir); hisi_hba->debugfs_dump_dentry = dump_dentry; + debugfs_create_u64("timestamp", 0400, dump_dentry, + debugfs_timestamp); + debugfs_create_file("global", 0400, dump_dentry, hisi_hba, &hisi_sas_debugfs_global_fops); @@ -3684,7 +3689,9 @@ void hisi_sas_debugfs_work_handler(struct work_struct *work) { struct hisi_hba *hisi_hba = container_of(work, struct hisi_hba, debugfs_work); + u64 timestamp = local_clock() / NSEC_PER_MSEC; + hisi_hba->debugfs_timestamp = timestamp; if (hisi_hba->debugfs_snapshot) return; hisi_hba->debugfs_snapshot = true;