common/symbols: Remove print_symbol() and associated infrastructure
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 12 Nov 2013 10:11:30 +0000 (11:11 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Nov 2013 10:11:30 +0000 (11:11 +0100)
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>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/common/symbols.c
xen/common/timer.c
xen/include/xen/symbols.h

index 83b2b58b59a44d8648d9f9ea9ad2ae8894d2cbd3..45941e1ceb8af0bbe682dd8dcd73478a38286100 100644 (file)
@@ -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);
-}
index 9ed74e98ad8a7d94d42cf9ba20d93ba8c28191c7..1895a78ba344081dd5f78e11ed6c1342878db817 100644 (file)
@@ -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)
index 37cf6bfef9d55a46058c5ba3ca9c72ead8cdfdb4..87cd77d230c83730842dcbec5fe981aaf0c269e5 100644 (file)
@@ -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*/