From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 02:31:15 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68E98106566B for ; Fri, 5 Feb 2010 02:31:15 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 135C48FC1A for ; Fri, 5 Feb 2010 02:31:14 +0000 (UTC) Received: by vws11 with SMTP id 11so1486750vws.13 for ; Thu, 04 Feb 2010 18:31:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=+cgoX9ubAbl+4DiqQY+2T8WzJORfCRVaAimD2CBJfwo=; b=JgZP4o5EosYKD5HjGg1EGp+4ZtPFdlXZCzjnGXVVdMt7sXHT/4jNxWHRnts9Mpzme2 gRoRg7YvroJeBqSTqHXx7tdNn3QuiTTdv9UYQlxCqljR4wEmQVJIlGYI0g4tKmHcVYHV 4laRPJjIKdjxfAjIi/t/rrS0QTMLZC8jmawH0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=Rc2PUphIpkH03lZiHn8Z6JJabOF5fMwo3ft3GoHbtwX8ZNPQ2f6fz97PP/UmxihLqJ 6Nr7FK13Iak4N0cLltOEl0Vz8ykUf7hJfF3B/jjl8UTIPv6FxpE0yGHOHtT8QtKJi9zY uKxHQcPa2XOnZ1CWVwLSokxnx+WEEN4j/jFao= Received: by 10.220.124.106 with SMTP id t42mr3587060vcr.92.1265337074194; Thu, 04 Feb 2010 18:31:14 -0800 (PST) Received: from centel.dataix.local (ppp-23.227.dialinfree.com [209.172.23.227]) by mx.google.com with ESMTPS id 42sm6757090vws.12.2010.02.04.18.31.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 18:31:12 -0800 (PST) Sender: "J. Hellenthal" Date: Thu, 4 Feb 2010 21:30:59 -0500 From: jhell To: Gleb Kurtsou In-Reply-To: <20100204115505.GA5272@tops.skynet.lt> Message-ID: References: <200902251724.40212.fbsd.hackers@rachie.is-a-geek.net> <20100204115505.GA5272@tops.skynet.lt> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Cc: Ed Schouten , eitanadlerlist@gmail.com, Xin LI , jasonspiro4@gmail.com, FreeBSD Hackers Subject: Re: [PATCH] Support for thresholds in du(1) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2010 02:31:15 -0000 On Thu, 4 Feb 2010 06:55, gleb.kurtsou@ wrote: > On (25/02/2009 17:24), Mel wrote: >> Hi, >> >> attached is a small patch to add threshold support to du(1). I've been using >> it on 7-STABLE machines for a while, cause I got tired of the noise I get >> when sorting and then reformatting to human-readable. Especially since >> sorting isn't part of the equasion "I'd like to see all dirs exceeding a >> given size". >> I've not updated the manpage on -STABLE yet, should be the same as HEAD. >> >> Example usage: >> # du -xht 20m . >> 29M ./contrib/binutils >> 52M ./contrib/gcc >> 237M ./contrib >> 35M ./crypto >> 28M ./lib >> 20M ./share >> 55M ./sys/dev >> 139M ./sys >> 545M . >> >> I'll file a PR for it, if there's no objections to this feature / >> implementation, the style(9) or the usage of -t. >> -- >> Mel > > Hi, > > I've cleaned up original patch: > * fixed style and some bugs > * as suggested changed it to use expand_number > * implemented support for negative threshold values > > I find the patch very useful. Does it look ok to be commited, or should > I file a PR so it won't get lost once again. > > Example usage: > src/sys/crypto % du -ht 100k > 137K ./des > 482K . > src/sys/crypto % du -A -ht +100k > 129K ./des > 446K . > src/sys/crypto % du -ht -100k > 56K ./camellia > 11K ./salsa20 > 38K ./sha2 > 9.0K ./rc4 > 68K ./des/arch/i386 > 70K ./des/arch > 88K ./rijndael > 37K ./via > 8.0K ./hmac > 36K ./blowfish/arch/i386 > 37K ./blowfish/arch > 85K ./blowfish > > I like it!. This certainly reduces some piping but as long as it is not integrated upstream it will only become more of a responsibility on FreeBSD's behalf to maintain it. If someone has the original authors email address I would say lets include him on this and see what he thinks. This would probably be the same for the pkill thread that I am involved in to. CC'ing responsible party for that thread. Best regards. This message was supposed to arrive 9 hours ago but there was some ISP problems that prevented me from sending it. -- jhell