blob: ba29535b8580a6caebfb339d4d81789b41e407ec [file] [log] [blame]
# Use vfs_getname probe to get syscall args filenames
# Uses the 'perf test shell' library to add probe:vfs_getname to the system
# then use it with 'perf record' using 'touch' to write to a temp file, then
# checks that that was captured by the vfs_getname probe in the generated
# file, with the temp file name as the pathname argument.
# Arnaldo Carvalho de Melo <>, 2017
. $(dirname $0)/lib/
skip_if_no_perf_probe || exit 2
. $(dirname $0)/lib/
perfdata=$(mktemp /tmp/
file=$(mktemp /tmp/temporary_file.XXXXX)
record_open_file() {
echo "Recording open file:"
perf record -o ${perfdata} -e probe:vfs_getname touch $file
perf_script_filenames() {
echo "Looking at file for vfs_getname records for the file we touched:"
perf script -i ${perfdata} | \
egrep " +touch +[0-9]+ +\[[0-9]+\] +[0-9]+\.[0-9]+: +probe:vfs_getname: +\([[:xdigit:]]+\) +pathname=\"${file}\""
add_probe_vfs_getname || skip_if_no_debuginfo
if [ $err -ne 0 ] ; then
exit $err
record_open_file && perf_script_filenames
rm -f ${perfdata}
rm -f ${file}
exit $err