docs: Add sandbox states

master
Sean McBride 4 years ago
parent 1a73d630a7
commit 2c20800266

@ -0,0 +1,15 @@
# The double dollar is needed to prevent expansion of $2 in the awk program
OS := $(shell awk -F= '/^NAME/{print $$2}' /etc/os-release)
.PHONY: graphviz
graphviz.install:
echo ${OS}
ifeq (${OS},"Ubuntu")
sudo apt install graphviz
endif
states.svg: states.dot
dot -Tsvg states.dot > states.svg
clean:
rm -f states.svg

@ -0,0 +1 @@
This is a state transition diagram of a sandbox. This maps to the state transition functions defined in `runtime/include/sandbox_set_as_*.h`

@ -0,0 +1,8 @@
digraph {
Uninitialized -> Initialized
Initialized -> {Runnable Error}
Runnable -> Running
Running -> {Blocked Runnable Returned Error}
Returned -> Complete
Blocked -> Runnable
}

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.43.0 (0)
-->
<!-- Title: %3 Pages: 1 -->
<svg width="319pt" height="404pt"
viewBox="0.00 0.00 318.84 404.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 400)">
<title>%3</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-400 314.84,-400 314.84,4 -4,4"/>
<!-- Uninitialized -->
<g id="node1" class="node">
<title>Uninitialized</title>
<ellipse fill="none" stroke="black" cx="207.45" cy="-378" rx="70.39" ry="18"/>
<text text-anchor="middle" x="207.45" y="-374.3" font-family="Times,serif" font-size="14.00">Uninitialized</text>
</g>
<!-- Initialized -->
<g id="node2" class="node">
<title>Initialized</title>
<ellipse fill="none" stroke="black" cx="207.45" cy="-306" rx="57.39" ry="18"/>
<text text-anchor="middle" x="207.45" y="-302.3" font-family="Times,serif" font-size="14.00">Initialized</text>
</g>
<!-- Uninitialized&#45;&gt;Initialized -->
<g id="edge1" class="edge">
<title>Uninitialized&#45;&gt;Initialized</title>
<path fill="none" stroke="black" d="M207.45,-359.7C207.45,-351.98 207.45,-342.71 207.45,-334.11"/>
<polygon fill="black" stroke="black" points="210.95,-334.1 207.45,-324.1 203.95,-334.1 210.95,-334.1"/>
</g>
<!-- Runnable -->
<g id="node3" class="node">
<title>Runnable</title>
<ellipse fill="none" stroke="black" cx="166.45" cy="-234" rx="54.69" ry="18"/>
<text text-anchor="middle" x="166.45" y="-230.3" font-family="Times,serif" font-size="14.00">Runnable</text>
</g>
<!-- Initialized&#45;&gt;Runnable -->
<g id="edge2" class="edge">
<title>Initialized&#45;&gt;Runnable</title>
<path fill="none" stroke="black" d="M197.52,-288.05C192.69,-279.8 186.77,-269.7 181.4,-260.54"/>
<polygon fill="black" stroke="black" points="184.35,-258.65 176.28,-251.79 178.31,-262.19 184.35,-258.65"/>
</g>
<!-- Error -->
<g id="node4" class="node">
<title>Error</title>
<ellipse fill="none" stroke="black" cx="274.45" cy="-90" rx="36.29" ry="18"/>
<text text-anchor="middle" x="274.45" y="-86.3" font-family="Times,serif" font-size="14.00">Error</text>
</g>
<!-- Initialized&#45;&gt;Error -->
<g id="edge3" class="edge">
<title>Initialized&#45;&gt;Error</title>
<path fill="none" stroke="black" d="M215.53,-288.06C220.26,-277.78 226.12,-264.3 230.45,-252 246.68,-205.83 260.65,-150.5 268.27,-118.19"/>
<polygon fill="black" stroke="black" points="271.75,-118.7 270.61,-108.17 264.93,-117.11 271.75,-118.7"/>
</g>
<!-- Running -->
<g id="node5" class="node">
<title>Running</title>
<ellipse fill="none" stroke="black" cx="166.45" cy="-162" rx="50.09" ry="18"/>
<text text-anchor="middle" x="166.45" y="-158.3" font-family="Times,serif" font-size="14.00">Running</text>
</g>
<!-- Runnable&#45;&gt;Running -->
<g id="edge4" class="edge">
<title>Runnable&#45;&gt;Running</title>
<path fill="none" stroke="black" d="M160.57,-216.05C159.75,-208.35 159.51,-199.03 159.84,-190.36"/>
<polygon fill="black" stroke="black" points="163.34,-190.49 160.53,-180.28 156.36,-190.01 163.34,-190.49"/>
</g>
<!-- Running&#45;&gt;Runnable -->
<g id="edge5" class="edge">
<title>Running&#45;&gt;Runnable</title>
<path fill="none" stroke="black" d="M172.36,-180.28C173.16,-188.03 173.39,-197.36 173.04,-206.01"/>
<polygon fill="black" stroke="black" points="169.54,-205.83 172.32,-216.05 176.52,-206.33 169.54,-205.83"/>
</g>
<!-- Running&#45;&gt;Error -->
<g id="edge6" class="edge">
<title>Running&#45;&gt;Error</title>
<path fill="none" stroke="black" d="M189.61,-145.98C205.66,-135.58 227.17,-121.64 244.51,-110.4"/>
<polygon fill="black" stroke="black" points="246.66,-113.18 253.15,-104.8 242.85,-107.31 246.66,-113.18"/>
</g>
<!-- Blocked -->
<g id="node6" class="node">
<title>Blocked</title>
<ellipse fill="none" stroke="black" cx="47.45" cy="-90" rx="47.39" ry="18"/>
<text text-anchor="middle" x="47.45" y="-86.3" font-family="Times,serif" font-size="14.00">Blocked</text>
</g>
<!-- Running&#45;&gt;Blocked -->
<g id="edge7" class="edge">
<title>Running&#45;&gt;Blocked</title>
<path fill="none" stroke="black" d="M141.5,-146.33C123.85,-135.94 99.99,-121.91 80.72,-110.57"/>
<polygon fill="black" stroke="black" points="82.35,-107.47 71.95,-105.42 78.8,-113.5 82.35,-107.47"/>
</g>
<!-- Returned -->
<g id="node7" class="node">
<title>Returned</title>
<ellipse fill="none" stroke="black" cx="166.45" cy="-90" rx="53.89" ry="18"/>
<text text-anchor="middle" x="166.45" y="-86.3" font-family="Times,serif" font-size="14.00">Returned</text>
</g>
<!-- Running&#45;&gt;Returned -->
<g id="edge8" class="edge">
<title>Running&#45;&gt;Returned</title>
<path fill="none" stroke="black" d="M166.45,-143.7C166.45,-135.98 166.45,-126.71 166.45,-118.11"/>
<polygon fill="black" stroke="black" points="169.95,-118.1 166.45,-108.1 162.95,-118.1 169.95,-118.1"/>
</g>
<!-- Blocked&#45;&gt;Runnable -->
<g id="edge10" class="edge">
<title>Blocked&#45;&gt;Runnable</title>
<path fill="none" stroke="black" d="M57.15,-107.95C68.17,-126.54 87.26,-156.8 107.45,-180 116.88,-190.84 128.43,-201.66 138.8,-210.66"/>
<polygon fill="black" stroke="black" points="136.57,-213.35 146.45,-217.16 141.1,-208.02 136.57,-213.35"/>
</g>
<!-- Complete -->
<g id="node8" class="node">
<title>Complete</title>
<ellipse fill="none" stroke="black" cx="166.45" cy="-18" rx="55.49" ry="18"/>
<text text-anchor="middle" x="166.45" y="-14.3" font-family="Times,serif" font-size="14.00">Complete</text>
</g>
<!-- Returned&#45;&gt;Complete -->
<g id="edge9" class="edge">
<title>Returned&#45;&gt;Complete</title>
<path fill="none" stroke="black" d="M166.45,-71.7C166.45,-63.98 166.45,-54.71 166.45,-46.11"/>
<polygon fill="black" stroke="black" points="169.95,-46.1 166.45,-36.1 162.95,-46.1 169.95,-46.1"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

Loading…
Cancel
Save