In some situations the vfs_getname is being added both as requested and with a _1 suffix (inlines?): probe:vfs_getname_1 (on getname_flags:63@acme/git/linux/fs/namei.c with pathname) This ends up making the cleanup to miss that one, as it removes just 'probe:vfs_getname', which makes the second test to use this probe point to fail, since it finds that leftover from the first test, use a wildcard to remove both. Before: # perf test 60 61 62 63 60: Use vfs_getname probe to get syscall args filenames : FAILED! 61: probe libc's inet_pton & backtrace it with ping : Ok 62: Check open filename arg using perf trace + vfs_getname: FAILED! 63: Add vfs_getname probe to get syscall args filenames : Ok After: # perf test 60 61 62 63 60: Use vfs_getname probe to get syscall args filenames : Ok 61: probe libc's inet_pton & backtrace it with ping : Ok 62: Check open filename arg using perf trace + vfs_getname: Ok 63: Add vfs_getname probe to get syscall args filenames : Ok # Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Thomas Richter <tmricht@linux.vnet.ibm.com> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-2k5kutwr4ds36adiakyb4yvy@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
23 lines
719 B
Bash
23 lines
719 B
Bash
# Arnaldo Carvalho de Melo <acme@kernel.org>, 2017
|
|
|
|
perf probe -l 2>&1 | grep -q probe:vfs_getname
|
|
had_vfs_getname=$?
|
|
|
|
cleanup_probe_vfs_getname() {
|
|
if [ $had_vfs_getname -eq 1 ] ; then
|
|
perf probe -q -d probe:vfs_getname*
|
|
fi
|
|
}
|
|
|
|
add_probe_vfs_getname() {
|
|
local verbose=$1
|
|
if [ $had_vfs_getname -eq 1 ] ; then
|
|
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
|
|
}
|
|
|
|
skip_if_no_debuginfo() {
|
|
add_probe_vfs_getname -v 2>&1 | egrep -q "^(Failed to find the path for kernel|Debuginfo-analysis is not supported)" && return 2
|
|
return 1
|
|
}
|