ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = libust hello libmallocwrap ustd ust
+SUBDIRS = libust tests libmallocwrap ustd ust
EXTRA_DIST = share/kernelcompat.h doc
AC_CONFIG_FILES([
Makefile
libust/Makefile
- hello/Makefile
+ tests/Makefile
+ tests/hello/Makefile
+ tests/hello2/Makefile
libmallocwrap/Makefile
ustd/Makefile
ust/Makefile
+++ /dev/null
-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
+++ /dev/null
-This is a hello world application used to test the LTTng userspace tracer.
+++ /dev/null
-#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;
+++ /dev/null
-#!/bin/sh
-
-UST_AUTOPROBE=1 UST_TRACE=1 LD_LIBRARY_PATH=../libust/.libs:../../liburcu $1 .libs/hello
+++ /dev/null
-#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);
-}
+++ /dev/null
-#include "tracepoint.h"
-
-DECLARE_TRACE(hello_tptest,
- TPPROTO(int anint),
- TPARGS(anint));
--- /dev/null
+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
--- /dev/null
+This is a hello world application used to test the LTTng userspace tracer.
--- /dev/null
+#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;
--- /dev/null
+#!/bin/sh
+
+UST_AUTOPROBE=1 UST_TRACE=1 LD_LIBRARY_PATH=../libust/.libs:../../liburcu $1 .libs/hello
--- /dev/null
+#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);
+}
--- /dev/null
+#include "tracepoint.h"
+
+DECLARE_TRACE(hello_tptest,
+ TPPROTO(int anint),
+ TPARGS(anint));
--- /dev/null
+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
--- /dev/null
+This is a hello world application used to test the LTTng userspace tracer.
--- /dev/null
+#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;
--- /dev/null
+#!/bin/sh
+
+UST_AUTOPROBE=1 UST_TRACE=1 LD_LIBRARY_PATH=../libust/.libs:../../liburcu $1 .libs/hello2