LIB_DIR?=/usr/lib
RANLIB=ranlib
-LTT_CFLAGS=-I. -O2 -L.
+LTT_CFLAGS=-I. -O2 -L. -fPIC
#For testing lib ltt-usertrace-fast
#CFLAGS+=-DLTT_SUBBUF_SIZE_CPU=134217728
samples: sample sample-highspeed sample-printf \
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: sample.c
+ $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-loader-user_generic -o $@ $^
+sample-block: sample-block.c
+ $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-loader-user_generic -o $@ $^
-sample-thread-brand: sample-thread-brand.c ltt-facility-loader-user_generic.c
- $(CC) $(LTT_CFLAGS) $(CFLAGS) -o $@ $^
+sample-thread-brand: sample-thread-brand.c
+ $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-loader-user_generic -o $@ $^
-sample-highspeed: sample-highspeed.c ltt-facility-loader-user_generic.c
- $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-usertrace-fast -o $@ $^
+sample-highspeed: sample-highspeed.c
+ $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-usertrace-fast -lltt-loader-user_generic -o $@ $^
-sample-printf: sample-printf.c ltt-facility-loader-user_generic.c
- $(CC) $(LTT_CFLAGS) $(CFLAGS) -o $@ $^
+sample-printf: sample-printf.c
+ $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-loader-user_generic -o $@ $^
sample-instrument-fct: sample-instrument-fct.c
$(CC) $(LTT_CFLAGS) $(CFLAGS) -g -finstrument-functions -lltt-instrument-functions -o $@ $^
-sample-thread-slow: sample-thread-slow.c ltt-facility-loader-user_generic.c
- $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -o $@ $^
+sample-thread-slow: sample-thread-slow.c
+ $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -lltt-loader-user_generic -o $@ $^
-sample-thread-fast: sample-thread-fast.c ltt-facility-loader-user_generic.c
- $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -lltt-usertrace-fast -o $@ $^
+sample-thread-fast: sample-thread-fast.c
+ $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -lltt-usertrace-fast -lltt-loader-user_generic -o $@ $^
#LIBRAIRIES
libs: libltt-instrument-functions.a libltt-instrument-functions.so.0 \
- libltt-usertrace-fast.a libltt-usertrace-fast.so.0
+ libltt-usertrace-fast.a libltt-usertrace-fast.so.0 \
+ libltt-loader-user_generic.a libltt-loader-user_generic.so.0
libltt-usertrace-fast.a: ltt-usertrace-fast.o
@rm -f libltt-usertrace-fast.a
$(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-instrument-functions.so -o $@ $^
ln -s libltt-instrument-functions.so.0 libltt-instrument-functions.so
+libltt-loader-user_generic.a: ltt-facility-loader-user_generic.o
+ @rm -f libltt-loader-user_generic.a
+ $(AR) rc $@ $^
+ $(RANLIB) $@
+
+libltt-loader-user_generic.so.0: ltt-facility-loader-user_generic.o
+ @rm -f libltt-loader-user_generic.so libltt-loader-user_generic.so.0
+ $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-loader-user_generic.so -o $@ $^
+ ln -s libltt-loader-user_generic.so.0 libltt-loader-user_generic.so
+
%.o: %.c
$(CC) $(LTT_CFLAGS) $(CFLAGS) -c -o $@ $+
install_libs:
cp -df libltt-instrument-functions.so* libltt-instrument-functions.a $(LIB_DIR)
cp -df libltt-usertrace-fast.so* libltt-usertrace-fast.a $(LIB_DIR)
+ cp -df libltt-loader-user_generic.so* libltt-loader-user_generic.a $(LIB_DIR)
install: install_headers libs install_libs
clean:
- 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* sample-thread-slow sample-thread-fast sample-thread-brand
+ 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* libltt-loader-user_generic.so* libltt-loader-user_generic.a sample-thread-slow sample-thread-fast sample-thread-brand
--- /dev/null
+#
+# Spec file for LTT Usertrace
+#
+Summary: Linux Trace Toolkit Userspace Tracing Package
+Name: ltt-usertrace
+Version: 0.13
+License: GPL
+Release: 1
+Group: Applications/Development
+Source: http://ltt.polymtl.ca/packages/%{name}-%{version}.tar.gz
+URL: http://ltt.polymtl.ca
+Packager: Martin Bisson <bissonm@discreet.com>
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+# Where do we install the libs
+%ifarch x86_64 ppc64 ppc64iseries ia64
+%define libdir /usr/lib64
+%else
+%define libdir /usr/lib
+%endif
+
+
+%description
+This packages makes it possible to do userspace tracing with the Linux
+Trace Toolkit.
+
+%prep
+%setup -q
+
+%build
+make libs
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT $RPM_BUILD_ROOT/usr/include $RPM_BUILD_ROOT/%{libdir}
+make INCLUDE_DIR=$RPM_BUILD_ROOT/usr/include LIB_DIR=$RPM_BUILD_ROOT/%{libdir} install
+
+%post
+echo "Running ldconfig (might take a while)"
+ldconfig
+
+%postun
+echo "Running ldconfig (might take a while)"
+ldconfig
+
+%files
+/usr/include/ltt
+/usr/include/ltt/atomic-ppc.h
+/usr/include/ltt/atomic-ppc64.h
+/usr/include/ltt/ltt-facility-custom-user_generic.h
+/usr/include/ltt/ltt-facility-id-user_generic.h
+/usr/include/ltt/ltt-facility-user_generic.h
+/usr/include/ltt/ltt-usertrace-fast.h
+/usr/include/ltt/ltt-usertrace-ppc.h
+/usr/include/ltt/ltt-usertrace.h
+/usr/include/ltt/ppc_asm-ppc.h
+/usr/include/ltt/system-ppc.h
+/usr/include/ltt/system-ppc64.h
+/usr/include/ltt/timex-ppc.h
+%{libdir}/libltt-instrument-functions.a
+%{libdir}/libltt-instrument-functions.so
+%{libdir}/libltt-instrument-functions.so.0
+%{libdir}/libltt-loader-user_generic.a
+%{libdir}/libltt-loader-user_generic.so
+%{libdir}/libltt-loader-user_generic.so.0
+%{libdir}/libltt-usertrace-fast.a
+%{libdir}/libltt-usertrace-fast.so
+%{libdir}/libltt-usertrace-fast.so.0