From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72576 invoked by alias); 6 Apr 2019 17:02:34 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 72566 invoked by uid 89); 6 Apr 2019 17:02:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=cc1 X-Spam-Status: No, score=-25.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mx1.suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Date: Tue, 01 Jan 2019 00:00:00 -0000 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com Subject: [committed] Enable developer-only options only with -DDEVEL Message-ID: <20190406170227.GA17128@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-q2/txt/msg00006.txt.bz2 Hi, For the --devel-ignore-locus option, we changed the code implementing that option to test ignore_locus at run-time, instead of testing IGNORE_LOCUS, by default defined to 0 at compile time. This caused a performance regression on cc1 of ~0.5%. Fix this by only enabling the developer-only options if DEVEL is defined. Committed to trunk. Thanks, - Tom Enable developer-only options only with -DDEVEL 2019-04-06 Tom de Vries * Makefile (dwz-for-test): Add -DDEVEL. * dwz.c [!DEVEL] (tracing, ignore_size, ignore_locus): Define to 0. [!DEVEL] (dwz_options): Remove --devel options. * testsuite/dwz.tests/devel-ignore-locus.sh: Use dwz-for-test instead * of dwz. * testsuite/dwz.tests/devel-ignore-size.sh: Same. * testsuite/dwz.tests/devel-trace.sh: Same. --- Makefile | 2 +- dwz.c | 8 ++++++++ testsuite/dwz.tests/devel-ignore-locus.sh | 4 ++-- testsuite/dwz.tests/devel-ignore-size.sh | 4 ++-- testsuite/dwz.tests/devel-trace.sh | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 9b4fb7f..69058a9 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ DWZ_TEST_SOURCES := $(patsubst %.o,%-for-test.c,$(OBJECTS)) sed 's/__GNUC__/NOT_DEFINED/' $< > $@ dwz-for-test: $(DWZ_TEST_SOURCES) - $(CC) $(DWZ_TEST_SOURCES) -O2 -g -lelf -o $@ -Wall -W \ + $(CC) $(DWZ_TEST_SOURCES) -O2 -g -lelf -o $@ -Wall -W -DDEVEL \ -D_FILE_OFFSET_BITS=64 -DDWZ_VERSION='"for-test"' min: diff --git a/dwz.c b/dwz.c index 9dba649..d31be82 100644 --- a/dwz.c +++ b/dwz.c @@ -132,9 +132,15 @@ static struct obstack ob2; and restored during final cleanup. */ static struct obstack alt_ob, alt_ob2; +#if DEVEL static int tracing; static int ignore_size; static int ignore_locus; +#else +#define tracing 0 +#define ignore_size 0 +#define ignore_locus 0 +#endif typedef struct { @@ -11821,9 +11827,11 @@ static struct option dwz_options[] = { "multifile-name", required_argument, 0, 'M' }, { "relative", no_argument, 0, 'r' }, { "version", no_argument, 0, 'v' }, +#if DEVEL { "devel-trace", no_argument, &tracing, 1 }, { "devel-ignore-size", no_argument, &ignore_size, 1 }, { "devel-ignore-locus",no_argument, &ignore_locus, 1 }, +#endif { NULL, no_argument, 0, 0 } }; diff --git a/testsuite/dwz.tests/devel-ignore-locus.sh b/testsuite/dwz.tests/devel-ignore-locus.sh index e856cc6..1cd0735 100644 --- a/testsuite/dwz.tests/devel-ignore-locus.sh +++ b/testsuite/dwz.tests/devel-ignore-locus.sh @@ -6,7 +6,7 @@ cnt=$(readelf -wi 1 \ [ $cnt -eq 2 ] -dwz 1 2>/dev/null +../dwz-for-test 1 2>/dev/null cnt=$(readelf -wi 1 \ | grep 'DW_AT_name.*: aaa' \ @@ -16,7 +16,7 @@ cnt=$(readelf -wi 1 \ cp ../two-typedef 1 -dwz --devel-ignore-locus --devel-ignore-size 1 +../dwz-for-test --devel-ignore-locus --devel-ignore-size 1 cnt=$(readelf -wi 1 \ | grep 'DW_AT_name.*: aaa' \ diff --git a/testsuite/dwz.tests/devel-ignore-size.sh b/testsuite/dwz.tests/devel-ignore-size.sh index 31cc923..db1c3eb 100644 --- a/testsuite/dwz.tests/devel-ignore-size.sh +++ b/testsuite/dwz.tests/devel-ignore-size.sh @@ -6,7 +6,7 @@ cnt=$(readelf -wi 1 \ [ $cnt -eq 0 ] -dwz 1 2>/dev/null +../dwz-for-test 1 2>/dev/null cnt=$(readelf -wi 1 \ | grep '(DW_TAG_partial_unit' \ @@ -16,7 +16,7 @@ cnt=$(readelf -wi 1 \ cp ../min 1 -dwz --devel-ignore-size 1 +../dwz-for-test --devel-ignore-size 1 cnt=$(readelf -wi 1 \ | grep '(DW_TAG_partial_unit' \ diff --git a/testsuite/dwz.tests/devel-trace.sh b/testsuite/dwz.tests/devel-trace.sh index 089cb52..7b3eb6b 100644 --- a/testsuite/dwz.tests/devel-trace.sh +++ b/testsuite/dwz.tests/devel-trace.sh @@ -1,5 +1,5 @@ cp ../hello 1 -dwz --devel-trace 1 2>/dev/null +../dwz-for-test --devel-trace 1 2>/dev/null rm -f 1