Skip to content

Commit e70b755

Browse files
author
Fox Snowpatch
committed
1 parent 4f37907 commit e70b755

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

tools/perf/tests/shell/base_probe/test_adding_kernel.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,23 @@ TEST_RESULT=0
2323
. "$DIR_PATH/../lib/probe_vfs_getname.sh"
2424

2525
TEST_PROBE=${TEST_PROBE:-"inode_permission"}
26+
PROBE_NO_LINE_CHECK=1
2627

2728
# set NO_DEBUGINFO to skip testcase if debuginfo is not present
2829
# skip_if_no_debuginfo returns 2 if debuginfo is not present
29-
skip_if_no_debuginfo
30+
#
31+
# The perf probe checks which depends on presence of debuginfo and
32+
# used in this testcase are:
33+
# 1. probe add for inode_permission
34+
# 2. probe max-probes option using 'vfs_* $params'
35+
# 3. non-existing variable probing
36+
#
37+
# For these tests, probe check for specific line is not
38+
# required ( add_probe_vfs_getname does that ). So call
39+
# skip_if_no_debuginfo with argument as 1. This is to convey
40+
# that test only needs to check for debuginfo, and not specifically
41+
# line number
42+
skip_if_no_debuginfo $PROBE_NO_LINE_CHECK
3043
if [ $? -eq 2 ]; then
3144
NO_DEBUGINFO=1
3245
fi

tools/perf/tests/shell/lib/probe_vfs_getname.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,18 @@ add_probe_vfs_getname() {
3939
}
4040

4141
skip_if_no_debuginfo() {
42-
add_probe_vfs_getname -v 2>&1 | grep -E -q "^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)|(file has no debug information)" && return 2
42+
no_line_check=$1
43+
debug_str="^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)|(file has no debug information)"
44+
45+
# search for debug_str using simple perf probe if the
46+
# test only needs to check for debuginfo, and not specifically
47+
# line number.
48+
if [ $no_line_check -eq 1 ]; then
49+
perf probe -vn add inode_permission 2>&1 | grep -E -q "$debug_str" && return 2
50+
else
51+
add_probe_vfs_getname -v 2>&1 | grep -E -q "$debug_str" && return 2
52+
fi
53+
4354
return 1
4455
}
4556

0 commit comments

Comments
 (0)