linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Kim Phillips <kim.phillips@arm.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 10/10] perf test shell: Replace '|&' with '2>&1 |' to work with more shells
Date: Wed, 16 Aug 2017 17:20:50 -0300	[thread overview]
Message-ID: <20170816202050.8865-11-acme@kernel.org> (raw)
In-Reply-To: <20170816202050.8865-1-acme@kernel.org>

From: Kim Phillips <kim.phillips@arm.com>

Since we do not specify bash (and/or zsh) as a requirement, use the
standard error redirection that is more widely supported.

Signed-off-by: Kim Phillips <kim.phillips@arm.com>
Link: http://lkml.kernel.org/n/tip-ji5mhn3iilgch3eaay6csr6z@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/shell/lib/probe.sh                  | 2 +-
 tools/perf/tests/shell/lib/probe_vfs_getname.sh      | 4 ++--
 tools/perf/tests/shell/trace+probe_libc_inet_pton.sh | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/tests/shell/lib/probe.sh b/tools/perf/tests/shell/lib/probe.sh
index 61da3b2c9bca..6293cc660947 100644
--- a/tools/perf/tests/shell/lib/probe.sh
+++ b/tools/perf/tests/shell/lib/probe.sh
@@ -1,6 +1,6 @@
 # Arnaldo Carvalho de Melo <acme@kernel.org>, 2017
 
 skip_if_no_perf_probe() {
-	perf probe |& grep -q 'is not a perf-command' && return 2
+	perf probe 2>&1 | grep -q 'is not a perf-command' && return 2
 	return 0
 }
diff --git a/tools/perf/tests/shell/lib/probe_vfs_getname.sh b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
index f832395daad7..30a950c9d407 100644
--- a/tools/perf/tests/shell/lib/probe_vfs_getname.sh
+++ b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
@@ -1,6 +1,6 @@
 # Arnaldo Carvalho de Melo <acme@kernel.org>, 2017
 
-perf probe -l |& grep -q probe:vfs_getname
+perf probe -l 2>&1 | grep -q probe:vfs_getname
 had_vfs_getname=$?
 
 cleanup_probe_vfs_getname() {
@@ -12,7 +12,7 @@ cleanup_probe_vfs_getname() {
 add_probe_vfs_getname() {
 	local verbose=$1
 	if [ $had_vfs_getname -eq 1 ] ; then
-		line=$(perf probe -L getname_flags |& egrep 'result.*=.*filename;' | sed -r 's/[[:space:]]+([[:digit:]]+)[[:space:]]+result->uptr.*/\1/')
+		line=$(perf probe -L getname_flags 2>&1 | egrep 'result.*=.*filename;' | sed -r 's/[[:space:]]+([[:digit:]]+)[[:space:]]+result->uptr.*/\1/')
 		perf probe $verbose "vfs_getname=getname_flags:${line} pathname=result->name:string"
 	fi
 }
diff --git a/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh b/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
index 99dafad61954..462fc755092e 100755
--- a/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
+++ b/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
@@ -22,7 +22,7 @@ trace_libc_inet_pton_backtrace() {
 	expected[7]="getaddrinfo[[:space:]]\(/usr/lib.*/libc-[0-9]+\.[0-9]+\.so\)$"
 	expected[8]=".*\(.*/bin/ping.*\)$"
 
-	perf trace --no-syscalls -e probe_libc:inet_pton/max-stack=3/ ping -6 -c 1 ::1 |& grep -v ^$ | while read line ; do
+	perf trace --no-syscalls -e probe_libc:inet_pton/max-stack=3/ ping -6 -c 1 ::1 2>&1 | grep -v ^$ | while read line ; do
 		echo $line
 		echo "$line" | egrep -q "${expected[$idx]}"
 		if [ $? -ne 0 ] ; then
-- 
2.13.5

  parent reply	other threads:[~2017-08-16 20:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-16 20:20 [GIT PULL 00/10] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-08-16 20:20 ` [PATCH 01/10] perf tests shell: Remove duplicate skip_if_no_debuginfo() function Arnaldo Carvalho de Melo
2017-08-16 20:20 ` [PATCH 02/10] perf test shell: Check if 'perf probe' is available, skip tests if not Arnaldo Carvalho de Melo
2017-08-16 20:20 ` [PATCH 03/10] perf test shell vfs_getname: Skip for tools built with NO_LIBDWARF=1 Arnaldo Carvalho de Melo
2017-08-16 20:20 ` [PATCH 04/10] perf scripts python: Fix missing call_path_id in export-to-postgresql script Arnaldo Carvalho de Melo
2017-08-16 20:20 ` [PATCH 05/10] perf scripts python: Fix query in call-graph-from-postgresql.py Arnaldo Carvalho de Melo
2017-08-16 20:20 ` [PATCH 06/10] perf script python: Add support for exporting to sqlite3 Arnaldo Carvalho de Melo
2017-08-16 20:20 ` [PATCH 07/10] perf script python: Rename call-graph-from-postgresql.py to call-graph-from-sql.py Arnaldo Carvalho de Melo
2017-08-16 20:20 ` [PATCH 08/10] perf script python: Add support for sqlite3 " Arnaldo Carvalho de Melo
2017-08-16 20:20 ` [PATCH 09/10] perf bpf: Fix endianness problem when loading parameters in prologue Arnaldo Carvalho de Melo
2017-08-16 20:20 ` Arnaldo Carvalho de Melo [this message]
2017-08-17  7:45 ` [GIT PULL 00/10] perf/core improvements and fixes Ingo Molnar

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=20170816202050.8865-11-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=kim.phillips@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).