From: Masatake YAMATO Date: Wed, 16 Apr 2014 06:33:08 +0000 (+0900) Subject: unwind: call unwind_tcb_fin before printing detached message X-Git-Tag: v4.9~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b09df9731f97685b4c06e34ce4ff5f1686eb4c1;p=platform%2Fupstream%2Fstrace.git unwind: call unwind_tcb_fin before printing detached message 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 top of droptcb. This is implicitly suggested by Dmitry Levin in patch review process. Signed-off-by: Masatake YAMATO --- diff --git a/strace.c b/strace.c index f8d5cb7f..fe197e5d 100644 --- a/strace.c +++ b/strace.c @@ -724,6 +724,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); @@ -745,11 +751,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)); }