diff mbox

[v2,2/3] doc: images: add resource_management.msc for users-guide

Message ID 1446486077-14973-2-git-send-email-mike.holmes@linaro.org
State Accepted
Commit 1b7e35f6261c4bea69b5d93ba2245ac084f32208
Headers show

Commit Message

Mike Holmes Nov. 2, 2015, 5:41 p.m. UTC
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 DEPENDENCIES                       |  5 +++++
 configure.ac                       | 10 +++++++++
 doc/images/Makefile.am             | 13 +++++++++--
 doc/images/resource_management.msc | 45 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 71 insertions(+), 2 deletions(-)
 create mode 100644 doc/images/resource_management.msc
diff mbox

Patch

diff --git a/DEPENDENCIES b/DEPENDENCIES
index 7d22bde..d551a58 100644
--- a/DEPENDENCIES
+++ b/DEPENDENCIES
@@ -194,6 +194,11 @@  Prerequisites for building the OpenDataPlane (ODP) API
   # Debian/Ubuntu
   # apt-get install imagemagick
 
+  Message squence diagrams are stored as msc files and the png or eps versions generated when the docs are built
+  mscgen is used
+  #Debian/Ubuntu
+  # apt-get install mscgen
+
 5.1 API Guide
 See http://www.stack.nl/~dimitri/doxygen/manual/install.html
 
diff --git a/configure.ac b/configure.ac
index 5cf07ca..d9669b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -258,6 +258,16 @@  AM_CONDITIONAL([user_guide], [test "x${user_guides}" = "xyes" ])
 AM_CONDITIONAL([HAVE_IMAGEMAGIC], [test "x${IMAGEMAGIC}" = "xconvert"])
 
 ##########################################################################
+# Check for mscgen availability
+##########################################################################
+       AC_CHECK_PROGS([MSCGEN], [mscgen])
+       if test -z "$MSCGEN";
+          then AC_MSG_WARN([mscgen not found - continuing without sequence message support])
+       fi
+
+AM_CONDITIONAL([HAVE_MSCGEN], [test "x${MSCGEN}" = "xmscgen"])
+
+##########################################################################
 # Save and set temporary compilation flags
 ##########################################################################
 OLD_LDFLAGS=$LDFLAGS
diff --git a/doc/images/Makefile.am b/doc/images/Makefile.am
index df8f9d4..0f9a8a8 100644
--- a/doc/images/Makefile.am
+++ b/doc/images/Makefile.am
@@ -3,8 +3,10 @@  SVG_SRCS =  atomic_queue.svg \
 	parallel_queue.svg
 SVG_TARGETS = $(SVG_SRCS:svg=png)
 SVG_TARGETS += $(SVG_SRCS:svg=eps)
+MSG_SRCS = resource_management.msc
+MSG_TARGETS = $(MSG_SRCS:msc=png)
 
-EXTRA_DIST = $(SVG_SRCS)
+EXTRA_DIST = $(SVG_SRCS) $(MSG_SRCS)
 
 TARGETS=
 
@@ -12,10 +14,14 @@  if HAVE_IMAGEMAGIC
 TARGETS += $(SVG_TARGETS)
 endif
 
+if HAVE_MSCGEN
+TARGETS += $(MSG_TARGETS)
+endif
+
 all-local: $(TARGETS)
 
 clean-local:
-	rm -f $(TARGETS)
+	rm -f $(SVG_TARGETS) $(MSG_TARGETS)
 
 atomic_queue.png: atomic_queue.svg
 	convert $< $@
@@ -31,3 +37,6 @@  parallel_queue.png: parallel_queue.svg
 	convert $< $@
 ordered_queue.eps: ordered_queue.svg
 	convert $< $@
+
+resource_management.png: resource_management.msc
+	mscgen -T png -i $< -o $@
diff --git a/doc/images/resource_management.msc b/doc/images/resource_management.msc
new file mode 100644
index 0000000..fa54c4c
--- /dev/null
+++ b/doc/images/resource_management.msc
@@ -0,0 +1,45 @@ 
+# ODP resource management
+msc {
+
+  a,b,c;
+
+  a->a [ label = "odp_init_global()"];
+  a->b [ label = "odp_thread_start()"];
+  a->c [ label = "odp_thread_start()"];
+  a->a [ label = "odp_init_local()"],
+  b->b [ label = "odp_init_local()"],
+  c->c [ label = "odp_init_local()"];
+  ---;
+  b->b [ label = "pool = odp_pool_create()", textcolour="#7f7fff"];
+
+  a->a [ label = "barrier()"],
+  b->b [ label = "barrier()"],
+  c->c [ label = "barrier()"];
+
+  a->a [ label = " buf = alloc(pool)", textcolour="#ffb000"],
+  b->b [ label = " buf = alloc(pool)", textcolour="#ffb000"],
+  c->c [ label = " buf = alloc(pool)", textcolour="#ffb000"];
+
+  a->a [ label = " free(buf)", textcolour="#ffb000"],
+  b->b [ label = " free(buf)", textcolour="#ffb000"],
+  c->c [ label = " free(buf)", textcolour="#ffb000"];
+
+  a->a [ label = "barrier()"],
+  b->b [ label = "barrier()"],
+  c->c [ label = "barrier()"];
+
+  a->a [ label = "pool = odp_pool_destroy(pool)", textcolour="#7f7fff"];
+  ---;
+  a->a [ label = "barrier()"],
+  b->b [ label = "barrier()"],
+  c->c [ label = "barrier()"];
+
+  ---  [ label = "do work", ID="*" ];
+
+  a->a [ label = "odp_term_local()"],
+  b->b [ label = "odp_term_local()"],
+  c->c [ label = "odp_term_local()"];
+  b->a [ label = "odp_thread_term()"];
+  c->a [ label = "odp_thread_term()"];
+  a->a [ label = "odp_term_global()"];
+}