From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 011103858D39 for ; Tue, 18 Jan 2022 11:29:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 011103858D39 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-648-9nwURUXdPS65HoMRSCnrjA-1; Tue, 18 Jan 2022 06:29:18 -0500 X-MC-Unique: 9nwURUXdPS65HoMRSCnrjA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72F9E1006AA3; Tue, 18 Jan 2022 11:29:17 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.198]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 55439752BE; Tue, 18 Jan 2022 11:29:11 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella via Libc-alpha Cc: jma14 , Carlos O'Donell , Adhemerval Zanella , John Mellor-Crummey Subject: Re: [PATCH v10 1/4] elf: Add la_activity during application exit References: <20220117213136.1327053-1-adhemerval.zanella@linaro.org> <20220117213136.1327053-2-adhemerval.zanella@linaro.org> Date: Tue, 18 Jan 2022 12:29:08 +0100 In-Reply-To: <20220117213136.1327053-2-adhemerval.zanella@linaro.org> (Adhemerval Zanella via Libc-alpha's message of "Mon, 17 Jan 2022 18:31:33 -0300") Message-ID: <87v8yhjn97.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 18 Jan 2022 11:29:23 -0000 * Adhemerval Zanella via Libc-alpha: > diff --git a/elf/dl-fini.c b/elf/dl-fini.c > index de8eb1b3c9..2705a15c88 100644 > --- a/elf/dl-fini.c > +++ b/elf/dl-fini.c > @@ -64,6 +64,11 @@ _dl_fini (void) > __rtld_lock_unlock_recursive (GL(dl_load_lock)); > else > { > +#ifdef SHARED > + /* Auditing checkpoint: we will start deleting objects. */ > + _dl_audit_activity_nsid (ns, LA_ACT_DELETE); > +#endif > + > /* Now we can allocate an array to hold all the pointers and > copy the pointers in. */ > struct link_map *maps[nloaded]; > @@ -153,6 +158,11 @@ _dl_fini (void) > /* Correct the previous increment. */ > --l->l_direct_opencount; > } > + > +#ifdef SHARED > + /* Auditing checkpoint: we will start deleting objects. */ > + _dl_audit_activity_nsid (ns, LA_ACT_CONSISTENT); > +#endif > } > } The tense in the second comment seems wrong. > > diff --git a/elf/tst-audit23.c b/elf/tst-audit23.c > new file mode 100644 > index 0000000000..9a7e69c1e1 > --- /dev/null > +++ b/elf/tst-audit23.c > + FILE *out = fmemopen (result.err.buffer, result.err.length, "r"); > + TEST_VERIFY (out != NULL); > + char *buffer = NULL; > + size_t buffer_length = 0; > + while (xgetline (&buffer, &buffer_length, out)) > + { > + if (startswith (buffer, "la_activity: ")) It may be simpler (or easier to maintain going forward) to have the expected output (without varying pointers) and compare against that verbatim. This is what I implemented for some of the DNS tests. Thanks, Florian