From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dormouse.elm.relay.mailchannels.net (dormouse.elm.relay.mailchannels.net [23.83.212.50]) by sourceware.org (Postfix) with ESMTPS id A2ECB385042D for ; Tue, 22 Jun 2021 10:20:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A2ECB385042D X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7214C642B79 for ; Tue, 22 Jun 2021 10:20:27 +0000 (UTC) Received: from pdx1-sub0-mail-a45.g.dreamhost.com (100-96-27-202.trex.outbound.svc.cluster.local [100.96.27.202]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 8F9CF6427AC for ; Tue, 22 Jun 2021 10:20:26 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a45.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.27.202 (trex/6.3.3); Tue, 22 Jun 2021 10:20:27 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Cold-Well-Made: 2143092c5a560030_1624357226834_1116321324 X-MC-Loop-Signature: 1624357226834:2464878989 X-MC-Ingress-Time: 1624357226834 Received: from pdx1-sub0-mail-a45.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a45.g.dreamhost.com (Postfix) with ESMTP id 2D5967F609 for ; Tue, 22 Jun 2021 03:20:26 -0700 (PDT) Received: from rhbox.intra.reserved-bit.com (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a45.g.dreamhost.com (Postfix) with ESMTPSA id D96477E3CC for ; Tue, 22 Jun 2021 03:20:24 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a45 From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [PATCH][trivial] More mcheck -> malloc-check refactoring Date: Tue, 22 Jun 2021 15:50:13 +0530 Message-Id: <20210622102013.2807141-1-siddhesh@sourceware.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3494.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, 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: Tue, 22 Jun 2021 10:20:31 -0000 Refactored malloc-check rules for tests that are automatically generated and executed with MALLOC_CHECK_=3D3. This does not affect codegen and tests run pretty much the same way too, so I'll push this shortly if there are no objections. --- Rules | 20 ++++++++++---------- malloc/Makefile | 30 +++++++++++++++++------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/Rules b/Rules index 082625bb71..c6b635c3f7 100644 --- a/Rules +++ b/Rules @@ -155,7 +155,7 @@ xtests: tests $(xtests-special) else tests: $(tests:%=3D$(objpfx)%.out) $(tests-internal:%=3D$(objpfx)%.out) = \ $(tests-container:%=3D$(objpfx)%.out) \ - $(tests-mcheck:%=3D$(objpfx)%-mcheck.out) \ + $(tests-malloc-check:%=3D$(objpfx)%-malloc-check.out) \ $(tests-special) $(tests-printers-out) xtests: tests $(xtests:%=3D$(objpfx)%.out) $(xtests-special) endif @@ -166,7 +166,7 @@ ifeq ($(run-built-tests),no) tests-expected =3D else tests-expected =3D $(tests) $(tests-internal) $(tests-printers) \ - $(tests-container) $(tests-mcheck:%=3D%-mcheck) + $(tests-container) $(tests-malloc-check:%=3D%-malloc-check) endif tests: $(..)scripts/merge-test-results.sh -s $(objpfx) $(subdir) \ @@ -192,7 +192,7 @@ else binaries-pie-tests =3D binaries-pie-notests =3D endif -binaries-mcheck-tests =3D $(tests-mcheck:%=3D%-mcheck) +binaries-malloc-check-tests =3D $(tests-malloc-check:%=3D%-malloc-check) else binaries-all-notests =3D binaries-all-tests =3D $(tests) $(tests-internal) $(xtests) $(test-srcs) @@ -202,7 +202,7 @@ binaries-static-tests =3D binaries-static =3D binaries-pie-tests =3D binaries-pie-notests =3D -binaries-mcheck-tests =3D +binaries-malloc-check-tests =3D endif =20 binaries-pie =3D $(binaries-pie-tests) $(binaries-pie-notests) @@ -226,8 +226,8 @@ $(addprefix $(objpfx),$(binaries-shared-tests)): %: %= .o \ $(+link-tests) endif =20 -ifneq "$(strip $(binaries-mcheck-tests))" "" -$(addprefix $(objpfx),$(binaries-mcheck-tests)): %-mcheck: %.o \ +ifneq "$(strip $(binaries-malloc-check-tests))" "" +$(addprefix $(objpfx),$(binaries-malloc-check-tests)): %-malloc-check: %= .o \ $(link-extra-libs-tests) \ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit) @@ -264,11 +264,11 @@ $(addprefix $(objpfx),$(binaries-static-tests)): %:= %.o \ $(+link-static-tests) endif =20 -# All mcheck tests will be run with MALLOC_CHECK_=3D3 -define mcheck-ENVS -$(1)-mcheck-ENV =3D MALLOC_CHECK_=3D3 +# All malloc-check tests will be run with MALLOC_CHECK_=3D3 +define malloc-check-ENVS +$(1)-malloc-check-ENV =3D MALLOC_CHECK_=3D3 endef -$(foreach t,$(tests-mcheck),$(eval $(call mcheck-ENVS,$(t)))) +$(foreach t,$(tests-malloc-check),$(eval $(call malloc-check-ENVS,$(t)))= ) =20 ifneq "$(strip $(tests) $(tests-internal) $(xtests) $(test-srcs))" "" # These are the implicit rules for making test outputs diff --git a/malloc/Makefile b/malloc/Makefile index f606c70fed..3162301fba 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -70,13 +70,11 @@ test-srcs =3D tst-mtrace =20 # These tests either are run with MALLOC_CHECK_=3D3 by default or do not= work # with MALLOC_CHECK_=3D3 because they expect a specific failure. -tests-exclude-mcheck =3D tst-malloc-check tst-malloc-usable \ - tst-interpose-nothread tst-interpose-static-nothread \ - tst-interpose-static-thread \ +tests-exclude-malloc-check =3D tst-malloc-check tst-malloc-usable \ tst-mxfast tst-safe-linking =20 # Run all tests with MALLOC_CHECK_=3D3 -tests-mcheck =3D $(filter-out $(tests-exclude-mcheck),$(tests)) +tests-malloc-check =3D $(filter-out $(tests-exclude-malloc-check),$(test= s)) =20 routines =3D malloc morecore mcheck mtrace obstack reallocarray \ scratch_buffer_dupfree \ @@ -117,11 +115,11 @@ $(objpfx)tst-malloc-thread-exit: $(shared-thread-li= brary) $(objpfx)tst-malloc-thread-fail: $(shared-thread-library) $(objpfx)tst-malloc-fork-deadlock: $(shared-thread-library) $(objpfx)tst-malloc-stats-cancellation: $(shared-thread-library) -$(objpfx)tst-malloc-backtrace-mcheck: $(shared-thread-library) -$(objpfx)tst-malloc-thread-exit-mcheck: $(shared-thread-library) -$(objpfx)tst-malloc-thread-fail-mcheck: $(shared-thread-library) -$(objpfx)tst-malloc-fork-deadlock-mcheck: $(shared-thread-library) -$(objpfx)tst-malloc-stats-cancellation-mcheck: $(shared-thread-library) +$(objpfx)tst-malloc-backtrace-malloc-check: $(shared-thread-library) +$(objpfx)tst-malloc-thread-exit-malloc-check: $(shared-thread-library) +$(objpfx)tst-malloc-thread-fail-malloc-check: $(shared-thread-library) +$(objpfx)tst-malloc-fork-deadlock-malloc-check: $(shared-thread-library) +$(objpfx)tst-malloc-stats-cancellation-malloc-check: $(shared-thread-lib= rary) =20 # These should be removed by `make clean'. extra-objs =3D mcheck-init.o libmcheck.a @@ -252,13 +250,19 @@ $(foreach o,$(all-object-suffixes),$(objpfx)malloc$= (o)): arena.c hooks.c $(tests:%=3D$(objpfx)%.o): CPPFLAGS +=3D -DTEST_NO_MALLOPT =20 $(objpfx)tst-interpose-nothread: $(objpfx)tst-interpose-aux-nothread.o +$(objpfx)tst-interpose-nothread-malloc-check: \ + $(objpfx)tst-interpose-aux-nothread.o $(objpfx)tst-interpose-thread: \ $(objpfx)tst-interpose-aux-thread.o $(shared-thread-library) -$(objpfx)tst-interpose-thread-mcheck: \ +$(objpfx)tst-interpose-thread-malloc-check: \ $(objpfx)tst-interpose-aux-thread.o $(shared-thread-library) $(objpfx)tst-interpose-static-nothread: $(objpfx)tst-interpose-aux-nothr= ead.o +$(objpfx)tst-interpose-static-nothread-malloc-check: \ + $(objpfx)tst-interpose-aux-nothread.o $(objpfx)tst-interpose-static-thread: \ $(objpfx)tst-interpose-aux-thread.o $(static-thread-library) +$(objpfx)tst-interpose-static-thread-malloc-check: \ + $(objpfx)tst-interpose-aux-thread.o $(static-thread-library) =20 tst-dynarray-ENV =3D MALLOC_TRACE=3D$(objpfx)tst-dynarray.mtrace $(objpfx)tst-dynarray-mem.out: $(objpfx)tst-dynarray.out @@ -273,6 +277,6 @@ $(objpfx)tst-dynarray-fail-mem.out: $(objpfx)tst-dyna= rray-fail.out $(objpfx)tst-malloc-tcache-leak: $(shared-thread-library) $(objpfx)tst-malloc_info: $(shared-thread-library) $(objpfx)tst-mallocfork2: $(shared-thread-library) -$(objpfx)tst-malloc-tcache-leak-mcheck: $(shared-thread-library) -$(objpfx)tst-malloc_info-mcheck: $(shared-thread-library) -$(objpfx)tst-mallocfork2-mcheck: $(shared-thread-library) +$(objpfx)tst-malloc-tcache-leak-malloc-check: $(shared-thread-library) +$(objpfx)tst-malloc_info-malloc-check: $(shared-thread-library) +$(objpfx)tst-mallocfork2-malloc-check: $(shared-thread-library) --=20 2.31.1