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-unstable] [TOOLS] Added option to xentrace to disca

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [TOOLS] Added option to xentrace to discard records in the buffer
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Feb 2007 12:20:08 -0800
Delivery-date: Wed, 28 Feb 2007 12:19:50 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 George Dunlap <gdunlap@xxxxxxxxxxxxx>
# Date 1172574095 18000
# Node ID ffe7e8ef2c981767f92e30246e7add96a8dc5a8a
# Parent  c2e7bacf0919242623bbd0f4c20fec08c1735a07
[TOOLS] Added option to xentrace to discard records in the buffer
before beginning the trace.

Signed-off-by: George Dunlap <gdunlap@xxxxxxxxxxxxx>
---
 tools/xentrace/xentrace.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+)

diff -r c2e7bacf0919 -r ffe7e8ef2c98 tools/xentrace/xentrace.c
--- a/tools/xentrace/xentrace.c Tue Feb 27 01:52:27 2007 +0000
+++ b/tools/xentrace/xentrace.c Tue Feb 27 06:01:35 2007 -0500
@@ -56,6 +56,7 @@ typedef struct settings_st {
     uint32_t evt_mask;
     uint32_t cpu_mask;
     unsigned long tbuf_size;
+    int discard:1;
 } settings_t;
 
 settings_t opts;
@@ -306,6 +307,13 @@ int monitor_tbufs(FILE *logfile)
     /* build arrays of convenience ptrs */
     meta  = init_bufs_ptrs(tbufs_mapped, num, size);
     data  = init_rec_ptrs(meta, num);
+
+    if(opts.discard) {
+        for ( i = 0; (i < num) ; i++ )
+        {
+           meta[i]->cons = meta[i]->prod;
+        }
+    }
 
     /* now, scan buffers for events */
     while ( !interrupted )
@@ -413,6 +421,12 @@ error_t cmd_parser(int key, char *arg, s
     }
     break;
 
+    case 'D': /* Discard traces currently in the buffer before beginning */
+    {
+        opts.discard=1;
+    }
+    break;
+
     case ARGP_KEY_ARG:
     {
         if ( state->arg_num == 0 )
@@ -457,6 +471,11 @@ const struct argp_option cmd_opts[] =
       "Set trace buffer size in pages (default " xstr(DEFAULT_TBUF_SIZE) "). "
       "N.B. that the trace buffer cannot be resized.  If it has "
       "already been set this boot cycle, this argument will be ignored." },
+
+    { .name = "discard-buffers", .key='D', .arg=NULL,
+      .flags=OPTION_ARG_OPTIONAL,
+      .doc = "Discard all records currently in the trace buffers before "
+      " beginning." },
 
     {0}
 };

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [TOOLS] Added option to xentrace to discard records in the buffer, Xen patchbot-unstable <=