From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 03:55:30 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 A55361065695 for ; Fri, 5 Feb 2010 03:55:30 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-qy0-f190.google.com (mail-qy0-f190.google.com [209.85.221.190]) by mx1.freebsd.org (Postfix) with ESMTP id 54F8E8FC14 for ; Fri, 5 Feb 2010 03:55:29 +0000 (UTC) Received: by qyk28 with SMTP id 28so1585047qyk.25 for ; Thu, 04 Feb 2010 19:55:29 -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=WEeZjmpku2MVehQ1s/aY4JhLjU1MaGKqX1iKrS7VUYw=; b=NCHEOJt1xsMlkwXG/w1B6d+6RcHJ14oWvZ5xaTCNuAsmwVsY7WjXVl4EwBzfiqdrI6 HVCuUjHocg357SnK5pE1BDwM3YyRaQihF3kLJXZpRD3d7Tzp4oc243xBpSgDuXnijphY vH10jZRvQvUMidtpggXu3MoRVZ1Ku0OoNGHVA= 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=tXWyOGZHpZCh4u3S0CUn2IpMPwco9ZydfoywNNnya/mwOTyqbBCprghWleCInrLioc um7xNht8TE94jN506Cg5+EPcZdeMFLejI6+IkXZmr0UN42qgs9WPhGDsYLiIFoao5APN OOn6V1L3TcF2h22YYeVNGPQkuG0h1FoI1PrzQ= Received: by 10.224.72.96 with SMTP id l32mr691443qaj.127.1265342129503; Thu, 04 Feb 2010 19:55:29 -0800 (PST) Received: from centel.dataix.local (ppp-21.112.dialinfree.com [209.172.21.112]) by mx.google.com with ESMTPS id 5sm2860142qwg.48.2010.02.04.19.55.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 19:55:28 -0800 (PST) Sender: "J. Hellenthal" Date: Thu, 4 Feb 2010 22:55:21 -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; charset=US-ASCII; format=flowed Cc: Ed Schouten , Xin LI , freebsd-hackers@freebsd.org 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 03:55:30 -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 would recommend generating this patch as a unified diff or a svn or cvs diff whichever version you checked out your tree with. -- jhell