diff -r d9dcb3ecebba tools/xentrace/xentrace.c --- a/tools/xentrace/xentrace.c Tue Dec 15 14:40:17 2009 +0000 +++ b/tools/xentrace/xentrace.c Wed Jan 06 12:02:54 2010 +0000 @@ -638,7 +683,9 @@ unsigned long size; /* size of a single trace buffer */ unsigned long data_size; + int last_read = 1; + /* prepare to listen for VIRQ_TBUF */ event_init(); @@ -725,14 +774,22 @@ } if ( interrupted ) - break; + { + if ( last_read ) + { + /* Disable tracing, then read through all the buffers one last time */ + if ( opts.disable_tracing ) + disable_tbufs(); + last_read = 0; + continue; + } + else + break; + } wait_for_event_or_timeout(opts.poll_sleep); } - if ( opts.disable_tracing ) - disable_tbufs(); - if ( opts.memory_buffer ) membuf_dump();