[lkml]   [2018]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.18 050/235] perf tests: Fix to ensure cleanups
4.18-stable review patch.  If anyone has any objections, please let me know.


From: Sandipan Das <>

[ Upstream commit 83e3b6d73e66a10088f362b08b99c36fec3a14e7 ]

If there is a mismatch in the perf script output, this test fails and
exits before the event and temporary files created during its execution
are cleaned up.

This can be observed on a powerpc64 system running Fedora 27 as shown

# perf test -v "probe libc's inet_pton & backtrace it with ping"

62: probe libc's inet_pton & backtrace it with ping :
--- start ---
test child forked, pid 18655
ping 18674 [013] 24511.496995: probe_libc:inet_pton: (7fffa6b423b0)
7fffa6b423b0 __GI___inet_pton+0x0 (/usr/lib64/power8/
7fffa6af90dc gaih_inet.constprop.7+0xf4c (/usr/lib64/power8/
FAIL: expected backtrace entry "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/power8/\)$" got "7fffa6af90dc gaih_inet.constprop.7+0xf4c (/usr/lib64/power8/"
test child finished with -1
---- end ----
probe libc's inet_pton & backtrace it with ping: FAILED!

# ls /tmp/expected.* /tmp/* /tmp/perf.script.*

/tmp/expected.u31 /tmp/ /tmp/perf.script.Bhs

# perf probe --list

probe_libc:inet_pton (on __inet_pton@resolv/inet_pton.c in /usr/lib64/power8/

Cleanup of the event and the temporary files are now ensured by allowing
the cleanup code to be executed even if the lines from the backtrace do
not match their expected patterns instead of simply exiting from the
point of failure.

Signed-off-by: Sandipan Das <>
Cc: Jiri Olsa <>
Cc: Kim Phillips <>
Cc: Naveen N. Rao <>
Cc: Ravi Bangoria <>
Signed-off-by: Arnaldo Carvalho de Melo <>
Signed-off-by: Sasha Levin <>
Signed-off-by: Greg Kroah-Hartman <>
tools/perf/tests/shell/ | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/perf/tests/shell/
+++ b/tools/perf/tests/shell/
@@ -65,7 +65,7 @@ trace_libc_inet_pton_backtrace() {
echo "$line" | egrep -q "$pattern"
if [ $? -ne 0 ] ; then
printf "FAIL: expected backtrace entry \"%s\" got \"%s\"\n" "$pattern" "$line"
- exit 1
+ return 1

 \ /
  Last update: 2018-09-24 14:37    [W:0.730 / U:2.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site