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 4 of 5] xenctx: add option -C to dump context for all

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 4 of 5] xenctx: add option -C to dump context for all vcpus
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Mon, 20 Jun 2011 17:27:00 +0200
Delivery-date: Mon, 20 Jun 2011 08:30:35 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1308583621; l=2066; s=domk; d=aepfle.de; h=To:From:Date:References:In-Reply-To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:X-RZG-CLASS-ID: X-RZG-AUTH; bh=8a5CsMoRVNd2TE3Dr+b3/rmCOqQ=; b=H5roRgYrSEDpBgkuyS0cH/7VdD9W+IUDeXtIKV7FEzxhMrh0KvUiPCAnAAPj3kNOCmC 1QBB98u86qGJUsRHCPnyBsS6gufP5qJ6aqHlcl6WHLYOEwHmHGXGHDwf/Jtxgm8PWUGW2 pgPoZm6rRnE1N5MtsEzQxGszes5aoDeJfs0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1308583616@xxxxxxxxxxxx>
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.1308583616@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.7.5
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1308313376 -7200
# Node ID ddf16ea954876d8af371f9751fc06eb4c9e78b36
# Parent  0e0c9fbedc2e29e2d507e2e1dce9536d06af442d
xenctx: add option -C to dump context for all vcpus

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

diff -r 0e0c9fbedc2e -r ddf16ea95487 tools/xentrace/xenctx.c
--- a/tools/xentrace/xenctx.c   Fri Jun 17 14:11:52 2011 +0200
+++ b/tools/xentrace/xenctx.c   Fri Jun 17 14:22:56 2011 +0200
@@ -35,6 +35,7 @@ static struct xenctx {
     int frame_ptrs;
     int stack_trace;
     int disp_all;
+    int all_vcpus;
     int self_paused;
     xc_dominfo_t dominfo;
 } xenctx;
@@ -899,6 +900,19 @@ static void dump_ctx(int vcpu)
 #endif
 }
 
+static void dump_all_vcpus(void)
+{
+    xc_vcpuinfo_t vinfo;
+    int vcpu;
+    for (vcpu = 0; vcpu <= xenctx.dominfo.max_vcpu_id; vcpu++)
+    {
+        if ( xc_vcpu_getinfo(xenctx.xc_handle, xenctx.domid, vcpu, &vinfo) )
+            continue;
+        if ( vinfo.online )
+            dump_ctx(vcpu);
+    }
+}
+
 static void usage(void)
 {
     printf("usage:\n\n");
@@ -920,13 +934,14 @@ static void usage(void)
 #else
     printf("  -a --all          display more registers\n");
 #endif
+    printf("  -C --all-vcpus    print info for all vcpus\n");
 }
 
 int main(int argc, char **argv)
 {
     int ch;
     int ret;
-    static const char *sopts = "fs:hak:S"
+    static const char *sopts = "fs:hak:SC"
 #ifdef __ia64__
         "r:"
 #endif
@@ -940,6 +955,7 @@ int main(int argc, char **argv)
         {"regs", 1, NULL, 'r'},
 #endif
         {"all", 0, NULL, 'a'},
+        {"all-vcpus", 0, NULL, 'C'},
         {"help", 0, NULL, 'h'},
         {0, 0, 0, 0}
     };
@@ -995,6 +1011,9 @@ int main(int argc, char **argv)
             xenctx.disp_all = 1;
             break;
 #endif
+        case 'C':
+            xenctx.all_vcpus = 1;
+            break;
         case 'k':
             kernel_start = strtoull(optarg, NULL, 0);
             break;
@@ -1047,7 +1066,10 @@ int main(int argc, char **argv)
         xenctx.self_paused = 1;
     }
 
-    dump_ctx(vcpu);
+    if (xenctx.all_vcpus)
+        dump_all_vcpus();
+    else
+        dump_ctx(vcpu);
 
     if (xenctx.self_paused) {
         ret = xc_domain_unpause(xenctx.xc_handle, xenctx.domid);

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