WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-4.0-testing] xentrace: Skip to low cpu when throwin

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] xentrace: Skip to low cpu when throwing away portions of the circular buffer
From: "Xen patchbot-4.0-testing" <patchbot-4.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Apr 2010 09:50:13 -0700
Delivery-date: Mon, 19 Apr 2010 07:24:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1271355456 -3600
# Node ID 8fe61b0b7a2891367b09fc4a9c27b17b7f2796c3
# Parent  8a96f37e9826e8fd085fe27c04076b074a5453f1
xentrace: Skip to low cpu when throwing away portions of the circular buffer

Skip to the next "low" cpu when throwing away portions of the circular
memory buffer.  This makes subsequent analysis easier.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
xen-unstable changeset:   21162:e2ec5cd8b396
xen-unstable date:        Tue Apr 13 18:18:36 2010 +0100
---
 tools/xentrace/xentrace.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+)

diff -r 8a96f37e9826 -r 8fe61b0b7a28 tools/xentrace/xentrace.c
--- a/tools/xentrace/xentrace.c Thu Apr 15 19:17:05 2010 +0100
+++ b/tools/xentrace/xentrace.c Thu Apr 15 19:17:36 2010 +0100
@@ -149,6 +149,7 @@ void membuf_reserve_window(unsigned cpu,
 {
     struct cpu_change_record *rec;
     long need_to_consume, free, freed;
+    int last_cpu = -1;
 
     if ( membuf.pending_size > 0 )
     {
@@ -193,10 +194,24 @@ void membuf_reserve_window(unsigned cpu,
 
         if ( need_to_consume > 0 )
         {
+            last_cpu = rec->data.cpu;
             MEMBUF_CONS_INCREMENT(freed);
             need_to_consume -= freed;
         }
     } while( need_to_consume > 0 );
+
+    /* For good tsc consistency, we need to start at a low-cpu buffer.  Keep
+     * skipping until the cpu goes down or stays the same. */
+    rec = (struct cpu_change_record *)MEMBUF_POINTER(membuf.cons);
+    while ( rec->data.cpu > last_cpu )
+    {
+        last_cpu = rec->data.cpu; 
+
+        freed = sizeof(*rec) + rec->data.window_size;
+        
+        MEMBUF_CONS_INCREMENT(freed);
+        rec = (struct cpu_change_record *)MEMBUF_POINTER(membuf.cons);
+    }
 
 start_window:
     /*

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] xentrace: Skip to low cpu when throwing away portions of the circular buffer, Xen patchbot-4.0-testing <=