diff options
author | Olaf Hering <olaf@aepfle.de> | 2011-06-17 14:22:56 +0200 |
---|---|---|
committer | Olaf Hering <olaf@aepfle.de> | 2011-06-17 14:22:56 +0200 |
commit | d25db55e86d726792fae964eef4e494720d59534 (patch) | |
tree | a423af8706b49f97dd07d529d2f81bbda70e6e2e /tools | |
parent | 84a750776894e1fe08bdd9c5d484c20cf51fad55 (diff) | |
download | xen-d25db55e86d726792fae964eef4e494720d59534.tar.gz xen-d25db55e86d726792fae964eef4e494720d59534.tar.bz2 xen-d25db55e86d726792fae964eef4e494720d59534.zip |
xenctx: add option -C to dump context for all vcpus
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/xentrace/xenctx.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c index 5af571b83d..a12cc219e4 100644 --- a/tools/xentrace/xenctx.c +++ b/tools/xentrace/xenctx.c @@ -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); |