From: mita@miraclelinux.com (Akinobu Mita)
To: ak@suse.de, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] makes print_symbol() return int
Date: Mon, 16 Jan 2006 21:17:07 +0900 [thread overview]
Message-ID: <20060116121706.GB539@miraclelinux.com> (raw)
In-Reply-To: <20060116121611.GA539@miraclelinux.com>
This patch makes print_symbol() return the number of characters printed.
Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
----
include/linux/kallsyms.h | 17 ++++++++++-------
kernel/kallsyms.c | 4 ++--
2 files changed, 12 insertions(+), 9 deletions(-)
--- 2.6-git.orig/include/linux/kallsyms.h 2006-01-03 12:21:10.000000000 +0900
+++ 2.6-git/include/linux/kallsyms.h 2006-01-11 14:02:57.578291640 +0900
@@ -20,7 +20,7 @@ const char *kallsyms_lookup(unsigned lon
char **modname, char *namebuf);
/* Replace "%s" in format with address, if found */
-extern void __print_symbol(const char *fmt, unsigned long address);
+extern int __print_symbol(const char *fmt, unsigned long address);
#else /* !CONFIG_KALLSYMS */
@@ -38,7 +38,10 @@ static inline const char *kallsyms_looku
}
/* Stupid that this does nothing, but I didn't create this mess. */
-#define __print_symbol(fmt, addr)
+static inline int __print_symbol(const char *fmt, unsigned long addr)
+{
+ return 0;
+}
#endif /*CONFIG_KALLSYMS*/
/* This macro allows us to keep printk typechecking */
@@ -58,10 +61,10 @@ do { \
#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)
+static inline int print_symbol(const char *fmt, unsigned long addr)
+{
+ __check_printsym_format(fmt, "");
+ return __print_symbol(fmt, addr);
+}
#endif /*_LINUX_KALLSYMS_H*/
--- 2.6-git.orig/kernel/kallsyms.c 2006-01-03 12:21:10.000000000 +0900
+++ 2.6-git/kernel/kallsyms.c 2006-01-11 13:45:13.056123608 +0900
@@ -231,7 +231,7 @@ const char *kallsyms_lookup(unsigned lon
}
/* Replace "%s" in format with address, or returns -errno. */
-void __print_symbol(const char *fmt, unsigned long address)
+int __print_symbol(const char *fmt, unsigned long address)
{
char *modname;
const char *name;
@@ -251,7 +251,7 @@ void __print_symbol(const char *fmt, uns
else
sprintf(buffer, "%s+%#lx/%#lx", name, offset, size);
}
- printk(fmt, buffer);
+ return printk(fmt, buffer);
}
/* To avoid using get_symbol_offset for every symbol, we carry prefix along. */
next prev parent reply other threads:[~2006-01-16 12:17 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-16 12:16 [PATCH 0/3] changes about Call Trace: Akinobu Mita
2006-01-16 12:17 ` Akinobu Mita [this message]
2006-01-16 14:16 ` [PATCH 1/3] makes print_symbol() return int Jesper Juhl
2006-01-16 14:24 ` Akinobu Mita
2006-01-16 15:18 ` Jesper Juhl
2006-01-16 12:18 ` [PATCH 2/3] use usual call trace format on x86-64 Akinobu Mita
2006-01-16 12:22 ` Andi Kleen
2006-01-16 12:32 ` Christoph Hellwig
2006-01-16 12:46 ` Andi Kleen
2006-01-16 12:18 ` [PATCH 3/3] omit symbol size field in print_symbol() Akinobu Mita
2006-01-16 12:22 ` Andi Kleen
2006-01-16 14:37 ` Arjan van de Ven
2006-01-16 15:51 ` Akinobu Mita
2006-01-17 7:06 ` Akinobu Mita
2006-01-16 12:22 ` [PATCH 0/3] changes about Call Trace: Andi Kleen
2006-01-16 13:41 ` Akinobu Mita
2006-01-16 13:41 ` Akinobu Mita
2006-01-16 13:42 ` Akinobu Mita
2006-01-16 22:22 ` Andi Kleen
2006-01-17 16:53 ` Jan Engelhardt
2006-01-17 7:05 ` Akinobu Mita
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=20060116121706.GB539@miraclelinux.com \
--to=mita@miraclelinux.com \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.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