Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1123852imm; Fri, 29 Jun 2018 11:48:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKZzSYAM4XYQXZFBWi9t+w364dWlecoOsHy+7XLIPof5JswGtBz1/SdL/wLpy6aXn13Wrqr X-Received: by 2002:a65:4146:: with SMTP id x6-v6mr13661158pgp.221.1530298114431; Fri, 29 Jun 2018 11:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530298114; cv=none; d=google.com; s=arc-20160816; b=BlaNqcwrFf6lQF9wugphePGR5oUFV9ITrTI4vyBz4iXN3qw1cHBJscTSIfCB6BOeTb NbL28I3LRvT3VN+/Bt1hFG/U2HJbhm0HprW4kGAAMg8bs/d/OHdFaSliaZO0uWVNRcGq Gy2XsKmPHxaEXFbw0lo7zm+eE4+5zrgIspnTQLSZ1+zy2mTa5XC0Vc1a1/2Fg//Ed/Lo wqbEBdCmRWw/YMxdOB4HScjz5pzwtBY1pNySS7LKKySDviYOmY5k0vG+wR9MCi09NK77 BTiXvXNapSbA4Zpp1kjyVMnOAFDg2iFg7o16L25sEXC747waiK8BWWf3he6uD4Uem+M6 OWjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:message-id:subject:cc:to:from:date :arc-authentication-results; bh=4iOm7+kSP9nnpckko5y2TXdkbY9WU7v6XjmhkCuzL88=; b=OOtUxcipiR6QSJElDYMrFt3AvNBS99al12iZe4L7xSuM3v6wrQfOWIyMYQqVdx5hWr zQ/Ch+fnB0tZPQ5m1s9tULTF/yjmIH3CKo62D3F1WHqhDBdFB6fyNX4HnZ7dhtohY4gr Lw+5L0xQs/oMibJW1sRCscIl8axY0phurOCkAcbCPhkE+DEmbfv93QLmOKxCwpBoZK9v pfIIydeYcD3kKz1xuEqtfKUzeQyP1AupQWfhpLVL48NMy4rZwzTQDKK4T8L+4uUU/D2/ B5sfjgxIJZpQVE9oiMh+6sczJVFUNeW1oUlKSXWIW4pMulTboUQwckVwLxq6LkR+5XUq b+eA== 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 e1-v6si6307513pli.6.2018.06.29.11.48.20; Fri, 29 Jun 2018 11:48:34 -0700 (PDT) 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 S934793AbeF2Rqi (ORCPT + 99 others); Fri, 29 Jun 2018 13:46:38 -0400 Received: from foss.arm.com ([217.140.101.70]:37900 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934656AbeF2Rqg (ORCPT ); Fri, 29 Jun 2018 13:46:36 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C740518A; Fri, 29 Jun 2018 10:46:35 -0700 (PDT) Received: from dupont (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D27283F5AD; Fri, 29 Jun 2018 10:46:34 -0700 (PDT) Date: Fri, 29 Jun 2018 12:46:33 -0500 From: Kim Phillips To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Richter , Michael Petlan , =?ISO-8859-1?Q? "Hendrik_Br=FCckner" ?= , Sandipan Das Subject: [PATCH v2 1/4] perf test shell: Replace '|&' with '2>&1 |' to work with more shells Message-Id: <20180629124633.0a9f4bea54b8d2c28f265de2@arm.com> Organization: Arm X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since we do not specify bash (and/or zsh) as a requirement, use the standard error redirection that is more widely supported. BEFORE: $ sudo ./perf test -v 62 62: Check open filename arg using perf trace + vfs_getname: --- start --- test child forked, pid 27305 ./tests/shell/trace+probe_vfs_getname.sh: 20: ./tests/shell/trace+probe_vfs_getname.sh: Syntax error: "&" unexpected test child finished with -2 ---- end ---- Check open filename arg using perf trace + vfs_getname: Skip AFTER: $ sudo ./perf test -v 62 64: Check open filename arg using perf trace + vfs_getname : --- start --- test child forked, pid 23008 Added new event: probe:vfs_getname (on getname_flags:72 with pathname=result->name:string) You can now use it in all perf tools, such as: perf record -e probe:vfs_getname -aR sleep 1 0.361 ( 0.008 ms): touch/23032 openat(dfd: CWD, filename: /tmp/temporary_file.VEh0n, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 4 test child finished with 0 ---- end ---- Check open filename arg using perf trace + vfs_getname: Ok Similar to commit 35435cd06081, with the same title. Cc: Arnaldo Carvalho de Melo Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Thomas Richter Cc: Michael Petlan Signed-off-by: Kim Phillips --- v2: indent terminal session logs with a space to avoid git-am parsing '--- start ---' as the end of the description text. tools/perf/tests/shell/trace+probe_vfs_getname.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/tests/shell/trace+probe_vfs_getname.sh b/tools/perf/tests/shell/trace+probe_vfs_getname.sh index 55ad9793d544..4ce276efe6b4 100755 --- a/tools/perf/tests/shell/trace+probe_vfs_getname.sh +++ b/tools/perf/tests/shell/trace+probe_vfs_getname.sh @@ -17,7 +17,7 @@ skip_if_no_perf_probe || exit 2 file=$(mktemp /tmp/temporary_file.XXXXX) trace_open_vfs_getname() { - evts=$(echo $(perf list syscalls:sys_enter_open* |& egrep 'open(at)? ' | sed -r 's/.*sys_enter_([a-z]+) +\[.*$/\1/') | sed 's/ /,/') + evts=$(echo $(perf list syscalls:sys_enter_open* 2>&1 | 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]+$" } -- 2.17.1