diff options
author | Mike Holmes <mike.holmes@linaro.org> | 2015-04-17 17:43:41 -0400 |
---|---|---|
committer | Mike Holmes <mike.holmes@linaro.org> | 2015-04-17 17:50:24 -0400 |
commit | e322649af2050271d65ad59e55a7bf437d487bed (patch) | |
tree | ef82a0dd7ecc0525f1f5c3d190f1df824457e6ab | |
parent | c8c82712198c16b14198da173837eb41c306b184 (diff) |
add mscgen for diagrams
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | mscgen/odp_thread.msc | 24 | ||||
-rw-r--r-- | mscgen/odp_thread.svg | 147 |
4 files changed, 185 insertions, 2 deletions
@@ -3,12 +3,17 @@ # #SPDX-License-Identifier: BSD-3-Clause +msg_list = $(basename $(wildcard mscgen/*.msc)) +msg_tgt = $(addsuffix .svn, $(msg_list)) + src_list = $(basename $(wildcard *.odt)) file_list = $(addsuffix .pdf, $(src_list)) -all: check_office_is_open $(file_list) +all: $(file_list) + +$(file_list): check_office_is_open $(msg_tgt) -check_office_is_open: +check_office_is_open: @if [ ! -z `pidof soffice.bin` ]; \ then \ echo "\nlibreoffice is already running, scripting can't run"; \ @@ -18,5 +23,8 @@ check_office_is_open: %.pdf: %.odt libreoffice --headless --convert-to pdf $< +%.svn: %.msc + mscgen -i $< -T svg + clean: rm -f $(file_list) @@ -1,3 +1,7 @@ +Generating mscgen diagrams + + sudo apt-get install mscgen + make Generating pdfs diff --git a/mscgen/odp_thread.msc b/mscgen/odp_thread.msc new file mode 100644 index 0000000..8bef709 --- /dev/null +++ b/mscgen/odp_thread.msc @@ -0,0 +1,24 @@ +#C for some fictional process +msc { +hscale = "2"; + +main,thread_1,thread_n; + +main=>main [ label = "odp_init_global()", textcolour="red" ]; +main=>thread_1 [ label = "odph_worker_create()" ]; +main=>thread_n [ label = "odph_worker_create()" ]; + +thread_1=>thread_1 [ label = "odp_init_local()", textcolour="blue" ]; +thread_1 rbox thread_1 [ label = "process packets" ]; +thread_1=>thread_1 [ label = "odp_term_local()", textcolour="blue" ]; + +thread_n=>thread_n [ label = "odp_init_local()", textcolour="blue" ]; +thread_n rbox thread_n [ label = "process packets" ]; +thread_n=>thread_n [ label = "odp_term_local()", textcolour="blue" ]; +...; +main<=thread_1 [ label = "odph_worker_join()" ]; +main<=thread_n [ label = "odph_worker_join()" ]; + +main=>main [ label = "odp_term_global()", textcolour="red" ]; + +} diff --git a/mscgen/odp_thread.svg b/mscgen/odp_thread.svg new file mode 100644 index 0000000..3d5ce2e --- /dev/null +++ b/mscgen/odp_thread.svg @@ -0,0 +1,147 @@ +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg version="1.1" + width="1200px" height="375px" + viewBox="0 0 1200 375" + xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges" + stroke-width="1" text-rendering="geometricPrecision"> +<polygon fill="white" points="185,7 213,7 213,16 185,16"/> +<text x="200" y="16" textLength="26" font-family="Helvetica" font-size="12" fill="black" text-anchor="middle"> + +main +</text> +<polygon fill="white" points="575,7 623,7 623,16 575,16"/> +<text x="600" y="16" textLength="47" font-family="Helvetica" font-size="12" fill="black" text-anchor="middle"> + +thread_1 +</text> +<polygon fill="white" points="975,7 1023,7 1023,16 975,16"/> +<text x="1000" y="16" textLength="47" font-family="Helvetica" font-size="12" fill="black" text-anchor="middle"> + +thread_n +</text> +<line x1="200" y1="22" x2="200" y2="50" stroke="black"/> +<line x1="600" y1="22" x2="600" y2="50" stroke="black"/> +<line x1="1000" y1="22" x2="1000" y2="50" stroke="black"/> +<path d="M 200 39 A198,6 0 0,1 200,27" stroke="black" fill="none"/><polygon fill="black" points="200,39 190,45 190,33"/> +<polygon fill="white" points="200,23 291,23 291,32 200,32"/> +<text x="201" y="32" textLength="89" font-family="Helvetica" font-size="12" fill="red"> +odp_init_global() +</text> +<line x1="200" y1="50" x2="200" y2="78" stroke="black"/> +<line x1="600" y1="50" x2="600" y2="78" stroke="black"/> +<line x1="1000" y1="50" x2="1000" y2="78" stroke="black"/> +<line x1="200" y1="61" x2="600" y2="61" stroke="black"/> +<polygon fill="black" points="600,61 590,67 590,55"/> +<polygon fill="white" points="340,51 459,51 459,60 340,60"/> +<text x="341" y="60" textLength="117" font-family="Helvetica" font-size="12" fill="black"> +odph_worker_create() +</text> +<line x1="200" y1="78" x2="200" y2="106" stroke="black"/> +<line x1="600" y1="78" x2="600" y2="106" stroke="black"/> +<line x1="1000" y1="78" x2="1000" y2="106" stroke="black"/> +<line x1="200" y1="89" x2="1000" y2="89" stroke="black"/> +<polygon fill="black" points="1000,89 990,95 990,83"/> +<polygon fill="white" points="540,79 659,79 659,88 540,88"/> +<text x="541" y="88" textLength="117" font-family="Helvetica" font-size="12" fill="black"> +odph_worker_create() +</text> +<line x1="200" y1="106" x2="200" y2="134" stroke="black"/> +<line x1="600" y1="106" x2="600" y2="134" stroke="black"/> +<line x1="1000" y1="106" x2="1000" y2="134" stroke="black"/> +<path d="M 600 111 A200,6 0 0,1 600,123" stroke="black" fill="none"/><polygon fill="black" points="600,123 610,129 610,117"/> +<polygon fill="white" points="515,107 598,107 598,116 515,116"/> +<text x="516" y="116" textLength="81" font-family="Helvetica" font-size="12" fill="blue"> +odp_init_local() +</text> +<line x1="200" y1="134" x2="200" y2="162" stroke="black"/> +<line x1="600" y1="134" x2="600" y2="162" stroke="black"/> +<line x1="1000" y1="134" x2="1000" y2="162" stroke="black"/> +<polygon fill="white" points="414,134 786,134 786,156 414,156"/> +<polygon fill="white" points="408,140 792,140 792,150 408,150"/> +<circle fill="white" cx="414" cy="140" r="6"/> +<circle fill="white" cx="786" cy="140" r="6"/> +<circle fill="white" cx="414" cy="150" r="6"/> +<circle fill="white" cx="786" cy="150" r="6"/> +<line x1="414" y1="134" x2="786" y2="134" stroke="black"/> +<line x1="414" y1="156" x2="786" y2="156" stroke="black"/> +<line x1="408" y1="140" x2="408" y2="150" stroke="black"/> +<line x1="792" y1="140" x2="792" y2="150" stroke="black"/> +<path d="M 408 140 A6,6 0 0,1 414,134" stroke="black" fill="none"/><path d="M 786 134 A6,6 0 0,1 792,140" stroke="black" fill="none"/><path d="M 792 150 A6,6 0 0,1 786,156" stroke="black" fill="none"/><path d="M 414 156 A6,6 0 0,1 408,150" stroke="black" fill="none"/><polygon fill="white" points="555,141 644,141 644,150 555,150"/> +<text x="556" y="150" textLength="87" font-family="Helvetica" font-size="12" fill="black"> +process packets +</text> +<line x1="200" y1="162" x2="200" y2="190" stroke="black"/> +<line x1="600" y1="162" x2="600" y2="190" stroke="black"/> +<line x1="1000" y1="162" x2="1000" y2="190" stroke="black"/> +<path d="M 600 167 A200,6 0 0,1 600,179" stroke="black" fill="none"/><polygon fill="black" points="600,179 610,185 610,173"/> +<polygon fill="white" points="506,163 598,163 598,172 506,172"/> +<text x="507" y="172" textLength="90" font-family="Helvetica" font-size="12" fill="blue"> +odp_term_local() +</text> +<line x1="200" y1="190" x2="200" y2="218" stroke="black"/> +<line x1="600" y1="190" x2="600" y2="218" stroke="black"/> +<line x1="1000" y1="190" x2="1000" y2="218" stroke="black"/> +<path d="M 1000 195 A200,6 0 0,1 1000,207" stroke="black" fill="none"/><polygon fill="black" points="1000,207 1010,213 1010,201"/> +<polygon fill="white" points="915,191 998,191 998,200 915,200"/> +<text x="916" y="200" textLength="81" font-family="Helvetica" font-size="12" fill="blue"> +odp_init_local() +</text> +<line x1="200" y1="218" x2="200" y2="246" stroke="black"/> +<line x1="600" y1="218" x2="600" y2="246" stroke="black"/> +<line x1="1000" y1="218" x2="1000" y2="246" stroke="black"/> +<polygon fill="white" points="814,218 1186,218 1186,240 814,240"/> +<polygon fill="white" points="808,224 1192,224 1192,234 808,234"/> +<circle fill="white" cx="814" cy="224" r="6"/> +<circle fill="white" cx="1186" cy="224" r="6"/> +<circle fill="white" cx="814" cy="234" r="6"/> +<circle fill="white" cx="1186" cy="234" r="6"/> +<line x1="814" y1="218" x2="1186" y2="218" stroke="black"/> +<line x1="814" y1="240" x2="1186" y2="240" stroke="black"/> +<line x1="808" y1="224" x2="808" y2="234" stroke="black"/> +<line x1="1192" y1="224" x2="1192" y2="234" stroke="black"/> +<path d="M 808 224 A6,6 0 0,1 814,218" stroke="black" fill="none"/><path d="M 1186 218 A6,6 0 0,1 1192,224" stroke="black" fill="none"/><path d="M 1192 234 A6,6 0 0,1 1186,240" stroke="black" fill="none"/><path d="M 814 240 A6,6 0 0,1 808,234" stroke="black" fill="none"/><polygon fill="white" points="955,225 1044,225 1044,234 955,234"/> +<text x="956" y="234" textLength="87" font-family="Helvetica" font-size="12" fill="black"> +process packets +</text> +<line x1="200" y1="246" x2="200" y2="274" stroke="black"/> +<line x1="600" y1="246" x2="600" y2="274" stroke="black"/> +<line x1="1000" y1="246" x2="1000" y2="274" stroke="black"/> +<path d="M 1000 251 A200,6 0 0,1 1000,263" stroke="black" fill="none"/><polygon fill="black" points="1000,263 1010,269 1010,257"/> +<polygon fill="white" points="906,247 998,247 998,256 906,256"/> +<text x="907" y="256" textLength="90" font-family="Helvetica" font-size="12" fill="blue"> +odp_term_local() +</text> +<line x1="200" y1="274" x2="200" y2="291" stroke="black" stroke-dasharray="2,2"/> +<line x1="600" y1="274" x2="600" y2="291" stroke="black" stroke-dasharray="2,2"/> +<line x1="1000" y1="274" x2="1000" y2="291" stroke="black" stroke-dasharray="2,2"/> +<line x1="200" y1="291" x2="200" y2="319" stroke="black"/> +<line x1="600" y1="291" x2="600" y2="319" stroke="black"/> +<line x1="1000" y1="291" x2="1000" y2="319" stroke="black"/> +<line x1="600" y1="302" x2="200" y2="302" stroke="black"/> +<polygon fill="black" points="200,302 210,308 210,296"/> +<polygon fill="white" points="347,292 452,292 452,301 347,301"/> +<text x="348" y="301" textLength="103" font-family="Helvetica" font-size="12" fill="black"> +odph_worker_join() +</text> +<line x1="200" y1="319" x2="200" y2="347" stroke="black"/> +<line x1="600" y1="319" x2="600" y2="347" stroke="black"/> +<line x1="1000" y1="319" x2="1000" y2="347" stroke="black"/> +<line x1="1000" y1="330" x2="200" y2="330" stroke="black"/> +<polygon fill="black" points="200,330 210,336 210,324"/> +<polygon fill="white" points="547,320 652,320 652,329 547,329"/> +<text x="548" y="329" textLength="103" font-family="Helvetica" font-size="12" fill="black"> +odph_worker_join() +</text> +<line x1="200" y1="347" x2="200" y2="375" stroke="black"/> +<line x1="600" y1="347" x2="600" y2="375" stroke="black"/> +<line x1="1000" y1="347" x2="1000" y2="375" stroke="black"/> +<path d="M 200 364 A198,6 0 0,1 200,352" stroke="black" fill="none"/><polygon fill="black" points="200,364 190,370 190,358"/> +<polygon fill="white" points="200,348 299,348 299,357 200,357"/> +<text x="201" y="357" textLength="97" font-family="Helvetica" font-size="12" fill="red"> +odp_term_global() +</text> +<line x1="200" y1="369" x2="200" y2="375" stroke="black"/> +<line x1="600" y1="369" x2="600" y2="375" stroke="black"/> +<line x1="1000" y1="369" x2="1000" y2="375" stroke="black"/> +</svg> |