All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sandipan Das <sandipan@linux.vnet.ibm.com>
To: acme@kernel.org, jolsa@redhat.com
Cc: linux-kernel@vger.kernel.org, ravi.bangoria@linux.ibm.com,
	naveen.n.rao@linux.vnet.ibm.com, tmricht@linux.ibm.com
Subject: [PATCH] perf tests: Fix regex for record+probe_libc_inet_pton.sh
Date: Fri, 18 May 2018 12:54:17 +0530	[thread overview]
Message-ID: <20180518072417.1498-1-sandipan@linux.vnet.ibm.com> (raw)

This test currently fails because the regular expressions for
matching the output of perf script do not consider the symbol
offsets to be part of the output.

The symbol offsets are seen because of the default behaviour
introduced by commit 4140d2ea74b3 ("perf script: Show symbol
offsets by default").

Before applying this patch:

  # perf test -v "probe libc's inet_pton & backtrace it with ping"

  62: probe libc's inet_pton & backtrace it with ping       :
  --- start ---
  test child forked, pid 30389
  ping 30406 [002] 307144.280983: probe_libc:inet_pton: (7f4117adf220)
  7f4117adf220 __GI___inet_pton+0x0 (/usr/lib64/libc-2.25.so)
  FAIL: expected backtrace entry 1 ".*inet_pton[[:space:]]\(/usr/lib64/libc-2.25.so|inlined\)$" got "7f4117adf220 __GI___inet_pton+0x0 (/usr/lib64/libc-2.25.so)"
  test child finished with -1
  ---- end ----
  probe libc's inet_pton & backtrace it with ping: FAILED!

After applying this patch:

  # perf test -v "probe libc's inet_pton & backtrace it with ping"

  62: probe libc's inet_pton & backtrace it with ping       :
  --- start ---
  test child forked, pid 30539
  ping 30556 [003] 307254.313217: probe_libc:inet_pton: (7fe19ab10220)
  7fe19ab10220 __GI___inet_pton+0x0 (/usr/lib64/libc-2.25.so)
  7fe19aad5ebd getaddrinfo+0x11d (/usr/lib64/libc-2.25.so)
  56351e3c1c71 main+0x891 (/usr/bin/ping)
  test child finished with 0
  ---- end ----
  probe libc's inet_pton & backtrace it with ping: Ok

Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
---
 tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
index ee86473643be..650b208f700f 100755
--- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
+++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
@@ -16,18 +16,18 @@ nm -g $libc 2>/dev/null | fgrep -q inet_pton || exit 254
 trace_libc_inet_pton_backtrace() {
 	idx=0
 	expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
-	expected[1]=".*inet_pton[[:space:]]\($libc|inlined\)$"
+	expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
 	case "$(uname -m)" in
 	s390x)
 		eventattr='call-graph=dwarf,max-stack=4'
-		expected[2]="gaih_inet.*[[:space:]]\($libc|inlined\)$"
-		expected[3]="(__GI_)?getaddrinfo[[:space:]]\($libc|inlined\)$"
-		expected[4]="main[[:space:]]\(.*/bin/ping.*\)$"
+		expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
+		expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
+		expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
 		;;
 	*)
 		eventattr='max-stack=3'
-		expected[2]="getaddrinfo[[:space:]]\($libc\)$"
-		expected[3]=".*\(.*/bin/ping.*\)$"
+		expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
+		expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
 		;;
 	esac
 
-- 
2.13.6

             reply	other threads:[~2018-05-18  7:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18  7:24 Sandipan Das [this message]
2018-05-18 10:21 ` [PATCH] perf tests: Fix regex for record+probe_libc_inet_pton.sh Thomas-Mich Richter
2018-05-18 10:29   ` Sandipan Das
2018-05-18 11:09     ` Thomas-Mich Richter
2018-05-18 14:14       ` Arnaldo Carvalho de Melo
2018-05-18 18:24         ` Arnaldo Carvalho de Melo
2018-05-22  6:09         ` Thomas-Mich Richter
2018-05-18 19:21 ` Arnaldo Carvalho de Melo
2018-05-18 19:28   ` Sandipan Das
2018-05-18 19:29   ` Arnaldo Carvalho de Melo
2018-05-18 19:30     ` Arnaldo Carvalho de Melo
2018-07-04  6:57 ` [lkp-robot] [perf tests] 32a4debc7c: perf-sanity-tests.probe_libc's_inet_pton_&_backtrace_it_with_ping.fail kernel test robot
2018-07-04  6:57   ` kernel test robot
2018-07-04 12:37   ` Sandipan Das

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=20180518072417.1498-1-sandipan@linux.vnet.ibm.com \
    --to=sandipan@linux.vnet.ibm.com \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ravi.bangoria@linux.ibm.com \
    --cc=tmricht@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.