Re: [PATCH 5/7] Ksplice: Add functions for walking kallsyms symbols

From: Rusty Russell
Date: Wed Feb 04 2009 - 06:31:10 EST


On Saturday 06 December 2008 10:33:58 Jeff Arnold wrote:
> From: Anders Kaseorg <andersk@xxxxxxx>
>
> kallsyms_lookup_name only returns the first match that it finds. Ksplice
> needs information about all symbols with a given name in order to correctly
> resolve local symbols.
>
> kallsyms_on_each_symbol provides a generic mechanism for iterating over the
> kallsyms table.

Seems reasonable. Did you really not want a name-filtering version? That
might be generally useful.

> +/* Call a function on each kallsyms symbol in the core kernel */
> +int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
> + unsigned long),
> + void *data);

But does no locking at all. It either needs a comment that it can only be
called from inside stop_machine, or that it needs preempt disabled, or
whatever.

> +static inline int kallsyms_on_each_symbol(int (*fn)(void *, const char *,
> + struct module *,
> + unsigned long),
> + void *data)
> +{
> + return 0;
> +}

Is the !CONFIG_KALLSYMS version useful to you? If not, please don't
implement the noop version. I want someone who *does* expect it to work to
have to think about it if they use it...

Thanks,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/