From ce22b1be52bf65ec4bd8088714f7e4fa0e08efac Mon Sep 17 00:00:00 2001 From: compudj Date: Fri, 7 Jul 2006 18:16:35 +0000 Subject: [PATCH] make user_generic a lib git-svn-id: http://ltt.polymtl.ca/svn@1984 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt-usertrace/Makefile | 46 ++++++++++------- ltt-usertrace/ltt/ltt-usertrace.h | 12 +++++ ltt-usertrace/specs/ltt-usertrace.spec | 68 ++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 17 deletions(-) create mode 100644 ltt-usertrace/specs/ltt-usertrace.spec diff --git a/ltt-usertrace/Makefile b/ltt-usertrace/Makefile index c59c0edf..719f8432 100644 --- a/ltt-usertrace/Makefile +++ b/ltt-usertrace/Makefile @@ -4,7 +4,7 @@ INCLUDE_DIR=/usr/include 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 @@ -17,34 +17,35 @@ all: libs samples 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 @@ -66,6 +67,16 @@ libltt-instrument-functions.so.0: ltt-instrument-functions.o ltt-facility-loader $(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 $@ $+ @@ -78,9 +89,10 @@ install_headers: 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 diff --git a/ltt-usertrace/ltt/ltt-usertrace.h b/ltt-usertrace/ltt/ltt-usertrace.h index 373315ab..60a6aabc 100644 --- a/ltt-usertrace/ltt/ltt-usertrace.h +++ b/ltt-usertrace/ltt/ltt-usertrace.h @@ -29,6 +29,11 @@ #include #include #endif +#elif defined(__x86_64__) +#include +#include +#include +#include #else #include #include @@ -45,6 +50,13 @@ #define NR_syscalls 319 #endif +#ifdef __x86_64__ +#define __NR_ltt_trace_generic 279 +#define __NR_ltt_register_generic 280 +#undef NR_syscalls +#define NR_syscalls 281 +#endif + #ifdef __powerpc__ #define __NR_ltt_trace_generic 301 #define __NR_ltt_register_generic 302 diff --git a/ltt-usertrace/specs/ltt-usertrace.spec b/ltt-usertrace/specs/ltt-usertrace.spec new file mode 100644 index 00000000..0480933a --- /dev/null +++ b/ltt-usertrace/specs/ltt-usertrace.spec @@ -0,0 +1,68 @@ +# +# 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 +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 -- 2.34.1