Module: xenomai-forge
Branch: master
Commit: 05676371d77e86292292ce9b76b769cc948397fd
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=05676371d77e86292292ce9b76b769cc948397fd

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Sep 24 17:19:34 2014 +0200

demo/alchemy/latency: rename to altency

For disambiguation, since we also have the main "latency" measurement
program (based on the POSIX API).

---

 demo/alchemy/Makefile.am              |   10 +++----
 demo/alchemy/Makefile.in              |   52 ++++++++++++++++-----------------
 demo/alchemy/{latency.c => altency.c} |   47 ++++++++++++++++-------------
 3 files changed, 57 insertions(+), 52 deletions(-)

diff --git a/demo/alchemy/Makefile.am b/demo/alchemy/Makefile.am
index 406bccb..beb3644 100644
--- a/demo/alchemy/Makefile.am
+++ b/demo/alchemy/Makefile.am
@@ -1,6 +1,6 @@
 demodir = @XENO_DEMO_DIR@
 
-demo_PROGRAMS = latency
+demo_PROGRAMS = altency
 
 core_libs =
 if XENO_COBALT
@@ -18,10 +18,10 @@ ldadd =                                     \
        $(core_libs)                            \
         @XENO_USER_LDADD@
 
-latency_SOURCES = latency.c
-latency_CPPFLAGS = $(cppflags)
-latency_LDADD = $(ldadd) -lpthread -lrt -lm
-latency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS)
+altency_SOURCES = altency.c
+altency_CPPFLAGS = $(cppflags)
+altency_LDADD = $(ldadd) -lpthread -lrt -lm
+altency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS)
 
 # This demo mixes the Alchemy and Xenomai-enabled POSIX APIs over
 # Cobalt, so we ask for both set of flags. --posix along with
diff --git a/demo/alchemy/Makefile.in b/demo/alchemy/Makefile.in
index f606a03..37284c1 100644
--- a/demo/alchemy/Makefile.in
+++ b/demo/alchemy/Makefile.in
@@ -79,7 +79,7 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-demo_PROGRAMS = latency$(EXEEXT)
+demo_PROGRAMS = altency$(EXEEXT)
 @XENO_COBALT_TRUE@am__append_1 = ../../lib/cobalt/libcobalt.la
 subdir = demo/alchemy
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
@@ -100,18 +100,18 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(demodir)"
 PROGRAMS = $(demo_PROGRAMS)
-am_latency_OBJECTS = latency-latency.$(OBJEXT)
-latency_OBJECTS = $(am_latency_OBJECTS)
+am_altency_OBJECTS = altency-altency.$(OBJEXT)
+altency_OBJECTS = $(am_altency_OBJECTS)
 am__DEPENDENCIES_1 = ../../lib/alchemy/libalchemy.la \
        ../../lib/copperplate/libcopperplate.la $(core_libs)
-latency_DEPENDENCIES = $(am__DEPENDENCIES_1)
+altency_DEPENDENCIES = $(am__DEPENDENCIES_1)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_1 = 
-latency_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+altency_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(latency_LDFLAGS) $(LDFLAGS) -o $@
+       $(altency_LDFLAGS) $(LDFLAGS) -o $@
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -146,8 +146,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(latency_SOURCES)
-DIST_SOURCES = $(latency_SOURCES)
+SOURCES = $(altency_SOURCES)
+DIST_SOURCES = $(altency_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
        ctags-recursive dvi-recursive html-recursive info-recursive \
        install-data-recursive install-dvi-recursive \
@@ -394,10 +394,10 @@ ldadd = \
        $(core_libs)                            \
         @XENO_USER_LDADD@
 
-latency_SOURCES = latency.c
-latency_CPPFLAGS = $(cppflags)
-latency_LDADD = $(ldadd) -lpthread -lrt -lm
-latency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS)
+altency_SOURCES = altency.c
+altency_CPPFLAGS = $(cppflags)
+altency_LDADD = $(ldadd) -lpthread -lrt -lm
+altency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS)
 all: all-recursive
 
 .SUFFIXES:
@@ -482,9 +482,9 @@ clean-demoPROGRAMS:
        echo " rm -f" $$list; \
        rm -f $$list
 
-latency$(EXEEXT): $(latency_OBJECTS) $(latency_DEPENDENCIES) 
$(EXTRA_latency_DEPENDENCIES) 
-       @rm -f latency$(EXEEXT)
-       $(AM_V_CCLD)$(latency_LINK) $(latency_OBJECTS) $(latency_LDADD) $(LIBS)
+altency$(EXEEXT): $(altency_OBJECTS) $(altency_DEPENDENCIES) 
$(EXTRA_altency_DEPENDENCIES) 
+       @rm -f altency$(EXEEXT)
+       $(AM_V_CCLD)$(altency_LINK) $(altency_OBJECTS) $(altency_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -492,7 +492,7 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/latency-latency.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/altency-altency.Po@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF 
$(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -515,19 +515,19 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
-latency-latency.o: latency.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(latency_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT latency-latency.o 
-MD -MP -MF $(DEPDIR)/latency-latency.Tpo -c -o latency-latency.o `test -f 
'latency.c' || echo '$(srcdir)/'`latency.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/latency-latency.Tpo 
$(DEPDIR)/latency-latency.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='latency.c' 
object='latency-latency.o' libtool=no @AMDEPBACKSLASH@
+altency-altency.o: altency.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(altency_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT altency-altency.o 
-MD -MP -MF $(DEPDIR)/altency-altency.Tpo -c -o altency-altency.o `test -f 
'altency.c' || echo '$(srcdir)/'`altency.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/altency-altency.Tpo 
$(DEPDIR)/altency-altency.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='altency.c' 
object='altency-altency.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES) $(latency_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o 
latency-latency.o `test -f 'latency.c' || echo '$(srcdir)/'`latency.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES) $(altency_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o 
altency-altency.o `test -f 'altency.c' || echo '$(srcdir)/'`altency.c
 
-latency-latency.obj: latency.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(latency_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT latency-latency.obj 
-MD -MP -MF $(DEPDIR)/latency-latency.Tpo -c -o latency-latency.obj `if test -f 
'latency.c'; then $(CYGPATH_W) 'latency.c'; else $(CYGPATH_W) 
'$(srcdir)/latency.c'; fi`
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/latency-latency.Tpo 
$(DEPDIR)/latency-latency.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='latency.c' 
object='latency-latency.obj' libtool=no @AMDEPBACKSLASH@
+altency-altency.obj: altency.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(altency_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT altency-altency.obj 
-MD -MP -MF $(DEPDIR)/altency-altency.Tpo -c -o altency-altency.obj `if test -f 
'altency.c'; then $(CYGPATH_W) 'altency.c'; else $(CYGPATH_W) 
'$(srcdir)/altency.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/altency-altency.Tpo 
$(DEPDIR)/altency-altency.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='altency.c' 
object='altency-altency.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES) $(latency_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o 
latency-latency.obj `if test -f 'latency.c'; then $(CYGPATH_W) 'latency.c'; 
else $(CYGPATH_W) '$(srcdir)/latency.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES) $(altency_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o 
altency-altency.obj `if test -f 'altency.c'; then $(CYGPATH_W) 'altency.c'; 
else $(CYGPATH_W) '$(srcdir)/altency.c'; fi`
 
 mostlyclean-libtool:
        -rm -f *.lo
diff --git a/demo/alchemy/latency.c b/demo/alchemy/altency.c
similarity index 92%
rename from demo/alchemy/latency.c
rename to demo/alchemy/altency.c
index 7d1bf0a..ef1a694 100644
--- a/demo/alchemy/latency.c
+++ b/demo/alchemy/altency.c
@@ -1,3 +1,8 @@
+/*
+ * The alternate latency measurement program based on the Alchemy API.
+ *
+ * Licensed under the LGPL v2.1.
+ */
 #include <stdlib.h>
 #include <math.h>
 #include <stdio.h>
@@ -82,7 +87,7 @@ static void latency(void *cookie)
 
        ret = rt_task_set_periodic(NULL, start_ns, period_ns);
        if (ret) {
-               fprintf(stderr, "latency: failed to set periodic, code %d\n",
+               fprintf(stderr, "altency: failed to set periodic, code %d\n",
                        ret);
                return;
        }
@@ -112,7 +117,7 @@ static void latency(void *cookie)
                        if (ret) {
                                if (ret != -ETIMEDOUT) {
                                        fprintf(stderr,
-                                               "latency: wait period failed, 
code %d\n",
+                                               "altency: wait period failed, 
code %d\n",
                                                ret);
                                        exit(EXIT_FAILURE); /* Timer stopped. */
                                }
@@ -169,7 +174,7 @@ static void display(void *cookie)
                ret = rt_sem_create(&display_sem, sem_name, 0, S_FIFO);
                if (ret) {
                        fprintf(stderr,
-                               "latency: cannot create semaphore: %s\n",
+                               "altency: cannot create semaphore: %s\n",
                                strerror(-ret));
                        return;
                }
@@ -192,7 +197,7 @@ static void display(void *cookie)
                ret = ioctl(devfd, RTTST_RTIOC_TMBENCH_START, &config);
                if (ret) {
                        fprintf(stderr,
-                               "latency: failed to start in-kernel timer 
benchmark, code %d\n",
+                               "altency: failed to start in-kernel timer 
benchmark, code %d\n",
                                ret);
                        return;
                }
@@ -215,7 +220,7 @@ static void display(void *cookie)
                        if (ret) {
                                if (ret != -EIDRM)
                                        fprintf(stderr,
-                                               "latency: failed to pend on 
semaphore, code %d\n",
+                                               "altency: failed to pend on 
semaphore, code %d\n",
                                                ret);
 
                                return;
@@ -234,7 +239,7 @@ static void display(void *cookie)
                        if (ret) {
                                if (ret != -EIDRM)
                                        fprintf(stderr,
-                                       "latency: failed to call 
RTTST_RTIOC_INTERM_BENCH_RES, %m\n");
+                                       "altency: failed to call 
RTTST_RTIOC_INTERM_BENCH_RES, %m\n");
 
                                return;
                        }
@@ -471,7 +476,7 @@ static void sigdebug(int sig, siginfo_t *si, void *context)
        case SIGDEBUG_UNDEFINED:
        case SIGDEBUG_NOMLOCK:
        case SIGDEBUG_WATCHDOG:
-               n = snprintf(buffer, sizeof(buffer), "latency: %s\n",
+               n = snprintf(buffer, sizeof(buffer), "altency: %s\n",
                             reason_str[reason]);
                n = write(STDERR_FILENO, buffer, n);
                exit(EXIT_FAILURE);
@@ -513,7 +518,7 @@ int main(int argc, char *const *argv)
                case 'p':
                        period_ns = atoi(optarg) * 1000LL;
                        if (period_ns > ONE_BILLION) {
-                               fprintf(stderr, "latency: invalid period (> 
1s).\n");
+                               fprintf(stderr, "altency: invalid period (> 
1s).\n");
                                exit(2);
                        }
                        break;
@@ -536,7 +541,7 @@ int main(int argc, char *const *argv)
                case 'c':
                        cpu = atoi(optarg);
                        if (cpu < 0 || cpu >= CPU_SETSIZE) {
-                               fprintf(stderr, "latency: invalid CPU #%d\n", 
cpu);
+                               fprintf(stderr, "altency: invalid CPU #%d\n", 
cpu);
                                return 1;
                        }
                        break;
@@ -549,7 +554,7 @@ int main(int argc, char *const *argv)
                default:
 
                        fprintf(stderr,
-"usage: latency [options]\n"
+"usage: altency [options]\n"
 "  [-h]                         # print histograms of min, avg, max 
latencies\n"
 "  [-g <file>]                  # dump histogram to <file> in gnuplot format\n"
 "  [-s]                         # print statistics of min, avg, max 
latencies\n"
@@ -570,12 +575,12 @@ int main(int argc, char *const *argv)
 
        if (!test_duration && quiet) {
                fprintf(stderr,
-                       "latency: -q only works if -T has been given.\n");
+                       "altency: -q only works if -T has been given.\n");
                quiet = 0;
        }
 
        if ((test_mode < USER_TASK) || (test_mode > TIMER_HANDLER)) {
-               fprintf(stderr, "latency: invalid test mode.\n");
+               fprintf(stderr, "altency: invalid test mode.\n");
                exit(2);
        }
 
@@ -628,17 +633,17 @@ int main(int argc, char *const *argv)
                devfd = open("/dev/rtdm/timerbench", O_RDWR);
                if (devfd < 0) {
                        fprintf(stderr,
-                               "latency: failed to open timerbench device, 
%m\n"
+                               "altency: failed to open timerbench device, 
%m\n"
                                "(modprobe xeno_timerbench?)\n");
                        return 0;
                }
        }
 
-       snprintf(task_name, sizeof(task_name), "display-%d", getpid());
+       snprintf(task_name, sizeof(task_name), "alt-display-%d", getpid());
        ret = rt_task_create(&display_task, task_name, 0, 0, 0);
        if (ret) {
                fprintf(stderr,
-                       "latency: failed to create display task, code %d\n",
+                       "altency: failed to create display task, code %d\n",
                        ret);
                return 0;
        }
@@ -646,18 +651,18 @@ int main(int argc, char *const *argv)
        ret = rt_task_start(&display_task, &display, NULL);
        if (ret) {
                fprintf(stderr,
-                       "latency: failed to start display task, code %d\n",
+                       "altency: failed to start display task, code %d\n",
                        ret);
                return 0;
        }
 
        if (test_mode == USER_TASK) {
-               snprintf(task_name, sizeof(task_name), "sampling-%d", getpid());
+               snprintf(task_name, sizeof(task_name), "alt-sampling-%d", 
getpid());
                ret = rt_task_create(&latency_task, task_name, 0, priority,
                                     T_WARNSW);
                if (ret) {
                        fprintf(stderr,
-                               "latency: failed to create latency task, code 
%d\n",
+                               "altency: failed to create sampling task, code 
%d\n",
                                ret);
                        return 0;
                }
@@ -668,16 +673,16 @@ int main(int argc, char *const *argv)
                        ret = rt_task_set_affinity(&latency_task, &cpus);
                        if (ret) {
                                fprintf(stderr,
-                                       "latency: failed to set CPU affinity, 
code %d\n",
+                                       "altency: failed to set CPU affinity, 
code %d\n",
                                        ret);
                                return 0;
                        }
                }
 
-               ret = rt_task_start(&latency_task, &latency, NULL);
+               ret = rt_task_start(&latency_task, latency, NULL);
                if (ret) {
                        fprintf(stderr,
-                               "latency: failed to start latency task, code 
%d\n",
+                               "altency: failed to start sampling task, code 
%d\n",
                                ret);
                        return 0;
                }


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to