glibc/malloc
Siddhesh Poyarekar 67e58f3941 Add framework for tunables
The tunables framework allows us to uniformly manage and expose global
variables inside glibc as switches to users.  tunables/README has
instructions for glibc developers to add new tunables.

Tunables support can be enabled by passing the --enable-tunables
configure flag to the configure script.  This patch only adds a
framework and does not pose any limitations on how tunable values are
read from the user.  It also adds environment variables used in malloc
behaviour tweaking to the tunables framework as a PoC of the
compatibility interface.

	* manual/install.texi: Add --enable-tunables option.
	* INSTALL: Regenerate.
	* README.tunables: New file.
	* Makeconfig (CPPFLAGS): Define TOP_NAMESPACE.
	(before-compile): Generate dl-tunable-list.h early.
	* config.h.in: Add HAVE_TUNABLES.
	* config.make.in: Add have-tunables.
	* configure.ac: Add --enable-tunables option.
	* configure: Regenerate.
	* csu/init-first.c (__libc_init_first): Move
	__libc_init_secure earlier...
	* csu/init-first.c (LIBC_START_MAIN):... to here.
	Include dl-tunables.h, libc-internal.h.
	(LIBC_START_MAIN) [!SHARED]: Initialize tunables for static
	binaries.
	* elf/Makefile (dl-routines): Add dl-tunables.
	* elf/Versions (ld): Add __tunable_set_val to GLIBC_PRIVATE
	namespace.
	* elf/dl-support (_dl_nondynamic_init): Unset MALLOC_CHECK_
	only when !HAVE_TUNABLES.
	* elf/rtld.c (process_envvars): Likewise.
	* elf/dl-sysdep.c [HAVE_TUNABLES]: Include dl-tunables.h
	(_dl_sysdep_start): Call __tunables_init.
	* elf/dl-tunable-types.h: New file.
	* elf/dl-tunables.c: New file.
	* elf/dl-tunables.h: New file.
	* elf/dl-tunables.list: New file.
	* malloc/tst-malloc-usable-static.c: New test case.
	* malloc/Makefile (tests-static): Add it.
	* malloc/arena.c [HAVE_TUNABLES]: Include dl-tunables.h.
	Define TUNABLE_NAMESPACE.
	(DL_TUNABLE_CALLBACK (set_mallopt_check)): New function.
	(DL_TUNABLE_CALLBACK_FNDECL): New macro.  Use it to define
	callback functions.
	(ptmalloc_init): Set tunable values.
	* scripts/gen-tunables.awk: New file.
	* sysdeps/mach/hurd/dl-sysdep.c: Include dl-tunables.h.
	(_dl_sysdep_start): Call __tunables_init.
2016-12-31 23:49:24 +05:30
..
arena.c Add framework for tunables 2016-12-31 23:49:24 +05:30
Depend
hooks.c malloc: Use accessors for chunk metadata access 2016-10-28 16:45:45 +02:00
Makefile Add framework for tunables 2016-12-31 23:49:24 +05:30
malloc-hooks.h Revert __malloc_initialize_hook symbol poisoning 2016-06-20 11:11:29 +02:00
malloc-internal.h elf: dl-minimal malloc needs to respect fundamental alignment 2016-08-03 16:11:01 +02:00
malloc.c malloc: Update comments about chunk layout 2016-10-28 22:36:58 +02:00
malloc.h malloc: Remove malloc_get_state, malloc_set_state [BZ #19473] 2016-10-26 13:28:28 +02:00
mallocbug.c Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
mcheck-init.c Revert __malloc_initialize_hook symbol poisoning 2016-06-20 11:11:29 +02:00
mcheck.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mcheck.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memusage.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memusage.sh Update copyright dates not handled by scripts/update-copyrights. 2016-01-04 16:26:30 +00:00
memusagestat.c Update copyright dates not handled by scripts/update-copyrights. 2016-01-04 16:26:30 +00:00
morecore.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mtrace.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mtrace.pl Update copyright dates not handled by scripts/update-copyrights. 2016-01-04 16:26:30 +00:00
obstack.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
obstack.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
scratch_buffer_grow_preserve.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
scratch_buffer_grow.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
scratch_buffer_set_array_size.c scratch_buffer_set_array_size: Include <limits.h> 2016-04-07 13:46:28 +02:00
set-freeres.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
thread-freeres.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-calloc.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-interpose-aux-nothread.c malloc: Simplify static malloc interposition [BZ #20432] 2016-08-26 23:20:41 +02:00
tst-interpose-aux-thread.c malloc: Simplify static malloc interposition [BZ #20432] 2016-08-26 23:20:41 +02:00
tst-interpose-aux.c malloc: Simplify static malloc interposition [BZ #20432] 2016-08-26 23:20:41 +02:00
tst-interpose-aux.h malloc: Simplify static malloc interposition [BZ #20432] 2016-08-26 23:20:41 +02:00
tst-interpose-nothread.c malloc: Simplify static malloc interposition [BZ #20432] 2016-08-26 23:20:41 +02:00
tst-interpose-skeleton.c malloc: Simplify static malloc interposition [BZ #20432] 2016-08-26 23:20:41 +02:00
tst-interpose-static-nothread.c malloc: Simplify static malloc interposition [BZ #20432] 2016-08-26 23:20:41 +02:00
tst-interpose-static-thread.c malloc: Simplify static malloc interposition [BZ #20432] 2016-08-26 23:20:41 +02:00
tst-interpose-thread.c malloc: Simplify static malloc interposition [BZ #20432] 2016-08-26 23:20:41 +02:00
tst-malloc-backtrace.c support: Introduce new subdirectory for test infrastructure 2016-12-09 08:18:27 +01:00
tst-malloc-fork-deadlock.c support: Introduce new subdirectory for test infrastructure 2016-12-09 08:18:27 +01:00
tst-malloc-thread-exit.c support: Introduce new subdirectory for test infrastructure 2016-12-09 08:18:27 +01:00
tst-malloc-thread-fail.c Bump up tst-malloc-thread-fail timeout from 20 to 30s 2016-07-05 17:05:28 -04:00
tst-malloc-usable-static.c Add framework for tunables 2016-12-31 23:49:24 +05:30
tst-malloc-usable.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-malloc.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-mallocfork2.c test-skeleton.c: Add write_message function 2016-06-23 11:00:36 +02:00
tst-mallocfork.c * malloc/tst-mallocfork.c (do_test): Make sure sa_flags is 2005-12-06 00:50:15 +00:00
tst-mallocstate.c malloc: Remove malloc_get_state, malloc_set_state [BZ #19473] 2016-10-26 13:28:28 +02:00
tst-mallopt.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-mcheck.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-memalign.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-mtrace.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-mtrace.sh Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
tst-obstack.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-posix_memalign.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-pvalloc.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-realloc.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-scratch_buffer.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-trim1.c * malloc/tst-trim1.c: New file. 2007-12-16 22:57:57 +00:00
tst-valloc.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Versions Add struct scratch_buffer and its internal helper functions 2015-04-07 11:03:43 +02:00