reorganize test programs into tests/ directory
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 15 Jun 2009 17:03:25 +0000 (13:03 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 15 Jun 2009 17:10:22 +0000 (13:10 -0400)
18 files changed:
Makefile.am
configure.ac
hello/Makefile.am [deleted file]
hello/README [deleted file]
hello/hello.c [deleted file]
hello/run [deleted file]
hello/tp.c [deleted file]
hello/tp.h [deleted file]
tests/hello/Makefile.am [new file with mode: 0644]
tests/hello/README [new file with mode: 0644]
tests/hello/hello.c [new file with mode: 0644]
tests/hello/run [new file with mode: 0755]
tests/hello/tp.c [new file with mode: 0644]
tests/hello/tp.h [new file with mode: 0644]
tests/hello2/Makefile.am [new file with mode: 0644]
tests/hello2/README [new file with mode: 0644]
tests/hello2/hello2.c [new file with mode: 0644]
tests/hello2/run [new file with mode: 0755]

index 99326afa027aff7c85b3bf190e47c50bbf86e2d6..1f9ba751ef89192f77d860bc25d7bf601f07a80a 100644 (file)
@@ -1,4 +1,4 @@
 ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = libust hello libmallocwrap ustd ust
+SUBDIRS = libust tests libmallocwrap ustd ust
 
 EXTRA_DIST = share/kernelcompat.h doc
index dce1239b03528d08082499b2cee2ebf6d672eba7..21e00b5855651423b4035bcce64af70cfc53d86e 100644 (file)
@@ -78,7 +78,9 @@ AC_SUBST(KCOMPAT_LIBS)
 AC_CONFIG_FILES([
        Makefile
        libust/Makefile
-       hello/Makefile
+       tests/Makefile
+       tests/hello/Makefile
+       tests/hello2/Makefile
        libmallocwrap/Makefile
        ustd/Makefile
        ust/Makefile
diff --git a/hello/Makefile.am b/hello/Makefile.am
deleted file mode 100644 (file)
index 845773e..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust \
-       $(KCOMPAT_CFLAGS) $(URCU_CFLAGS)
-
-noinst_PROGRAMS = hello
-hello_SOURCES = hello.c tp.c tp.h
-hello_LDADD = $(top_builddir)/libust/libust.la $(URCU_LIBS)
-
-noinst_SCRIPTS = run
-EXTRA_DIST = run
diff --git a/hello/README b/hello/README
deleted file mode 100644 (file)
index 68b11e6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This is a hello world application used to test the LTTng userspace tracer.
diff --git a/hello/hello.c b/hello/hello.c
deleted file mode 100644 (file)
index 102b7db..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <signal.h>
-
-#include "marker.h"
-#include "usterr.h"
-#include "tracer.h"
-#include "marker-control.h"
-#include "relay.h"
-#include "tp.h"
-
-
-void inthandler(int sig)
-{
-       printf("in handler\n");
-       exit(0);
-}
-
-int init_int_handler(void)
-{
-       int result;
-       struct sigaction act;
-
-       result = sigemptyset(&act.sa_mask);
-       if(result == -1) {
-               PERROR("sigemptyset");
-               return -1;
-       }
-
-       act.sa_handler = inthandler;
-       act.sa_flags = SA_RESTART;
-
-       /* Only defer ourselves. Also, try to restart interrupted
-        * syscalls to disturb the traced program as little as possible.
-        */
-       result = sigaction(SIGINT, &act, NULL);
-       if(result == -1) {
-               PERROR("sigaction");
-               return -1;
-       }
-
-       return 0;
-}
-
-int main()
-{
-       int result;
-       int i;
-
-       init_int_handler();
-
-       printf("Hello, World!\n");
-
-       sleep(1);
-       for(i=0; i<50; i++) {
-               trace_mark(ust, bar, "str %s", "FOOBAZ");
-               trace_mark(ust, bar2, "number1 %d number2 %d", 53, 9800);
-               trace_hello_tptest(i);
-               usleep(100000);
-       }
-
-       scanf("%*s");
-
-       ltt_trace_stop("auto");
-       ltt_trace_destroy("auto");
-
-       DBG("TRACE STOPPED");
-       scanf("%*s");
-
-       return 0;
-}
-
-MARKER_LIB;
-TRACEPOINT_LIB;
diff --git a/hello/run b/hello/run
deleted file mode 100755 (executable)
index da8df17..0000000
--- a/hello/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-UST_AUTOPROBE=1 UST_TRACE=1 LD_LIBRARY_PATH=../libust/.libs:../../liburcu $1 .libs/hello
diff --git a/hello/tp.c b/hello/tp.c
deleted file mode 100644 (file)
index 2ee7392..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "tp.h"
-#include "marker.h"
-#include "usterr.h"
-
-DEFINE_TRACE(hello_tptest);
-
-void tptest_probe(int anint)
-{
-       DBG("in tracepoint probe...");
-       trace_mark(ust, tptest, "anint %d", anint);
-}
-
-static void __attribute__((constructor)) init()
-{
-       DBG("connecting tracepoint...");
-       register_trace_hello_tptest(tptest_probe);
-}
diff --git a/hello/tp.h b/hello/tp.h
deleted file mode 100644 (file)
index 6064283..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "tracepoint.h"
-
-DECLARE_TRACE(hello_tptest,
-             TPPROTO(int anint),
-             TPARGS(anint));
diff --git a/tests/hello/Makefile.am b/tests/hello/Makefile.am
new file mode 100644 (file)
index 0000000..845773e
--- /dev/null
@@ -0,0 +1,9 @@
+INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust \
+       $(KCOMPAT_CFLAGS) $(URCU_CFLAGS)
+
+noinst_PROGRAMS = hello
+hello_SOURCES = hello.c tp.c tp.h
+hello_LDADD = $(top_builddir)/libust/libust.la $(URCU_LIBS)
+
+noinst_SCRIPTS = run
+EXTRA_DIST = run
diff --git a/tests/hello/README b/tests/hello/README
new file mode 100644 (file)
index 0000000..68b11e6
--- /dev/null
@@ -0,0 +1 @@
+This is a hello world application used to test the LTTng userspace tracer.
diff --git a/tests/hello/hello.c b/tests/hello/hello.c
new file mode 100644 (file)
index 0000000..102b7db
--- /dev/null
@@ -0,0 +1,79 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <signal.h>
+
+#include "marker.h"
+#include "usterr.h"
+#include "tracer.h"
+#include "marker-control.h"
+#include "relay.h"
+#include "tp.h"
+
+
+void inthandler(int sig)
+{
+       printf("in handler\n");
+       exit(0);
+}
+
+int init_int_handler(void)
+{
+       int result;
+       struct sigaction act;
+
+       result = sigemptyset(&act.sa_mask);
+       if(result == -1) {
+               PERROR("sigemptyset");
+               return -1;
+       }
+
+       act.sa_handler = inthandler;
+       act.sa_flags = SA_RESTART;
+
+       /* Only defer ourselves. Also, try to restart interrupted
+        * syscalls to disturb the traced program as little as possible.
+        */
+       result = sigaction(SIGINT, &act, NULL);
+       if(result == -1) {
+               PERROR("sigaction");
+               return -1;
+       }
+
+       return 0;
+}
+
+int main()
+{
+       int result;
+       int i;
+
+       init_int_handler();
+
+       printf("Hello, World!\n");
+
+       sleep(1);
+       for(i=0; i<50; i++) {
+               trace_mark(ust, bar, "str %s", "FOOBAZ");
+               trace_mark(ust, bar2, "number1 %d number2 %d", 53, 9800);
+               trace_hello_tptest(i);
+               usleep(100000);
+       }
+
+       scanf("%*s");
+
+       ltt_trace_stop("auto");
+       ltt_trace_destroy("auto");
+
+       DBG("TRACE STOPPED");
+       scanf("%*s");
+
+       return 0;
+}
+
+MARKER_LIB;
+TRACEPOINT_LIB;
diff --git a/tests/hello/run b/tests/hello/run
new file mode 100755 (executable)
index 0000000..da8df17
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+UST_AUTOPROBE=1 UST_TRACE=1 LD_LIBRARY_PATH=../libust/.libs:../../liburcu $1 .libs/hello
diff --git a/tests/hello/tp.c b/tests/hello/tp.c
new file mode 100644 (file)
index 0000000..2ee7392
--- /dev/null
@@ -0,0 +1,17 @@
+#include "tp.h"
+#include "marker.h"
+#include "usterr.h"
+
+DEFINE_TRACE(hello_tptest);
+
+void tptest_probe(int anint)
+{
+       DBG("in tracepoint probe...");
+       trace_mark(ust, tptest, "anint %d", anint);
+}
+
+static void __attribute__((constructor)) init()
+{
+       DBG("connecting tracepoint...");
+       register_trace_hello_tptest(tptest_probe);
+}
diff --git a/tests/hello/tp.h b/tests/hello/tp.h
new file mode 100644 (file)
index 0000000..6064283
--- /dev/null
@@ -0,0 +1,5 @@
+#include "tracepoint.h"
+
+DECLARE_TRACE(hello_tptest,
+             TPPROTO(int anint),
+             TPARGS(anint));
diff --git a/tests/hello2/Makefile.am b/tests/hello2/Makefile.am
new file mode 100644 (file)
index 0000000..1abdae0
--- /dev/null
@@ -0,0 +1,9 @@
+INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust \
+       $(KCOMPAT_CFLAGS) $(URCU_CFLAGS)
+
+noinst_PROGRAMS = hello2
+hello2_SOURCES = hello2.c
+hello2_LDADD = $(top_builddir)/libust/libust.la $(URCU_LIBS)
+
+noinst_SCRIPTS = run
+EXTRA_DIST = run
diff --git a/tests/hello2/README b/tests/hello2/README
new file mode 100644 (file)
index 0000000..68b11e6
--- /dev/null
@@ -0,0 +1 @@
+This is a hello world application used to test the LTTng userspace tracer.
diff --git a/tests/hello2/hello2.c b/tests/hello2/hello2.c
new file mode 100644 (file)
index 0000000..f9bebce
--- /dev/null
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#include <unistd.h>
+#include "marker.h"
+int main()
+{
+       int result;
+       int i;
+
+//     sleep(1);
+
+       printf("Hello, World!\n");
+
+       for(i=0; i<500; i++) {
+               trace_mark(ust, bar, "str %d", i);
+               trace_mark(ust, bar2, "number1 %d number2 %d", (int)53, (int)9800);
+               usleep(20);
+       }
+
+       return 0;
+}
+MARKER_LIB;
diff --git a/tests/hello2/run b/tests/hello2/run
new file mode 100755 (executable)
index 0000000..6f5f5ba
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+UST_AUTOPROBE=1 UST_TRACE=1 LD_LIBRARY_PATH=../libust/.libs:../../liburcu $1 .libs/hello2
This page took 0.029886 seconds and 4 git commands to generate.