Skip to contentSkip to conversation

kselftest/arm64: Log the PIDs of the parent and child in sve-ptrace

PATCH In review Mark Brown 3 participants 3 messages Mar 3, 2022 – Mar 7, 2022

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 kselftest/arm64: Log the PIDs of the parent and child in sve-ptrace

If the test triggers a problem it may well result in a log message from the kernel such as a WARN() or BUG(). If these include a PID it can help with debugging to know if it was the parent or child process that triggered the issue, since the test is just creating a new thread the process name will be the same either way. Print the PIDs of the parent and child on startup so users have this information to hand should it be needed.

---
 tools/testing/selftests/arm64/fp/sve-ptrace.c | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/arm64/fp/sve-ptrace.c +2 -0
index 4bd333768cc4..4c418b2021e0 100644
@@ -487,6 +487,8 @@ static int do_parent(pid_t child)
 	unsigned int vq, vl;
 	bool vl_supported;
 
+	ksft_print_msg("Parent is %d, child is %d\n", getpid(), child);
+
 	/* Attach to the child */
 	while (1) {
 		int sig;
Signature · 1 line
2.30.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Mark Brown

If the test triggers a problem it may well result in a log message from the kernel such as a WARN() or BUG(). If these include a PID it can help with debugging to know if it was the parent or child process that triggered the issue, since the test is just creating a new thread the process name will be the same either way. Print the PIDs of the parent and child on startup so users have this information to hand should it be needed.

---
  tools/testing/selftests/arm64/fp/sve-ptrace.c | 2 ++
  1 file changed, 2 insertions(+)
tools/testing/selftests/arm64/fp/sve-ptrace.c +0 -0
index 4bd333768cc4..4c418b2021e0 100644

tools/testing/selftests/arm64/fp/sve-ptrace.c static int do_parent(pid_t child) · line 494

Quoted 8 lines
tools/testing/selftests/arm64/fp/sve-ptrace.c +2 -0
@@ -487,6 +487,8 @@ static int do_parent(pid_t child)
  	unsigned int vq, vl;
  	bool vl_supported;
 
+	ksft_print_msg("Parent is %d, child is %d\n", getpid(), child);
+
  	/* Attach to the child */
  	while (1) {
  		int sig;

Nice addition. Thanks for the patch.

thanks,
-- Shuah

maintainer
#2 lore raw
In reply to Mark Brown
Quoted 8 lines · Mark Brown

If the test triggers a problem it may well result in a log message from the kernel such as a WARN() or BUG(). If these include a PID it can help with debugging to know if it was the parent or child process that triggered the issue, since the test is just creating a new thread the process name will be the same either way. Print the PIDs of the parent and child on startup so users have this information to hand should it be needed.

[...]

Applied to arm64 (for-next/kselftest), thanks!

[1/1] kselftest/arm64: Log the PIDs of the parent and child in sve-ptrace

      https://git.kernel.org/arm64/c/e2dc49ef6c6b

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev