public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Guilherme Amadio <amadio@gentoo.org>, Leo Yan <leo.yan@arm.com>,
	linux-perf-users@vger.kernel.org
Subject: Re: perf test for inet_pton probe fails to match stacktrace
Date: Tue, 26 Nov 2024 13:27:45 -0300	[thread overview]
Message-ID: <Z0X3AYUWkAgfPpWj@x1> (raw)
In-Reply-To: <Z0VXvySyHm4q4r2c@google.com>

On Mon, Nov 25, 2024 at 09:08:15PM -0800, Namhyung Kim wrote:
> Hello guys,
> 
> On Mon, Nov 25, 2024 at 02:12:41PM +0100, Guilherme Amadio wrote:
> > Dear Leo,
> > 
> > On Sun, Nov 24, 2024 at 10:50:53AM +0000, Leo Yan wrote:
> > > Hi Guilherme,
> > > 
> > > On Fri, Nov 22, 2024 at 10:35:16PM +0100, Guilherme Amadio wrote:
> > > 
> > > [...]
> > > > [...]
> > > 
> > > This is not the first reported failure on this case, see [1] for
> > > previous one.
> 
> Right, and I'm also seeing the failure now.
> 
> > > 
> > > I assume you are working on x86_64 machine.  Could you confirm if the
> > > change below can fix your issue?  If yes, I will send a formal patch.
> > 
> > Indeed, I am working on an AMD 3950X, and have glibc 2.40 installed.
> > The patch you sent didn't work out of the box, but with minor modifications
> > I could fix it. I just needed to replace nm -D $libc with nm $libc for it work.
> > The reason is that gaih_inet doesn't show with nm -D for my glibc:
> > 
> > $ nm -D /usr/lib64/libc.so.6 | grep getaddrinfo
> > 0000000000116a40 T getaddrinfo@@GLIBC_2.2.5
> > 000000000010c140 T getaddrinfo_a@GLIBC_2.2.5
> > 000000000010c140 T getaddrinfo_a@@GLIBC_2.34
> > $ nm /usr/lib64/libc.so.6 | grep getaddrinfo
> > 0000000000116a40 t __GI_getaddrinfo
> > 000000000010c140 t __getaddrinfo_a
> > 0000000000115e53 t __libc_getaddrinfo_freemem
> > 0000000000116a40 T getaddrinfo
> > 000000000010c140 T getaddrinfo_a@@GLIBC_2.34
> > 000000000010c140 T getaddrinfo_a@GLIBC_2.2.5
> > 
> > $ nm -D /usr/lib64/libc.so.6 | grep gaih_inet
> > $ nm /usr/lib64/libc.so.6 | grep gaih_inet
> > 0000000000115405 t gaih_inet
> > 00000000001139b2 t gaih_inet_serv
> > 0000000000177780 r gaih_inet_typeproto
> > 
> > Using nm $libc in both cases, and increasing max-stack to 4 allows the test to pass:
> > 
> > $ sudo ./perf test -vF pton
> > --- start ---
> > ping 1237113 [000] 18561.204983: probe_libc:inet_pton: (7f7c34d38eb7)
> > 7f7c34d38eb7 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
> > 7f7c34d4b517 gaih_inet+0x112 (/usr/lib64/libc.so.6)
> > 7f7c34d4cb73 getaddrinfo+0x133 (/usr/lib64/libc.so.6)
> > 55680ac46518 [unknown] (/usr/bin/ping)
> > ---- end ----
> >  86: probe libc's inet_pton & backtrace it with ping                 : Ok
> 
> I think it's very fragile as it depends on specific entries in the call
> stack.  As we want to test if perf probe (for uprobes) and perf record
> working correctly, maybe it can just check the number of samples only.
> 
> Arnaldo, what do you think?

That would reduce the usefulness of the test as it would be testing
fewer aspects of perf's functionality, including backtraces from uprobes
in addition to backtraces in general.

So I think Leo has a point in a followup message to this one where he
seems to have identified a subset of functions that are present in the
architectures we test?

- Arnaldo

      parent reply	other threads:[~2024-11-26 16:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 21:35 perf test for inet_pton probe fails to match stacktrace Guilherme Amadio
2024-11-24 10:50 ` Leo Yan
2024-11-25 13:12   ` Guilherme Amadio
2024-11-26  5:08     ` Namhyung Kim
2024-11-26 10:27       ` Leo Yan
2024-11-26 16:39         ` Arnaldo Carvalho de Melo
2024-11-26 18:27           ` Leo Yan
2024-11-26 16:27       ` Arnaldo Carvalho de Melo [this message]

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

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

  git send-email \
    --in-reply-to=Z0X3AYUWkAgfPpWj@x1 \
    --to=acme@kernel.org \
    --cc=amadio@gentoo.org \
    --cc=leo.yan@arm.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    /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