Re: [PATCH 002/001] /kernel: /proc/kallsyms reports lower-case types for some non-exported symbols (Resend #1)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adam Jerome wrote:
This patch addresses incorrect symbol type information reported through /proc/kallsyms.
A lowercase character should designate the symbol as local (or non-exported).  An
uppercase character should designate the symbol as global (or external). Without this
patch, some non-exported symbols are incorrectly assigned an upper-case designation in
/proc/kallsyms.  This patch corrects this condition by converting non-exported symbols
types to lower case when appropriate and eliminates the superfluous upcase_if_global
function

After looking at this patch I thought "this is all wrong: we should fix this at build time and not at run-time". The module infrastructure is a little hard to follow, though (Rusty CC'ed).

Anyway, it looks like doing the case correction in add_kallsyms should at least avoid the "is_exported" call at every module symbol at every "cat /proc/kallsyms". It would be done only once at module loading (doing it at build time would be even better, though).

"is_exported" does a linear search inside the symbols of one module, so the time it takes to "cat" all the symbols in a module grows O(N^2). Although there aren't that many symbols in each module, a quick grep shows that "usbcore", for instance, has 876 symbols in /proc/kallsyms.

The st_info field seems to be used only to display the type in "/proc/kallsyms" and in mod_find_symname to ignore undefined symbols (this would have to be adjusted if the case of the 'U' symbol is changed).

This has actually very little to do with the patch in question, because this behavior was already in place before the patch. Maybe some benchmarks of "cat /proc/kallsyms" with both the is_exported call and without it can show if this really matters in the end.

--
Paulo Marques - www.grupopie.com

"The face of a child can say it all, especially the
mouth part of the face."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux