From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, PDS_RDNS_DYNAMIC_FP,RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 9B2331F5AE for ; Tue, 20 Jul 2021 08:32:09 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3159E39874C8 for ; Tue, 20 Jul 2021 08:32:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3159E39874C8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626769928; bh=SdE4B4L3Kfx1at/6K6Voo1jwC9QooM3qwQvdPw6mPJg=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=uAKZACqRAmiS/vV/ptXfcCLX5kq6Wuhn5pZtIQ329QS5kE3i3FQ2Q6GpFEA7XLDeu n67K1y1IIMmzwd8Dq6tYp9C/nQBnh8/Bn6w97ua2X7r7pZ4bso0nJNMbGFEkuLay8L JXXHXTFkhnz74fnwHfNK54zvu24SA43EldItMPUg= Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by sourceware.org (Postfix) with ESMTPS id 652CE398703E for ; Tue, 20 Jul 2021 08:31:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 652CE398703E Received: from monopod.intra.ispras.ru (unknown [10.10.3.121]) by mail.ispras.ru (Postfix) with ESMTPS id 66DFD40D3BFF; Tue, 20 Jul 2021 08:31:15 +0000 (UTC) Date: Tue, 20 Jul 2021 11:31:14 +0300 (MSK) To: Adhemerval Zanella Subject: Re: [PATCH v2 2/6] elf: Avoid unnecessary slowdown from profiling with audit (BZ#15533) In-Reply-To: <20210719143309.2848878-3-adhemerval.zanella@linaro.org> Message-ID: References: <20210719143309.2848878-1-adhemerval.zanella@linaro.org> <20210719143309.2848878-3-adhemerval.zanella@linaro.org> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: , From: Alexander Monakov via Libc-alpha Reply-To: Alexander Monakov Cc: Alexander Monakov , John Mellor-Crummey , libc-alpha@sourceware.org Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Mon, 19 Jul 2021, Adhemerval Zanella via Libc-alpha wrote: > The rtld-audit interfaces introduces a slowdown due to enabling profiling "interface" (my original message had "using the audit interfaces introduces"). > instrumentation (as if LD_AUDIT implied LD_PROFILE). However, instrumenting > is only necessary if one of audit libraries provides PLT (la_plt{enter,exit} > symbols). Otherwise, the slowdown can be avoided. > > The following patch adjusts the logic that enables profiling to iterate > over all audit modules and check if any of those provides a PLT hook. > > Co-authored-by: Alexander Monakov Please use my correct email here and in the Cc list (it's ispras.ru, not ispras.dot.ru). > --- > NEWS | 4 ++++ > elf/Makefile | 6 +++++- > elf/dl-reloc.c | 12 +++++++++++- > elf/rtld.c | 8 +------- > elf/tst-audit18.c | 39 +++++++++++++++++++++++++++++++++++++++ > elf/tst-auditmod18.c | 24 ++++++++++++++++++++++++ > include/link.h | 2 ++ > 7 files changed, 86 insertions(+), 9 deletions(-) > create mode 100644 elf/tst-audit18.c > create mode 100644 elf/tst-auditmod18.c > > diff --git a/NEWS b/NEWS > index 13ffe627da..8fde312ec6 100644 > --- a/NEWS > +++ b/NEWS > @@ -76,6 +76,10 @@ Major new features: > equal to a giver integer. This function is a GNU extension, although > Solaris also provides a similar function. > > +* The audit libraries will avoid unnecessary slowdown if it is not required "required for" or "... by"? > + either PLT tracking or symbol binding profiling (enabled with LA_FLG_BINDFROM > + or LA_FLG_BINDTO from la_objopen() callback). It seems the part about binding needs to be updated, because the commit message and the patch itself does not change anything for binding hooks? My understanding always was that no change is necessary w.r.t la_symbind callbacks: the loader invokes them when doing symbol resolution, and presence of PLT does not matter. Alexander