debuggers.hg

changeset 20926:0e453e4d932d

xentrace: Disable tracing, then read records one more time.

When interrupted, first disable tracing, then read through the records
one last time.

Without this patch, it's possible to get traces which interact (such
as runstate changes) on processors with higher numbers, while missing
the corresponding traces generated on lower-numbered processors.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Feb 03 09:36:37 2010 +0000 (2010-02-03)
parents 2a07df55c08a
children 62ce32978d2e
files tools/xentrace/xentrace.c
line diff
     1.1 --- a/tools/xentrace/xentrace.c	Wed Feb 03 09:35:56 2010 +0000
     1.2 +++ b/tools/xentrace/xentrace.c	Wed Feb 03 09:36:37 2010 +0000
     1.3 @@ -634,6 +634,8 @@ static int monitor_tbufs(void)
     1.4  
     1.5      unsigned long data_size;
     1.6  
     1.7 +    int last_read = 1;
     1.8 +
     1.9      /* prepare to listen for VIRQ_TBUF */
    1.10      event_init();
    1.11  
    1.12 @@ -712,14 +714,22 @@ static int monitor_tbufs(void)
    1.13          }
    1.14  
    1.15          if ( interrupted )
    1.16 -            break;
    1.17 +        {
    1.18 +            if ( last_read )
    1.19 +            {
    1.20 +                /* Disable tracing, then read through all the buffers one last time */
    1.21 +                if ( opts.disable_tracing )
    1.22 +                    disable_tbufs();
    1.23 +                last_read = 0;
    1.24 +                continue;
    1.25 +            }
    1.26 +            else
    1.27 +                break;
    1.28 +        }
    1.29  
    1.30          wait_for_event_or_timeout(opts.poll_sleep);
    1.31      }
    1.32  
    1.33 -    if ( opts.disable_tracing )
    1.34 -        disable_tbufs();
    1.35 -
    1.36      if ( opts.memory_buffer )
    1.37          membuf_dump();
    1.38