[PATCH v2 3/5] tests: check strace -kk -p

Masatake YAMATO yamato at redhat.com
Sun Nov 19 05:30:23 UTC 2023


* tests/strace-kk-p.test: New test case.
* tests/strace-kk-p.expected: New file.
* tests/Makefile.am (check_SCRIPTS): add strace-kk-p.test.
(check_DATA): add strace-kk-p.expected.

Signed-off-by: Masatake YAMATO <yamato at redhat.com>
---
 tests/Makefile.am          |  4 +++-
 tests/strace-kk-p.expected |  2 ++
 tests/strace-kk-p.test     | 15 +++++++++++++++
 3 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 tests/strace-kk-p.expected
 create mode 100755 tests/strace-kk-p.test

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 05f2e34dc..a36f980b0 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -501,7 +501,7 @@ include gen_tests.am
 if ENABLE_STACKTRACE
 STACKTRACE_TESTS = strace-k.test strace-k-p.test
 if USE_LIBDW
-STACKTRACE_TESTS += strace-kk.test
+STACKTRACE_TESTS += strace-kk.test strace-kk-p.test
 endif
 if USE_DEMANGLE
 STACKTRACE_TESTS += strace-k-demangle.test
@@ -706,6 +706,7 @@ check_SCRIPTS = \
 	strace-k-demangle.test \
 	strace-k-p.test \
 	strace-k.test \
+	strace-kk-p.test \
 	strace-kk.test \
 	syntax.sh \
 	# end of check_SCRIPTS
@@ -763,6 +764,7 @@ check_DATA = \
 	strace-k-demangle.expected \
 	strace-k-p.expected \
 	strace-k.expected \
+	strace-kk-p.expected \
 	strace-kk.expected \
 	strace-r.expected \
 	strace.supp \
diff --git a/tests/strace-kk-p.expected b/tests/strace-kk-p.expected
new file mode 100644
index 000000000..fa75b2117
--- /dev/null
+++ b/tests/strace-kk-p.expected
@@ -0,0 +1,2 @@
+chdir f3<stack-fcall-3.c:18> f2<stack-fcall-2.c:15> f1<stack-fcall-1.c:15> f0<stack-fcall-0.c:15> main<stack-fcall.c:25>
+kill f3<stack-fcall-3.c:18> f2<stack-fcall-2.c:15> f1<stack-fcall-1.c:15> f0<stack-fcall-0.c:15> main<stack-fcall.c:25>
diff --git a/tests/strace-kk-p.test b/tests/strace-kk-p.test
new file mode 100755
index 000000000..8f28a59ab
--- /dev/null
+++ b/tests/strace-kk-p.test
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# Check strace --stack-traces=source for attached tracees.
+#
+# Copyright (c) 2020 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+ATTACH_MODE=1
+KOPT_SHORT=-kk
+KOPT_LONG=--stack-traces=source
+test_prog=../stack-fcall-attach
+
+. "${srcdir=.}"/strace-k.test
-- 
2.41.0



More information about the Strace-devel mailing list