This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch master
in repository 389-ds-base.
commit 0349d0138c8882f55d3427a7c707a33b8c8a1e36
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Feb 21 13:05:21 2017 -0500
Issue 49141 - Use tcmalloc by default
Description: Add configure option "--with-tcmalloc" for linking
libtcmalloc
with the core server. Update the spec file to use it by default.
https://pagure.io/389-ds-base/issue/49141
Reviewed by: nhosoi(Thanks!)
---
Makefile.am | 7 ++++---
configure.ac | 2 ++
ldap/admin/src/base-initconfig.in | 7 -------
m4/tcmalloc.m4 | 29 +++++++++++++++++++++++++++++
rpm/389-ds-base.spec.in | 13 ++++++++++---
5 files changed, 45 insertions(+), 13 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 112b8f1..6760e7a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -98,7 +98,7 @@ PCRE_LINK = @pcre_lib@ -lpcre
NETSNMP_LINK = @netsnmp_lib@ @netsnmp_link@
PAM_LINK = -lpam
KERBEROS_LINK = $(kerberos_lib)
-
+TCMALLOC_LINK = @tcmalloc_link@
SYSTEMD_LINK = @systemd_lib@
@@ -1075,7 +1075,8 @@ libslapd_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) @sasl_inc@ @db_inc@
@svrcore_inc@ @ker
if SPARC
libslapd_la_SOURCES += ldap/servers/slapd/slapi_counter_sunos_sparcv9.S
endif
-libslapd_la_LIBADD = $(LDAPSDK_LINK) $(SASL_LINK) $(NUNC_STANS_LINK) $(SVRCORE_LINK)
$(NSS_LINK) $(NSPR_LINK) $(KERBEROS_LINK) $(PCRE_LINK) $(THREADLIB) $(SYSTEMD_LINK)
+libslapd_la_LIBADD = $(LDAPSDK_LINK) $(SASL_LINK) $(NUNC_STANS_LINK) $(SVRCORE_LINK)
$(NSS_LINK) \
+ $(NSPR_LINK) $(KERBEROS_LINK) $(PCRE_LINK) $(THREADLIB)
$(SYSTEMD_LINK) $(TCMALLOC_LINK)
#////////////////////////////////////////////////////////////////
@@ -1804,7 +1805,7 @@ ns_slapd_SOURCES = ldap/servers/slapd/abandon.c \
ns_slapd_CPPFLAGS = $(AM_CPPFLAGS) @sasl_inc@ @openldap_inc@ @ldapsdk_inc@ @nss_inc@ \
@nspr_inc@ @svrcore_inc@ @systemd_inc@
ns_slapd_LDADD = libslapd.la libldaputil.a $(LDAPSDK_LINK) $(NSS_LINK) $(LIBADD_DL) \
- $(NSPR_LINK) $(SASL_LINK) $(SVRCORE_LINK) $(LIBNSL) $(LIBSOCKET) $(THREADLIB)
$(SYSTEMD_LINK)
+ $(NSPR_LINK) $(SASL_LINK) $(SVRCORE_LINK) $(LIBNSL) $(LIBSOCKET) $(THREADLIB)
$(SYSTEMD_LINK) $(TCMALLOC_LINK)
ns_slapd_DEPENDENCIES = libslapd.la
# We need to link ns-slapd with the C++ compiler on HP-UX since we load
# some C++ shared libraries (such as icu).
diff --git a/configure.ac b/configure.ac
index 38e6480..00e9bc7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -689,6 +689,7 @@ m4_include(m4/selinux.m4)
m4_include(m4/nunc-stans.m4)
m4_include(m4/systemd.m4)
m4_include(m4/cmocka.m4)
+m4_include(m4/tcmalloc.m4)
PACKAGE_BASE_VERSION=`echo $PACKAGE_VERSION | awk -F\. '{print
$1"."$2}'`
AC_SUBST(PACKAGE_BASE_VERSION)
@@ -753,6 +754,7 @@ AC_SUBST(localrundir)
AC_SUBST(systemd_inc)
AC_SUBST(systemd_lib)
AC_SUBST(systemd_defs)
+AC_SUBST(tcmalloc_link)
AC_SUBST(brand)
AC_SUBST(capbrand)
diff --git a/ldap/admin/src/base-initconfig.in b/ldap/admin/src/base-initconfig.in
index 8507296..1403ada 100644
--- a/ldap/admin/src/base-initconfig.in
+++ b/ldap/admin/src/base-initconfig.in
@@ -40,10 +40,3 @@
# is a problem and fail to start.
# If using systemd, omit the "; export PID_TIME" at the end.
#PID_TIME=600 ; export PID_TIME
-
-# The tcmalloc memory allocator has been shown to have a positive impact on
-# the Directory Server's virtual & resident memory size/growth. tcmalloc is
-# available on RHEL/Fedora in the gperftools-libs package (this could be
-# different on other platforms).
-# If using systemd, omit the "; export LD_PRELOAD" at the end.
-#LD_PRELOAD=@libdir(a)/libtcmalloc.so.4 ; export LD_PRELOAD
diff --git a/m4/tcmalloc.m4 b/m4/tcmalloc.m4
new file mode 100644
index 0000000..da9a722
--- /dev/null
+++ b/m4/tcmalloc.m4
@@ -0,0 +1,29 @@
+# BEGIN COPYRIGHT BLOCK
+# Copyright (C) 2017 Red Hat, Inc.
+# All rights reserved.
+#
+# License: GPL (version 3 or any later version).
+# See LICENSE for details.
+# END COPYRIGHT BLOCK
+
+AC_CHECKING(for tcmalloc)
+
+# check for --with-tcmalloc
+AC_MSG_CHECKING(for --with-tcmalloc)
+AC_ARG_WITH(tcmalloc, AS_HELP_STRING([--with-tcmalloc],[Use TCMalloc memory
allocator.]),
+[
+ if test "$withval" = yes
+ then
+ AC_MSG_RESULT([using tcmalloc memory allocator])
+ with_tcmalloc=yes
+ else
+ AC_MSG_RESULT(no)
+ fi
+],
+AC_MSG_RESULT(no))
+
+if test "$with_tcmalloc" = yes; then
+ tcmalloc_link=-ltcmalloc
+fi
+
+
diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in
index f1358af..ddd801c 100644
--- a/rpm/389-ds-base.spec.in
+++ b/rpm/389-ds-base.spec.in
@@ -11,6 +11,7 @@
# also need the relprefix field for a pre-release e.g. .0 - also comment out for official
release
#% global relprefix 0.
+%global use_tcmalloc 1
%global use_openldap 1
%global use_db4 0
# If perl-Socket-2.000 or newer is available, set 0 to use_Socket6.
@@ -43,7 +44,7 @@ Name: 389-ds-base
Version: __VERSION__
Release: __RELEASE__%{?dist}
License: GPLv3+
-URL:
http://port389.org/
+URL:
http://www.port389.org/
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Obsoletes: %{name}-selinux
@@ -92,6 +93,12 @@ BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
+%if %{use_tcmalloc}
+BuildRequires: gperftools-devel
+Requires: gperftools-libs
+TCMALLOC_FLAGS="--with-tcmalloc"
+%endif
+
# this is needed for using semanage from our setup scripts
Requires: policycoreutils-python
@@ -154,7 +161,7 @@ Requires: libasan
Requires: llvm
%endif
-Source0:
http://port389.org/sources/%{name}-%{version}%{?prerel}.tar.bz2
+Source0:
http://www.port389.org/sources/%{name}-%{version}%{?prerel}.tar.bz2
# 389-ds-git.sh should be used to generate the source tarball from git
Source1: %{name}-git.sh
Source2: %{name}-devel.README
@@ -314,7 +321,7 @@ autoreconf -fiv
--with-systemdsystemunitdir=%{_unitdir} \
--with-systemdsystemconfdir=%{_sysconfdir}/systemd/system \
--with-systemdgroupname=%{groupname} $NSSARGS $NUNC_STANS_FLAGS \
- --with-systemd $ASAN_FLAGS
+ --with-systemd $TCMALLOC_FLAGS $ASAN_FLAGS
# Generate symbolic info for debuggers
export XCFLAGS=$RPM_OPT_FLAGS
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.