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-devel

[Xen-devel] [PATCH 2 of 3] xentrace: Add an option not to enable tracing

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 2 of 3] xentrace: Add an option not to enable tracing
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: Tue, 13 Apr 2010 17:52:59 +0100
Cc: george.dunlap@xxxxxxxxxxxxx
Delivery-date: Tue, 13 Apr 2010 10:01:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1271177577@silas>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1271177577@silas>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Add an option that will set up the buffers and listen for updates,
but will not enable tracing.  This is useful if you have hacks
in Xen to enable tracing at key points (for example, debugging a shadow
bug).

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

diff -r 16ef34de0129 -r ce0812566a4d tools/xentrace/xentrace.c
--- a/tools/xentrace/xentrace.c Tue Apr 13 17:24:07 2010 +0100
+++ b/tools/xentrace/xentrace.c Tue Apr 13 17:24:08 2010 +0100
@@ -58,7 +58,8 @@
     unsigned long timeout;
     unsigned long memory_buffer;
     uint8_t discard:1,
-        disable_tracing:1;
+        disable_tracing:1,
+        start_disabled:1;
 } settings_t;
 
 struct t_struct {
@@ -659,6 +660,10 @@
 
     /* setup access to trace buffers */
     get_tbufs(&tbufs_mfn, &tinfo_size);
+
+    if ( opts.start_disabled )
+        disable_tbufs();
+    
     tbufs = map_tbufs(tbufs_mfn, num, tinfo_size);
 
     size = tbufs->t_info->tbuf_size * XC_PAGE_SIZE;
@@ -791,6 +796,9 @@
 "                          it exits. Selecting this option will tell it to\n" \
 "                          keep tracing on.  Traces will be collected in\n" \
 "                          Xen's trace buffers until they become full.\n" \
+"  -X  --start-disabled    Setup trace buffers and listen, but don't enable\n" 
\
+"                          tracing. (Useful if tracing will be enabled by\n" \
+"                          else.)\n" \
 "  -T  --time-interval=s   Run xentrace for s seconds and quit.\n" \
 "  -?, --help              Show this message\n" \
 "  -V, --version           Print program version\n" \
@@ -914,12 +922,13 @@
         { "memory-buffer",  required_argument, 0, 'M' },
         { "discard-buffers", no_argument,      0, 'D' },
         { "dont-disable-tracing", no_argument, 0, 'x' },
+        { "start-disabled", no_argument,       0, 'X' },
         { "help",           no_argument,       0, '?' },
         { "version",        no_argument,       0, 'V' },
         { 0, 0, 0, 0 }
     };
 
-    while ( (option = getopt_long(argc, argv, "t:s:c:e:S:r:T:M:Dx?V",
+    while ( (option = getopt_long(argc, argv, "t:s:c:e:S:r:T:M:DxX?V",
                     long_options, NULL)) != -1) 
     {
         switch ( option )
@@ -957,6 +966,10 @@
             opts.disable_tracing = 0;
             break;
 
+        case 'X': /* Start disabled */
+            opts.start_disabled = 1;
+            break;
+
         case 'T':
             opts.timeout = argtol(optarg, 0);
             break;
@@ -993,6 +1006,7 @@
     opts.cpu_mask = 0;
     opts.disk_rsvd = 0;
     opts.disable_tracing = 1;
+    opts.start_disabled = 0;
     opts.timeout = 0;
 
     parse_args(argc, argv);

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

<Prev in Thread] Current Thread [Next in Thread>