From: Chaitanya Kulkarni <kch@nvidia.com>
To: <linux-nvme@lists.infradead.org>
Cc: <hch@lst.de>, <sagi@grimberg.me>, <kbusch@kernel.org>,
Chaitanya Kulkarni <kch@nvidia.com>
Subject: [PATCH] nvme: add ctrl state machine pdf creator
Date: Wed, 27 Jul 2022 14:54:24 -0700 [thread overview]
Message-ID: <20220727215424.5252-1-kch@nvidia.com> (raw)
It is not always easy to read the NVMe Host controller state machine
quickly written in C when debugging the code for various transports.
This adds a simple dot based state machine for the host controller that
creates pdf. The resulting pdf is easier to understand and process.
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
.../nvme/host-ctrl-state-machine/Makefile | 4 +++
.../ctrl-state-machine.dot | 27 +++++++++++++++++++
2 files changed, 31 insertions(+)
create mode 100644 Documentation/nvme/host-ctrl-state-machine/Makefile
create mode 100644 Documentation/nvme/host-ctrl-state-machine/ctrl-state-machine.dot
diff --git a/Documentation/nvme/host-ctrl-state-machine/Makefile b/Documentation/nvme/host-ctrl-state-machine/Makefile
new file mode 100644
index 000000000000..916ce24b1b2f
--- /dev/null
+++ b/Documentation/nvme/host-ctrl-state-machine/Makefile
@@ -0,0 +1,4 @@
+all:
+ dot -Tps ctrl-state-machine.dot -o ctrl-state-machine.pdf
+clean:
+ rm -fr ctrl-state-machine.pdf
diff --git a/Documentation/nvme/host-ctrl-state-machine/ctrl-state-machine.dot b/Documentation/nvme/host-ctrl-state-machine/ctrl-state-machine.dot
new file mode 100644
index 000000000000..9c277112c5df
--- /dev/null
+++ b/Documentation/nvme/host-ctrl-state-machine/ctrl-state-machine.dot
@@ -0,0 +1,27 @@
+/*
+ * NVMe Host Controller State transition diagram
+ * dot -Tps nvme-ctrl-state-machine.dot -o nvme-ctrl-state-machine.pdf
+ */
+digraph NVMe_Controller_State_Machine {
+NEW -> LIVE
+NEW -> CONNECTING
+NEW -> RESETTING
+CONNECTING -> LIVE
+CONNECTING -> DELETING
+LIVE -> RESETTING
+LIVE -> DELETING
+RESETTING -> CONNECTING
+RESETTING -> DELETING
+RESETTING -> LIVE
+DEAD -> DELETING_NOIO
+DELETING -> DELETING_NOIO
+DELETING -> DEAD
+
+NEW [shape=polygon,sides=5,peripheries=3,color=lightblue,style=filled]
+LIVE [color=green,style=filled]
+CONNECTING [color=yellow,style=filled]
+RESETTING [color=lightyellow,style=filled]
+DELETING [color=pink,style=filled]
+DEAD [color=red,style=filled]
+DELETING_NOIO [shape=polygon,sides=5,peripheries=3,color=maroon,style=filled]
+}
--
2.29.0
next reply other threads:[~2022-07-27 21:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 21:54 Chaitanya Kulkarni [this message]
2022-07-28 18:40 ` [PATCH] nvme: add ctrl state machine pdf creator Christoph Hellwig
2022-07-28 23:07 ` Chaitanya Kulkarni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220727215424.5252-1-kch@nvidia.com \
--to=kch@nvidia.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox