Skip to contentSkip to conversation

tools/perf/tests: Fix perf probe error log check in skip_if_no_debuginfo

PATCH Superseded Athira Rajeev 1 participant 1 message Sep 13, 2022 perf events

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/perf/tests: Fix perf probe error log check in skip_if_no_debuginfo

The perf probe related tests like probe_vfs_getname.sh which is in "tools/perf/tests/shell" directory have dependency on debuginfo information in the kernel. Currently debuginfo check is handled by skip_if_no_debuginfo function in the file "lib/probe_vfs_getname.sh". skip_if_no_debuginfo function looks for this specific error log from perf probe to skip the testcase:

<<>>
Failed to find the path for the kernel|Debuginfo-analysis is not supported
<>>

But in some case, like this one in powerpc, while running this test, observed error logs is:

<<>>
The /lib/modules/<version>/build/vmlinux file has no debug information. Rebuild with CONFIG_DEBUG_INFO=y, or install an appropriate debuginfo package.
Error: Failed to add events.
<<>>

Update the skip_if_no_debuginfo function to include the above error, to skip the test in these scenarios too.

---
 tools/perf/tests/shell/lib/probe_vfs_getname.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/tests/shell/lib/probe_vfs_getname.sh +3 -1
index 5b17d916c555..26d95069e50d 100644
@@ -19,6 +19,8 @@ add_probe_vfs_getname() {
 }
 
 skip_if_no_debuginfo() {
-	add_probe_vfs_getname -v 2>&1 | egrep -q "^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)" && return 2
+	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
 	return 1
 }
Signature · 1 line
2.31.1