From fccef669d1d489d675fd6a8ae5fb87cac72a54d6 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Wed, 25 Dec 2002 09:46:32 -0600 Subject: kbuild: Stem compression for kallsyms This patch implements simple stem compression for the kallsyms symbol table. Each symbol has as first byte a count on how many characters are identical to the previous symbol. This compresses the often common repetive prefixes (like subsys_) fairly effectively. On a fairly full featured monolithic i386 kernel this saves about 60k in the kallsyms symbol table. The changes are very simple, so the 60k are not shabby. One visible change is that the caller of kallsyms_lookup has to pass in a buffer now, because it has to be modified. I added an arbitary 127 character limit to it. Still >210k left in the symbol table unfortunately. Another idea would be to delta encode the addresses in 16bits (functions are all likely to be smaller than 64K). This would especially help on 64bit hosts. Not done yet, however. No, before someone asks, I don't want to use zlib for that. Far too fragile during an oops and overkill too and it would require to link it into all kernels. --- include/linux/kallsyms.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index dcba85045308..d2a90b7766a1 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -12,7 +12,7 @@ const char *kallsyms_lookup(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, - char **modname); + char **modname, char *namebuf); /* Replace "%s" in format with address, if found */ extern void __print_symbol(const char *fmt, unsigned long address); @@ -22,7 +22,7 @@ extern void __print_symbol(const char *fmt, unsigned long address); static inline const char *kallsyms_lookup(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, - char **modname) + char **modname, char *namebuf) { return NULL; } -- cgit v1.2.3