# 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
}
# 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() {
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
}
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