Skip to content

Commit 35435cd

Browse files
kim-phillips-armacmel
authored andcommitted
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 <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent db26984 commit 35435cd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

tools/perf/tests/shell/lib/probe.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Arnaldo Carvalho de Melo <[email protected]>, 2017
22

33
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
55
return 0
66
}

tools/perf/tests/shell/lib/probe_vfs_getname.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Arnaldo Carvalho de Melo <[email protected]>, 2017
22

3-
perf probe -l |& grep -q probe:vfs_getname
3+
perf probe -l 2>&1 | grep -q probe:vfs_getname
44
had_vfs_getname=$?
55

66
cleanup_probe_vfs_getname() {
@@ -12,7 +12,7 @@ cleanup_probe_vfs_getname() {
1212
add_probe_vfs_getname() {
1313
local verbose=$1
1414
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/')
1616
perf probe $verbose "vfs_getname=getname_flags:${line} pathname=result->name:string"
1717
fi
1818
}

tools/perf/tests/shell/trace+probe_libc_inet_pton.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ trace_libc_inet_pton_backtrace() {
2222
expected[7]="getaddrinfo[[:space:]]\(/usr/lib.*/libc-[0-9]+\.[0-9]+\.so\)$"
2323
expected[8]=".*\(.*/bin/ping.*\)$"
2424

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
2626
echo $line
2727
echo "$line" | egrep -q "${expected[$idx]}"
2828
if [ $? -ne 0 ] ; then

0 commit comments

Comments
 (0)