From owner-freebsd-current@FreeBSD.ORG Thu Nov 8 15:23:13 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F67344A; Thu, 8 Nov 2012 15:23:13 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (lrosenman-1-pt.tunnel.tserv8.dal1.ipv6.he.net [IPv6:2001:470:1f0e:3ad::2]) by mx1.freebsd.org (Postfix) with ESMTP id 1D1BB8FC14; Thu, 8 Nov 2012 15:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date:Content-Transfer-Encoding:Content-Type:MIME-Version; bh=fmpkzkPHt/NJHuDMYWgq//dYEZU6Uao4VKWtHpvkIMQ=; b=QTj4LaPV0D7C02Z4XefUNvHrPtx2WrCBahUvuwpxRmHCQLlOusZ6U7Qu79OUCiQtH9Qt0nChvy0pCbKIE7BPecglF5nikbbctuRlJi6LXHxNB8fDUbPAcsp1OAgMXvQH3GwrWc6sn/0WIzryfESb3G4C2zZR3YxxN918VK3D7cc=; Received: from localhost.lerctr.org ([127.0.0.1]:21440 helo=webmail.lerctr.org) by thebighonker.lerctr.org with esmtpa (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1TWTwm-000Lfm-25; Thu, 08 Nov 2012 09:23:12 -0600 Received: from [32.97.110.60] by webmail.lerctr.org with HTTP (HTTP/1.1 POST); Thu, 08 Nov 2012 09:23:11 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 08 Nov 2012 09:23:11 -0600 From: Larry Rosenman To: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Subject: Re: sysutils/lsof Author Question (for CLANG).... In-Reply-To: <7662C646-941D-4E94-92C3-444752DF1EF7@FreeBSD.org> References: <5d4c4abe37bd6fffd0c206c1b7b68ce1@webmail.lerctr.org> <20121107213917.GD77848@eureka.lemis.com> <20121107230034.GF77848@eureka.lemis.com> <509BBEDC.4070103@FreeBSD.org> <7662C646-941D-4E94-92C3-444752DF1EF7@FreeBSD.org> Message-ID: <6aadce9c231079e0738de9f059625358@webmail.lerctr.org> X-Sender: ler@lerctr.org User-Agent: Roundcube Webmail/0.8.2 X-Spam-Score: -3.3 (---) X-LERCTR-Spam-Score: -3.3 (---) X-Spam-Report: SpamScore (-3.3/5.0) ALL_TRUSTED=-1, BAYES_00=-1.9, RP_MATCHES_RCVD=-0.369 X-LERCTR-Spam-Report: SpamScore (-3.3/5.0) ALL_TRUSTED=-1, BAYES_00=-1.9, RP_MATCHES_RCVD=-0.369 Cc: Greg 'groggy' Lehey , freebsd-current@freebsd.org, Andriy Gapon X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 08 Nov 2012 15:23:13 -0000 On 2012-11-08 09:20, Edward Tomasz Napierała wrote: > Wiadomość napisana przez Andriy Gapon w dniu 8 lis 2012, o godz. > 15:17: >> on 08/11/2012 01:00 Greg 'groggy' Lehey said the following: >>> On Wednesday, 7 November 2012 at 16:35:22 -0600, Larry Rosenman >>> wrote: >>>> On 2012-11-07 15:39, Greg 'groggy' Lehey wrote: >>>>> On Wednesday, 7 November 2012 at 10:32:23 -0500, Benjamin Kaduk >>>>> wrote: >>>>>> >>>>>> Once again, attempting to use kernel internals outside of the >>>>>> supported interfaces is just asking for trouble; I do not >>>>>> understand >>>>>> why this message is not sinking in over the course of your >>>>>> previous >>>>>> mails to these lists, so I will not try to belabor it further. >>>>> >>>>> IIRC lsof is a special case that always needs to be built with >>>>> intimate knowledge of the kernel. >>>> >>>> This is VERY true. Since some of the information lsof uses has >>>> no API/ABI/KPI/KBI to get, it grovels around in the kernel. >>> >>> And until those interfaces are provided, I think this is >>> legitimate. >>> If there's anybody out there who hasn't used lsof, you should try >>> it. >>> It's good. >> >> Just curious why lsof can't use interfaces that e.g. >> fstat/sockstat/etc use? >> Those base utilities do not seem to experience as much trouble as >> lsof. > > Note that fstat(8) does not report file paths. On the other hand, > procstat(8) > does. It looks like "procstat -fa" and "procstat -va" together > provide the > same information lsof(8) does; unfortunately there doesn't seem to be > a way > to show a "merged" output for files opened (-f) and files mmapped, > but closed > (-v). Remember also that lsof is portable between MANY flavors of *nix.