All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf test fix check open filename arg using perf trace on s390x
@ 2017-11-14  7:18 Thomas Richter
  2017-11-14  7:18 ` [PATCH] perf test: fix test case probe libc's inet_pton " Thomas Richter
  2017-11-14 13:13 ` [PATCH] perf test fix check open filename arg using perf trace " Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 10+ messages in thread
From: Thomas Richter @ 2017-11-14  7:18 UTC (permalink / raw)
  To: acme, linux-perf-users; +Cc: brueckner, Thomas Richter

This perf test case fails on s390x. The touch command on s390x uses
the openat system call to open the file named on the command line:

[root@s35lp76 perf]# ./perf probe -l
  probe:vfs_getname    (on getname_flags:72@fs/namei.c with pathname)
[root@s35lp76 perf]# ./perf trace -e open touch /tmp/abc
     0.400 ( 0.015 ms): touch/27542 open(filename:
		/usr/lib/locale/locale-archive, flags: CLOEXEC         ) = 3
[root@s35lp76 perf]#

There is no open system call for file /tmp/abc. Instead openat
system call is used:

[root@s35lp76 perf]# strace touch /tmp/abc
    execve("/usr/bin/touch", ["touch", "/tmp/abc"], 0x3ffd547ec98
			/* 30 vars */) = 0
    [...]
    openat(AT_FDCWD, "/tmp/abc", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = 3
    [...]

On s390x the egrep command does not find a matching pattern and returns
an error.

Fix this for the s390x platform and create a platform dependend command
line to enable the perf probe to listen to openat system call on s390x
and get the correct perf trace output.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
---
 tools/perf/tests/shell/trace+probe_vfs_getname.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/tests/shell/trace+probe_vfs_getname.sh b/tools/perf/tests/shell/trace+probe_vfs_getname.sh
index 2e68c5f120da..2a9ef080efd0 100755
--- a/tools/perf/tests/shell/trace+probe_vfs_getname.sh
+++ b/tools/perf/tests/shell/trace+probe_vfs_getname.sh
@@ -17,8 +17,10 @@ skip_if_no_perf_probe || exit 2
 file=$(mktemp /tmp/temporary_file.XXXXX)
 
 trace_open_vfs_getname() {
-	perf trace -e open touch $file 2>&1 | \
-	egrep " +[0-9]+\.[0-9]+ +\( +[0-9]+\.[0-9]+ ms\): +touch\/[0-9]+ open\(filename: +${file}, +flags: CREAT\|NOCTTY\|NONBLOCK\|WRONLY, +mode: +IRUGO\|IWUGO\) += +[0-9]+$"
+	test "$(uname -m)" = s390x && { svc="openat"; txt="dfd: +CWD, +"; }
+
+	perf trace -e ${svc:-open} touch $file 2>&1 | \
+	egrep " +[0-9]+\.[0-9]+ +\( +[0-9]+\.[0-9]+ ms\): +touch\/[0-9]+ ${svc:-open}\(${txt}filename: +${file}, +flags: CREAT\|NOCTTY\|NONBLOCK\|WRONLY, +mode: +IRUGO\|IWUGO\) += +[0-9]+$"
 }
 
 
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-11-29  6:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-14  7:18 [PATCH] perf test fix check open filename arg using perf trace on s390x Thomas Richter
2017-11-14  7:18 ` [PATCH] perf test: fix test case probe libc's inet_pton " Thomas Richter
2017-11-14 13:26   ` Arnaldo Carvalho de Melo
2017-11-14 13:34     ` Arnaldo Carvalho de Melo
2017-11-14 13:47       ` Arnaldo Carvalho de Melo
2017-11-14 13:55         ` Thomas-Mich Richter
2017-11-14 14:58           ` Arnaldo Carvalho de Melo
2017-11-18  8:33       ` [tip:perf/core] perf test shell: Fix " tip-bot for Thomas Richter
2017-11-29  6:31       ` tip-bot for Thomas Richter
2017-11-14 13:13 ` [PATCH] perf test fix check open filename arg using perf trace " Arnaldo Carvalho de Melo

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.