[PATCH v4 10/37] unwind: call unwind_tcb_fin before printing detached message

Masatake YAMATO yamato at redhat.com
Wed Apr 16 06:33:08 UTC 2014


captured stacktrace is printed in `unwind_tcb_fin' if tcp->queue is
not empty. This should happen before printing detached message.  So
unwind_tcb_fin is moved to the too of `droptcb'.

This is implicitly suggested by Dmitry V. Levin <ldv at altlinux.org> in patch review process.

Signed-off-by: Masatake YAMATO <yamato at redhat.com>
---
 strace.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/strace.c b/strace.c
index d066219..8abb4fe 100644
--- a/strace.c
+++ b/strace.c
@@ -714,6 +714,12 @@ droptcb(struct tcb *tcp)
 	if (tcp->pid == 0)
 		return;
 
+#ifdef USE_LIBUNWIND
+	if (stack_trace_enabled) {
+		unwind_tcb_fin(tcp);
+	}
+#endif
+
 	nprocs--;
 	if (debug_flag)
 		fprintf(stderr, "dropped tcb for pid %d, %d remain\n", tcp->pid, nprocs);
@@ -735,11 +741,6 @@ droptcb(struct tcb *tcp)
 	if (printing_tcp == tcp)
 		printing_tcp = NULL;
 
-#ifdef USE_LIBUNWIND
-	if (stack_trace_enabled) {
-		unwind_tcb_fin(tcp);
-	}
-#endif
 	memset(tcp, 0, sizeof(*tcp));
 }
 
-- 
1.9.0





More information about the Strace-devel mailing list