From e1d3bf7a0cd19a6b4b59462f58e7cbb7435d1650 Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Tue, 6 Jul 2004 01:22:18 +0000 Subject: [PATCH] Ported LLADD to Fedora, cleaned up autoconf setup, and numerouse #includes that were problematic. --- README | 5 + autoscan.log | 2 - configure.in | 33 ++- libdfa/Makefile | 309 --------------------- lladd/Makefile | 309 --------------------- lladd/bufferManager.h | 2 +- lladd/common.h | 103 +------ lladd/logger/logEntry.h | 2 +- lladd/logger/logger2.h | 3 - lladd/operations.h | 16 +- lladd/operations/alloc.h | 2 +- lladd/operations/decrement.h | 2 - lladd/operations/increment.h | 2 - lladd/operations/lladdhash.h | 18 +- lladd/page.h | 19 +- lladd/transactional.h | 2 +- m4/check.m4 | 133 +++++++++ pbl/Makefile | 309 --------------------- reconf | 8 +- src/apps/cyrus/Makefile | 457 ------------------------------- src/libdfa/messages.c | 2 +- src/lladd/Makefile.am | 2 +- src/lladd/blobManager.c | 50 ++-- src/lladd/blobManager.h | 2 +- src/lladd/bufferManager.c | 42 +-- src/lladd/common.c | 27 +- src/lladd/latches.h | 74 +++++ src/lladd/linkedlist.c | 7 +- src/lladd/logger/logEntry.c | 9 +- src/lladd/logger/logWriter.c | 80 ++++-- src/lladd/logger/logger2.c | 14 +- src/lladd/operations.c | 16 +- src/lladd/operations/alloc.c | 7 +- src/lladd/operations/lladdhash.c | 19 +- src/lladd/page.c | 41 +-- src/lladd/pageCache.c | 9 +- src/lladd/recovery2.c | 13 +- src/lladd/stats.c | 2 + src/lladd/transactional2.c | 19 +- test/2pc/Makefile.am | 2 +- test/check_includes.h | 2 + test/check_setup.h | 2 +- test/cht/Makefile.am | 2 +- test/cht/simple.c | 3 +- test/dfa/Makefile.am | 2 +- test/lladd-old/Makefile | 309 --------------------- test/lladd/Makefile.am | 2 +- test/lladd/check_logWriter.c | 8 +- test/monotree/Makefile.am | 2 +- utilities/Makefile.am | 2 +- utilities/logfile_dump.c | 4 +- 51 files changed, 471 insertions(+), 2040 deletions(-) delete mode 100644 autoscan.log delete mode 100644 libdfa/Makefile delete mode 100644 lladd/Makefile create mode 100644 m4/check.m4 delete mode 100644 pbl/Makefile delete mode 100644 src/apps/cyrus/Makefile create mode 100644 src/lladd/latches.h delete mode 100644 test/lladd-old/Makefile diff --git a/README b/README index 1ba5ce2..af2e1ea 100644 --- a/README +++ b/README @@ -19,6 +19,11 @@ after configure. We haven't tested make install. ;) +If you want to install check to a non-standard location, try this: + +./configure --with-check=/home/eecs/sears/check + + This package contains a copy of Peter Graf's Program Base Library, PBL, which is distributed under the terms of the LGPL. diff --git a/autoscan.log b/autoscan.log deleted file mode 100644 index 1dfb7b6..0000000 --- a/autoscan.log +++ /dev/null @@ -1,2 +0,0 @@ -autoscan: warning: missing AC_PROG_RANLIB wanted by: - ltmain.sh:6370 diff --git a/configure.in b/configure.in index 6b80e45..8ddf750 100644 --- a/configure.in +++ b/configure.in @@ -1,10 +1,8 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -PACKAGE=LLADD -VERSION=0.1 -AC_PREREQ(2.59) -AC_INIT(PACKAGE, VERSION, sears@cs.berkeley.edu) +AC_PREREQ(2.57) +AC_INIT(LLADD, 0.1, sears@cs.berkeley.edu) AM_INIT_AUTOMAKE(hello,0.1) AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_HEADER([config.h]) @@ -22,10 +20,15 @@ AC_PROG_LIBTOOL # Checks for libraries. -AM_PATH_CHECK(,[have_check="yes"], +#AM_PATH_CHECK(,[have_check="yes"], +# AC_MSG_WARN([Check not found; cannot run unit tests!]) +# [have_check="no"]) +#AM_CONDITIONAL(HAVE_CHECK, test x"$have_check", "xyes") + +AM_PATH_CHECK(,[have_check=true], AC_MSG_WARN([Check not found; cannot run unit tests!]) - [have_check="no"]) -AM_CONDITIONAL(HAVE_CHECK, test x"$have_check", "xyes") + [have_check=false]) +AM_CONDITIONAL(HAVE_CHECK, test x$have_check = xtrue) ## alas, it won't link if this is put in here.. instead, it's linked in manually in the test directory... @@ -42,11 +45,14 @@ AM_CONDITIONAL(HAVE_CHECK, test x"$have_check", "xyes") #AC_CHECK_LIB(efence,memalign) #fi +AC_CHECK_LIB([m], [sqrt]) +AC_CHECK_LIB([pthread], [pthread_create]) + # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h memory.h netdb.h netinet/in.h stddef.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h]) +AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h memory.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h errno.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -57,11 +63,8 @@ AC_HEADER_TIME # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_MEMCMP -AC_FUNC_MMAP AC_FUNC_STAT -AC_CHECK_FUNCS([bzero fdatasync getcwd gettimeofday inet_ntoa memmove memset mkdir munmap socket strchr strdup strerror strrchr strstr strtoul]) - -AC_CHECK_LIB(pthread, pthread_create) +AC_CHECK_FUNCS([bzero fdatasync getcwd gettimeofday inet_ntoa memmove memset mkdir socket sqrt strchr strdup strerror strrchr strstr strtoul]) AC_CONFIG_FILES([Makefile libdfa/Makefile @@ -76,13 +79,13 @@ AC_CONFIG_FILES([Makefile src/lladd/Makefile src/pbl/Makefile src/timing/Makefile - utilities/Makefile test/2pc/Makefile test/Makefile test/cht/Makefile test/dfa/Makefile - test/lladd/Makefile test/lladd-old/Makefile + test/lladd/Makefile test/messages/Makefile - test/monotree/Makefile]) + test/monotree/Makefile + utilities/Makefile]) AC_OUTPUT diff --git a/libdfa/Makefile b/libdfa/Makefile deleted file mode 100644 index 3103813..0000000 --- a/libdfa/Makefile +++ /dev/null @@ -1,309 +0,0 @@ -# Makefile.in generated by automake 1.8.5 from Makefile.am. -# libdfa/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - -srcdir = . -top_srcdir = .. - -pkgdatadir = $(datadir)/hello -pkglibdir = $(libdir)/hello -pkgincludedir = $(includedir)/hello -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = /usr/bin/install -c -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = i686-pc-linux-gnu -subdir = libdfa -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/morph/lladd/missing --run aclocal-1.8 -AMDEP_FALSE = # -AMDEP_TRUE = -AMTAR = ${SHELL} /home/morph/lladd/missing --run tar -AR = ar -AUTOCONF = ${SHELL} /home/morph/lladd/missing --run autoconf -AUTOHEADER = ${SHELL} /home/morph/lladd/missing --run autoheader -AUTOMAKE = ${SHELL} /home/morph/lladd/missing --run automake-1.8 -AWK = gawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CHECK_CFLAGS = -CHECK_LIBS = -lcheck -CPP = gcc -E -CPPFLAGS = -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -O2 -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -ECHO = echo -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = grep -E -EXEEXT = -F77 = g77 -FFLAGS = -g -O2 -HAVE_CHECK_FALSE = # -HAVE_CHECK_TRUE = -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -LDFLAGS = -LIBOBJS = -LIBS = -lpthread -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /home/morph/lladd/missing --run makeinfo -OBJEXT = o -PACKAGE = hello -PACKAGE_BUGREPORT = sears@cs.berkeley.edu -PACKAGE_NAME = PACKAGE -PACKAGE_STRING = PACKAGE VERSION -PACKAGE_TARNAME = package -PACKAGE_VERSION = VERSION -PATH_SEPARATOR = : -RANLIB = ranlib -SET_MAKE = -SHELL = /bin/sh -STRIP = strip -VERSION = 0.1 -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_F77 = g77 -ac_ct_RANLIB = ranlib -ac_ct_STRIP = strip -am__fastdepCC_FALSE = # -am__fastdepCC_TRUE = -am__fastdepCXX_FALSE = # -am__fastdepCXX_TRUE = -am__include = include -am__leading_dot = . -am__quote = -bindir = ${exec_prefix}/bin -build = i686-pc-linux-gnu -build_alias = -build_cpu = i686 -build_os = linux-gnu -build_vendor = pc -datadir = ${prefix}/share -exec_prefix = ${prefix} -host = i686-pc-linux-gnu -host_alias = -host_cpu = i686 -host_os = linux-gnu -host_vendor = pc -includedir = ${prefix}/include -infodir = ${prefix}/info -install_sh = /home/morph/lladd/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localstatedir = ${prefix}/var -mandir = ${prefix}/man -mkdir_p = mkdir -p -- . -oldincludedir = /usr/include -prefix = /usr/local -program_transform_name = s,x,x, -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -sysconfdir = ${prefix}/etc -target_alias = -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libdfa/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu libdfa/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/lladd/Makefile b/lladd/Makefile deleted file mode 100644 index 66617a2..0000000 --- a/lladd/Makefile +++ /dev/null @@ -1,309 +0,0 @@ -# Makefile.in generated by automake 1.8.5 from Makefile.am. -# lladd/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - -srcdir = . -top_srcdir = .. - -pkgdatadir = $(datadir)/hello -pkglibdir = $(libdir)/hello -pkgincludedir = $(includedir)/hello -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = /usr/bin/install -c -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = i686-pc-linux-gnu -subdir = lladd -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/morph/lladd/missing --run aclocal-1.8 -AMDEP_FALSE = # -AMDEP_TRUE = -AMTAR = ${SHELL} /home/morph/lladd/missing --run tar -AR = ar -AUTOCONF = ${SHELL} /home/morph/lladd/missing --run autoconf -AUTOHEADER = ${SHELL} /home/morph/lladd/missing --run autoheader -AUTOMAKE = ${SHELL} /home/morph/lladd/missing --run automake-1.8 -AWK = gawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CHECK_CFLAGS = -CHECK_LIBS = -lcheck -CPP = gcc -E -CPPFLAGS = -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -O2 -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -ECHO = echo -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = grep -E -EXEEXT = -F77 = g77 -FFLAGS = -g -O2 -HAVE_CHECK_FALSE = # -HAVE_CHECK_TRUE = -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -LDFLAGS = -LIBOBJS = -LIBS = -lpthread -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /home/morph/lladd/missing --run makeinfo -OBJEXT = o -PACKAGE = hello -PACKAGE_BUGREPORT = sears@cs.berkeley.edu -PACKAGE_NAME = PACKAGE -PACKAGE_STRING = PACKAGE VERSION -PACKAGE_TARNAME = package -PACKAGE_VERSION = VERSION -PATH_SEPARATOR = : -RANLIB = ranlib -SET_MAKE = -SHELL = /bin/sh -STRIP = strip -VERSION = 0.1 -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_F77 = g77 -ac_ct_RANLIB = ranlib -ac_ct_STRIP = strip -am__fastdepCC_FALSE = # -am__fastdepCC_TRUE = -am__fastdepCXX_FALSE = # -am__fastdepCXX_TRUE = -am__include = include -am__leading_dot = . -am__quote = -bindir = ${exec_prefix}/bin -build = i686-pc-linux-gnu -build_alias = -build_cpu = i686 -build_os = linux-gnu -build_vendor = pc -datadir = ${prefix}/share -exec_prefix = ${prefix} -host = i686-pc-linux-gnu -host_alias = -host_cpu = i686 -host_os = linux-gnu -host_vendor = pc -includedir = ${prefix}/include -infodir = ${prefix}/info -install_sh = /home/morph/lladd/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localstatedir = ${prefix}/var -mandir = ${prefix}/man -mkdir_p = mkdir -p -- . -oldincludedir = /usr/include -prefix = /usr/local -program_transform_name = s,x,x, -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -sysconfdir = ${prefix}/etc -target_alias = -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lladd/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu lladd/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/lladd/bufferManager.h b/lladd/bufferManager.h index 06155f9..1940494 100644 --- a/lladd/bufferManager.h +++ b/lladd/bufferManager.h @@ -110,7 +110,7 @@ Page loadPage(int pageid); * @param size The size of the new record * @return allocated record */ -recordid ralloc(int xid, size_t size); +recordid ralloc(int xid, long size); /** * Find a page with some free space. diff --git a/lladd/common.h b/lladd/common.h index 410fd44..05783d6 100644 --- a/lladd/common.h +++ b/lladd/common.h @@ -44,7 +44,15 @@ terms specified in this license. * * A standard header file, adopted from Autobook. * - * @todo: Need to make sure everyone actually includes this thing, and also includes constants.h + * The idea behind this file is twofold. First, we want to keep as + * much of the #ifdef portability nonsense in here as possible. + * Second, we allow users to #include headers that in turn #include + * common.h. If they do so, then their code should continue to 'do + * the right thing' and build, even though they do not #include the + * config.h file that all of the LLADD stuff uses. + * + * @todo: Need to make sure everyone actually includes this thing, and + * also includes constants.h * * @ingroup LLADD_CORE * @@ -68,9 +76,6 @@ terms specified in this license. # include "config.h" #endif */ -#include -#include - #if STDC_HEADERS # include # include @@ -91,18 +96,13 @@ extern int errno; #endif #define byte unsigned char -#define lsn_t off_t - - +#define lsn_t long #define DEBUGGING -/** - @todo Currently, latches obtained using rw.h are not currently profiled. -*/ #define PROFILE_LATCHES - #ifdef DEBUGGING +/** @todo Files that use DEBUG have to pull in stdio.h, which is a pain! */ #define DEBUG(...) \ printf(__VA_ARGS__); fflush(NULL) #else @@ -110,86 +110,5 @@ extern int errno; #endif /*DEBUGGING*/ - - -#include -#include -#include - -/** - @todo Is it useful to track per-line spin counts? -*/ -/*typedef struct { - double sum_x_hold; - double sum_xsquared_hold; - long max_hold; - long count; -} lladd_locking_profile_tuple; -*/ - -/** - A data structure for profiling latching behavior. - - All time values recorded in this struct are in microseconds. - */ -typedef struct { - const char * file; - int line; - const char * name; - pthread_mutex_t mutex; - profile_tuple tup; - char * last_acquired_at; - pblHashTable_t * lockpoints; -} lladd_pthread_mutex_t; - -#include - -/** - Keeps some profiling information along with a read/write lock. -*/ - -typedef struct { - const char * file; - int line; - rwl * lock; - profile_tuple tup; - char * last_acquired_at; - pblHashTable_t * lockpoints; -} __profile_rwl; - -#ifdef PROFILE_LATCHES - -#define pthread_mutex_t lladd_pthread_mutex_t - -#define pthread_mutex_init(x, y) __lladd_pthread_mutex_init((x), (y), __FILE__, __LINE__, #x) -#define pthread_mutex_destroy(x) __lladd_pthread_mutex_destroy((x)) -#define pthread_mutex_lock(x) __lladd_pthread_mutex_lock((x), __FILE__, __LINE__) -#define pthread_mutex_unlock(x) __lladd_pthread_mutex_unlock((x)) -#define pthread_mutex_trylock(x) NO_PROFILING_EQUIVALENT_TO_PTHREAD_TRYLOCK - -int __lladd_pthread_mutex_init(lladd_pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr, const char * file, int line, const char * mutex_name); -int __lladd_pthread_mutex_lock(lladd_pthread_mutex_t *mutex, char * file, int line); -int __lladd_pthread_mutex_unlock(lladd_pthread_mutex_t *mutex); -int __lladd_pthread_mutex_destroy(lladd_pthread_mutex_t *mutex); - -#define initlock() __profile_rw_initlock(__FILE__, __LINE__) -#define readlock(x, y) __profile_readlock((x),(y), __FILE__, __LINE__) -#define writelock(x, y) __profile_writelock((x), (y), __FILE__, __LINE__) -#define readunlock(x) __profile_readunlock((x)) -#define writeunlock(x) __profile_writeunlock((x)) -#define deletelock(x) __profile_deletelock((x)) - -#define rwl __profile_rwl - -rwl *__profile_rw_initlock (char * file, int line); -void __profile_readlock (rwl *lock, int d, char * file, int line); -void __profile_writelock (rwl *lock, int d, char * file, int line); -void __profile_readunlock (rwl *lock); -void __profile_writeunlock (rwl *lock); -void __profile_deletelock (rwl *lock); - - -#endif - #endif /* __lladd_common_h */ diff --git a/lladd/logger/logEntry.h b/lladd/logger/logEntry.h index 4b66954..b5c3318 100644 --- a/lladd/logger/logEntry.h +++ b/lladd/logger/logEntry.h @@ -120,7 +120,7 @@ LogEntry * allocCLRLogEntry (lsn_t prevLSN, int xid, -size_t sizeofLogEntry(const LogEntry * log); +long sizeofLogEntry(const LogEntry * log); const byte * getUpdateArgs(const LogEntry * log); const byte * getUpdatePreImage(const LogEntry * log); diff --git a/lladd/logger/logger2.h b/lladd/logger/logger2.h index 0f55aa3..a5dd88b 100644 --- a/lladd/logger/logger2.h +++ b/lladd/logger/logger2.h @@ -53,11 +53,8 @@ terms specified in this license. #ifndef __LOGGER2_H__ #define __LOGGER2_H__ -/*#include "logEntry.h" -#include "logHandle.h"*/ #include - /** A callback function that allows logHandle's iterator to stop returning log entries depending on the context in which it was diff --git a/lladd/operations.h b/lladd/operations.h index 90a6078..4c33118 100644 --- a/lladd/operations.h +++ b/lladd/operations.h @@ -52,14 +52,8 @@ terms specified in this license. #ifndef __OPERATIONS_H__ #define __OPERATIONS_H__ -/*#include */ -/*#include "common.h"*/ - - - - #include -#include +/*#include */ #include BEGIN_C_DECLS @@ -91,7 +85,7 @@ typedef struct { takes. If set to SIZEOF_RECORD, then the size of the record that the operation affects will be used instead. */ - size_t sizeofData; + long sizeofData; /** Does this operation supply an undo operation? @@ -132,8 +126,10 @@ typedef struct { } Operation; /* These need to be installed, since they are required by applications that use LLADD. */ -/*#include "constants.h" - #include */ +/*#include "constants.h"*/ + +/*#include */ +/*#include "logger/logEntry.h"*/ #include "operations/increment.h" #include "operations/decrement.h" diff --git a/lladd/operations/alloc.h b/lladd/operations/alloc.h index f678079..369c0bc 100644 --- a/lladd/operations/alloc.h +++ b/lladd/operations/alloc.h @@ -5,7 +5,7 @@ Operation getAlloc(); Operation getDealloc(); -recordid Talloc(int xid, size_t size); +recordid Talloc(int xid, long size); void Tdealloc(int xid, recordid rid); #endif diff --git a/lladd/operations/decrement.h b/lladd/operations/decrement.h index 3a9ebeb..1f0bb80 100644 --- a/lladd/operations/decrement.h +++ b/lladd/operations/decrement.h @@ -54,9 +54,7 @@ terms specified in this license. #ifndef __DECREMENT_H__ #define __DECREMENT_H__ -/*#include "../constants.h"*/ #include -/*#include "../bufferManager.h"*/ #define Tdecrement(xid,rid) Tupdate(xid,rid,0, OPERATION_DECREMENT) diff --git a/lladd/operations/increment.h b/lladd/operations/increment.h index a766278..7611531 100644 --- a/lladd/operations/increment.h +++ b/lladd/operations/increment.h @@ -57,9 +57,7 @@ terms specified in this license. #ifndef __INCREMENT_H__ #define __INCREMENT_H__ -/*#include "../constants.h"*/ #include -/*#include "../bufferManager.h"*/ #define Tincrement(xid,rid) Tupdate(xid,rid,0, OPERATION_INCREMENT) diff --git a/lladd/operations/lladdhash.h b/lladd/operations/lladdhash.h index 287986a..9f12400 100644 --- a/lladd/operations/lladdhash.h +++ b/lladd/operations/lladdhash.h @@ -27,16 +27,14 @@ #ifndef __LLADDHASH_H__ #define __LLADDHASH_H__ -/*#include "../transactional.h"*/ - #include #define MAX_LLADDHASHES 1000 typedef struct { recordid store; - size_t keylen; - size_t datlen; + int keylen; + long datlen; recordid next; } lladdHashItem_t; @@ -55,21 +53,21 @@ typedef struct { lladdHash_t * lHtCreate(int xid, int size); int lHtValid(int xid, lladdHash_t *ht); -int lHtLookup( int xid, lladdHash_t *ht, const void *key, size_t keylen, void *buf ); +int lHtLookup( int xid, lladdHash_t *ht, const void *key, int keylen, void *buf ); int lHtFirst( int xid, lladdHash_t *ht, void *buf ); int lHtNext( int xid, lladdHash_t *ht, void *buf ); int lHtCurrent( int xid, lladdHash_t *ht, void *buf); int lHtCurrentKey(int xid, lladdHash_t *ht, void *buf); int lHtDelete(int xid, lladdHash_t *ht); -int lHtPosition( int xid, lladdHash_t *ht, const void *key, size_t key_length ); +int lHtPosition( int xid, lladdHash_t *ht, const void *key, int key_length ); /* These two are the only ones that result in a log entry... */ /* - int _lHtInsert(int xid, lladdHash_t *ht, const void *key, size_t keylen, void * dat, size_t datlen); - int _lHtRemove( int xid, lladdHash_t *ht, const void *key, size_t keylen, void *buf ); + int _lHtInsert(int xid, lladdHash_t *ht, const void *key, int keylen, void * dat, long datlen); + int _lHtRemove( int xid, lladdHash_t *ht, const void *key, int keylen, void *buf ); */ -int lHtInsert(int xid, lladdHash_t *ht, const void *key, size_t keylen, void * dat, size_t datlen); -int lHtRemove( int xid, lladdHash_t *ht, const void *key, size_t keylen, void *buf, size_t buflen); +int lHtInsert(int xid, lladdHash_t *ht, const void *key, int keylen, void * dat, long datlen); +int lHtRemove( int xid, lladdHash_t *ht, const void *key, int keylen, void *buf, long buflen); Operation getLHInsert(); Operation getLHRemove(); diff --git a/lladd/page.h b/lladd/page.h index 1eab362..8471a5e 100644 --- a/lladd/page.h +++ b/lladd/page.h @@ -58,16 +58,13 @@ terms specified in this license. BEGIN_C_DECLS -#include -/*#include */ - /** * represents how to look up a record on a page */ typedef struct { int page; int slot; - size_t size; + long size; } recordid; @@ -108,14 +105,24 @@ long pageReadLSN(Page page); * parameter a Page, and returns an estimate of the amount of free space on this * page. This is either exact, or an underestimate. */ -size_t freespace(Page page); +int freespace(Page page); /** * assumes that the page is already loaded in memory. It takes as * parameters a Page and the size in bytes of the new record. pageRalloc() * returns a recordid representing the newly allocated record. + * + * NOTE: might want to pad records to be multiple of words in length, or, simply + * make sure all records start word aligned, but not necessarily having + * a length that is a multiple of words. (Since Tread(), Twrite() ultimately + * call memcpy(), this shouldn't be an issue) + * + * NOTE: pageRalloc() assumes that the caller already made sure that sufficient + * amount of freespace exists in this page. (@see freespace()) + * + * @todo Makes no attempt to reuse old recordid's. */ -recordid pageRalloc(Page page, size_t size); +recordid pageRalloc(Page page, int size); void pageWriteRecord(int xid, Page page, recordid rid, const byte *data); diff --git a/lladd/transactional.h b/lladd/transactional.h index 1c94961..965c6e2 100644 --- a/lladd/transactional.h +++ b/lladd/transactional.h @@ -147,7 +147,7 @@ int Tcommit(int xid); * @returns A new recordid. On success, this recordid's size will be * the requested size. On failure, its size will be zero. */ -recordid Talloc(int xid, size_t size); +recordid Talloc(int xid, long size); /* @function Tabort * @param xid transaction ID diff --git a/m4/check.m4 b/m4/check.m4 new file mode 100644 index 0000000..97bfd9c --- /dev/null +++ b/m4/check.m4 @@ -0,0 +1,133 @@ +dnl AM_PATH_CHECK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS +dnl + +AC_DEFUN(AM_PATH_CHECK, +[ + AC_ARG_WITH(check, + [ --with-check=PATH prefix where check is installed [default=auto]]) + + min_check_version=ifelse([$1], ,0.8.2,$1) + + AC_MSG_CHECKING(for check - version >= $min_check_version) + + if test x$with_check = xno; then + AC_MSG_RESULT(disabled) + ifelse([$3], , AC_MSG_ERROR([disabling check is not supported]), [$3]) + else + if test "x$with_check" != x; then + CHECK_CFLAGS="-I$with_check/include" + CHECK_LIBS="-L$with_check/lib -lcheck" + else + CHECK_CFLAGS="" + CHECK_LIBS="-lcheck" + fi + + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + + CFLAGS="$CFLAGS $CHECK_CFLAGS" + LIBS="$CHECK_LIBS $LIBS" + + rm -f conf.check-test + AC_TRY_RUN([ +#include +#include + +#include + +int main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.check-test"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = strdup("$min_check_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_check_version"); + return 1; + } + + if ((CHECK_MAJOR_VERSION != check_major_version) || + (CHECK_MINOR_VERSION != check_minor_version) || + (CHECK_MICRO_VERSION != check_micro_version)) + { + printf("\n*** The check header file (version %d.%d.%d) does not match\n", + CHECK_MAJOR_VERSION, CHECK_MINOR_VERSION, CHECK_MICRO_VERSION); + printf("*** the check library (version %d.%d.%d).\n", + check_major_version, check_minor_version, check_micro_version); + return 1; + } + + if ((check_major_version > major) || + ((check_major_version == major) && (check_minor_version > minor)) || + ((check_major_version == major) && (check_minor_version == minor) && (check_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of check (%d.%d.%d) was found.\n", + check_major_version, check_minor_version, check_micro_version); + printf("*** You need a version of check being at least %d.%d.%d.\n", major, minor, micro); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the check library and header\n"); + printf("*** file is being found. Rerun configure with the --with-check=PATH option\n"); + printf("*** to specify the prefix where the correct version was installed.\n"); + } + + return 1; +} +],, no_check=yes, [echo $ac_n "cross compiling; assumed OK... $ac_c"]) + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + + if test "x$no_check" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test -f conf.check-test ; then + : + else + echo "*** Could not run check test program, checking why..." + CFLAGS="$CFLAGS $CHECK_CFLAGS" + LIBS="$CHECK_LIBS $LIBS" + AC_TRY_LINK([ +#include +#include + +#include +], , [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding check. You'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for" + echo "*** the exact error that occured." ]) + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + + CHECK_CFLAGS="" + CHECK_LIBS="" + + rm -f conf.check-test + ifelse([$3], , AC_MSG_ERROR([check not found]), [$3]) + fi + + AC_SUBST(CHECK_CFLAGS) + AC_SUBST(CHECK_LIBS) + + rm -f conf.check-test + + fi +]) diff --git a/pbl/Makefile b/pbl/Makefile deleted file mode 100644 index 0f82885..0000000 --- a/pbl/Makefile +++ /dev/null @@ -1,309 +0,0 @@ -# Makefile.in generated by automake 1.8.5 from Makefile.am. -# pbl/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - -srcdir = . -top_srcdir = .. - -pkgdatadir = $(datadir)/hello -pkglibdir = $(libdir)/hello -pkgincludedir = $(includedir)/hello -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = /usr/bin/install -c -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = i686-pc-linux-gnu -subdir = pbl -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/morph/lladd/missing --run aclocal-1.8 -AMDEP_FALSE = # -AMDEP_TRUE = -AMTAR = ${SHELL} /home/morph/lladd/missing --run tar -AR = ar -AUTOCONF = ${SHELL} /home/morph/lladd/missing --run autoconf -AUTOHEADER = ${SHELL} /home/morph/lladd/missing --run autoheader -AUTOMAKE = ${SHELL} /home/morph/lladd/missing --run automake-1.8 -AWK = gawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CHECK_CFLAGS = -CHECK_LIBS = -lcheck -CPP = gcc -E -CPPFLAGS = -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -O2 -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -ECHO = echo -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = grep -E -EXEEXT = -F77 = g77 -FFLAGS = -g -O2 -HAVE_CHECK_FALSE = # -HAVE_CHECK_TRUE = -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -LDFLAGS = -LIBOBJS = -LIBS = -lpthread -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /home/morph/lladd/missing --run makeinfo -OBJEXT = o -PACKAGE = hello -PACKAGE_BUGREPORT = sears@cs.berkeley.edu -PACKAGE_NAME = PACKAGE -PACKAGE_STRING = PACKAGE VERSION -PACKAGE_TARNAME = package -PACKAGE_VERSION = VERSION -PATH_SEPARATOR = : -RANLIB = ranlib -SET_MAKE = -SHELL = /bin/sh -STRIP = strip -VERSION = 0.1 -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_F77 = g77 -ac_ct_RANLIB = ranlib -ac_ct_STRIP = strip -am__fastdepCC_FALSE = # -am__fastdepCC_TRUE = -am__fastdepCXX_FALSE = # -am__fastdepCXX_TRUE = -am__include = include -am__leading_dot = . -am__quote = -bindir = ${exec_prefix}/bin -build = i686-pc-linux-gnu -build_alias = -build_cpu = i686 -build_os = linux-gnu -build_vendor = pc -datadir = ${prefix}/share -exec_prefix = ${prefix} -host = i686-pc-linux-gnu -host_alias = -host_cpu = i686 -host_os = linux-gnu -host_vendor = pc -includedir = ${prefix}/include -infodir = ${prefix}/info -install_sh = /home/morph/lladd/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localstatedir = ${prefix}/var -mandir = ${prefix}/man -mkdir_p = mkdir -p -- . -oldincludedir = /usr/include -prefix = /usr/local -program_transform_name = s,x,x, -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -sysconfdir = ${prefix}/etc -target_alias = -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pbl/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu pbl/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/reconf b/reconf index 9bc63df..9436469 100755 --- a/reconf +++ b/reconf @@ -1,11 +1,9 @@ #!/bin/sh rm -f config.cache rm -f acconfig.h -#touch acconfig.h -#aclocal -I m4 -aclocal-1.8 +aclocal -I m4 autoconf autoheader -#acconfig -automake-1.8 -a +libtoolize --automake +automake -a exit diff --git a/src/apps/cyrus/Makefile b/src/apps/cyrus/Makefile deleted file mode 100644 index a0253bc..0000000 --- a/src/apps/cyrus/Makefile +++ /dev/null @@ -1,457 +0,0 @@ -# Makefile.in generated by automake 1.8.5 from Makefile.am. -# src/apps/cyrus/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - -SOURCES = cyrusdb_lladd.c - -srcdir = . -top_srcdir = ../../.. - -pkgdatadir = $(datadir)/hello -pkglibdir = $(libdir)/hello -pkgincludedir = $(includedir)/hello -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = /usr/bin/install -c -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = i686-pc-linux-gnu -subdir = src/apps/cyrus -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -am__installdirs = "$(DESTDIR)$(libdir)" -libLIBRARIES_INSTALL = $(INSTALL_DATA) -LIBRARIES = $(lib_LIBRARIES) -ARFLAGS = cru -libcyrusdb_lladd_a_AR = $(AR) $(ARFLAGS) -libcyrusdb_lladd_a_LIBADD = -am_libcyrusdb_lladd_a_OBJECTS = cyrusdb_lladd.$(OBJEXT) -libcyrusdb_lladd_a_OBJECTS = $(am_libcyrusdb_lladd_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -DEP_FILES = ./$(DEPDIR)/cyrusdb_lladd.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libcyrusdb_lladd_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/morph/lladd/missing --run aclocal-1.8 -AMDEP_FALSE = # -AMDEP_TRUE = -AMTAR = ${SHELL} /home/morph/lladd/missing --run tar -AR = ar -AUTOCONF = ${SHELL} /home/morph/lladd/missing --run autoconf -AUTOHEADER = ${SHELL} /home/morph/lladd/missing --run autoheader -AUTOMAKE = ${SHELL} /home/morph/lladd/missing --run automake-1.8 -AWK = gawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CHECK_CFLAGS = -CHECK_LIBS = -lcheck -CPP = gcc -E -CPPFLAGS = -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -O2 -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -ECHO = echo -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = grep -E -EXEEXT = -F77 = g77 -FFLAGS = -g -O2 -HAVE_CHECK_FALSE = # -HAVE_CHECK_TRUE = -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -LDFLAGS = -LIBOBJS = -LIBS = -lpthread -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /home/morph/lladd/missing --run makeinfo -OBJEXT = o -PACKAGE = hello -PACKAGE_BUGREPORT = sears@cs.berkeley.edu -PACKAGE_NAME = PACKAGE -PACKAGE_STRING = PACKAGE VERSION -PACKAGE_TARNAME = package -PACKAGE_VERSION = VERSION -PATH_SEPARATOR = : -RANLIB = ranlib -SET_MAKE = -SHELL = /bin/sh -STRIP = strip -VERSION = 0.1 -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_F77 = g77 -ac_ct_RANLIB = ranlib -ac_ct_STRIP = strip -am__fastdepCC_FALSE = # -am__fastdepCC_TRUE = -am__fastdepCXX_FALSE = # -am__fastdepCXX_TRUE = -am__include = include -am__leading_dot = . -am__quote = -bindir = ${exec_prefix}/bin -build = i686-pc-linux-gnu -build_alias = -build_cpu = i686 -build_os = linux-gnu -build_vendor = pc -datadir = ${prefix}/share -exec_prefix = ${prefix} -host = i686-pc-linux-gnu -host_alias = -host_cpu = i686 -host_os = linux-gnu -host_vendor = pc -includedir = ${prefix}/include -infodir = ${prefix}/info -install_sh = /home/morph/lladd/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localstatedir = ${prefix}/var -mandir = ${prefix}/man -mkdir_p = mkdir -p -- . -oldincludedir = /usr/include -prefix = /usr/local -program_transform_name = s,x,x, -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -sysconfdir = ${prefix}/etc -target_alias = -LDADD = $(top_builddir)/build/libdfa.a $(top_builddir)/build/lib2pc.a -SOURCES = cyrusdb_lladd.c -lib_LIBRARIES = libcyrusdb_lladd.a -libcyrusdb_lladd_a_SOURCES = cyrusdb_lladd.c -AM_CFLAGS = -g -Wall -pedantic -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/apps/cyrus/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/apps/cyrus/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-libLIBRARIES: $(lib_LIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ - else :; fi; \ - done - @$(POST_INSTALL) - @list='$(lib_LIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - p="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \ - $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \ - else :; fi; \ - done - -uninstall-libLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LIBRARIES)'; for p in $$list; do \ - p="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - rm -f "$(DESTDIR)$(libdir)/$$p"; \ - done - -clean-libLIBRARIES: - -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) -libcyrusdb_lladd.a: $(libcyrusdb_lladd_a_OBJECTS) $(libcyrusdb_lladd_a_DEPENDENCIES) - -rm -f libcyrusdb_lladd.a - $(libcyrusdb_lladd_a_AR) libcyrusdb_lladd.a $(libcyrusdb_lladd_a_OBJECTS) $(libcyrusdb_lladd_a_LIBADD) - $(RANLIB) libcyrusdb_lladd.a - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -include ./$(DEPDIR)/cyrusdb_lladd.Po - -.c.o: - if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ - then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -# source='$<' object='$@' libtool=no \ -# depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ -# $(CCDEPMODE) $(depcomp) \ -# $(COMPILE) -c $< - -.c.obj: - if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ - then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -# source='$<' object='$@' libtool=no \ -# depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ -# $(CCDEPMODE) $(depcomp) \ -# $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: - if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ - then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -# source='$<' object='$@' libtool=yes \ -# depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \ -# $(CCDEPMODE) $(depcomp) \ -# $(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(libdir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: install-libLIBRARIES - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-libLIBRARIES - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLIBRARIES clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am \ - install-libLIBRARIES install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ - uninstall-libLIBRARIES - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/libdfa/messages.c b/src/libdfa/messages.c index ddb74de..17bd6ae 100644 --- a/src/libdfa/messages.c +++ b/src/libdfa/messages.c @@ -39,7 +39,7 @@ authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. ---*/ -#include +/*#include */ #include #include #include diff --git a/src/lladd/Makefile.am b/src/lladd/Makefile.am index e2b9f5e..d3b4787 100644 --- a/src/lladd/Makefile.am +++ b/src/lladd/Makefile.am @@ -3,6 +3,6 @@ lib_LIBRARIES=liblladd.a #liblladd_a_LIBADD=logger/liblogger.a operations/liboperations.a # removed: recovery.c transactional.c logger.c logger/logparser.c logger/logstreamer.c -liblladd_a_SOURCES=common.c stats.c bufferManager.c linkedlist.c operations.c pageCache.c page.c blobManager.c recovery2.c transactional2.c logger/logEntry.c logger/logWriter.c logger/logHandle.c logger/logger2.c operations/decrement.c operations/increment.c operations/lladdhash.c operations/prepare.c operations/set.c operations/alloc.c +liblladd_a_SOURCES=common.c stats.c bufferManager.c linkedlist.c operations.c pageCache.c page.c blobManager.c recovery2.c transactional2.c logger/logEntry.c logger/logWriter.c logger/logHandle.c logger/logger2.c operations/decrement.c operations/increment.c operations/prepare.c operations/set.c operations/alloc.c #operations/lladdhash.c AM_CFLAGS= -g -Wall -pedantic -std=gnu99 diff --git a/src/lladd/blobManager.c b/src/lladd/blobManager.c index 862d3ad..daebda8 100644 --- a/src/lladd/blobManager.c +++ b/src/lladd/blobManager.c @@ -1,19 +1,16 @@ -#include -#include -#include -#include -#include -#include +#include +#include + +#include -#include #include #include -#include #include #include "blobManager.h" +#include - +#include static FILE * blobf0 = NULL, * blobf1 = NULL; /** @@ -28,7 +25,8 @@ static pblHashTable_t * dirtyBlobs; static void readRawRecord(int xid, recordid rid, void * buf, int size) { recordid blob_rec_rid = rid; blob_rec_rid.size = size; - readRecord(xid, blob_rec_rid, buf); + /*readRecord(xid, blob_rec_rid, buf);*/ + Tread(xid, blob_rec_rid, buf); } static void writeRawRecord(int xid, recordid rid, const void * buf, int size) { @@ -41,31 +39,17 @@ static void writeRawRecord(int xid, recordid rid, const void * buf, int size) { /* moved verbatim from bufferManger.c, then hacked up to use FILE * instead of ints. */ void openBlobStore() { - int blobfd0, blobfd1; + + /* the r+ mode opens an existing file read /write */ if( ! (blobf0 = fopen(BLOB0_FILE, "r+"))) { /* file may not exist */ - if( (blobfd0 = creat(BLOB0_FILE, 0666)) == -1 ) { /* cannot even create it */ - printf("ERROR: %i on %s line %d", errno, __FILE__, __LINE__); - perror("Creating blob 0 file"); abort(); - } - if( close(blobfd0)) { - printf("ERROR: %i on %s line %d", errno, __FILE__, __LINE__); - perror(NULL); abort(); - } - if(!(blobf0 = fopen(BLOB0_FILE, "r+"))) { perror("Couldn't open or create blob 0 file"); abort(); } + /* the w+ mode truncates, creates, and opens read / write */ + if(!(blobf0 = fopen(BLOB0_FILE, "w+"))) { perror("Couldn't open or create blob 0 file"); abort(); } } DEBUG("blobf0 opened.\n"); if( ! (blobf1 = fopen(BLOB1_FILE, "r+"))) { /* file may not exist */ - if( (blobfd1 = creat(BLOB1_FILE, 0666)) == -1 ) { /* cannot even create it */ - printf("ERROR: %i on %s line %d", errno, __FILE__, __LINE__); - perror("Creating blob 1 file"); abort(); - } - if( close(blobfd1)) { - printf("ERROR: %i on %s line %d", errno, __FILE__, __LINE__); - perror(NULL); abort(); - } - if(!(blobf1 = fopen(BLOB1_FILE, "r+"))) { perror("Couldn't open or create blob 1 file"); abort(); } + if(!(blobf1 = fopen(BLOB1_FILE, "w+"))) { perror("Couldn't open or create blob 1 file"); abort(); } } DEBUG("blobf1 opened.\n"); @@ -102,14 +86,14 @@ long myFseek(FILE * f, long offset, int whence) { return ret; } -recordid preAllocBlob(int xid, size_t blobSize) { +recordid preAllocBlob(int xid, long blobSize) { long fileSize = myFseek(blobf1, 0, SEEK_END); blob_record_t blob_rec; Page p; /* char zero = 0; */ /* Allocate space for the blob entry. */ - DEBUG("Allocing blob (size %d)\n", blobSize); + DEBUG("Allocing blob (size %ld)\n", blobSize); assert(blobSize > 0); /* Don't support zero length blobs right now... */ @@ -153,7 +137,7 @@ void allocBlob(int xid, lsn_t lsn, recordid rid) { /* recordid rid = preAllocBlob(xid, blobSize); */ /* Allocate space for the blob entry. */ - DEBUG("post Allocing blob (size %d)\n", rid.size); + DEBUG("post Allocing blob (size %ld)\n", rid.size); assert(rid.size > 0); /* Don't support zero length blobs right now... */ @@ -280,7 +264,7 @@ void writeBlob(int xid, lsn_t lsn, recordid rid, const void * buf) { FILE * fd; int readcount; - DEBUG("Writing blob (size %d)\n", rid.size); + DEBUG("Writing blob (size %ld)\n", rid.size); /* Tread() raw record */ diff --git a/src/lladd/blobManager.h b/src/lladd/blobManager.h index ed73af1..06b5665 100644 --- a/src/lladd/blobManager.h +++ b/src/lladd/blobManager.h @@ -72,7 +72,7 @@ typedef struct { } blob_record_t; -recordid preAllocBlob(int xid, size_t blobsize); +recordid preAllocBlob(int xid, long blobsize); /** Allocate a blob of size blobSize. diff --git a/src/lladd/bufferManager.c b/src/lladd/bufferManager.c index 1272e29..fd67d42 100644 --- a/src/lladd/bufferManager.c +++ b/src/lladd/bufferManager.c @@ -44,27 +44,16 @@ terms specified in this license. * * implementation of the page buffer * *************************************************/ -#include + +#include +#include + #include -#include -#include -#include -#include #include -#include -#include -#include - -#include #include -#include -#include - #include "blobManager.h" - #include - #include static FILE * stable = NULL; @@ -131,27 +120,18 @@ void pageWrite(const Page * ret) { } static void openPageFile() { - int stable_fd; DEBUG("Opening storefile.\n"); if( ! (stable = fopen(STORE_FILE, "r+"))) { /* file may not exist */ byte* zero = calloc(1, PAGE_SIZE); - DEBUG("Creating new page storefile.\n"); - - if( (stable_fd = creat(STORE_FILE, 0666)) == -1 ) { /* cannot even create it */ - printf("ERROR: %i on %s line %d", errno, __FILE__, __LINE__); - perror("Creating store file"); abort(); - } - if( close(stable_fd)) { - printf("ERROR: %i on %s line %d", errno, __FILE__, __LINE__); - perror(NULL); abort(); - } - if(!(stable = fopen(STORE_FILE, "r+"))) { perror("Couldn't open or create store file"); abort(); } + if(!(stable = fopen(STORE_FILE, "w+"))) { perror("Couldn't open or create store file"); abort(); } /* Write out one page worth of zeros to get started. */ if(1 != fwrite(zero, PAGE_SIZE, 1, stable)) { assert (0); } + + free(zero); } lastFreepage = 0; @@ -273,7 +253,7 @@ Page loadPage (int pageid) { Page * lastRallocPage = 0; -recordid ralloc(int xid, /*lsn_t lsn,*/ size_t size) { +recordid ralloc(int xid, /*lsn_t lsn,*/ long size) { recordid ret; Page p; @@ -292,7 +272,7 @@ recordid ralloc(int xid, /*lsn_t lsn,*/ size_t size) { ret = pageRalloc(p, size); /* } */ - DEBUG("alloced rid = {%d, %d, %d}\n", ret.page, ret.slot, ret.size); + DEBUG("alloced rid = {%d, %d, %ld}\n", ret.page, ret.slot, ret.size); return ret; } long readLSN(int pageid) { @@ -326,10 +306,10 @@ void writeRecord(int xid, lsn_t lsn, recordid rid, const void *dat) { } void readRecord(int xid, recordid rid, void *buf) { if(rid.size > BLOB_THRESHOLD_SIZE) { - DEBUG("Reading blob. xid = %d rid = { %d %d %d } buf = %x\n", xid, rid.page, rid.slot, rid.size, (unsigned int)buf); + DEBUG("Reading blob. xid = %d rid = { %d %d %ld } buf = %x\n", xid, rid.page, rid.slot, rid.size, (unsigned int)buf); readBlob(xid, rid, buf); } else { - DEBUG("Reading record xid = %d rid = { %d %d %d } buf = %x\n", xid, rid.page, rid.slot, rid.size, (unsigned int)buf); + DEBUG("Reading record xid = %d rid = { %d %d %ld } buf = %x\n", xid, rid.page, rid.slot, rid.size, (unsigned int)buf); pageReadRecord(xid, loadPage(rid.page), rid, buf); } } diff --git a/src/lladd/common.c b/src/lladd/common.c index bd2f0c9..cf7d8a4 100644 --- a/src/lladd/common.c +++ b/src/lladd/common.c @@ -1,18 +1,14 @@ #define _GNU_SOURCE +#include #include + +#include "latches.h" + +#include #include -#include -#include - - -#include -#include -#include - #undef pthread_mutex_t - #undef pthread_mutex_init #undef pthread_mutex_destroy #undef pthread_mutex_lock @@ -42,9 +38,16 @@ int __lladd_pthread_mutex_lock(lladd_pthread_mutex_t *mutex, char * file, int li char * location; int location_length = asprintf(&location, "%s %d", file, line); + /* DEBUG("Acquire mutex: %s %d\n", file, line);*/ + while(EBUSY == (ret = pthread_mutex_trylock(&(mutex->mutex)))) { blockCount ++; pthread_yield(); + + if(blockCount > 10000) { + DEBUG("Spinning at %s:%d, %ld times\n", file, line, blockCount); + } + } @@ -135,6 +138,9 @@ __profile_rwl *__profile_rw_initlock (char * file, int line) { @todo For now, we only profile write locks... */ void __profile_readlock (__profile_rwl *lock, int d, char * file, int line) { + + /* DEBUG("Read lock: %s %d\n", file, line); */ + readlock(lock->lock, d); } @@ -145,6 +151,9 @@ void __profile_writelock (__profile_rwl *lock, int d, char * file, int line) { profile_tuple * tup; + /* DEBUG("Write lock: %s %d\n", file, line); */ + + /** @todo Should we spin instead of using the more efficient rwl implementation, or should we see how many times we were woken before obtaining the lock? */ diff --git a/src/lladd/latches.h b/src/lladd/latches.h new file mode 100644 index 0000000..6bbf6f4 --- /dev/null +++ b/src/lladd/latches.h @@ -0,0 +1,74 @@ +#include +#include + +/** @todo threading should be moved into its own header file. */ +#include + +/*#include -- Don't want everything that touches threading to include pbl... */ +#include + +/** + A data structure for profiling latching behavior. + All time values recorded in this struct are in microseconds. + */ +typedef struct { + const char * file; + int line; + const char * name; + pthread_mutex_t mutex; + profile_tuple tup; + char * last_acquired_at; + /* pblHashTable_t * lockpoints; */ + void * lockpoints; +} lladd_pthread_mutex_t; + +#include + +/** + Keeps some profiling information along with a read/write lock. +*/ + +typedef struct { + const char * file; + int line; + rwl * lock; + profile_tuple tup; + char * last_acquired_at; + /* pblHashTable_t * lockpoints; */ + void * lockpoints; +} __profile_rwl; + +#ifdef PROFILE_LATCHES + +#define pthread_mutex_t lladd_pthread_mutex_t + +#define pthread_mutex_init(x, y) __lladd_pthread_mutex_init((x), (y), __FILE__, __LINE__, #x) +#define pthread_mutex_destroy(x) __lladd_pthread_mutex_destroy((x)) +#define pthread_mutex_lock(x) __lladd_pthread_mutex_lock((x), __FILE__, __LINE__) +#define pthread_mutex_unlock(x) __lladd_pthread_mutex_unlock((x)) +#define pthread_mutex_trylock(x) NO_PROFILING_EQUIVALENT_TO_PTHREAD_TRYLOCK + +int __lladd_pthread_mutex_init(lladd_pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr, const char * file, int line, const char * mutex_name); +int __lladd_pthread_mutex_lock(lladd_pthread_mutex_t *mutex, char * file, int line); +int __lladd_pthread_mutex_unlock(lladd_pthread_mutex_t *mutex); +int __lladd_pthread_mutex_destroy(lladd_pthread_mutex_t *mutex); + +#define initlock() __profile_rw_initlock(__FILE__, __LINE__) +#define readlock(x, y) __profile_readlock((x),(y), __FILE__, __LINE__) +#define writelock(x, y) __profile_writelock((x), (y), __FILE__, __LINE__) +#define readunlock(x) __profile_readunlock((x)) +#define writeunlock(x) __profile_writeunlock((x)) +#define deletelock(x) __profile_deletelock((x)) + +#define rwl __profile_rwl + +rwl *__profile_rw_initlock (char * file, int line); +void __profile_readlock (rwl *lock, int d, char * file, int line); +void __profile_writelock (rwl *lock, int d, char * file, int line); +void __profile_readunlock (rwl *lock); +void __profile_writeunlock (rwl *lock); +void __profile_deletelock (rwl *lock); + + +#endif + diff --git a/src/lladd/linkedlist.c b/src/lladd/linkedlist.c index 6afa927..730f5ce 100644 --- a/src/lladd/linkedlist.c +++ b/src/lladd/linkedlist.c @@ -44,12 +44,13 @@ terms specified in this license. * * simple linked list *****************************/ - -#include -#include +#include +#include #include "linkedlist.h" +#include + #ifndef NULL #define NULL 0 #endif diff --git a/src/lladd/logger/logEntry.c b/src/lladd/logger/logEntry.c index d610e39..cd277a2 100644 --- a/src/lladd/logger/logEntry.c +++ b/src/lladd/logger/logEntry.c @@ -39,13 +39,14 @@ authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. ---*/ + +#include +#include + #include #include #include -#include -#include -#include LogEntry * allocCommonLogEntry(lsn_t prevLSN, int xid, unsigned int type) { LogEntry * ret = malloc(sizeof(struct __raw_log_entry)); @@ -116,7 +117,7 @@ LogEntry * allocCLRLogEntry (lsn_t prevLSN, int xid, -size_t sizeofLogEntry(const LogEntry * log) { +long sizeofLogEntry(const LogEntry * log) { switch (log->type) { case CLRLOG: return sizeof(struct __raw_log_entry) + sizeof(CLRLogEntry); diff --git a/src/lladd/logger/logWriter.c b/src/lladd/logger/logWriter.c index e314d8a..2ecbb14 100644 --- a/src/lladd/logger/logWriter.c +++ b/src/lladd/logger/logWriter.c @@ -39,15 +39,16 @@ authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. ---*/ +#include +#include + #include #include -#include -#include -#include -#include -#include -#include +#include "../latches.h" + +#include +#include /** @todo Should the log file be global? */ @@ -91,7 +92,16 @@ static lsn_t global_offset; if it needs the file position to be preserved across calls. (For example, when using fseek(); myFseek() does this, but only internally, so if it is used to position the stream, it should be - guarded with flockfile(). + guarded with flockfile(). Unfortunately, it appears as though we + cannot use flockfile() on some systems, because this sequence does + not behave correctly: + + flockfile(foo); + fclose(foo); + fopen(foo); + funlockfile(foo); + + Oh well. */ static rwl * log_read_lock; @@ -101,7 +111,7 @@ static rwl * log_read_lock; the tail of the old log to the new log, until after the rename call returns. */ -pthread_mutex_t log_write_mutex; +pthread_mutex_t log_write_mutex; /** Invariant: We only want one thread in truncateLog at a time. @@ -109,10 +119,11 @@ pthread_mutex_t log_write_mutex; pthread_mutex_t truncateLog_mutex; + /** @todo Put myFseek, myFwrite in their own file, and make a header for it... */ -void myFwrite(const void * dat, size_t size, FILE * f); +void myFwrite(const void * dat, long size, FILE * f); long myFseek(FILE * f, long offset, int whence); int openLogWriter() { log = fopen(LOG_FILE, "a+"); @@ -190,7 +201,7 @@ int openLogWriter() { */ int writeLogEntry(LogEntry * e) { int nmemb; - const size_t size = sizeofLogEntry(e); + const long size = sizeofLogEntry(e); if(e->xid == -1) { /* Don't write log entries for recovery xacts. */ @@ -212,11 +223,13 @@ int writeLogEntry(LogEntry * e) { lh = getLSNHandle(nextAvailableLSN); while((le = nextInLog(&lh))) { - nextAvailableLSN = le->LSN + sizeofLogEntry(le) + sizeof(size_t);; + nextAvailableLSN = le->LSN + sizeofLogEntry(le) + sizeof(long);; free(le); } } + writelock(log_read_lock, 100); + /* Set the log entry's LSN. */ #ifdef DEBUGGING @@ -229,14 +242,15 @@ int writeLogEntry(LogEntry * e) { e->LSN = nextAvailableLSN; - flockfile(log); /* Prevent other threads from calling fseek... */ + /* We have the write lock, so no-one else can call fseek behind our back. */ + /* flockfile(log); */ /* Prevent other threads from calling fseek... */ fseek(log, nextAvailableLSN - global_offset, SEEK_SET); - nextAvailableLSN += (size + sizeof(size_t)); + nextAvailableLSN += (size + sizeof(long)); /* Print out the size of this log entry. (not including this item.) */ - nmemb = fwrite(&size, sizeof(size_t), 1, log); + nmemb = fwrite(&size, sizeof(long), 1, log); if(nmemb != 1) { perror("writeLog couldn't write next log entry size!"); @@ -252,9 +266,10 @@ int writeLogEntry(LogEntry * e) { return FILE_WRITE_ERROR; } - funlockfile(log); + /* funlockfile(log); */ pthread_mutex_unlock(&log_write_mutex); + writeunlock(log_read_lock); /* We're done. */ return 0; @@ -301,7 +316,7 @@ void closeLogWriter() { deletelock(flushedLSN_lock); deletelock(nextAvailableLSN_lock); deletelock(log_read_lock); - pthread_mutex_destroy(&log_write_mutex); + pthread_mutex_destroy(&log_write_mutex); } @@ -311,7 +326,7 @@ void deleteLogWriter() { static LogEntry * readLogEntry() { LogEntry * ret = NULL; - size_t size, entrySize; + long size, entrySize; int nmemb; @@ -319,7 +334,7 @@ static LogEntry * readLogEntry() { return NULL; } - nmemb = fread(&size, sizeof(size_t), 1, log); + nmemb = fread(&size, sizeof(long), 1, log); if(nmemb != 1) { if(feof(log)) { @@ -377,11 +392,15 @@ LogEntry * readLSNEntry(lsn_t LSN) { /* readlock(log_read_lock); */ - flockfile(log); + /* Irritating overhead; two mutex acquires to do a read. */ + readlock(log_read_lock, 200); + + flockfile(log); fseek(log, LSN - global_offset, SEEK_SET); ret = readLogEntry(); funlockfile(log); - /* readunlock(log_read_lock); */ + + readunlock(log_read_lock); return ret; @@ -397,7 +416,7 @@ int truncateLog(lsn_t LSN) { long size; - int count; + /* int count; */ pthread_mutex_lock(&truncateLog_mutex); @@ -435,13 +454,16 @@ int truncateLog(lsn_t LSN) { pthread_mutex_lock(&log_write_mutex); lh = getLSNHandle(LSN); - + + while((le = nextInLog(&lh))) { size = sizeofLogEntry(le); myFwrite(&size, sizeof(lsn_t), tmpLog); myFwrite(le, size, tmpLog); free (le); } + + writelock(log_read_lock, 300); fflush(tmpLog); #ifdef HAVE_FDATASYNC @@ -452,7 +474,7 @@ int truncateLog(lsn_t LSN) { /** Time to shut out the readers */ - flockfile(log); + /* flockfile(log); --- Don't need this; we hold the writelock. */ fclose(log); /* closeLogWriter calls sync, but we don't need to. :) */ fclose(tmpLog); @@ -470,12 +492,14 @@ int truncateLog(lsn_t LSN) { return FILE_WRITE_OPEN_ERROR; } - myFseek(log, 0, SEEK_SET); - count = fread(&global_offset, sizeof(lsn_t), 1, log); - assert(count == 1); + /* myFseek(log, 0, SEEK_SET); */ + global_offset = LSN - sizeof(lsn_t); /*= fread(&global_offset, sizeof(lsn_t), 1, log);*/ + /*assert(count == 1); */ - funlockfile(log); + /* funlockfile(log); */ + writeunlock(log_read_lock); pthread_mutex_unlock(&log_write_mutex); + pthread_mutex_unlock(&truncateLog_mutex); return 0; @@ -486,7 +510,7 @@ lsn_t firstLogEntry() { return global_offset + sizeof(lsn_t); } -void myFwrite(const void * dat, size_t size, FILE * f) { +void myFwrite(const void * dat, long size, FILE * f) { int nmemb = fwrite(dat, size, 1, f); /* test */ if(nmemb != 1) { diff --git a/src/lladd/logger/logger2.c b/src/lladd/logger/logger2.c index d6694a0..51bfbf1 100644 --- a/src/lladd/logger/logger2.c +++ b/src/lladd/logger/logger2.c @@ -40,13 +40,13 @@ permission to use and distribute the software in accordance with the terms specified in this license. ---*/ -#include +#include +#include + #include #include -#include - -#include - +#include +#include TransactionLog LogTransBegin(int xid) { TransactionLog tl; tl.xid = xid; @@ -83,7 +83,7 @@ lsn_t LogTransAbort(TransactionLog * l) { LogEntry * LogUpdate(TransactionLog * l, recordid rid, int operation, const byte * args) { void * preImage = NULL; - size_t argSize = 0; + long argSize = 0; LogEntry * e; if(operationsTable[operation].sizeofData == SIZEOF_RECORD) { @@ -93,7 +93,7 @@ LogEntry * LogUpdate(TransactionLog * l, recordid rid, int operation, const byte } if(operationsTable[operation].undo == NO_INVERSE) { - DEBUG("Creating %d byte physical pre-image.\n", rid.size); + DEBUG("Creating %ld byte physical pre-image.\n", rid.size); preImage = malloc(rid.size); if(!preImage) { perror("malloc"); abort(); } readRecord(l->xid, rid, preImage); diff --git a/src/lladd/operations.c b/src/lladd/operations.c index 38e1ec7..4903c23 100644 --- a/src/lladd/operations.c +++ b/src/lladd/operations.c @@ -45,6 +45,8 @@ terms specified in this license. #include #include +#include + Operation operationsTable[MAX_OPERATIONS]; void doUpdate(const LogEntry * e) { @@ -61,10 +63,10 @@ void redoUpdate(const LogEntry * e) { recordid rid = e->contents.update.rid; #endif if(e->LSN > pageLSN) { - DEBUG("OPERATION Redo, %ld > %ld {%d %d %d}\n", e->LSN, pageLSN, rid.page, rid.slot, rid.size); + DEBUG("OPERATION Redo, %ld > %ld {%d %d %ld}\n", e->LSN, pageLSN, rid.page, rid.slot, rid.size); doUpdate(e); } else { - DEBUG("OPERATION Skipping redo, %ld <= %ld {%d %d %d}\n", e->LSN, pageLSN, rid.page, rid.slot, rid.size); + DEBUG("OPERATION Skipping redo, %ld <= %ld {%d %d %ld}\n", e->LSN, pageLSN, rid.page, rid.slot, rid.size); } } else if(e->type == CLRLOG) { LogEntry * f = readLSNEntry(e->contents.clr.thisUpdateLSN); @@ -75,10 +77,10 @@ void redoUpdate(const LogEntry * e) { doesn't, then undo the original operation. */ if(f->LSN > readLSN(e->contents.update.rid.page)) { - DEBUG("OPERATION Undoing for clr, %ld {%d %d %d}\n", f->LSN, rid.page, rid.slot, rid.size); + DEBUG("OPERATION Undoing for clr, %ld {%d %d %ld}\n", f->LSN, rid.page, rid.slot, rid.size); undoUpdate(f, e->LSN); } else { - DEBUG("OPERATION Skiping undo for clr, %ld {%d %d %d}\n", f->LSN, rid.page, rid.slot, rid.size); + DEBUG("OPERATION Skiping undo for clr, %ld {%d %d %ld}\n", f->LSN, rid.page, rid.slot, rid.size); } } else { assert(0); @@ -102,16 +104,16 @@ void undoUpdate(const LogEntry * e, lsn_t clr_lsn) { if(undo == NO_INVERSE) { /* Physical undo */ - DEBUG("OPERATION Physical undo, %ld {%d %d %d}\n", e->LSN, rid.page, rid.slot, rid.size); + DEBUG("OPERATION Physical undo, %ld {%d %d %ld}\n", e->LSN, rid.page, rid.slot, rid.size); writeRecord(e->xid, clr_lsn, e->contents.update.rid, getUpdatePreImage(e)); } else { /* @see doUpdate() */ /* printf("Logical undo"); fflush(NULL); */ - DEBUG("OPERATION Logical undo, %ld {%d %d %d}\n", e->LSN, rid.page, rid.slot, rid.size); + DEBUG("OPERATION Logical undo, %ld {%d %d %ld}\n", e->LSN, rid.page, rid.slot, rid.size); operationsTable[undo].run(e->xid, clr_lsn, e->contents.update.rid, getUpdateArgs(e)); } } else { - DEBUG("OPERATION Skipping undo, %ld {%d %d %d}\n", e->LSN, rid.page, rid.slot, rid.size); + DEBUG("OPERATION Skipping undo, %ld {%d %d %ld}\n", e->LSN, rid.page, rid.slot, rid.size); } /* printf("Undo done."); fflush(NULL); */ diff --git a/src/lladd/operations/alloc.c b/src/lladd/operations/alloc.c index 65eba34..ec381fb 100644 --- a/src/lladd/operations/alloc.c +++ b/src/lladd/operations/alloc.c @@ -1,4 +1,9 @@ +#include +#include + #include + +#include #include #include #include "../blobManager.h" @@ -50,7 +55,7 @@ Operation getAlloc() { } -recordid Talloc(int xid, size_t size) { +recordid Talloc(int xid, long size) { recordid rid; if(size >= BLOB_THRESHOLD_SIZE) { diff --git a/src/lladd/operations/lladdhash.c b/src/lladd/operations/lladdhash.c index 21acea0..98ae853 100644 --- a/src/lladd/operations/lladdhash.c +++ b/src/lladd/operations/lladdhash.c @@ -1,13 +1,12 @@ +#include +#include + #include +#include +#include #include #include -#include -#include - - -#include - static const recordid ZERO_RECORDID = {0,0,0}; typedef struct { @@ -190,7 +189,7 @@ int _lHtInsert(int xid, recordid garbage, lladdHashRec_t * arg) { return 0; } /**Todo: ht->iterData is global to the hash table... seems like a bad idea! */ -int lHtPosition( int xid, lladdHash_t *ht, const void *key, size_t key_length ) { +int lHtPosition( int xid, lladdHash_t *ht, const void *key, int key_length ) { int index = hash(key, key_length, ht->size); recordid rid = _getHashMap(xid, ht)[index]; @@ -221,7 +220,7 @@ int lHtPosition( int xid, lladdHash_t *ht, const void *key, size_t key_length ) } } -int lHtLookup( int xid, lladdHash_t *ht, const void *key, size_t keylen, void *buf ) { +int lHtLookup( int xid, lladdHash_t *ht, const void *key, int keylen, void *buf ) { int index = hash(key, keylen, ht->size); recordid rid = _getHashMap(xid, ht)[index]; @@ -378,7 +377,7 @@ int lHtDelete(int xid, lladdHash_t *ht) { } -int lHtInsert(int xid, lladdHash_t *ht, const void *key, size_t keylen, void *dat, size_t datlen) { +int lHtInsert(int xid, lladdHash_t *ht, const void *key, int keylen, void *dat, long datlen) { recordid rid; void * log_r; lladdHashRec_t lir; @@ -401,7 +400,7 @@ int lHtInsert(int xid, lladdHash_t *ht, const void *key, size_t keylen, void *da return 0; } -int lHtRemove( int xid, lladdHash_t *ht, const void *key, size_t keylen, void *buf, size_t buflen ) { +int lHtRemove( int xid, lladdHash_t *ht, const void *key, int keylen, void *buf, long buflen ) { recordid rid; void * log_r; diff --git a/src/lladd/page.c b/src/lladd/page.c index b93615b..c3d5bf8 100644 --- a/src/lladd/page.c +++ b/src/lladd/page.c @@ -45,22 +45,14 @@ terms specified in this license. * implementation of pages ************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -/*#include "linkedlist.h"*/ +#include +#include #include -#include + +#include +#include + +#include /* TODO: Combine with buffer size... */ static int nextPage = 0; @@ -243,7 +235,7 @@ void pageWriteLSN(Page page) { * in the page, minus the size of a new slot entry.) This is either exact, * or an underestimate. */ -size_t freespace(Page page) { +int freespace(Page page) { int space = (slotMemAddr(page.memAddr, readNumSlots(page.memAddr)) - (page.memAddr + readFreeSpace(page.memAddr))); return (space < 0) ? 0 : space; } @@ -284,22 +276,7 @@ static void writeNumSlots(byte *memAddr, int numSlots) { setFirstHalfOfWord((int*)(unsigned int*)(memAddr + START_OF_NUMSLOTS), numSlots); } -/** - * pageRalloc() assumes that the page is already loaded in memory. It takes - * as parameters a Page and the size in bytes of the new record. pageRalloc() - * returns a recordid representing the newly allocated record. - * - * NOTE: might want to pad records to be multiple of words in length, or, simply - * make sure all records start word aligned, but not necessarily having - * a length that is a multiple of words. (Since Tread(), Twrite() ultimately - * call memcpy(), this shouldn't be an issue) - * - * NOTE: pageRalloc() assumes that the caller already made sure that sufficient - * amount of freespace exists in this page. (@see freespace()) - * - * @todo Makes no attempt to reuse old recordid's. - */ -recordid pageRalloc(Page page, size_t size) { +recordid pageRalloc(Page page, int size) { int freeSpace = readFreeSpace(page.memAddr); int numSlots = readNumSlots(page.memAddr); recordid rid; diff --git a/src/lladd/pageCache.c b/src/lladd/pageCache.c index 7f2e65f..84b809f 100644 --- a/src/lladd/pageCache.c +++ b/src/lladd/pageCache.c @@ -5,14 +5,15 @@ allows bufferManager's implementation to focus on providing atomic writes, and locking. */ +#include +#include #include +#include + #include #include -#include -#include -#include -#include +#include static pblHashTable_t *activePages; /* page lookup */ static unsigned int bufferSize; /* < MAX_BUFFER_SIZE */ diff --git a/src/lladd/recovery2.c b/src/lladd/recovery2.c index b350d9c..d5fbdbf 100644 --- a/src/lladd/recovery2.c +++ b/src/lladd/recovery2.c @@ -8,16 +8,23 @@ */ +#include +#include + +#include + #include #include "linkedlist.h" -#include #include -#include +#include #include -#include +#include + +#include #include + /** @todo This include is an artifact of our lack of infrastructure to support log iterator guards. */ #include diff --git a/src/lladd/stats.c b/src/lladd/stats.c index 52ce1bc..e039f52 100644 --- a/src/lladd/stats.c +++ b/src/lladd/stats.c @@ -1,4 +1,6 @@ +#include #include +#include "latches.h" #include diff --git a/src/lladd/transactional2.c b/src/lladd/transactional2.c index 31b1c60..e1ffc70 100644 --- a/src/lladd/transactional2.c +++ b/src/lladd/transactional2.c @@ -1,12 +1,15 @@ +#include +#include + #include -#include -#include -#include + #include -#include -#include #include -#include +#include +#include + +#include +#include TransactionLog XactionTable[MAX_TRANSACTIONS]; int numActiveXactions = 0; @@ -21,8 +24,8 @@ void setupOperationsTable() { operationsTable[OPERATION_INCREMENT] = getIncrement(); operationsTable[OPERATION_DECREMENT] = getDecrement(); operationsTable[OPERATION_PREPARE] = getPrepare(); - operationsTable[OPERATION_LHINSERT] = getLHInsert(); - operationsTable[OPERATION_LHREMOVE] = getLHRemove(); + /* operationsTable[OPERATION_LHINSERT] = getLHInsert(); + operationsTable[OPERATION_LHREMOVE] = getLHRemove(); */ operationsTable[OPERATION_ALLOC] = getAlloc(); operationsTable[OPERATION_DEALLOC] = getDealloc(); diff --git a/test/2pc/Makefile.am b/test/2pc/Makefile.am index 9538dbc..e15e1d0 100644 --- a/test/2pc/Makefile.am +++ b/test/2pc/Makefile.am @@ -1,4 +1,4 @@ LDADD=$(top_builddir)/src/2pc/lib2pc.a $(top_builddir)/src/libdfa/libdfa.a \ - $(top_builddir)/src/lladd/liblladd.a $(top_builddir)/src/pbl/libpbl.a $(top_builddir)/src/libdfa/librw.a -lm + $(top_builddir)/src/lladd/liblladd.a $(top_builddir)/src/pbl/libpbl.a $(top_builddir)/src/libdfa/librw.a bin_PROGRAMS=always_commit AM_CFLAGS= -g -Wall -pedantic -std=gnu99 diff --git a/test/check_includes.h b/test/check_includes.h index 1d57198..f56e40c 100644 --- a/test/check_includes.h +++ b/test/check_includes.h @@ -1,3 +1,5 @@ +#include + void setup (void) { remove("logfile.txt"); remove("storefile.txt"); diff --git a/test/check_setup.h b/test/check_setup.h index a5475e8..77ef733 100644 --- a/test/check_setup.h +++ b/test/check_setup.h @@ -51,6 +51,6 @@ int main() { srunner_run_all(sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); - suite_free(s); +/* suite_free(s); */ return (nf == 0) ? 0 : 1; } diff --git a/test/cht/Makefile.am b/test/cht/Makefile.am index 30e9519..5cff260 100644 --- a/test/cht/Makefile.am +++ b/test/cht/Makefile.am @@ -1,4 +1,4 @@ LDADD=$(top_builddir)/src/apps/cht/libcht.a $(top_builddir)/src/2pc/lib2pc.a $(top_builddir)/src/libdfa/libdfa.a \ - $(top_builddir)/src/lladd/liblladd.a $(top_builddir)/src/pbl/libpbl.a $(top_builddir)/src/libdfa/librw.a -lm + $(top_builddir)/src/lladd/liblladd.a $(top_builddir)/src/pbl/libpbl.a $(top_builddir)/src/libdfa/librw.a bin_PROGRAMS=simple cht_server AM_CFLAGS= -g -Wall -pedantic -std=c99 diff --git a/test/cht/simple.c b/test/cht/simple.c index a440f90..0734647 100644 --- a/test/cht/simple.c +++ b/test/cht/simple.c @@ -39,10 +39,11 @@ authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. ---*/ +#include #include "../../src/apps/cht/cht.h" #include -#include + /** Thanks, jbhtsimple.c!! */ diff --git a/test/dfa/Makefile.am b/test/dfa/Makefile.am index 9c424b7..90475f4 100644 --- a/test/dfa/Makefile.am +++ b/test/dfa/Makefile.am @@ -1,3 +1,3 @@ -LDADD=$(top_builddir)/src/libdfa/libdfa.a $(top_builddir)/src/lladd/liblladd.a $(top_builddir)/src/pbl/libpbl.a -lm $(top_builddir)/src/libdfa/librw.a +LDADD=$(top_builddir)/src/libdfa/libdfa.a $(top_builddir)/src/lladd/liblladd.a $(top_builddir)/src/pbl/libpbl.a $(top_builddir)/src/libdfa/librw.a bin_PROGRAMS=ping_pong_dfa fork_bomb star AM_FLAGS= -g -Wall -pedantic -std=c99 diff --git a/test/lladd-old/Makefile b/test/lladd-old/Makefile deleted file mode 100644 index 4ae36b0..0000000 --- a/test/lladd-old/Makefile +++ /dev/null @@ -1,309 +0,0 @@ -# Makefile.in generated by automake 1.8.5 from Makefile.am. -# test/lladd-old/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - -srcdir = . -top_srcdir = ../.. - -pkgdatadir = $(datadir)/hello -pkglibdir = $(libdir)/hello -pkgincludedir = $(includedir)/hello -top_builddir = ../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = /usr/bin/install -c -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = i686-pc-linux-gnu -subdir = test/lladd-old -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/morph/lladd/missing --run aclocal-1.8 -AMDEP_FALSE = # -AMDEP_TRUE = -AMTAR = ${SHELL} /home/morph/lladd/missing --run tar -AR = ar -AUTOCONF = ${SHELL} /home/morph/lladd/missing --run autoconf -AUTOHEADER = ${SHELL} /home/morph/lladd/missing --run autoheader -AUTOMAKE = ${SHELL} /home/morph/lladd/missing --run automake-1.8 -AWK = gawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CHECK_CFLAGS = -CHECK_LIBS = -lcheck -CPP = gcc -E -CPPFLAGS = -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -O2 -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -ECHO = echo -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = grep -E -EXEEXT = -F77 = g77 -FFLAGS = -g -O2 -HAVE_CHECK_FALSE = # -HAVE_CHECK_TRUE = -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -LDFLAGS = -LIBOBJS = -LIBS = -lpthread -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /home/morph/lladd/missing --run makeinfo -OBJEXT = o -PACKAGE = hello -PACKAGE_BUGREPORT = sears@cs.berkeley.edu -PACKAGE_NAME = PACKAGE -PACKAGE_STRING = PACKAGE VERSION -PACKAGE_TARNAME = package -PACKAGE_VERSION = VERSION -PATH_SEPARATOR = : -RANLIB = ranlib -SET_MAKE = -SHELL = /bin/sh -STRIP = strip -VERSION = 0.1 -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_F77 = g77 -ac_ct_RANLIB = ranlib -ac_ct_STRIP = strip -am__fastdepCC_FALSE = # -am__fastdepCC_TRUE = -am__fastdepCXX_FALSE = # -am__fastdepCXX_TRUE = -am__include = include -am__leading_dot = . -am__quote = -bindir = ${exec_prefix}/bin -build = i686-pc-linux-gnu -build_alias = -build_cpu = i686 -build_os = linux-gnu -build_vendor = pc -datadir = ${prefix}/share -exec_prefix = ${prefix} -host = i686-pc-linux-gnu -host_alias = -host_cpu = i686 -host_os = linux-gnu -host_vendor = pc -includedir = ${prefix}/include -infodir = ${prefix}/info -install_sh = /home/morph/lladd/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localstatedir = ${prefix}/var -mandir = ${prefix}/man -mkdir_p = mkdir -p -- . -oldincludedir = /usr/include -prefix = /usr/local -program_transform_name = s,x,x, -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -sysconfdir = ${prefix}/etc -target_alias = -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/lladd-old/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu test/lladd-old/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/test/lladd/Makefile.am b/test/lladd/Makefile.am index 32d885c..3946c12 100644 --- a/test/lladd/Makefile.am +++ b/test/lladd/Makefile.am @@ -6,6 +6,6 @@ else TESTS = endif noinst_PROGRAMS = $(TESTS) -LDADD = @CHECK_LIBS@ $(top_builddir)/src/lladd/liblladd.a $(top_builddir)/src/pbl/libpbl.a $(top_builddir)/src/libdfa/librw.a -lpthread -lm -lefence +LDADD = @CHECK_LIBS@ $(top_builddir)/src/lladd/liblladd.a $(top_builddir)/src/pbl/libpbl.a $(top_builddir)/src/libdfa/librw.a #-lefence CLEANFILES = check_lht.log check_logEntry.log storefile.txt logfile.txt blob0_file.txt blob1_file.txt check_blobRecovery.log check_logWriter.log check_operations.log check_recovery.log check_transactional2.log AM_CFLAGS= -g -Wall -pedantic -std=gnu99 diff --git a/test/lladd/check_logWriter.c b/test/lladd/check_logWriter.c index c28baa9..e89ed25 100644 --- a/test/lladd/check_logWriter.c +++ b/test/lladd/check_logWriter.c @@ -48,7 +48,8 @@ terms specified in this license. #include #include -#include +#include "../../src/lladd/latches.h" +#include #include #include "../check_includes.h" @@ -68,7 +69,7 @@ static void setup_log() { LogEntry * f; recordid rid; byte * args = (byte*)"Test 123."; - size_t args_size = 10; /* Including null */ + long args_size = 10; /* Including null */ unsigned long preImage = 42; rid.page = 0; @@ -289,7 +290,8 @@ static void* worker_thread(void * arg) { /* fail_unless(1, NULL); */ /* Try to interleave requests as much as possible */ - pthread_yield(); + /*pthread_yield(); */ + sched_yield(); } diff --git a/test/monotree/Makefile.am b/test/monotree/Makefile.am index cf366a3..3cb0d81 100644 --- a/test/monotree/Makefile.am +++ b/test/monotree/Makefile.am @@ -1,4 +1,4 @@ -LDADD=$(top_builddir)/src/libdfa/libdfa.a $(top_builddir)/src/lladd/liblladd.a $(top_builddir)/src/pbl/libpbl.a $(top_builddir)/src/libdfa/librw.a -lm +LDADD=$(top_builddir)/src/libdfa/libdfa.a $(top_builddir)/src/lladd/liblladd.a $(top_builddir)/src/pbl/libpbl.a $(top_builddir)/src/libdfa/librw.a bin_PROGRAMS=bit_arithmetic binary_search soundness soundness_SOURCES = soundness.c AM_CFLAGS= -g -Wall -pedantic -std=c99 diff --git a/utilities/Makefile.am b/utilities/Makefile.am index fde2f78..fee5542 100644 --- a/utilities/Makefile.am +++ b/utilities/Makefile.am @@ -1,5 +1,5 @@ LDADD=$(top_builddir)/src/2pc/lib2pc.a $(top_builddir)/src/libdfa/libdfa.a \ $(top_builddir)/src/lladd/liblladd.a $(top_builddir)/src/pbl/libpbl.a \ - $(top_builddir)/src/libdfa/librw.a -lpthread -lm + $(top_builddir)/src/libdfa/librw.a bin_PROGRAMS=logfile_dump AM_CFLAGS= -g -Wall -pedantic -std=gnu99 diff --git a/utilities/logfile_dump.c b/utilities/logfile_dump.c index e2eafe7..b5b6fbd 100644 --- a/utilities/logfile_dump.c +++ b/utilities/logfile_dump.c @@ -13,7 +13,7 @@ static char * logEntryToString(LogEntry * le) { case UPDATELOG: { recordid rid = le->contents.clr.rid; - asprintf(&ret, "UPDATE\tlsn=%9ld\tprevlsn=%9ld\txid=%4d\trid={%5d %5d %5d}\tfuncId=%3d\targSize=%9d\n", le->LSN, le->prevLSN, le->xid, + asprintf(&ret, "UPDATE\tlsn=%9ld\tprevlsn=%9ld\txid=%4d\trid={%5d %5d %5ld}\tfuncId=%3d\targSize=%9d\n", le->LSN, le->prevLSN, le->xid, rid.page, rid.slot, rid.size, le->contents.update.funcID, le->contents.update.argSize ); } @@ -43,7 +43,7 @@ static char * logEntryToString(LogEntry * le) { case CLRLOG: { recordid rid = le->contents.clr.rid; - asprintf(&ret, "CLR \tlsn=%9ld\tprevlsn=%9ld\txid=%4d\trid={%5d %5d %5d}\tthisUpdateLSN=%9ld\tundoNextLSN=%9ld\n", le->LSN, le->prevLSN, le->xid, + asprintf(&ret, "CLR \tlsn=%9ld\tprevlsn=%9ld\txid=%4d\trid={%5d %5d %5ld}\tthisUpdateLSN=%9ld\tundoNextLSN=%9ld\n", le->LSN, le->prevLSN, le->xid, rid.page, rid.slot, rid.size, (long int)le->contents.clr.thisUpdateLSN, (long int)le->contents.clr.undoNextLSN ); } break;