Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf test shell: Replace '|&' with '2>&1 |' to work with more shells

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>

authored by

Kim Phillips and committed by
Arnaldo Carvalho de Melo
35435cd0 db26984a

+4 -4
+1 -1
tools/perf/tests/shell/lib/probe.sh
··· 1 1 # Arnaldo Carvalho de Melo <acme@kernel.org>, 2017 2 2 3 3 skip_if_no_perf_probe() { 4 - perf probe |& grep -q 'is not a perf-command' && return 2 4 + perf probe 2>&1 | grep -q 'is not a perf-command' && return 2 5 5 return 0 6 6 }
+2 -2
tools/perf/tests/shell/lib/probe_vfs_getname.sh
··· 1 1 # Arnaldo Carvalho de Melo <acme@kernel.org>, 2017 2 2 3 - perf probe -l |& grep -q probe:vfs_getname 3 + perf probe -l 2>&1 | grep -q probe:vfs_getname 4 4 had_vfs_getname=$? 5 5 6 6 cleanup_probe_vfs_getname() { ··· 12 12 add_probe_vfs_getname() { 13 13 local verbose=$1 14 14 if [ $had_vfs_getname -eq 1 ] ; then 15 - line=$(perf probe -L getname_flags |& egrep 'result.*=.*filename;' | sed -r 's/[[:space:]]+([[:digit:]]+)[[:space:]]+result->uptr.*/\1/') 15 + line=$(perf probe -L getname_flags 2>&1 | egrep 'result.*=.*filename;' | sed -r 's/[[:space:]]+([[:digit:]]+)[[:space:]]+result->uptr.*/\1/') 16 16 perf probe $verbose "vfs_getname=getname_flags:${line} pathname=result->name:string" 17 17 fi 18 18 }
+1 -1
tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
··· 22 22 expected[7]="getaddrinfo[[:space:]]\(/usr/lib.*/libc-[0-9]+\.[0-9]+\.so\)$" 23 23 expected[8]=".*\(.*/bin/ping.*\)$" 24 24 25 - perf trace --no-syscalls -e probe_libc:inet_pton/max-stack=3/ ping -6 -c 1 ::1 |& grep -v ^$ | while read line ; do 25 + 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 26 26 echo $line 27 27 echo "$line" | egrep -q "${expected[$idx]}" 28 28 if [ $? -ne 0 ] ; then