Re: sockstat: struct xtcpcb size mismatch

From: Boris Samorodov <bsam_at_ipt.ru>
Date: Mon, 10 Dec 2007 20:54:52 +0300
On Mon, 10 Dec 2007 17:19:51 +0000 (GMT) Robert Watson wrote:
> On Mon, 10 Dec 2007, Boris Samorodov wrote:
> > On Sat, 8 Dec 2007 17:13:14 -0500 Josh Carroll wrote:
> >
> >>> Thanks for the answer. And sorry, I can't understand what to do
> >>> further. Is it by design and should stay so or should it be fixed?
> >>>
> >>> BTW, RELENG_7 behaves the same way. And "netstat -a" is broken:
> >
> >> Your world and kernel are out of sync. I would recommend a
> >> buildworld/installworld and building a new kernel. That should do
> >> the trick.
> >
> > I wish you were right.
> >
> > Fresh cvsup to RELENG_7, buildworld (after make clean twice), make
> > kernel, install world, mergemaster. The kernel config (diff from
> > GENERIC shown later) doesn't work. If "options LOCK_PROFILING" is
> > removed and the kernel is rebuilt, all goes well. The bad case:

Robert, thank you for the answer. Now I (hope) understand the case.

> This is currently an accepted failure mode -- lock profiling
> significantly swells the overhead of various data structures and
> operations, so is not compiled in by default, and when compiled in,
> does modify the ABI for the monitoring interfaces.  You may be able to
> "fix" the user tools to match the kernel ABI by recompiling them but
> adding -DLOCK_PROFILING (or something along these lines).  It turns

Yes, I managed to build sockstat and netstat by adding a line
"CFLAGS+=-DLOCK_PROFILING" to apropriate Makefiles, then make clean,
make and make install did the trick.

> out that the interfaces that export TCP information directly export
> kernel data structures to user space -- this was presumably easy at
> the time for whoever did the work, but is a Bad Idea.  I've looked at
> fixing this before, but it's quite involved.  I hope that we will fix
> it for 8.0.

Meanwhile may be it's the right thing to mention this workaround at
LOCK_PROFILING(9) man page?


WBR
-- 
Boris Samorodov (bsam)
Research Engineer, http://www.ipt.ru Telephone & Internet SP
FreeBSD committer, http://www.FreeBSD.org The Power To Serve
Received on Mon Dec 10 2007 - 16:56:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:23 UTC