From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by sourceware.org (Postfix) with ESMTPS id C0B233850426 for ; Fri, 18 Sep 2020 15:25:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C0B233850426 Received: by mail-il1-x142.google.com with SMTP id f82so6573082ilh.8 for ; Fri, 18 Sep 2020 08:25:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NQy6pBu+X/6zqLaocBCgT7td4R5spbHTVmv/lSDxRdc=; b=Wqw6qd+vil7Qe2nyLr/d2Qo3ZxuPnQ4jA7Y0fSvvI9rSeJzxgvUgSvdg8vK56hF5c+ 2wHn4ifA2Ayxu+y+AcesGuGns+rh8mYSXK/veZhSyahI241Ci3xA9bBm4PA9rYGP+QQX E4Usbe3kWNwG7GS54d7uZa3SqMr3CksqzwqN0k3ozAXYfOvfpUHZ4XesYmYC2jP/aaW0 ls26tIBVNyLLls6WG1kcdjUby/6eFUbhpfk7AMNrdPCg9kCj5McqJfZrtVctuVCgFY5G Otj2pPmgAU4Bja/muDYrrwzvOOOhuvW1SLb+YSEEQiRUkFu0XXbd3XoczhNLiLGOe1V+ GIpA== X-Gm-Message-State: AOAM532m4vcM/GI5L5kBak6HBiA9BWxLhyHNz5oSuPA7WGfyk+sKYzRi s6kTz1Y0KWdr6GCS0Cg15DZLeMTg6RGqwcza2DA= X-Google-Smtp-Source: ABdhPJyLotTDmt60xS/dezyvnYocdkhdvgzB9aGz+uB7ZpmJKzcXRtvlmuA3XoH+TvHJ4YlIYsb387cfpYtGXSHCMUs= X-Received: by 2002:a92:ca85:: with SMTP id t5mr1108321ilo.13.1600442708274; Fri, 18 Sep 2020 08:25:08 -0700 (PDT) MIME-Version: 1.0 References: <20200912134441.2407884-1-hjl.tools@gmail.com> <20200912134441.2407884-4-hjl.tools@gmail.com> <87tuvv8pv2.fsf@oldenburg2.str.redhat.com> In-Reply-To: <87tuvv8pv2.fsf@oldenburg2.str.redhat.com> From: "H.J. Lu" Date: Fri, 18 Sep 2020 08:24:32 -0700 Message-ID: Subject: Re: [PATCH 3/3] ld.so: Add --list-tunables to print tunable values To: Florian Weimer Cc: "H.J. Lu via Libc-alpha" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 15:25:10 -0000 On Fri, Sep 18, 2020 at 1:13 AM Florian Weimer wrote: > > * H. J. Lu via Libc-alpha: > > > diff --git a/elf/Makefile b/elf/Makefile > > index 0b78721848..7943a684ab 100644 > > --- a/elf/Makefile > > +++ b/elf/Makefile > > @@ -414,7 +414,7 @@ endif > > ifeq (yes,$(build-shared)) > > ifeq ($(run-built-tests),yes) > > tests-special += $(objpfx)tst-pathopt.out $(objpfx)tst-rtld-load-self.out \ > > - $(objpfx)tst-rtld-preload.out > > + $(objpfx)tst-rtld-preload.out $(objpfx)list-tunables.out > > endif > > I think the new test needs to be conditional on $(have-tunables) as > well. Will do. > > /* If we have no further argument the program was called incorrectly. > > Grant the user some education. */ > > if (_dl_argc < 2) > > - _dl_fatal_printf ("\ > > + { > > +#if HAVE_TUNABLES > > + _dl_printf > > +#else > > + _dl_fatal_printf > > +#endif > > + ("\ > > Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]\n\ > > You have invoked `ld.so', the helper program for shared library executables.\n\ > > This program usually lives in the file `/lib/ld.so', and special directives\n\ > > @@ -1293,6 +1321,11 @@ of this helper program; chances are you did not intend to run this program.\n\ > > in LIST\n\ > > --audit LIST use objects named in LIST as auditors\n\ > > --preload LIST preload objects named in LIST\n"); > > +#if HAVE_TUNABLES > > + _dl_fatal_printf ("\ > > + --list-tunables list all tunables with minimum and maximum values\n"); > > +#endif > > + } > > I think you should preprocessor string splicing, so something like this: > > --preload LIST preload objects named in LIST\n" > #if HAVE_TUNABLES > "\ > --list-tunables list all tunables with minimum and maximum values\n" > #endif > ); > > It should minimize the required changes. Will do. > Rest looks okay to me. > I will submit the updated patch set. Thanks. -- H.J.