From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
Subject: [PATCH 2/5] x86: Replace print_symbol() with new %ps/%pS format
Date: Mon, 4 Nov 2013 10:55:36 +0000 [thread overview]
Message-ID: <1383562539-16085-3-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1383562539-16085-1-git-send-email-andrew.cooper3@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
---
xen/arch/x86/irq.c | 7 ++-----
xen/arch/x86/time.c | 3 +--
xen/arch/x86/traps.c | 30 ++++++++++--------------------
xen/arch/x86/x86_64/traps.c | 2 +-
xen/common/timer.c | 6 +++---
5 files changed, 17 insertions(+), 31 deletions(-)
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index a984bda..c2e5629 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2276,7 +2276,7 @@ static void dump_irqs(unsigned char key)
printk("\n");
}
else if ( desc->action )
- print_symbol("%s\n", (unsigned long)desc->action->handler);
+ printk("%ps()\n", _p(desc->action->handler));
else
printk("mapped, unbound\n");
@@ -2288,10 +2288,7 @@ static void dump_irqs(unsigned char key)
printk("Direct vector information:\n");
for ( i = FIRST_DYNAMIC_VECTOR; i < NR_VECTORS; ++i )
if ( direct_apic_vector[i] )
- {
- printk(" %#02x -> ", i);
- print_symbol("%s\n", (unsigned long)direct_apic_vector[i]);
- }
+ printk(" %#02x -> %ps()\n", i, _p(direct_apic_vector[i]));
dump_ioapic_irq_info();
}
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index c1bbd50..daade00 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1475,8 +1475,7 @@ static int _disable_pit_irq(void(*hpet_broadcast_setup)(void))
{
if ( xen_cpuidle > 0 )
{
- print_symbol("%s() failed, turning to PIT broadcast\n",
- (unsigned long)hpet_broadcast_setup);
+ printk("hpet_broadcast_setup() failed, turning to PIT broadcast\n");
return -1;
}
ret = 0;
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 77c200b..0e3c6e3 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -198,19 +198,14 @@ static void show_trace(struct cpu_user_regs *regs)
{
unsigned long *stack = ESP_BEFORE_EXCEPTION(regs), addr;
- printk("Xen call trace:\n ");
-
- printk("[<%p>]", _p(regs->eip));
- print_symbol(" %s\n ", regs->eip);
+ printk("Xen call trace:\n"
+ " [<%p>] %pS\n", _p(regs->eip), _p(regs->eip));
while ( ((long)stack & (STACK_SIZE-BYTES_PER_LONG)) != 0 )
{
addr = *stack++;
if ( is_active_kernel_text(addr) )
- {
- printk("[<%p>]", _p(addr));
- print_symbol(" %s\n ", addr);
- }
+ printk(" [<%p>] %pS\n", _p(addr), _p(addr));
}
printk("\n");
@@ -222,8 +217,6 @@ static void show_trace(struct cpu_user_regs *regs)
{
unsigned long *frame, next, addr, low, high;
- printk("Xen call trace:\n ");
-
/*
* If RIP is not pointing into hypervisor code then someone may have
* called into oblivion. Peek to see if they left a return address at
@@ -232,8 +225,9 @@ static void show_trace(struct cpu_user_regs *regs)
addr = is_active_kernel_text(regs->eip) ||
!is_active_kernel_text(*ESP_BEFORE_EXCEPTION(regs)) ?
regs->eip : *ESP_BEFORE_EXCEPTION(regs);
- printk("[<%p>]", _p(addr));
- print_symbol(" %s\n ", addr);
+
+ printk("Xen call trace:\n"
+ " [<%p>] %pS\n", _p(addr), _p(addr));
/* Bounds for range of valid frame pointer. */
low = (unsigned long)(ESP_BEFORE_EXCEPTION(regs) - 2);
@@ -269,8 +263,7 @@ static void show_trace(struct cpu_user_regs *regs)
addr = frame[1];
}
- printk("[<%p>]", _p(addr));
- print_symbol(" %s\n ", addr);
+ printk(" [<%p>] %pS\n", _p(addr), _p(addr));
low = (unsigned long)&frame[2];
}
@@ -338,10 +331,7 @@ void show_stack_overflow(unsigned int cpu, unsigned long esp)
{
addr = *stack++;
if ( is_active_kernel_text(addr) )
- {
- printk("%p: [<%p>]", stack, _p(addr));
- print_symbol(" %s\n ", addr);
- }
+ printk("%p: [<%p>] %pS\n", stack, _p(addr), _p(addr));
}
printk("\n");
@@ -3755,8 +3745,8 @@ void asm_domain_crash_synchronous(unsigned long addr)
if ( addr == 0 )
addr = this_cpu(last_extable_addr);
- printk("domain_crash_sync called from entry.S: fault at %p ", _p(addr));
- print_symbol("%s\n", addr);
+ printk("domain_crash_sync called from entry.S: fault at %p %pS\n",
+ _p(addr), _p(addr));
__domain_crash_synchronous();
}
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 0316d7c..ae93539 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -49,7 +49,7 @@ static void _show_registers(
printk("RIP: %04x:[<%016lx>]", regs->cs, regs->rip);
if ( context == CTXT_hypervisor )
- print_symbol(" %s", regs->rip);
+ printk(" %pS", _p(regs->rip));
printk("\nRFLAGS: %016lx ", regs->rflags);
if ( (context == CTXT_pv_guest) && v && v->vcpu_info )
printk("EM: %d ", !!vcpu_info(v, evtchn_upcall_mask));
diff --git a/xen/common/timer.c b/xen/common/timer.c
index 9ed74e9..eff9c26 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -511,9 +511,9 @@ s_time_t align_timer(s_time_t firsttick, uint64_t period)
static void dump_timer(struct timer *t, s_time_t now)
{
- printk(" ex=%8"PRId64"us timer=%p cb=%p(%p)",
- (t->expires - now) / 1000, t, t->function, t->data);
- print_symbol(" %s\n", (unsigned long)t->function);
+ printk(" ex=%8"PRId64"us timer=%p cb=%p(%p) %ps()\n",
+ (t->expires - now) / 1000, t, t->function, t->data,
+ _p(t->function));
}
static void dump_timerq(unsigned char key)
--
1.7.10.4
next prev parent reply other threads:[~2013-11-04 10:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-04 10:55 [PATCH 0/5] Printk symbol specifier Andrew Cooper
2013-11-04 10:55 ` [PATCH 1/5] common/vsprintf: Add %ps and %pS format specifier support Andrew Cooper
2013-11-04 14:51 ` Jan Beulich
2013-11-04 14:54 ` Jan Beulich
2013-11-04 18:39 ` Tim Deegan
2013-11-04 10:55 ` Andrew Cooper [this message]
2013-11-04 10:55 ` [PATCH 3/5] arm: Replace print_symbol() with new %ps/%pS format Andrew Cooper
2013-11-04 15:20 ` Ian Campbell
2013-11-04 10:55 ` [PATCH 4/5] common/symbols: Remove print_symbol() and associated infrastructure Andrew Cooper
2013-11-04 10:55 ` [PATCH 5/5] Test harness for new printk formatting Andrew Cooper
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=1383562539-16085-3-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--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).