Re: [PATCH] kallsyms data size reduction / lookup speedup

From: Paulo Marques
Date: Mon Aug 30 2004 - 13:47:13 EST


Sam Ravnborg wrote:
On Thu, Aug 26, 2004 at 11:26:33AM +0100, Paulo Marques wrote:

If there is a way to know at compile time the exported symbols, then scripts/kallsyms might generate a bitmap along with all the other data it generates so that checking is_exported would become O(1).


If there exist a symbol named __ksymtab_{symbol} then you know it is exported.

Thanks for the sugestion.

I already looked at EXPORT_SYMBOL in module.h and reached the same conclusion, and wrote a patch that did just that.

The problem with that patch was that symbols exported with EXPORT_SYMBOL_GPL would show up as exported whereas in the previous version they didn't :(

I asked Rusty Russell in private if the old behaviour was the desired behaviour or if it would be better to uppercase the symbols that are uppercased in System.map (i.e. exported vs public), and he replied that the old behaviour was done on purpose and should be kept (at least that is what I understood, not being a native speaker and all).

So I'm writting a new version right now that checks that the __ksymtab_{symbol} is on the __ksymtab section and not on the __ksymtab_gpl section to keep the old behaviour.

Anyway, the patch really speeds up a "time cat /proc/kallsyms" from 0.25s to 0.00s (I really need to do my own benchmark. "time" doesn't have enough resolution :)

I'll probably post it tonight.

--
Paulo Marques - www.grupopie.com

To err is human, but to really foul things up requires a computer.
Farmers' Almanac, 1978
-
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/