* [PATCH 3/3] btreplay: make Ctrl-C work
@ 2016-04-23 11:44 Roman Pen
2016-04-25 14:53 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Roman Pen @ 2016-04-23 11:44 UTC (permalink / raw)
To: linux-btrace
is_reap_done() must also check that SIGINT or SIGTERM have come, or
we hang forever with such backtraces after Ctrl-C:
(gdb) thr a a bt
Thread 3 (Thread 0x7fbff8ff9700 (LWP 12607)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x0000000000402698 in replay_rec () at btreplay.c:1035
#2 0x00007fc001fe5454 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#3 0x00007fc001d1eecd in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x0000000000000000 in ?? ()
Thread 2 (Thread 0x7fbfea7fc700 (LWP 12611)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x0000000000402698 in replay_rec () at btreplay.c:1035
#2 0x00007fc001fe5454 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#3 0x00007fc001d1eecd in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x0000000000000000 in ?? ()
Thread 1 (Thread 0x7fc00282e700 (LWP 12597)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x0000000000402303 in __wait_cv () at btreplay.c:413
#2 0x0000000000401ae8 in main () at btreplay.c:426
Signed-off-by: Roman Pen <r.peniaev@gmail.com>
Cc: Jens Axboe <axboe@fb.com>
Cc: <linux-btrace@vger.kernel.org>
---
btreplay/btreplay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/btreplay/btreplay.c b/btreplay/btreplay.c
index 5bf47ff..321851c 100644
--- a/btreplay/btreplay.c
+++ b/btreplay/btreplay.c
@@ -275,7 +275,7 @@ static inline int is_send_done(struct thr_info *tip)
*/
static inline int is_reap_done(struct thr_info *tip)
{
- return tip->send_done && tip->naios_out = 0;
+ return signal_done || (tip->send_done && tip->naios_out = 0);
}
/**
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 3/3] btreplay: make Ctrl-C work
2016-04-23 11:44 [PATCH 3/3] btreplay: make Ctrl-C work Roman Pen
@ 2016-04-25 14:53 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2016-04-25 14:53 UTC (permalink / raw)
To: linux-btrace
On 04/23/2016 05:44 AM, Roman Pen wrote:
> is_reap_done() must also check that SIGINT or SIGTERM have come, or
> we hang forever with such backtraces after Ctrl-C:
>
> (gdb) thr a a bt
>
> Thread 3 (Thread 0x7fbff8ff9700 (LWP 12607)):
> #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
> #1 0x0000000000402698 in replay_rec () at btreplay.c:1035
> #2 0x00007fc001fe5454 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
> #3 0x00007fc001d1eecd in ?? () from /lib/x86_64-linux-gnu/libc.so.6
> #4 0x0000000000000000 in ?? ()
>
> Thread 2 (Thread 0x7fbfea7fc700 (LWP 12611)):
> #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
> #1 0x0000000000402698 in replay_rec () at btreplay.c:1035
> #2 0x00007fc001fe5454 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
> #3 0x00007fc001d1eecd in ?? () from /lib/x86_64-linux-gnu/libc.so.6
> #4 0x0000000000000000 in ?? ()
>
> Thread 1 (Thread 0x7fc00282e700 (LWP 12597)):
> #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
> #1 0x0000000000402303 in __wait_cv () at btreplay.c:413
> #2 0x0000000000401ae8 in main () at btreplay.c:426
Applied this, and the two other patches. Thanks!
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-25 14:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-23 11:44 [PATCH 3/3] btreplay: make Ctrl-C work Roman Pen
2016-04-25 14:53 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).