Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jun 2009 12:39:17 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        "Bjoern A. Zeeb" <bz@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r194629 - head/sys/net
Message-ID:  <20090623120338.T32054@delplex.bde.org>
In-Reply-To: <20090622151017.H22887@maildrop.int.zabbadoz.net>
References:  <200906221507.n5MF7CIq044459@svn.freebsd.org> <20090622151017.H22887@maildrop.int.zabbadoz.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 22 Jun 2009, Bjoern A. Zeeb wrote:

> On Mon, 22 Jun 2009, Bjoern A. Zeeb wrote:
>> Log:
>>  Collect all VIMAGE_GLOBALS variables in one place.
>> 
>>  No longer export rt_tables as all lookups go through
>>  rt_tables_get_rnh().
>> 
>>  We cannot make rt_tables (and rtstat, rttrash[1]) static as
>>  netstat -r (-rs[1]) would stop working on a stripped
>>  VIMAGE_GLOBALS kernel.

We can do this.

>> 
>>  Reviewed by:		zec
>>  Presumably broken by:	phk 13.5y ago in r12820 [1]
>
> Which seriously leads to the questions:
> 1) is this because we do not ship stripped kernels?

It shouldn't be:
- we shouldn't try to break all utilities that use nlist() on kernels by
   shipping stripped kernels
- we shouldn't try to break some utilities that use nlist() on kernels by
   shipping kernels with only static symbols stripped.  Static symbols are
   public except at the level of compiling.

> 2) is the kvm_* interface to read them the wrong way?

It's the easiest way, and should still work even if the values are
exported by sysctls, since it is the only way that works on dead
kernels.

Maybe netstat is looking up the wrong symbols.

Maybe this is a gcc bug.  gcc now leaves out static symbols that it
thinhs are not used at the level of compiling.  An example might be a
pointer that is initialized at compile time but not used except by kvm
and debuggers (not to mention nm to check that it has not been removed),
or even a non-volatile pointer that is initialized at runtime but not
used except by kvm, etc.  gcc now also leaves out static functions
that are called only once, after inlining them.  This probably doesn't
affect kvm, but it breaks profiling and debugging.  There are various
attributes and compiler flags to prevent these bugs, but these are not
used everywhere necessary.

> 3) those stats are useless and should be garbage collected entirely?
>
> I only tripped over this because I wanted to do the same to rt_tables
> as phk did 13.5 years back to rtstat,rttrash and Marko made me
> tripple check things.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090623120338.T32054>