From owner-freebsd-current@FreeBSD.ORG Mon Dec 10 17:56:31 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32EC416A419; Mon, 10 Dec 2007 17:56:31 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from services.ipt.ru (services.ipt.ru [194.62.233.110]) by mx1.freebsd.org (Postfix) with ESMTP id DE31C13C469; Mon, 10 Dec 2007 17:56:30 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from bb.ipt.ru ([194.62.233.89]) by services.ipt.ru with esmtp (Exim 4.54 (FreeBSD)) id 1J1mrl-000Kul-IP; Mon, 10 Dec 2007 20:56:29 +0300 To: Robert Watson References: <97676449@bb.ipt.ru> <3bbf2fe10712062309j7c49aef7g9a5cfa6e2a52158c@mail.gmail.com> <53021179@bb.ipt.ru> <8cb6106e0712081413uc58f836w611b99ab0a536a4a@mail.gmail.com> <31551976@bs1.sp34.ru> <20071210171726.V52506@fledge.watson.org> From: Boris Samorodov Date: Mon, 10 Dec 2007 20:54:52 +0300 In-Reply-To: <20071210171726.V52506@fledge.watson.org> (Robert Watson's message of "Mon\, 10 Dec 2007 17\:19\:51 +0000 \(GMT\)") Message-ID: <95868243@bb.ipt.ru> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: josh.carroll@gmail.com, Attilio Rao , freebsd-current@freebsd.org Subject: Re: sockstat: struct xtcpcb size mismatch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2007 17:56:31 -0000 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