[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20070301185250.58564692.rdunlap@xenotime.net>
Date: Thu, 1 Mar 2007 18:52:50 -0800
From: Randy Dunlap <rdunlap@...otime.net>
To: linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org, mm-commits@...r.kernel.org,
rpeterso@...hat.com, rdunlap@...otime.net, rusty@...tcorp.com.au,
sam@...nborg.org, zippel@...ux-m68k.org
Subject: Re: + extend-print_symbol-capability.patch added to -mm tree
On Thu, 01 Mar 2007 18:17:56 -0800 akpm@...ux-foundation.org wrote:
> Today's print_symbol function dumps a kernel symbol with printk. This
> patch extends the functionality of kallsyms.c so that the symbol lookup
> function may be used without the printk. This is useful for modules that
> want to dump symbols elsewhere, for example, to debugfs. I intend to use
> the new function call in the GFS2 file system (which will be a separate
> patch).
Hey, I've needed this one in the past. Thanks.
> ---
>
> include/linux/kallsyms.h | 10 ++++++++++
> kernel/kallsyms.c | 21 ++++++++++++++-------
> 2 files changed, 24 insertions(+), 7 deletions(-)
>
> diff -puN kernel/kallsyms.c~extend-print_symbol-capability kernel/kallsyms.c
> --- a/kernel/kallsyms.c~extend-print_symbol-capability
> +++ a/kernel/kallsyms.c
> @@ -288,6 +285,15 @@ void __print_symbol(const char *fmt, uns
> else
> sprintf(buffer, "%s+%#lx/%#lx", name, offset, size);
> }
> +}
> +
> +/* Replace "%s" in format with address, or returns -errno. */
Please fix the comment above...
> +void __print_symbol(const char *fmt, unsigned long address)
> +{
> + char buffer[KSYM_SYMBOL_LEN];
> +
> + lookup_symbol(address, buffer);
> +
> printk(fmt, buffer);
> }
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists