nvme-pci: add NVMe controller statistics
PATCH v2 1/1 nvme-pci: add NVMe controller statistics
This is to count the controller warning events.
---
Changes since v1:
- Split the sysfs stats attribute to create 4 new files.
- Create stats subdirectory for the attibutes split.
- Change the device attributes to read-write version.
drivers/nvme/host/nvme.h | 9 +++ drivers/nvme/host/pci.c | 127 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+)
drivers/nvme/host/nvme.h +9 -0
@@ -277,6 +277,13 @@ enum nvme_ctrl_flags { NVME_CTRL_FROZEN = 6, }; +struct nvme_stats { +unsigned long timeouts; +unsigned long aborts; +unsigned long resets; +unsigned long disables; +}; +struct nvme_ctrl {bool comp_seen;bool identified;
@@ -411,6 +418,8 @@ struct nvme_ctrl {enum nvme_ctrl_type cntrltype;enum nvme_dctype dctype;u16 awupf;/* 0's based value. */ + +struct nvme_stats stats; };static inline enum nvme_ctrl_state nvme_ctrl_state (struct nvme_ctrl *ctrl)
drivers/nvme/host/pci.c +127 -0
172 lines not on this page · raw message
Signature · 1 line
2.48.1
Quoted 3 lines · Tokunori Ikegami
This is to count the controller warning events.
Signed-off-by Tokunori Ikegami<[email protected]>
can you please update the commit log with why you want to count the events at the first place, what kind problem it is solving and any impact on performance because of it ?
-ck
Quoted 3 lines · Chaitanya Kulkarni
can you please update the commit log with why you want to count the events at the first place, what kind problem it is solving and any impact on performance because of it ?
Just done by the version 3 patch. Thank you.