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 v3 6/7] common/symbols: Remove print_symbol() and associated infrastructure
Date: Tue, 5 Nov 2013 14:38:43 +0000 [thread overview]
Message-ID: <1383662324-3397-7-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1383662324-3397-1-git-send-email-andrew.cooper3@citrix.com>
Also adjust the one common user of print_symbol() to use the new printk()
format. While adjusting the format string, increase the width so a
long-to-expire plt_overflow() timer doesn't break the column alignment.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
---
Changes in v3:
* Move the single common change from x86 patch to here
---
xen/common/symbols.c | 26 --------------------------
xen/common/timer.c | 3 +--
xen/include/xen/symbols.h | 23 -----------------------
3 files changed, 1 insertion(+), 51 deletions(-)
diff --git a/xen/common/symbols.c b/xen/common/symbols.c
index 83b2b58..45941e1 100644
--- a/xen/common/symbols.c
+++ b/xen/common/symbols.c
@@ -148,29 +148,3 @@ const char *symbols_lookup(unsigned long addr,
*offset = addr - symbols_address(low);
return namebuf;
}
-
-/* Replace "%s" in format with address, or returns -errno. */
-void __print_symbol(const char *fmt, unsigned long address)
-{
- const char *name;
- unsigned long offset, size, flags;
-
- static DEFINE_SPINLOCK(lock);
- static char namebuf[KSYM_NAME_LEN+1];
-#define BUFFER_SIZE sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN + \
- 2*(BITS_PER_LONG*3/10) + 1
- static char buffer[BUFFER_SIZE];
-
- spin_lock_irqsave(&lock, flags);
-
- name = symbols_lookup(address, &size, &offset, namebuf);
-
- if (!name)
- snprintf(buffer, BUFFER_SIZE, "???");
- else
- snprintf(buffer, BUFFER_SIZE, "%s+%#lx/%#lx", name, offset, size);
-
- printk(fmt, buffer);
-
- spin_unlock_irqrestore(&lock, flags);
-}
diff --git a/xen/common/timer.c b/xen/common/timer.c
index 9ed74e9..1895a78 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -511,9 +511,8 @@ 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)",
+ printk(" ex=%12"PRId64"us timer=%p cb=%ps(%p)\n",
(t->expires - now) / 1000, t, t->function, t->data);
- print_symbol(" %s\n", (unsigned long)t->function);
}
static void dump_timerq(unsigned char key)
diff --git a/xen/include/xen/symbols.h b/xen/include/xen/symbols.h
index 37cf6bf..87cd77d 100644
--- a/xen/include/xen/symbols.h
+++ b/xen/include/xen/symbols.h
@@ -11,27 +11,4 @@ const char *symbols_lookup(unsigned long addr,
unsigned long *offset,
char *namebuf);
-/* Replace "%s" in format with address, if found */
-void __print_symbol(const char *fmt, unsigned long address);
-
-/* This macro allows us to keep printk typechecking */
-static void __check_printsym_format(const char *fmt, ...)
- __attribute__((format(printf,1,2)));
- static inline void __check_printsym_format(const char *fmt, ...)
-{
-}
-
-#if 0
-#define print_fn_descriptor_symbol(fmt, addr) \
- print_symbol(fmt, *(unsigned long *)addr)
-#else
-#define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr)
-#endif
-
-#define print_symbol(fmt, addr) \
-do { \
- __check_printsym_format(fmt, ""); \
- __print_symbol(fmt, addr); \
-} while(0)
-
#endif /*_XEN_SYMBOLS_H*/
--
1.7.10.4
next prev parent reply other threads:[~2013-11-05 14:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-05 14:38 [PATCH v3 0/7] Printk symbol specifier Andrew Cooper
2013-11-05 14:38 ` [Patch v3 1/7] common/vsprintf: Refactor string() out of vsnprintf() Andrew Cooper
2013-11-05 14:38 ` [Patch v3 2/7] common/vsprintf: Refactor pointer() " Andrew Cooper
2013-11-05 14:38 ` [Patch v3 3/7] common/vsprintf: Add %ps and %pS format specifier support Andrew Cooper
2013-11-05 14:38 ` [Patch v3 4/7] x86: Replace print_symbol() with new %ps/%pS format Andrew Cooper
2013-11-05 14:38 ` [Patch v3 5/7] arm: " Andrew Cooper
2013-11-05 14:38 ` Andrew Cooper [this message]
2013-11-05 14:38 ` [Patch v3 7/7] Test harness for new printk formatting Andrew Cooper
2013-11-05 15:04 ` [PATCH v3 0/7] Printk symbol specifier Jan Beulich
2013-11-06 17:48 ` Andrew Cooper
2013-11-11 17:20 ` Keir Fraser
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=1383662324-3397-7-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).