1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

ld.so: Add --list-tunables to print tunable values

Pass --list-tunables to ld.so to print tunables with min and max values.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
H.J. Lu
2020-07-12 06:04:53 -07:00
parent cc528f9a7e
commit 86f65dffc2
10 changed files with 172 additions and 2 deletions

View File

@ -50,6 +50,7 @@
#include <dl-main.h>
#include <list.h>
#include <gnu/lib-names.h>
#include <dl-tunables.h>
#include <assert.h>
@ -1276,6 +1277,16 @@ dl_main (const ElfW(Phdr) *phdr,
_dl_argc -= 2;
_dl_argv += 2;
}
#if HAVE_TUNABLES
else if (! strcmp (_dl_argv[1], "--list-tunables"))
{
state.mode = rtld_mode_list_tunables;
++_dl_skip_args;
--_dl_argc;
++_dl_argv;
}
#endif
else if (strcmp (_dl_argv[1], "--help") == 0)
{
state.mode = rtld_mode_help;
@ -1296,6 +1307,14 @@ dl_main (const ElfW(Phdr) *phdr,
else
break;
#if HAVE_TUNABLES
if (__glibc_unlikely (state.mode == rtld_mode_list_tunables))
{
__tunables_print ();
_exit (0);
}
#endif
/* If we have no further argument the program was called incorrectly.
Grant the user some education. */
if (_dl_argc < 2)