LIB_DIR=/usr/lib
RANLIB=ranlib
LIB_DIR=/usr/lib
RANLIB=ranlib
-all: libltt-instrument-functions.a libltt-instrument-functions.so.0 sample-thread sample sample-highspeed sample-printf sample-instrument-fct
+CFLAGS=-I. -O3
+LDFLAGS=-L.
+
+#For testing lib ltt-usertrace-fast
+#CFLAGS+=-DLTT_SUBBUF_SIZE_CPU=134217728
+#CFLAGS+=-DLTT_NULL_OUTPUT_TEST
+
+all: libs samples
+
+
+libs: libltt-instrument-functions.a libltt-instrument-functions.so.0 \
+ libltt-usertrace-fast.a libltt-usertrace-fast.so.0
+
+samples: sample-thread sample sample-highspeed sample-printf \
+ sample-instrument-fct
sample-thread: sample-thread.c ltt-facility-loader-user_generic.c
$(CC) $(CFLAGS) -lpthread -o $@ $^
sample-thread: sample-thread.c ltt-facility-loader-user_generic.c
$(CC) $(CFLAGS) -lpthread -o $@ $^
$(CC) $(CFLAGS) -o $@ $^
sample-highspeed: sample-highspeed.c ltt-facility-loader-user_generic.c
$(CC) $(CFLAGS) -o $@ $^
sample-highspeed: sample-highspeed.c ltt-facility-loader-user_generic.c
- $(CC) $(CFLAGS) -o $@ $^
+ $(CC) $(CFLAGS) -L. -lltt-usertrace-fast -o $@ $^
sample-printf: sample-printf.c ltt-facility-loader-user_generic.c
$(CC) $(CFLAGS) -o $@ $^
sample-printf: sample-printf.c ltt-facility-loader-user_generic.c
$(CC) $(CFLAGS) -o $@ $^
sample-instrument-fct: sample-instrument-fct.c
$(CC) $(CFLAGS) -L. -g -finstrument-functions -lltt-instrument-functions -o $@ $^
sample-instrument-fct: sample-instrument-fct.c
$(CC) $(CFLAGS) -L. -g -finstrument-functions -lltt-instrument-functions -o $@ $^
-libltt-instrument-functions.a: ltt-instrument-functions.o ltt-facility-loader-user_generic.o
+libltt-usertrace-fast.a: ltt-usertrace-fast.o ltt-facility-loader-user_generic.o
+ @rm -f libltt-usertrace-fast.a
+ $(AR) rc $@ $^
+ $(RANLIB) $@
+
+libltt-usertrace-fast.so.0: ltt-usertrace-fast.o ltt-facility-loader-user_generic.o
+ @rm -f libltt-usertrace-fast.so libltt-usertrace-fast.so.0
+ $(CC) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-usertrace-fast.so -o $@ $^
+ ln -s libltt-usertrace-fast.so.0 libltt-usertrace-fast.so
+
+libltt-instrument-functions.a: ltt-instrument-functions.o ltt-facility-loader-user_generic.o ltt-usertrace-fast.o
@rm -f libltt-instrument-functions.a
$(AR) rc $@ $^
$(RANLIB) $@
@rm -f libltt-instrument-functions.a
$(AR) rc $@ $^
$(RANLIB) $@
-libltt-instrument-functions.so.0: ltt-instrument-functions.o ltt-facility-loader-user_generic.o
+libltt-instrument-functions.so.0: ltt-instrument-functions.o ltt-facility-loader-user_generic.o ltt-usertrace-fast.o
@rm -f libltt-instrument-functions.so libltt-instrument-functions.so.0
@rm -f libltt-instrument-functions.so libltt-instrument-functions.so.0
- $(CC) $(CFLAGS) -shared -Wl,-soname,libltt-instrument-functions.so -o $@ $^
+ $(CC) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-instrument-functions.so -o $@ $^
ln -s libltt-instrument-functions.so.0 libltt-instrument-functions.so
ln -s libltt-instrument-functions.so.0 libltt-instrument-functions.so
+.PHONY : clean install libs samples
install:
if [ ! -e "$(INCLUDE_DIR)/ltt" ] ; then mkdir $(INCLUDE_DIR)/ltt ; fi
cp -f ltt/*.h $(INCLUDE_DIR)/ltt
cp -df libltt-instrument-functions.so* libltt-instrument-functions.a $(LIB_DIR)
install:
if [ ! -e "$(INCLUDE_DIR)/ltt" ] ; then mkdir $(INCLUDE_DIR)/ltt ; fi
cp -f ltt/*.h $(INCLUDE_DIR)/ltt
cp -df libltt-instrument-functions.so* libltt-instrument-functions.a $(LIB_DIR)
+ cp -df libltt-usertrace-fast.so* libltt-usertrace-fast.a $(LIB_DIR)
- rm -fr *.o *~ sample-thread sample sample-highspeed sample-printf sample-instrument-fct libltt-instrument-functions.so* libltt-instrument-functions.a
+ rm -fr *.o *~ sample-thread sample sample-highspeed sample-printf sample-instrument-fct libltt-instrument-functions.so* libltt-instrument-functions.a libltt-usertrace-fast.a libltt-usertrace-fast.so.0
#define _GNU_SOURCE
#define LTT_TRACE
#define _GNU_SOURCE
#define LTT_TRACE
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
-#include <ltt/ltt-usertrace-fast.h>
+#include <ltt/ltt-usertrace.h>
#ifdef LTT_SHOW_DEBUG
#define dbg_printf(...) dbg_printf(__VA_ARGS__)
#ifdef LTT_SHOW_DEBUG
#define dbg_printf(...) dbg_printf(__VA_ARGS__)
#include <signal.h>
#include <ltt/ltt-facility-id-user_generic.h>
#include <signal.h>
#include <ltt/ltt-facility-id-user_generic.h>
-#include <ltt/ltt-generic.h>
#ifndef LTT_N_SUBBUFS
#define LTT_N_SUBBUFS 2
#ifndef LTT_N_SUBBUFS
#define LTT_N_SUBBUFS 2
#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new))
#endif //atomic_cmpxchg
#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new))
#endif //atomic_cmpxchg
-typedef unsigned int ltt_facility_t;
-
struct ltt_trace_header {
uint32_t magic_number;
uint32_t arch_type;
struct ltt_trace_header {
uint32_t magic_number;
uint32_t arch_type;
#include <sys/types.h>
#include <stdint.h>
#include <sys/types.h>
#include <stdint.h>
-#ifdef LTT_TRACE_FAST
-#include <ltt/ltt-usertrace-fast.h>
-#endif //LTT_TRACE_FAST
-
#ifndef min
#define min(a,b) ((a)<(b)?(a):(b))
#endif
#ifndef min
#define min(a,b) ((a)<(b)?(a):(b))
#endif
#define LTT_ALIGN __attribute__((packed))
#endif //LTT_PACK
#define LTT_ALIGN __attribute__((packed))
#endif //LTT_PACK
+#ifdef LTT_TRACE_FAST
+#include <ltt/ltt-usertrace-fast.h>
+#endif //LTT_TRACE_FAST
+
#endif //_LTT_USERTRACE_H
#endif //_LTT_USERTRACE_H