public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paulo Marques <pmarques@grupopie.com>
To: Adam Jerome <abj@novell.com>
Cc: linux-kernel@vger.kernel.org, Akpm@osdl.org,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH 002/001] /kernel: /proc/kallsyms reports lower-case	types for some non-exported symbols       (Resend #1)
Date: Tue, 10 Oct 2006 20:06:41 +0100	[thread overview]
Message-ID: <452BEF41.9060402@grupopie.com> (raw)
In-Reply-To: <452B7079.3C0A.0073.0@novell.com>

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."

      reply	other threads:[~2006-10-10 19:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-10 17:59 [PATCH 002/001] /kernel: /proc/kallsyms reports lower-case types for some non-exported symbols (Resend #1) Adam Jerome
2006-10-10 19:06 ` Paulo Marques [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=452BEF41.9060402@grupopie.com \
    --to=pmarques@grupopie.com \
    --cc=Akpm@osdl.org \
    --cc=abj@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox