[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Added option to xentrace to set the trace buffer size.



# HG changeset patch
# User George Dunlap <dunlapg@xxxxxxxxx>
# Node ID f681ffc9b01a5ba97ccb81dbeb50343904e8498b
# Parent  6a8204e4619d5bd182364b768b1ec2c8a43e8d15
Added option to xentrace to set the trace buffer size.

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

diff -r 6a8204e4619d -r f681ffc9b01a tools/xentrace/xentrace.c
--- a/tools/xentrace/xentrace.c Mon Aug 21 13:36:05 2006 +0100
+++ b/tools/xentrace/xentrace.c Mon Aug 21 12:05:11 2006 -0400
@@ -55,6 +55,7 @@ typedef struct settings_st {
     unsigned long new_data_thresh;
     uint32_t evt_mask;
     uint32_t cpu_mask;
+    unsigned long tbuf_size;
 } settings_t;
 
 settings_t opts;
@@ -111,7 +112,10 @@ static void get_tbufs(unsigned long *mfn
         exit(EXIT_FAILURE);
     }
 
-    ret = xc_tbuf_enable(xc_handle, DEFAULT_TBUF_SIZE, mfn, size);
+    if(!opts.tbuf_size)
+      opts.tbuf_size = DEFAULT_TBUF_SIZE;
+
+    ret = xc_tbuf_enable(xc_handle, opts.tbuf_size, mfn, size);
 
     if ( ret != 0 )
     {
@@ -400,6 +404,15 @@ error_t cmd_parser(int key, char *arg, s
     }
     break;
     
+    case 'S': /* set tbuf size (given in pages) */
+    {
+        char *inval;
+        setup->tbuf_size = strtol(arg, &inval, 0);
+        if ( inval == arg )
+            argp_usage(state);
+    }
+    break;
+
     case ARGP_KEY_ARG:
     {
         if ( state->arg_num == 0 )
@@ -438,6 +451,12 @@ const struct argp_option cmd_opts[] =
     { .name = "evt-mask", .key='e', .arg="e",
       .doc = 
       "set evt-mask " },
+
+    { .name = "trace-buf-size", .key='S', .arg="N",
+      .doc =
+      "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." },
 
     {0}
 };

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.