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
*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;
*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;
#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 {
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
--- /dev/null
+
+#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;
+}
+
#include <unistd.h>
#define LTT_TRACE
+#define LTT_BLOCKING 1
#include <ltt/ltt-facility-user_generic.h>