tests: add test-nevents
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Tue, 2 Mar 2010 05:46:31 +0000 (00:46 -0500)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Tue, 2 Mar 2010 05:46:31 +0000 (00:46 -0500)
configure.ac
tests/Makefile.am
tests/test-nevents/Makefile.am [new file with mode: 0644]
tests/test-nevents/prog.c [new file with mode: 0644]

index 514a1f4e9635077414d5ecd6c82ecda2771b579a..f0c99e6666d6e5c7dba81329c3a2738f5622eab4 100644 (file)
@@ -119,6 +119,7 @@ AC_CONFIG_FILES([
        tests/fork/Makefile
        tests/simple_include/Makefile
        tests/snprintf/Makefile
+       tests/test-nevents/Makefile
        libmallocwrap/Makefile
        libinterfork/Makefile
        ustd/Makefile
index abe446e2d9aaf81000271388cbdb34cfdf92df03..061f5e21b42efcf0907aedbd16545250f8ea07ee 100644 (file)
@@ -1 +1 @@
-SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf
+SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf test-nevents
diff --git a/tests/test-nevents/Makefile.am b/tests/test-nevents/Makefile.am
new file mode 100644 (file)
index 0000000..502d6c4
--- /dev/null
@@ -0,0 +1,5 @@
+#AM_CPPFLAGS = -I$(top_srcdir)/include
+
+noinst_PROGRAMS = prog
+prog_SOURCES = prog.c
+prog_LDADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o
diff --git a/tests/test-nevents/prog.c b/tests/test-nevents/prog.c
new file mode 100644 (file)
index 0000000..71c03e0
--- /dev/null
@@ -0,0 +1,23 @@
+#include <string.h>
+#include <stdlib.h>
+#include <ust/ust.h>
+
+#define N_ITER 100000
+
+int main()
+{
+       int i;
+       const char teststr[] = "Hello World! 1234567890abc";
+       void *ptrs[N_ITER];
+
+       for(i=0; i<N_ITER; i++) {
+               trace_mark(ust, an_event, "%d", i);
+               trace_mark(ust, another_event, "%s", "Hello, World!");
+       }
+
+//     ltt_trace_stop("auto");
+//     ltt_trace_destroy("auto");
+//     sleep(2);
+
+       return 0;
+}
This page took 0.02496 seconds and 4 git commands to generate.