aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xentrace
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-02-03 09:36:37 +0000
committerKeir Fraser <keir.fraser@citrix.com>2010-02-03 09:36:37 +0000
commite0b0cd61d2ffde48d7fc69623c4a59005a4c58af (patch)
treea7cfb796e18d3ffc2a3ebcd127966cb672c16035 /tools/xentrace
parent7a223440b71e664b31505eba0a064566d03d7e2d (diff)
downloadxen-e0b0cd61d2ffde48d7fc69623c4a59005a4c58af.tar.gz
xen-e0b0cd61d2ffde48d7fc69623c4a59005a4c58af.tar.bz2
xen-e0b0cd61d2ffde48d7fc69623c4a59005a4c58af.zip
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>
Diffstat (limited to 'tools/xentrace')
-rw-r--r--tools/xentrace/xentrace.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c
index 7f63e7fc9d..18283f3e97 100644
--- a/tools/xentrace/xentrace.c
+++ b/tools/xentrace/xentrace.c
@@ -634,6 +634,8 @@ static int monitor_tbufs(void)
unsigned long data_size;
+ int last_read = 1;
+
/* prepare to listen for VIRQ_TBUF */
event_init();
@@ -712,14 +714,22 @@ static int monitor_tbufs(void)
}
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();