From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [PATCH 4/5] common/symbols: Remove print_symbol() and associated infrastructure Date: Mon, 4 Nov 2013 10:55:38 +0000 Message-ID: <1383562539-16085-5-git-send-email-andrew.cooper3@citrix.com> References: <1383562539-16085-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1383562539-16085-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org Signed-off-by: Andrew Cooper CC: Keir Fraser CC: Jan Beulich --- xen/common/symbols.c | 26 -------------------------- xen/include/xen/symbols.h | 23 ----------------------- 2 files changed, 49 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/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