test block
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 20 Jun 2006 15:35:50 +0000 (15:35 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 20 Jun 2006 15:35:50 +0000 (15:35 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1939 04897980-b3bd-0310-b5e0-8ef037075253

ltt-usertrace/Makefile
ltt-usertrace/sample-block.c [new file with mode: 0644]

index c7ca3cf56d1dc6d0bbab627b86778e5ddd8673c3..c59c0edf6e294fcc386dad968802d2f92fa223be 100644 (file)
@@ -15,10 +15,12 @@ all: libs samples
 #SAMPLE PROGRAMS
 
 samples: sample sample-highspeed sample-printf \
-       sample-instrument-fct sample-thread-slow sample-thread-fast sample-thread-brand
+       sample-instrument-fct sample-thread-slow sample-thread-fast sample-thread-brand sample-block
 
 sample: sample.c ltt-facility-loader-user_generic.c
        $(CC) $(LTT_CFLAGS) $(CFLAGS) -o $@ $^
+sample-block: sample-block.c ltt-facility-loader-user_generic.c
+       $(CC) $(LTT_CFLAGS) $(CFLAGS) -o $@ $^
        
 sample-thread-brand: sample-thread-brand.c ltt-facility-loader-user_generic.c
        $(CC) $(LTT_CFLAGS) $(CFLAGS) -o $@ $^
diff --git a/ltt-usertrace/sample-block.c b/ltt-usertrace/sample-block.c
new file mode 100644 (file)
index 0000000..10c4bdd
--- /dev/null
@@ -0,0 +1,25 @@
+
+#include <stdio.h>
+#include <unistd.h>
+
+#define LTT_TRACE
+#define LTT_BLOCKING 1
+#include <ltt/ltt-facility-user_generic.h>
+
+
+int main(int argc, char **argv)
+{
+       printf("Will trace the following string : \"Hello world! Have a nice day.\"\n");
+       printf("every second.\n");
+       printf("Abort with CTRL-C.\n");
+       printf("No file is created with this example : it logs through a kernel\n");
+       printf("system call. See the LTTng lttctl command to start tracing.\n");
+
+       while(1) {
+               trace_user_generic_string("Hello world! Have a nice day.");
+               usleep(1);
+       }
+       
+       return 0;
+}
+
This page took 0.025113 seconds and 4 git commands to generate.