* [committed] Enable developer-only options only with -DDEVEL
@ 2019-01-01 0:00 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-01 0:00 UTC (permalink / raw)
To: dwz, jakub
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 <tdevries@suse.de>
* 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-04-06 17:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01 0:00 [committed] Enable developer-only options only with -DDEVEL Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).