rt-tests/SOURCES/ssdd-change-the-written-pid...

49 lines
1.4 KiB
Diff

From 153c8171e07d88260b4d40fc7894eca220bbee5b Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Tue, 15 Jan 2019 11:32:26 +0100
Subject: [PATCH 5/5] ssdd: change the written pid
During debugging it turned out to be helpful to see the parent pid
and mostly the two tasks interact with each other: the tracer and
tracee.
Add this information it can searched for it.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/ssdd/ssdd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/ssdd/ssdd.c b/src/ssdd/ssdd.c
index 68a426266dd9..4e293586526e 100644
--- a/src/ssdd/ssdd.c
+++ b/src/ssdd/ssdd.c
@@ -144,7 +144,6 @@ static int forktests(int testid)
struct sigaction act, oact;
parent = getpid();
- printf("forktest#%d/%d: STARTING\n", testid, parent);
child = fork();
if (child == -1) {
@@ -155,6 +154,8 @@ static int forktests(int testid)
if (!child)
child_process();
+ printf("forktest#%d/%d/%d: STARTING\n", testid, parent, child);
+
act.sa_sigaction = sigchld;
sigemptyset(&act.sa_mask);
act.sa_flags = SA_SIGINFO;
@@ -275,6 +276,7 @@ int main(int argc, char **argv)
if (argc)
nsteps = atoi(*argv);
}
+ printf("#main : %d\n", getpid());
printf("#forks: %d\n", nforks);
printf("#steps: %d\n", nsteps);
printf("\n");
--
2.20.1