All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xentrace: Disable tracing, then read records one more time.
@ 2010-02-01 19:05 George Dunlap
  0 siblings, 0 replies; only message in thread
From: George Dunlap @ 2010-02-01 19:05 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 351 bytes --]

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>

[-- Attachment #2: 20100107-unstable-xentrace-read-after-disable.diff --]
[-- Type: text/x-patch, Size: 1017 bytes --]

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();
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-02-01 19:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-01 19:05 [PATCH] xentrace: Disable tracing, then read records one more time George Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.