public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Keith Owens <kaos@ocs.com.au>
Cc: kernel-janitors@lists.osdl.org, linux-kernel@vger.kernel.org
Subject: Re: finding unused globals in the kernel
Date: Mon, 1 Mar 2004 10:42:09 +0100	[thread overview]
Message-ID: <200403011042.10099.arnd@arndb.de> (raw)
In-Reply-To: <5138.1078121472@kao2.melbourne.sgi.com>

On Monday 01 March 2004 07:11, Keith Owens wrote:
> It is a bit harder than a simple compare.  EXPORT_SYMBOL(foo) generates
> a reference to foo even if nothing uses it, which hides unused
> variables.  Certain symbols appear as unused but are really used by the
> 2.4 version of insmod.  Your script does not handle modules at all.
> 
> namespace.pl below handles all the special cases on kernels from 2.0
> through 2.4.  It needs updating for 2.6 kernels, enjoy.

Well, your script is about a related, but still different question.
namespace.pl apparently gives a list of symbols that could/should have 
been marked static because they are not referenced outside of their
files. I have another script that does this as well, though yours
is a lot better at it.

The question that my checkunused.sh is trying to answer is which symbols 
are never referenced at all and therefore could be removed from the 
kernel binary. I intentionally kept the references from EXPORT_SYMBOL,
because I didn't want to think about whether there might be modules
using them.

Finding exported symbols that no module in the tree uses is yet
another problem. Your namespace.pl does this on object files, but
using cscope at source level could perhaps do this better.

	Arnd <><

  parent reply	other threads:[~2004-03-01  9:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-28 21:13 finding unused globals in the kernel Arnd Bergmann
2004-03-01  6:11 ` Keith Owens
2004-03-01  6:22   ` Keith Owens
2004-03-01  9:42   ` Arnd Bergmann [this message]
2004-03-01 12:37     ` Keith Owens
2004-03-01 15:34   ` [Kernel-janitors] " Arnd Bergmann
2004-03-01 14:32 ` Marcelo Tosatti
2004-03-01 19:28   ` Arnd Bergmann

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=200403011042.10099.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=kaos@ocs.com.au \
    --cc=kernel-janitors@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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