add high speed blocking test
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 6 Mar 2006 07:09:46 +0000 (07:09 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 6 Mar 2006 07:09:46 +0000 (07:09 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1579 04897980-b3bd-0310-b5e0-8ef037075253

usertrace-generic/Makefile
usertrace-generic/ltt/ltt-facility-user_generic.h
usertrace-generic/ltt/ltt-generic.h
usertrace-generic/sample-highspeed.c [new file with mode: 0644]
usertrace-generic/sample.c

index 94a5a6a2517de0616863226c151d64db696ce2ca..8d02d71bbeac1d6925d9060c2d3d022f5e7c996c 100644 (file)
@@ -2,13 +2,16 @@
 
 CC=gcc
 
-all: sample-thread sample
+all: sample-thread sample sample-highspeed
 
 sample-thread: sample-thread.c ltt-facility-loader-user_generic.c
        $(CC) $(CFLAGS) -I. -lpthread -o $@ $^
 
 sample: sample.c ltt-facility-loader-user_generic.c
        $(CC) $(CFLAGS) -I. -o $@ $^
+       
+sample-highspeed: sample-highspeed.c ltt-facility-loader-user_generic.c
+       $(CC) $(CFLAGS) -I. -o $@ $^
 
 .PHONY : clean
 
index c5b9bd03999e2de272f983b8b352f0fdeffba5ad..1529fe2e0abb3bd1a1aa0b7d0034c277d2751188 100644 (file)
@@ -97,7 +97,7 @@ static inline int trace_user_generic_string(
                        *len = 0;
                }
 
-               ret = ltt_trace_generic(ltt_facility_user_generic_411B0F83, event_user_generic_string, stack_buffer, sizeof(stack_buffer));
+               ret = ltt_trace_generic(ltt_facility_user_generic_411B0F83, event_user_generic_string, stack_buffer, sizeof(stack_buffer), LTT_BLOCKING);
        }
 
        return ret;
@@ -226,7 +226,7 @@ static inline int trace_user_generic_string_pointer(
                        *len = 0;
                }
 
-               ret = ltt_trace_generic(ltt_facility_user_generic_411B0F83, event_user_generic_string_pointer, stack_buffer, sizeof(stack_buffer));
+               ret = ltt_trace_generic(ltt_facility_user_generic_411B0F83, event_user_generic_string_pointer, stack_buffer, sizeof(stack_buffer), LTT_BLOCKING);
        }
 
        return ret;
index ab9423d3464c51f370b2fd58c6af127ed4c18720..efa338c3ce8f7c702df02910445a8377f4fcde94 100644 (file)
 
 #define FACNAME_LEN 32
 
+/* LTT userspace tracing is non blocking by default when buffers are full */
+#ifndef LTT_BLOCKING
+#define LTT_BLOCKING 0
+#endif //LTT_BLOCKING
+                                                                                                                        
 typedef unsigned int ltt_facility_t;
 
 struct user_facility_info {
@@ -52,8 +57,8 @@ struct user_facility_info {
   size_t size_t_size;
 };
 
-static inline _syscall4(int, ltt_trace_generic, unsigned int, facility_id,
-               unsigned int, event_id, void *, data, size_t, data_size)
+static inline _syscall5(int, ltt_trace_generic, unsigned int, facility_id,
+               unsigned int, event_id, void *, data, size_t, data_size, int, blocking)
 static inline _syscall2(int, ltt_register_generic, unsigned int *, facility_id, const struct user_facility_info *, info)
 
 #ifndef LTT_PACK
diff --git a/usertrace-generic/sample-highspeed.c b/usertrace-generic/sample-highspeed.c
new file mode 100644 (file)
index 0000000..bd9ea37
--- /dev/null
@@ -0,0 +1,20 @@
+
+#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 : Running fast! in a infinite loop.\n");
+
+       while(1) {
+               trace_user_generic_string("Running fast!");
+       }
+       
+       return 0;
+}
+
index 7692ee72aeec2d3fbd4ab2eb0901fe52f29ce1c4..efe4110bfdb0c3bd652f3fc7f8fdffabcf5bed01 100644 (file)
@@ -3,6 +3,7 @@
 #include <unistd.h>
 
 #define LTT_TRACE
+#define LTT_BLOCKING 1
 #include <ltt/ltt-facility-user_generic.h>
 
 
This page took 0.026277 seconds and 4 git commands to generate.