xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Don Slutz <dslutz@verizon.com>
To: xen-devel@lists.xen.org
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Don Slutz <dslutz@verizon.com>, Jan Beulich <JBeulich@suse.com>
Subject: [PATCH v3 14/16] xenctx: Add convert of more registers to symbols
Date: Mon, 11 Nov 2013 13:15:20 -0500	[thread overview]
Message-ID: <1384193722-2916-15-git-send-email-dslutz@terremark.com> (raw)
In-Reply-To: <1384193722-2916-1-git-send-email-dslutz@terremark.com>

From: Don Slutz <dslutz@verizon.com>

For example can change:
 gs: 0000 @ ffffffff803ac000/0000000000000000
to
 gs: 0000 @ ffffffff803ac000/0000000000000000 boot_cpu_pda/

Signed-off-by: Don Slutz <dslutz@verizon.com>
---
Changed since v2:
  * Extract just the symbol printing code from "xenctx: Dump registers via hvm info if available"

 tools/xentrace/xenctx.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 23f2199..d0398da 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -317,10 +317,14 @@ static void print_special(void *regs, const char *name, unsigned int mask, int w
     printf("\n");
     for (i = 0; mask; mask >>= 1, ++i)
         if (mask & 1) {
-            if (width == 4)
-                printf("%s%u: %08"PRIx32"\n", name, i, ((uint32_t *) regs)[i]);
-            else
-                printf("%s%u: %08"PRIx64"\n", name, i, ((uint64_t *) regs)[i]);
+            if (width == 4) {
+                printf("%s%u: %08"PRIx32, name, i, ((uint32_t *) regs)[i]);
+                print_symbol(((uint32_t *) regs)[i], KERNEL_DATA_ADDR);
+            } else {
+                printf("%s%u: %016"PRIx64, name, i, ((uint64_t *) regs)[i]);
+                print_symbol(((uint64_t *) regs)[i], KERNEL_DATA_ADDR);
+            }
+            printf("\n");
         }
 }
 
@@ -416,9 +420,17 @@ static void print_ctx_64(vcpu_guest_context_x86_64_t *ctx)
     printf(" ds: %04x\t", regs->ds);
     printf(" es: %04x\n", regs->es);
 
-    printf(" fs: %04x @ %016"PRIx64"\n", regs->fs, ctx->fs_base);
-    printf(" gs: %04x @ %016"PRIx64"/%016"PRIx64"\n", regs->gs,
+    printf(" fs: %04x @ %016"PRIx64, regs->fs, ctx->fs_base);
+    print_symbol(ctx->fs_base, KERNEL_DATA_ADDR);
+    printf("\n");
+    printf(" gs: %04x @ %016"PRIx64"/%016"PRIx64, regs->gs,
            ctx->gs_base_kernel, ctx->gs_base_user);
+    if (symbol_table) {
+        print_symbol(ctx->gs_base_kernel, KERNEL_DATA_ADDR);
+        printf("/");
+        print_symbol(ctx->gs_base_user, KERNEL_DATA_ADDR);
+    }
+    printf("\n");
 
     if (xenctx.disp_all) {
         print_special(ctx->ctrlreg, "cr", 0x1d, 8);
-- 
1.8.4

  parent reply	other threads:[~2013-11-11 18:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 18:15 [PATCH v3 00/16] xenctx: Many changes Don Slutz
2013-11-11 18:15 ` [PATCH v3 01/16] xenctx: clean up usage output Don Slutz
2013-11-13 17:24   ` Don Slutz
2013-11-11 18:15 ` [PATCH v3 02/16] xenctx: Correct check for xc_interface_open failing (prevents SIGSEGV) Don Slutz
2013-11-14 12:04   ` Don Slutz
2013-11-11 18:15 ` [PATCH v3 03/16] xenctx: Clean up stack trace when hypercall_page not in symbol table Don Slutz
2013-11-11 18:15 ` [PATCH v3 04/16] xenctx: Add -2 (--two-pages) option to switch stack size to 8KiB Don Slutz
2013-11-12 15:31   ` Jan Beulich
2013-11-13 17:19     ` Don Slutz
2013-11-11 18:15 ` [PATCH v3 05/16] xenctx: Add command line options -b and -l Don Slutz
2013-11-11 18:15 ` [PATCH v3 06/16] xenctx: Add command line option -D (--decode-as-ascii) Don Slutz
2013-11-11 18:15 ` [PATCH v3 07/16] xenctx: Add command line option -t (--tag-stack-dump) Don Slutz
2013-11-11 18:15 ` [PATCH v3 08/16] xenctx: Change print_symbol to do the space before Don Slutz
2013-11-11 18:15 ` [PATCH v3 09/16] xenctx: More info on failed to map page Don Slutz
2013-11-11 18:15 ` [PATCH v3 10/16] xenctx: Add command line option -T (--tag-call-trace) Don Slutz
2013-11-11 18:15 ` [PATCH v3 11/16] xenctx: Add -m <maddr> option to dump memory at maddr Don Slutz
2013-11-11 18:15 ` [PATCH v3 12/16] xenctx: Add -d <daddr> option to dump memory at daddr as a stack Don Slutz
2013-11-11 18:15 ` [PATCH v3 13/16] xenctx: change is_kernel_text() into kernel_addr() Don Slutz
2013-11-11 18:15 ` Don Slutz [this message]
2013-11-11 18:15 ` [PATCH v3 15/16] xenctx: Add output of vcpu value and state for --all-vcpus Don Slutz
2013-11-11 18:15 ` [PATCH v3 16/16] MAINTAINERS: Add XENCTX maintainer Don Slutz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1384193722-2916-15-git-send-email-dslutz@terremark.com \
    --to=dslutz@verizon.com \
    --cc=JBeulich@suse.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).