linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Richter <tmricht@linux.ibm.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	sumanthk@linux.ibm.com, svens@linux.ibm.com, gor@linux.ibm.com,
	hca@linux.ibm.com, Thomas Richter <richter@de.ibm.com>
Subject: Re: [PATCH v2 2/2] perf/test: Fix test case 89 for x86
Date: Wed, 4 Jan 2023 10:33:51 +0100	[thread overview]
Message-ID: <2d8265c4-6c1d-dbcd-2e85-64a3dd1ddc2c@linux.ibm.com> (raw)
In-Reply-To: <Y7QrqshCjRocRlWP@kernel.org>

On 1/3/23 14:20, Arnaldo Carvalho de Melo wrote:
> Em Wed, Dec 28, 2022 at 03:57:04PM +0100, Thomas Richter escreveu:
>> From: Thomas Richter <richter@de.ibm.com>
>>
>> perf test '89: probe libc's inet_pton & backtrace it with ping'
>> fails on x86. Debugging revealed a changed stack trace for the
>> ping command using probes:
>>
>> ping 35729 [002]  8006.365063: probe_libc:inet_pton: (3ff9603e7c0)
>>                   12be50 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
>>                   4fca main+0x139b (/usr/bin/ping)
>>
>> The line getaddrinfo.... in the call stack is gone.
>> It was introduced with glibc version 2.36.8 released
>> with Fedora 37.
> 
> Humm, I'm testing and invetigating this issue and by looking at the
> backtraces I see that it is just on the first entry that the getaddrinfo
> isn't present, i.e. now there are two inet_pton() calls, one of them
> doesn't come from getaddrinfo():
> 
> [root@quaco ~]# cat /tmp/perf.script.IUC
> ping 623883 [006] 265438.471610: probe_libc:inet_pton: (7f32bcf314c0)
> 	          1314c0 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
> 	           29510 __libc_start_call_main+0x80 (/usr/lib64/libc.so.6)
> 
> ping 623883 [006] 265438.471664: probe_libc:inet_pton: (7f32bcf314c0)
> 	          1314c0 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
> 	           fa6c6 getaddrinfo+0x126 (/usr/lib64/libc.so.6)
> 	            491e [unknown] (/usr/bin/ping)
> 
> The above is the temp file for the perf script output from the collected
> perf.data file See the second entry? Its as we expect:
> 
> [root@quaco ~]# cat /tmp/expected.aT6
> ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)
> .*inet_pton\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/libc.so.6|inlined\)$
> getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/libc.so.6\)$
> .*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$
> [root@quaco ~]#
> 
> But if I just ignore that first one and match against the second event
> instance:
> 
> [root@quaco ~]# perf test inet_pton
>  90: probe libc's inet_pton & backtrace it with ping                 : Ok
> [root@quaco ~]# perf test -v inet_pton
>  90: probe libc's inet_pton & backtrace it with ping                 :
> --- start ---
> test child forked, pid 626199
> ping 626222 [007] 266979.123047: probe_libc:inet_pton_1: (7f0650d314c0)
> 1314c0 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
> fa6c6 getaddrinfo+0x126 (/usr/lib64/libc.so.6)
> 491e n (/usr/bin/ping)
> test child finished with 0
> ---- end ----
> probe libc's inet_pton & backtrace it with ping: Ok
> [root@quaco ~]#
> 
> So, can you try with the following patch in your s/390 system?

Thanks Arnaldo,

your patch also works on my s390 system. I applied patch 1/2 which is
necessary and then your change:

  # ./perf test  85
  85: probe libc's inet_pton & backtrace it with ping                 : FAILED!
  # git am your-patch
  # ./perf test  85
  85: probe libc's inet_pton & backtrace it with ping                 : Ok
  #

So for patch 2/2 your have my
Tested-by: Thomas Richter <tmricht@linux.ibm.com>

> 
> I wish 'perf script' had a --skip option that allowed us to ask for just
> the second event, not having that I did a trick with tac + grep -m1 -B :-)
> 
> We can try to revisit your approach for the next merge window, as at
> this point, for 6.2 we want for fixes to be as minimal as possible.
> 

Yes that would be good to make this test case more rebust.

-- 
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294


      parent reply	other threads:[~2023-01-04  9:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-28 14:57 [PATCH v2 1/2] perf/test: Fix perf test 84 on s390 Thomas Richter
2022-12-28 14:57 ` [PATCH v2 2/2] perf/test: Fix test case 89 for x86 Thomas Richter
2023-01-03 13:20   ` Arnaldo Carvalho de Melo
2023-01-03 13:48     ` Arnaldo Carvalho de Melo
2023-01-04  9:33     ` Thomas Richter [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=2d8265c4-6c1d-dbcd-2e85-64a3dd1ddc2c@linux.ibm.com \
    --to=tmricht@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=richter@de.ibm.com \
    --cc=sumanthk@linux.ibm.com \
    --cc=svens@linux.ibm.com \
    /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 NNTP newsgroup(s).