0001
0002
0003 perf probe -l 2>&1 | grep -q probe:vfs_getname
0004 had_vfs_getname=$?
0005
0006 cleanup_probe_vfs_getname() {
0007 if [ $had_vfs_getname -eq 1 ] ; then
0008 perf probe -q -d probe:vfs_getname*
0009 fi
0010 }
0011
0012 add_probe_vfs_getname() {
0013 local verbose=$1
0014 if [ $had_vfs_getname -eq 1 ] ; then
0015 line=$(perf probe -L getname_flags 2>&1 | egrep 'result.*=.*filename;' | sed -r 's/[[:space:]]+([[:digit:]]+)[[:space:]]+result->uptr.*/\1/')
0016 perf probe -q "vfs_getname=getname_flags:${line} pathname=result->name:string" || \
0017 perf probe $verbose "vfs_getname=getname_flags:${line} pathname=filename:ustring"
0018 fi
0019 }
0020
0021 skip_if_no_debuginfo() {
0022 add_probe_vfs_getname -v 2>&1 | egrep -q "^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)" && return 2
0023 return 1
0024 }