Received: by 10.223.185.116 with SMTP id b49csp1074792wrg; Fri, 23 Feb 2018 11:27:48 -0800 (PST) X-Google-Smtp-Source: AH8x227IdcLHs9wnH1Y4vHNiEiPaCyPPSDuwER1iHVAw8cs0o5GT3FJjzaqzVYiMI8ZiMFDOp9ux X-Received: by 10.101.98.133 with SMTP id f5mr2197351pgv.357.1519414068474; Fri, 23 Feb 2018 11:27:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519414068; cv=none; d=google.com; s=arc-20160816; b=JHkT/5xqGpb+Xxp2F6tP+TSD8w8cPmJS7+kvWn1s0o+NnFDgcfCnbfypyrP3EgcefR 6yH2eGXuq//ugjrMyIN2bS2j6uiSdDcmLCgB7MhtAxS9xxOt2Xw9dhgnVmOZlSBXpXHk CmxOd8JCpc73O6Q1U7pIaawlXpm7riGjThH4jsX4Zw0qtyYbpQhM6VQMdSR8BFwGkR+b PpRgxAFuZCCSbYcZzqrb/WRe6X9HHxRUGSx/ldMmAqSWjD46GM54jvGYflPDqIA/Rh1n Vp8BCPZ+MYVUX4r4M8lo6ZLrHIzycYLp9cHAgPa+ro6o8VhKQNvfrI0swMd10t55GYBb 4s+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=f6h3VpHuzlr7zJK99xzvChxPNa4HUb/wNe2byNA5GcY=; b=TpyrgVa4YrgFRkFUB8qB4fnfj4EmapjAe2hYcrXUnPqt0tqQiIDgZ3ueQRPzh0ctUh 7qAzQXsSTB1reelgy7F3w3K/j1LPaaMEj9dxK7zhzoGBAI0ZD9UTeaCSqB+dBvn/UKk5 Y/6RS+MO6hlhHhXz2ic9Sr6tSD6xUVr20R+isIgglkazJjY9HEGQxq63cUw1oUX+PPKi iE0CwDv5oybsM+rXsypY0/reZw3ABAC0Fd8cQ8Pgf7AQDUUiHVABifd51pp1IQS3ORw8 GdgbFmgZE+4kK/nd4mYFzeskwKvcZijCnq8HR+Jm29ZT2sR2F2NDHy7X3s3xxJoMp68R jn+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k12si1874641pgs.166.2018.02.23.11.27.34; Fri, 23 Feb 2018 11:27:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754613AbeBWT1A (ORCPT + 99 others); Fri, 23 Feb 2018 14:27:00 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:46950 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935135AbeBWSw3 (ORCPT ); Fri, 23 Feb 2018 13:52:29 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D922EF82; Fri, 23 Feb 2018 18:52:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas-Mich Richter , Arnaldo Carvalho de Melo , Hendrik Brueckner , Sasha Levin Subject: [PATCH 4.14 071/159] perf test shell: Fix check open filename arg using perf trace on s390x Date: Fri, 23 Feb 2018 19:26:19 +0100 Message-Id: <20180223170752.223365418@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170743.086611315@linuxfoundation.org> References: <20180223170743.086611315@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Richter [ Upstream commit ccafc38f1c778847ab6d53dd7933260426731cf3 ] 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 the '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 s390x create a platform dependent command line to enable the 'perf probe' call to listen to the 'openat' system call and get the expected output. Signed-off-by: Thomas-Mich Richter Tested-by: Arnaldo Carvalho de Melo Cc: Hendrik Brueckner Cc: Thomas-Mich Richter LPU-Reference: 20171114071847.2381-1-tmricht@linux.vnet.ibm.com Link: http://lkml.kernel.org/n/tip-3qf38jk0prz54rhmhyu871my@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/perf/tests/shell/trace+probe_vfs_getname.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- 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]+$" }