From: Paulo Marques <pmarques@grupopie.com>
To: Robert Peterson <rpeterso@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.21-rc1] Extend print_symbol capability
Date: Fri, 02 Mar 2007 16:11:01 +0000 [thread overview]
Message-ID: <45E84C95.3060604@grupopie.com> (raw)
In-Reply-To: <45E744E2.1040000@redhat.com>
Robert Peterson wrote:
> [...]
> #define KSYM_NAME_LEN 127
> +#define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN + \
> + 2*(BITS_PER_LONG*3/10) + MODULE_NAME_LEN + 1)
>
> #ifdef CONFIG_KALLSYMS
> /* Lookup the address for a symbol. Returns 0 if not found. */
> @@ -22,6 +24,9 @@ const char *kallsyms_lookup(unsigned long addr,
> unsigned long *offset,
> char **modname, char *namebuf);
>
> +/* Look up a kernel symbol and return it in a text buffer. */
> +extern void lookup_symbol(unsigned long addr, char *buffer);
I don't like this name much :(
We already have kallsyms_lookup and kallsyms_lookup_name. The name of
this function should imply that it will print the formatted result into
the buffer, not just lookup a symbol.
Maybe "__sprint_symbol", and change the interface to
"__sprint_symbol(char *buffer, unsigned long addr)"?
> +
> /* Replace "%s" in format with address, if found */
> extern void __print_symbol(const char *fmt, unsigned long address);
>
> @@ -47,6 +52,11 @@ static inline const char *kallsyms_lookup(unsigned
> long addr,
> return NULL;
> }
>
> +static inline void lookup_symbol(unsigned long addr, char *buffer)
> +{
> + return NULL;
> +}
Returning NULL in a function returning "void" doesn't seem right :P
Maybe it should be something like this instead:
{
*buffer = '\0';
}
> [...]
Anyway, the change looks useful, so thanks for the patch :)
--
Paulo Marques - www.grupopie.com
"Very funny Scotty. Now beam up my clothes."
next prev parent reply other threads:[~2007-03-02 16:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-01 21:25 Robert Peterson
2007-03-02 16:11 ` Paulo Marques [this message]
2007-03-02 17:24 ` Robert Peterson
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=45E84C95.3060604@grupopie.com \
--to=pmarques@grupopie.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpeterso@redhat.com \
/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
Powered by JetHome