Re: [may-be-patch?] introduce MODULE_USE_UNEXPORTED()

From: Rusty Russell
Date: Thu Jul 21 2011 - 05:34:01 EST


On Tue, 19 Jul 2011 20:45:36 +0200, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> Hi.
>
> >From time to time I need to write a module for debugging purposes,
> and it is a bit annoying I can't simply use, say, put_task_struct().
>
> Can't we do something like the simple patch below? Of course, it
> is very unsafe to use kallsyms_lookup_name() by many reasons. But
> it looks handy for the testing/debugging.
>
> Yes, I am not saying this feature is terribly useful, so I agree
> in advance with the "go away, we don't need this hack" nack.
>
> Still, what do you think?
>
> Oleg.

I hate it, but I've wanted it too...

Can we bury it under a CONFIG_DEBUG_KERNEL option? I don't want
distributions turning this on. And add a GPL license check.

Alternative is to have a "void *khacker_lookup_sym(const char *)" which
does this at runtime, but that's less convenient to use than this.

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/