Skip to contentSkip to conversation

perf test shell: Fix check open filename arg using 'perf trace'

PATCH In review Michael Petlan 1 participant 1 message Dec 12, 2017 1 message not in the archive perf events

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 3481dc9fd2a192afb457b7782494e9b68b9f2ca3.1513095505.git.mpetlan@redhat.com

#1 lore raw

PATCH 1/2 perf test shell: Fix check open filename arg using 'perf trace'

The following commit added an exception for s390x to use openat() instead of open() in the test:

commit f231af789b11a2f1a3795acc3228a3e178a80c21
Author: Thomas Richter <[email protected]>
Date: Tue Nov 14 08:18:46 2017 +0100

Since the problem is not s390x-specific, this patch makes it more generic, so the test handles both open() and openat() no matter which architecture it is running on.

---
 tools/perf/tests/shell/trace+probe_vfs_getname.sh | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
tools/perf/tests/shell/trace+probe_vfs_getname.sh +3 -4
index 2a9ef08..55ad979 100755
@@ -17,10 +17,9 @@ skip_if_no_perf_probe || exit 2
 file=$(mktemp /tmp/temporary_file.XXXXX)
 
 trace_open_vfs_getname() {
-	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]+$"
+	evts=$(echo $(perf list syscalls:sys_enter_open* |& egrep 'open(at)? ' | sed -r 's/.*sys_enter_([a-z]+) +\[.*$/\1/') | sed 's/ /,/')
+	perf trace -e $evts touch $file 2>&1 | \
+	egrep " +[0-9]+\.[0-9]+ +\( +[0-9]+\.[0-9]+ ms\): +touch\/[0-9]+ open(at)?\((dfd: +CWD, +)?filename: +${file}, +flags: CREAT\|NOCTTY\|NONBLOCK\|WRONLY, +mode: +IRUGO\|IWUGO\) += +[0-9]+$"
 }
 
 
Signature · 1 line
1.8.3.1