tools/perf/tests: Update debuginfo check in skip_if_no_debuginfo
PATCH 1/1 tools/perf/tests: Update debuginfo check in skip_if_no_debuginfo
Perf test perftool-testsuite_probe fails as below:
Regexp not found: "\s*probe:inode_permission(?:_\d+)?\s+\(on inode_permission(?:[:\+][0-9A-Fa-f]+)?@.+\)" -- [ FAIL ] -- perf_probe :: test_adding_kernel :: listing added probe :: perf probe -l (output regexp parsing) -- [ PASS ] -- perf_probe :: test_adding_kernel :: removing multiple probes
Regexp not found: "probe:vfs_mknod"
Regexp not found: "probe:vfs_create"
Regexp not found: "probe:vfs_rmdir"
Regexp not found: "probe:vfs_link"
Regexp not found: "probe:vfs_write"
-- [ FAIL ] -- perf_probe :: test_adding_kernel :: wildcard adding support (command exitcode + output regexp parsing) Regexp not found: "somenonexistingrandomstuffwhichisalsoprettylongorevenlongertoexceed64"
Regexp not found: "in this function|at this address"
-- [ FAIL ] -- perf_probe :: test_adding_kernel :: non-existing variable (output regexp parsing) ## [ FAIL ] ## perf_probe :: test_adding_kernel SUMMARY :: 3 failures found
Further analysing, the failed testcase is for "test_adding_kernel". If the kernel debuginfo is missing, perf probe fails as below:
perf probe -nf --max-probes=512 -a 'vfs_* $params' Failed to find the path for the kernel: No such file or directory
Error: Failed to add events.
skip_if_no_debuginfo has check to handle whether debuginfo is present and the testcase checks for debuginfo since this :
commit 90d32e92011e ("tools/perf: Handle perftool-testsuite_probe testcases fail when kernel debuginfo is not present")
Recently a change got added in "tests/shell/lib/probe_vfs_getname.sh" via this another fix:
commit 92b664dcefab ("perf test probe_vfs_getname: Skip if no suitable line detected")
Since this commit, first add_probe_vfs_getname is used to prevent false failures. And based on return code of add_probe_vfs_getname, skip_if_no_debuginfo is used to skip testcase if debuginfo is present. And this modified other testcases to call add_probe_vfs_getname first and invoke skip_if_no_debuginfo based on return value.
The tests in test_adding_kernel.sh which depends on presence of debuginfo are:
1. probe add for inode_permission
2. probe max-probes option using 'vfs_* $params'
3. non-existing variable probing
For these tests, probe check for specific line is not required. So call skip_if_no_debuginfo with argument to say if line check is needed. This is to convey to skip_if_no_debuginfo() function that test only needs to check for debuginfo, and not specifically line number. Update skip_if_no_debuginfo to use simple "perf probe" check if test only needs to check for debuginfo. And for other tests which rely on line number, use add_probe_vfs_getname()
With the change, verified that only three which required debuginfo only is skipped and others ran successfully. Also tested with debuginfo to make sure tests are not skipped.
--- .../tests/shell/base_probe/test_adding_kernel.sh | 15 ++++++++++++++- tools/perf/tests/shell/lib/probe_vfs_getname.sh | 13 ++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-)
tools/perf/tests/shell/base_probe/test_adding_kernel.sh +14 -1
@@ -23,10 +23,23 @@ TEST_RESULT=0 . "$DIR_PATH/../lib/probe_vfs_getname.sh" TEST_PROBE=${TEST_PROBE:-"inode_permission"} +PROBE_NO_LINE_CHECK=1 # set NO_DEBUGINFO to skip testcase if debuginfo is not present # skip_if_no_debuginfo returns 2 if debuginfo is not present -skip_if_no_debuginfo +# +# The perf probe checks which depends on presence of debuginfo and +# used in this testcase are: +# 1. probe add for inode_permission +# 2. probe max-probes option using 'vfs_* $params' +# 3. non-existing variable probing +# +# For these tests, probe check for specific line is not +# required ( add_probe_vfs_getname does that ). So call +# skip_if_no_debuginfo with argument as 1. This is to convey +# that test only needs to check for debuginfo, and not specifically +# line number +skip_if_no_debuginfo $PROBE_NO_LINE_CHECK if [ $? -eq 2 ]; then NO_DEBUGINFO=1 fi
tools/perf/tests/shell/lib/probe_vfs_getname.sh +12 -1
@@ -39,7 +39,18 @@ add_probe_vfs_getname() { } skip_if_no_debuginfo() { - 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 + no_line_check=$1 + debug_str="^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)|(file has no debug information)" + + # search for debug_str using simple perf probe if the + # test only needs to check for debuginfo, and not specifically + # line number. + if [ $no_line_check -eq 1 ]; then + perf probe -v -L getname_flags 2>&1 | grep -E -q "$debug_str" && return 2 + else + add_probe_vfs_getname -v 2>&1 | grep -E -q "$debug_str" && return 2 + fi + return 1 }
Signature · 1 line
2.47.3
Quoted 107 lines · Athira Rajeev
Perf test perftool-testsuite_probe fails as below:
Regexp not found:"\s*probe:inode_permission(?:_\d+)?\s+\(on
inode_permission(?:[:\+][0-9A-Fa-f]+)?@.+\)"
-- [ FAIL ] --perf_probe::test_adding_kernel:: listing added probe :: perf probe -l (output regexp parsing) -- [ PASS ] --perf_probe::test_adding_kernel:: removing multiple probes
Regexp not found: "probe:vfs_mknod"
Regexp not found: "probe:vfs_create"
Regexp not found: "probe:vfs_rmdir"
Regexp not found: "probe:vfs_link"
Regexp not found: "probe:vfs_write"
-- [ FAIL ] --perf_probe::test_adding_kernel:: wildcard adding support (command exitcode + output regexp parsing) Regexp not found: "somenonexistingrandomstuffwhichisalsoprettylongorevenlongertoexceed64"
Regexp not found: "in this function|at this address"
-- [ FAIL ] --perf_probe::test_adding_kernel:: non-existing variable (output regexp parsing) ## [ FAIL ] ##perf_probe::test_adding_kernelSUMMARY :: 3 failures foundFurther analysing, the failed testcase is for "
test_adding_kernel". If the kernel debuginfo is missing, perf probe fails as below:perf probe -nf --max-probes=512 -a 'vfs_* $params' Failed to find the path for the kernel: No such file or directory
Error: Failed to add events.
skip_if_no_debuginfohas check to handle whether debuginfo is present and the testcase checks for debuginfo since this :
commit90d32e92011e("tools/perf: Handle perftool-testsuite_probe testcases fail when kernel debuginfo is not present")Recently a change got added in "
tests/shell/lib/probe_vfs_getname.sh" via this another fix:
commit92b664dcefab("perf testprobe_vfs_getname: Skip if no suitable line detected")
Since this commit, firstadd_probe_vfs_getnameis used to prevent false failures. And based on return code ofadd_probe_vfs_getname,skip_if_no_debuginfois used to skip testcase if debuginfo is present. And this modified other testcases to calladd_probe_vfs_getnamefirst and invokeskip_if_no_debuginfobased on return value.The tests in
test_adding_kernel.shwhich depends on presence of debuginfo are:
1. probe add forinode_permission
2. probe max-probes option using 'vfs_* $params'
3. non-existing variable probingFor these tests, probe check for specific line is not required. So call
skip_if_no_debuginfowith argument to say if line check is needed. This is to convey toskip_if_no_debuginfo()function that test only needs to check for debuginfo, and not specifically line number. Updateskip_if_no_debuginfoto use simple "perf probe" check if test only needs to check for debuginfo. And for other tests which rely on line number, useadd_probe_vfs_getname()With the change, verified that only three which required debuginfo only is skipped and others ran successfully. Also tested with debuginfo to make sure tests are not skipped.
Reported-by Tejas Manhas<[email protected]>Signed-off-by Athira Rajeev<[email protected]>--- .../tests/shell/base_probe/test_adding_kernel.sh | 15 ++++++++++++++- tools/perf/tests/shell/lib/probe_vfs_getname.sh | 13 ++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-)tools/perf/tests/shell/base_probe/test_adding_kernel.sh +14
-1@@ -23,10 +23,23 @@ TEST_RESULT=0 . "$DIR_PATH/../lib/probe_vfs_getname.sh" TEST_PROBE=${TEST_PROBE:-"inode_permission"} +PROBE_NO_LINE_CHECK=1 # set NO_DEBUGINFO to skip testcase if debuginfo is not present # skip_if_no_debuginfo returns 2 if debuginfo is not present -skip_if_no_debuginfo +# +# The perf probe checks which depends on presence of debuginfo and +# used in this testcase are: +# 1. probe add for inode_permission +# 2. probe max-probes option using 'vfs_* $params' +# 3. non-existing variable probing +# +# For these tests, probe check for specific line is not +# required ( add_probe_vfs_getname does that ). So call +# skip_if_no_debuginfo with argument as 1. This is to convey +# that test only needs to check for debuginfo, and not specifically +# line number +skip_if_no_debuginfo $PROBE_NO_LINE_CHECK if [ $? -eq 2 ]; then NO_DEBUGINFO=1 fitools/perf/tests/shell/lib/probe_vfs_getname.sh +5
-1@@ -39,7 +39,18 @@ add_probe_vfs_getname() { } skip_if_no_debuginfo() { - 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 + no_line_check=$1 + debug_str="^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)|(file has no debug information)" + + # search for debug_str using simple perf probe if the + # test only needs to check for debuginfo, and not specifically
tools/perf/tests/shell/lib/probe_vfs_getname.sh add_probe_vfs_getname() { · line 56
Quoted 10 lines
tools/perf/tests/shell/lib/probe_vfs_getname.sh +7
-0+ # line number. + if [ $no_line_check -eq 1 ]; then + perf probe -v -L getname_flags 2>&1 | grep -E -q "$debug_str" && return 2 + else + add_probe_vfs_getname -v 2>&1 | grep -E -q "$debug_str" && return 2 + fi + return 1 }
Hi Athira,
I have tested the patch on the kernel[ 7.0.0-rc4+ ] and it works as expected, i.e. skipping in case of no debuginfo. Please add the tag below for the patch.
Thanks & Regards,
Tejas
Quoted 106 lines · Athira Rajeev
Perf test perftool-testsuite_probe fails as below:
Regexp not found: "\s*probe:inode_permission(?:_\d+)?\s+\(on inode_permission(?:[:\+][0-9A-Fa-f]+)?@.+\)" -- [ FAIL ] --
perf_probe::test_adding_kernel:: listing added probe :: perf probe -l (output regexp parsing) -- [ PASS ] --perf_probe::test_adding_kernel:: removing multiple probes
Regexp not found: "probe:vfs_mknod"
Regexp not found: "probe:vfs_create"
Regexp not found: "probe:vfs_rmdir"
Regexp not found: "probe:vfs_link"
Regexp not found: "probe:vfs_write"
-- [ FAIL ] --perf_probe::test_adding_kernel:: wildcard adding support (command exitcode + output regexp parsing) Regexp not found: "somenonexistingrandomstuffwhichisalsoprettylongorevenlongertoexceed64"
Regexp not found: "in this function|at this address"
-- [ FAIL ] --perf_probe::test_adding_kernel:: non-existing variable (output regexp parsing) ## [ FAIL ] ##perf_probe::test_adding_kernelSUMMARY :: 3 failures foundFurther analysing, the failed testcase is for "
test_adding_kernel". If the kernel debuginfo is missing, perf probe fails as below:perf probe -nf --max-probes=512 -a 'vfs_* $params' Failed to find the path for the kernel: No such file or directory
Error: Failed to add events.
skip_if_no_debuginfohas check to handle whether debuginfo is present and the testcase checks for debuginfo since this :
commit90d32e92011e("tools/perf: Handle perftool-testsuite_probe testcases fail when kernel debuginfo is not present")Recently a change got added in "
tests/shell/lib/probe_vfs_getname.sh" via this another fix:
commit92b664dcefab("perf testprobe_vfs_getname: Skip if no suitable line detected")
Since this commit, firstadd_probe_vfs_getnameis used to prevent false failures. And based on return code ofadd_probe_vfs_getname,skip_if_no_debuginfois used to skip testcase if debuginfo is present. And this modified other testcases to calladd_probe_vfs_getnamefirst and invokeskip_if_no_debuginfobased on return value.The tests in
test_adding_kernel.shwhich depends on presence of debuginfo are:
1. probe add forinode_permission
2. probe max-probes option using 'vfs_* $params'
3. non-existing variable probingFor these tests, probe check for specific line is not required. So call
skip_if_no_debuginfowith argument to say if line check is needed. This is to convey toskip_if_no_debuginfo()function that test only needs to check for debuginfo, and not specifically line number. Updateskip_if_no_debuginfoto use simple "perf probe" check if test only needs to check for debuginfo. And for other tests which rely on line number, useadd_probe_vfs_getname()With the change, verified that only three which required debuginfo only is skipped and others ran successfully. Also tested with debuginfo to make sure tests are not skipped.
Reported-by Tejas Manhas <[email protected]>Signed-off-by Athira Rajeev <[email protected]>--- .../tests/shell/base_probe/test_adding_kernel.sh | 15 ++++++++++++++- tools/perf/tests/shell/lib/probe_vfs_getname.sh | 13 ++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-)tools/perf/tests/shell/base_probe/test_adding_kernel.sh +14
-1@@ -23,10 +23,23 @@ TEST_RESULT=0 . "$DIR_PATH/../lib/probe_vfs_getname.sh" TEST_PROBE=${TEST_PROBE:-"inode_permission"} +PROBE_NO_LINE_CHECK=1 # set NO_DEBUGINFO to skip testcase if debuginfo is not present # skip_if_no_debuginfo returns 2 if debuginfo is not present -skip_if_no_debuginfo +# +# The perf probe checks which depends on presence of debuginfo and +# used in this testcase are: +# 1. probe add for inode_permission +# 2. probe max-probes option using 'vfs_* $params' +# 3. non-existing variable probing +# +# For these tests, probe check for specific line is not +# required ( add_probe_vfs_getname does that ). So call +# skip_if_no_debuginfo with argument as 1. This is to convey +# that test only needs to check for debuginfo, and not specifically +# line number +skip_if_no_debuginfo $PROBE_NO_LINE_CHECK if [ $? -eq 2 ]; then NO_DEBUGINFO=1 fitools/perf/tests/shell/lib/probe_vfs_getname.sh +5
-1@@ -39,7 +39,18 @@ add_probe_vfs_getname() { } skip_if_no_debuginfo() { - 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 + no_line_check=$1 + debug_str="^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)|(file has no debug information)" + + # search for debug_str using simple perf probe if the + # test only needs to check for debuginfo, and not specifically
tools/perf/tests/shell/lib/probe_vfs_getname.sh add_probe_vfs_getname() { · line 56
Quoted 10 lines
tools/perf/tests/shell/lib/probe_vfs_getname.sh +7
-0+ # line number. + if [ $no_line_check -eq 1 ]; then + perf probe -v -L getname_flags 2>&1 | grep -E -q "$debug_str" && return 2 + else + add_probe_vfs_getname -v 2>&1 | grep -E -q "$debug_str" && return 2 + fi + return 1 }
Hello Athira,
I see, If perf is not built with elfuitls-devel package, then test still fails.
Failure Logs:
-- [ PASS ] -- perf_probe :: test_adding_kernel :: adding probe inode_permission ::
-- [ PASS ] -- perf_probe :: test_adding_kernel :: adding probe inode_permission :: -a
-- [ PASS ] -- perf_probe :: test_adding_kernel :: adding probe inode_permission :: --add
-- [ PASS ] -- perf_probe :: test_adding_kernel :: listing added probe :: perf list
Regexp not found: "\s*probe:inode_permission(?:_\d+)?\s+\(on inode_permission(?:[:\+][0-9A-Fa-f]+)?@.+\)" -- [ FAIL ] -- perf_probe :: test_adding_kernel :: listing added probe :: perf probe -l (output regexp parsing) -- [ PASS ] -- perf_probe :: test_adding_kernel :: using added probe
-- [ PASS ] -- perf_probe :: test_adding_kernel :: deleting added probe
-- [ PASS ] -- perf_probe :: test_adding_kernel :: listing removed probe (should NOT be listed)
-- [ PASS ] -- perf_probe :: test_adding_kernel :: dry run :: adding probe
-- [ PASS ] -- perf_probe :: test_adding_kernel :: force-adding probes :: first probe adding
-- [ PASS ] -- perf_probe :: test_adding_kernel :: force-adding probes :: second probe adding (without force) -- [ PASS ] -- perf_probe :: test_adding_kernel :: force-adding probes :: second probe adding (with force) -- [ PASS ] -- perf_probe :: test_adding_kernel :: using doubled probe
-- [ PASS ] -- perf_probe :: test_adding_kernel :: removing multiple probes
Regexp not found: "probe:vfs_mknod"
Regexp not found: "probe:vfs_create"
Regexp not found: "probe:vfs_rmdir"
Regexp not found: "probe:vfs_link"
Regexp not found: "probe:vfs_write"
-- [ FAIL ] -- perf_probe :: test_adding_kernel :: wildcard adding support (command exitcode + output regexp parsing) Regexp not found: "Failed to find"
Regexp not found: "somenonexistingrandomstuffwhichisalsoprettylongorevenlongertoexceed64"
Regexp not found: "in this function|at this address"
Line did not match any pattern: "Debuginfo-analysis is not supported."
-- [ FAIL ] -- perf_probe :: test_adding_kernel :: non-existing variable (output regexp parsing) -- [ PASS ] -- perf_probe :: test_adding_kernel :: function with retval :: add
-- [ PASS ] -- perf_probe :: test_adding_kernel :: function with retval :: record
-- [ PASS ] -- perf_probe :: test_adding_kernel :: function argument probing :: script
## [ FAIL ] ## perf_probe :: test_adding_kernel SUMMARY :: 3 failures found
Regards,
Venkat.
Quoted 53 lines · Athira Rajeev
Perf test perftool-testsuite_probe fails as below:
Regexp not found: "\s*probe:inode_permission(?:_\d+)?\s+\(on inode_permission(?:[:\+][0-9A-Fa-f]+)?@.+\)" -- [ FAIL ] --
perf_probe::test_adding_kernel:: listing added probe :: perf probe -l (output regexp parsing) -- [ PASS ] --perf_probe::test_adding_kernel:: removing multiple probes
Regexp not found: "probe:vfs_mknod"
Regexp not found: "probe:vfs_create"
Regexp not found: "probe:vfs_rmdir"
Regexp not found: "probe:vfs_link"
Regexp not found: "probe:vfs_write"
-- [ FAIL ] --perf_probe::test_adding_kernel:: wildcard adding support (command exitcode + output regexp parsing) Regexp not found: "somenonexistingrandomstuffwhichisalsoprettylongorevenlongertoexceed64"
Regexp not found: "in this function|at this address"
-- [ FAIL ] --perf_probe::test_adding_kernel:: non-existing variable (output regexp parsing) ## [ FAIL ] ##perf_probe::test_adding_kernelSUMMARY :: 3 failures foundFurther analysing, the failed testcase is for "
test_adding_kernel". If the kernel debuginfo is missing, perf probe fails as below:perf probe -nf --max-probes=512 -a 'vfs_* $params' Failed to find the path for the kernel: No such file or directory
Error: Failed to add events.
skip_if_no_debuginfohas check to handle whether debuginfo is present and the testcase checks for debuginfo since this :
commit90d32e92011e("tools/perf: Handle perftool-testsuite_probe testcases fail when kernel debuginfo is not present")Recently a change got added in "
tests/shell/lib/probe_vfs_getname.sh" via this another fix:
commit92b664dcefab("perf testprobe_vfs_getname: Skip if no suitable line detected")
Since this commit, firstadd_probe_vfs_getnameis used to prevent false failures. And based on return code ofadd_probe_vfs_getname,skip_if_no_debuginfois used to skip testcase if debuginfo is present. And this modified other testcases to calladd_probe_vfs_getnamefirst and invokeskip_if_no_debuginfobased on return value.The tests in
test_adding_kernel.shwhich depends on presence of debuginfo are:
1. probe add forinode_permission
2. probe max-probes option using 'vfs_* $params'
3. non-existing variable probingFor these tests, probe check for specific line is not required. So call
skip_if_no_debuginfowith argument to say if line check is needed. This is to convey toskip_if_no_debuginfo()function that test only needs to check for debuginfo, and not specifically line number. Updateskip_if_no_debuginfoto use simple "perf probe" check if test only needs to check for debuginfo. And for other tests which rely on line number, useadd_probe_vfs_getname()
Quoted 6 lines
With the change, verified that only three which required debuginfo only is skipped and others ran successfully. Also tested with debuginfo to make sure tests are not skipped.
Reported-by Tejas Manhas <[email protected]>Signed-off-by Athira Rajeev <[email protected]>
Thanks for taking the time to improve the test pass rate! I'm sure you saw Venkat's comments, but for the change itself:
Thanks,
Ian
Quoted 61 lines
--- .../tests/shell/base_probe/test_adding_kernel.sh | 15 ++++++++++++++- tools/perf/tests/shell/lib/probe_vfs_getname.sh | 13 ++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-)tools/perf/tests/shell/base_probe/test_adding_kernel.sh +14
-1@@ -23,10 +23,23 @@ TEST_RESULT=0 . "$DIR_PATH/../lib/probe_vfs_getname.sh" TEST_PROBE=${TEST_PROBE:-"inode_permission"} +PROBE_NO_LINE_CHECK=1 # set NO_DEBUGINFO to skip testcase if debuginfo is not present # skip_if_no_debuginfo returns 2 if debuginfo is not present -skip_if_no_debuginfo +# +# The perf probe checks which depends on presence of debuginfo and +# used in this testcase are: +# 1. probe add for inode_permission +# 2. probe max-probes option using 'vfs_* $params' +# 3. non-existing variable probing +# +# For these tests, probe check for specific line is not +# required ( add_probe_vfs_getname does that ). So call +# skip_if_no_debuginfo with argument as 1. This is to convey +# that test only needs to check for debuginfo, and not specifically +# line number +skip_if_no_debuginfo $PROBE_NO_LINE_CHECK if [ $? -eq 2 ]; then NO_DEBUGINFO=1 fitools/perf/tests/shell/lib/probe_vfs_getname.sh +12
-2@@ -39,7 +39,18 @@ add_probe_vfs_getname() { } skip_if_no_debuginfo() { - 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 + no_line_check=$1 + debug_str="^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)|(file has no debug information)" + + # search for debug_str using simple perf probe if the + # test only needs to check for debuginfo, and not specifically + # line number. + if [ $no_line_check -eq 1 ]; then + perf probe -v -L getname_flags 2>&1 | grep -E -q "$debug_str" && return 2 + else + add_probe_vfs_getname -v 2>&1 | grep -E -q "$debug_str" && return 2 + fi + return 1 } --2.47.3
Quoted 65 lines · Ian Rogers
Quoted 53 lines · Athira Rajeev
Perf test perftool-testsuite_probe fails as below:
Regexp not found: "\s*probe:inode_permission(?:_\d+)?\s+\(on inode_permission(?:[:\+][0-9A-Fa-f]+)?@.+\)" -- [ FAIL ] --
perf_probe::test_adding_kernel:: listing added probe :: perf probe -l (output regexp parsing) -- [ PASS ] --perf_probe::test_adding_kernel:: removing multiple probes
Regexp not found: "probe:vfs_mknod"
Regexp not found: "probe:vfs_create"
Regexp not found: "probe:vfs_rmdir"
Regexp not found: "probe:vfs_link"
Regexp not found: "probe:vfs_write"
-- [ FAIL ] --perf_probe::test_adding_kernel:: wildcard adding support (command exitcode + output regexp parsing) Regexp not found: "somenonexistingrandomstuffwhichisalsoprettylongorevenlongertoexceed64"
Regexp not found: "in this function|at this address"
-- [ FAIL ] --perf_probe::test_adding_kernel:: non-existing variable (output regexp parsing) ## [ FAIL ] ##perf_probe::test_adding_kernelSUMMARY :: 3 failures foundFurther analysing, the failed testcase is for "
test_adding_kernel". If the kernel debuginfo is missing, perf probe fails as below:perf probe -nf --max-probes=512 -a 'vfs_* $params' Failed to find the path for the kernel: No such file or directory
Error: Failed to add events.
skip_if_no_debuginfohas check to handle whether debuginfo is present and the testcase checks for debuginfo since this :
commit90d32e92011e("tools/perf: Handle perftool-testsuite_probe testcases fail when kernel debuginfo is not present")Recently a change got added in "
tests/shell/lib/probe_vfs_getname.sh" via this another fix:
commit92b664dcefab("perf testprobe_vfs_getname: Skip if no suitable line detected")
Since this commit, firstadd_probe_vfs_getnameis used to prevent false failures. And based on return code ofadd_probe_vfs_getname,skip_if_no_debuginfois used to skip testcase if debuginfo is present. And this modified other testcases to calladd_probe_vfs_getnamefirst and invokeskip_if_no_debuginfobased on return value.The tests in
test_adding_kernel.shwhich depends on presence of debuginfo are:
1. probe add forinode_permission
2. probe max-probes option using 'vfs_* $params'
3. non-existing variable probingFor these tests, probe check for specific line is not required. So call
skip_if_no_debuginfowith argument to say if line check is needed. This is to convey toskip_if_no_debuginfo()function that test only needs to check for debuginfo, and not specifically line number. Updateskip_if_no_debuginfoto use simple "perf probe" check if test only needs to check for debuginfo. And for other tests which rely on line number, useadd_probe_vfs_getname()Quoted 6 lines
With the change, verified that only three which required debuginfo only is skipped and others ran successfully. Also tested with debuginfo to make sure tests are not skipped.
Reported-by Tejas Manhas <[email protected]>Signed-off-by Athira Rajeev <[email protected]>
Quoted 7 lines
Thanks for taking the time to improve the test pass rate! I'm sure you saw Venkat's comments, but for the change itself:
Reviewed-by Ian Rogers <[email protected]>Thanks,
Ian
Thanks Ian for the review.
Sure, I will address Venkat’s comments along with your Reviewed-by in V2
Thanks
Athira
Quoted 61 lines
Quoted 61 lines
---
.../tests/shell/base_probe/test_adding_kernel.sh| 15 ++++++++++++++-tools/perf/tests/shell/lib/probe_vfs_getname.sh| 13 ++++++++++++-2 files changed, 26 insertions(+), 2 deletions(-)tools/perf/tests/shell/base_probe/test_adding_kernel.sh +0
-0@@ -23,10 +23,23 @@ TEST_RESULT=0. "
$DIR_PATH/../lib/probe_vfs_getname.sh"TEST_PROBE=${TEST_PROBE:-"inode_permission"}
+PROBE_NO_LINE_CHECK=1# set NO_DEBUGINFO to skip testcase if debuginfo is not present # skip_if_no_debuginfo returns 2 if debuginfo is not presenttools/perf/tests/shell/base_probe/test_adding_kernel.sh +13
-1-skip_if_no_debuginfo +# +# The perf probe checks which depends on presence of debuginfo and +# used in this testcase are: +# 1. probe add for inode_permission +# 2. probe max-probes option using 'vfs_* $params' +# 3. non-existing variable probing +# +# For these tests, probe check for specific line is not +# required ( add_probe_vfs_getname does that ). So call +# skip_if_no_debuginfo with argument as 1. This is to convey +# that test only needs to check for debuginfo, and not specifically +# line number +skip_if_no_debuginfo $PROBE_NO_LINE_CHECKif [ $? -eq 2 ]; then
NO_DEBUGINFO=1
fitools/perf/tests/shell/lib/probe_vfs_getname.sh +12
-2@@ -39,7 +39,18 @@ add_probe_vfs_getname() { } skip_if_no_debuginfo() { - 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 + no_line_check=$1 + debug_str="^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)|(file has no debug information)" + + # search for debug_str using simple perf probe if the + # test only needs to check for debuginfo, and not specifically + # line number. + if [ $no_line_check -eq 1 ]; then + perf probe -v -L getname_flags 2>&1 | grep -E -q "$debug_str" && return 2 + else + add_probe_vfs_getname -v 2>&1 | grep -E -q "$debug_str" && return 2 + fi + return 1 } --2.47.3