summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/trace.h
diff options
context:
space:
mode:
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>2018-09-17 10:47:06 -0700
committerChristoph Hellwig <hch@lst.de>2018-10-01 14:16:12 -0700
commit09bd1ff4b15143bc0e6dd2adf39f59f6ab6e2621 (patch)
tree852011bc3aa900cd3211c7b9440dc5b37311ebd4 /drivers/nvme/host/trace.h
parent97faec531460c949d7120672b8c77e2f41f8d6d7 (diff)
downloadlinux-09bd1ff4b15143bc0e6dd2adf39f59f6ab6e2621.tar.gz
linux-09bd1ff4b15143bc0e6dd2adf39f59f6ab6e2621.tar.bz2
linux-09bd1ff4b15143bc0e6dd2adf39f59f6ab6e2621.zip
nvme-core: add async event trace helper
This patch adds a new event for nvme async event notification. We print the async event in the decoded format when we recognize the event otherwise we just dump the result. Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/trace.h')
-rw-r--r--drivers/nvme/host/trace.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/nvme/host/trace.h b/drivers/nvme/host/trace.h
index a490790d6691..196d5bd56718 100644
--- a/drivers/nvme/host/trace.h
+++ b/drivers/nvme/host/trace.h
@@ -156,6 +156,34 @@ TRACE_EVENT(nvme_complete_rq,
);
+#define aer_name(aer) { aer, #aer }
+
+TRACE_EVENT(nvme_async_event,
+ TP_PROTO(struct nvme_ctrl *ctrl, u32 result),
+ TP_ARGS(ctrl, result),
+ TP_STRUCT__entry(
+ __field(int, ctrl_id)
+ __field(u32, result)
+ ),
+ TP_fast_assign(
+ __entry->ctrl_id = ctrl->instance;
+ __entry->result = result;
+ ),
+ TP_printk("nvme%d: NVME_AEN=%#08x [%s]",
+ __entry->ctrl_id, __entry->result,
+ __print_symbolic(__entry->result,
+ aer_name(NVME_AER_NOTICE_NS_CHANGED),
+ aer_name(NVME_AER_NOTICE_ANA),
+ aer_name(NVME_AER_NOTICE_FW_ACT_STARTING),
+ aer_name(NVME_AER_ERROR),
+ aer_name(NVME_AER_SMART),
+ aer_name(NVME_AER_CSS),
+ aer_name(NVME_AER_VS))
+ )
+);
+
+#undef aer_name
+
#endif /* _TRACE_NVME_H */
#undef TRACE_INCLUDE_PATH