From owner-cvs-all@FreeBSD.ORG Sun Jul 24 18:12:19 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F01A316A41F; Sun, 24 Jul 2005 18:12:19 +0000 (GMT) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [66.127.85.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9616743D45; Sun, 24 Jul 2005 18:12:19 +0000 (GMT) (envelope-from sam@errno.com) Received: from [66.127.85.91] ([66.127.85.91]) (authenticated bits=0) by ebb.errno.com (8.12.9/8.12.6) with ESMTP id j6OICHms056609 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 Jul 2005 11:12:18 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <42E3DB49.4070704@errno.com> Date: Sun, 24 Jul 2005 11:17:45 -0700 From: Sam Leffler User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050327) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Christian S.J. Peron" References: <200507241721.j6OHLImZ032073@repoman.freebsd.org> <20050724172508.GA15547@freefall.freebsd.org> In-Reply-To: <20050724172508.GA15547@freefall.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/net bpf.c bpfdesc.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2005 18:12:20 -0000 Christian S.J. Peron wrote: > On Sun, Jul 24, 2005 at 05:21:18PM +0000, Christian S.J. Peron wrote: > >>csjp 2005-07-24 17:21:18 UTC >> >> FreeBSD src repository >> >> Modified files: >> sys/net bpf.c bpfdesc.h >> Log: >> Introduce new sysctl variable: net.bpf.stats. This sysctl variable can >> be used to pass statistics regarding dropped, matched and received >> packet counts from the kernel to user-space. While we are here >> introduce a new counter for filtered or matched packets. We currently >> keep track of packets received or dropped by the bpf device, but not >> how many packets actually matched the bpf filter. >> > > > I have a userspace program to display these stats: > > http://people.freebsd.org/~csjp/bpfstat.1122182321.shar > > An example of the output is: > > $ bpfstat > pid netif flags recv drop match sblen hblen command > 10750 rl0 p--s- 260 0 260 2426 0 tcpdump > $ > > I plan to move this into base, but I would like some people > to test/review it first. > There are numerous little programs like this looking for a common home. I suggest you stick your program in the tools area until we can resolve where to integrate them. I've wanted to overhaul netstats in a manner similar to ifconfig so it's easy to add code like this and/or write these as modules that are dynamically loaded (e.g. so vendors can distribute add-ons). Sam