unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Alexander Monakov via Libc-alpha <libc-alpha@sourceware.org>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Alexander Monakov <amonakov@ispras.dot.ru>,
	John Mellor-Crummey <johnmc@rice.edu>,
	libc-alpha@sourceware.org
Subject: Re: [PATCH v2 2/6] elf: Avoid unnecessary slowdown from profiling with audit (BZ#15533)
Date: Tue, 20 Jul 2021 11:31:14 +0300 (MSK)	[thread overview]
Message-ID: <alpine.LNX.2.20.13.2107201121130.1900@monopod.intra.ispras.ru> (raw)
In-Reply-To: <20210719143309.2848878-3-adhemerval.zanella@linaro.org>

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 <amonakov@ispras.dot.ru>

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

  reply	other threads:[~2021-07-20  8:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 14:33 [PATCH v2 0/6] Some rtld-audit fixes Adhemerval Zanella via Libc-alpha
2021-07-19 14:33 ` [PATCH v2 1/6] elf: Fix audit regression Adhemerval Zanella via Libc-alpha
2021-07-27 16:36   ` Florian Weimer via Libc-alpha
2021-07-19 14:33 ` [PATCH v2 2/6] elf: Avoid unnecessary slowdown from profiling with audit (BZ#15533) Adhemerval Zanella via Libc-alpha
2021-07-20  8:31   ` Alexander Monakov via Libc-alpha [this message]
2021-07-20 18:37     ` Adhemerval Zanella via Libc-alpha
2021-07-27 16:12   ` Adhemerval Zanella via Libc-alpha
2021-07-19 14:33 ` [PATCH v2 3/6] elf: Add audit tests for modules with TLSDESC Adhemerval Zanella via Libc-alpha
2021-07-19 14:33 ` [PATCH v2 4/6] elf: Do not fail for failed dlopem on audit modules (BZ #28061) Adhemerval Zanella via Libc-alpha
2021-07-19 14:33 ` [PATCH v2 5/6] elf: Suppress audit calls when a (new) namespace is empty (BZ #28062) Adhemerval Zanella via Libc-alpha
2021-07-19 14:33 ` [PATCH v2 6/6] elf: Fix initial-exec TLS access on audit modules (BZ #28096) Adhemerval Zanella via Libc-alpha
2021-07-20 22:09 ` [PATCH v2 0/6] Some rtld-audit fixes Michael Hudson-Doyle via Libc-alpha
2021-07-20 22:11   ` Michael Hudson-Doyle via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.20.13.2107201121130.1900@monopod.intra.ispras.ru \
    --to=libc-alpha@sourceware.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=amonakov@ispras.dot.ru \
    --cc=amonakov@ispras.ru \
    --cc=johnmc@rice.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).