2017-08-04 14:18:29 -03:00
# Arnaldo Carvalho de Melo <acme@kernel.org>, 2017
2017-08-16 16:20:40 -03:00
perf probe -l 2>& 1 | grep -q probe:vfs_getname
2017-08-04 14:18:29 -03:00
had_vfs_getname = $?
cleanup_probe_vfs_getname( ) {
if [ $had_vfs_getname -eq 1 ] ; then
2018-02-16 15:26:51 -03:00
perf probe -q -d probe:vfs_getname*
2017-08-04 14:18:29 -03:00
fi
}
add_probe_vfs_getname( ) {
local verbose = $1
if [ $had_vfs_getname -eq 1 ] ; then
2017-08-16 16:20:40 -03:00
line = $( perf probe -L getname_flags 2>& 1 | egrep 'result.*=.*filename;' | sed -r 's/[[:space:]]+([[:digit:]]+)[[:space:]]+result->uptr.*/\1/' )
2019-01-04 15:10:00 -03:00
perf probe -q " vfs_getname=getname_flags: ${ line } pathname=result->name:string " || \
2020-02-17 11:21:11 +01:00
perf probe $verbose " vfs_getname=getname_flags: ${ line } pathname=filename:ustring "
2017-08-04 14:18:29 -03:00
fi
}
skip_if_no_debuginfo( ) {
2022-09-16 16:19:04 +05:30
add_probe_vfs_getname -v 2>& 1 | egrep -q "^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)|(file has no debug information)" && return 2
2017-08-04 14:18:29 -03:00
return 1
}