From owner-freebsd-questions@FreeBSD.ORG Fri Feb 15 20:01:27 2013 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3B2D6B98 for ; Fri, 15 Feb 2013 20:01:27 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from be-well.ilk.org (be-well.ilk.org [23.30.133.173]) by mx1.freebsd.org (Postfix) with ESMTP id F26B4187 for ; Fri, 15 Feb 2013 20:01:26 +0000 (UTC) Received: from lowell-desk.lan (lowell-desk.lan [172.30.250.41]) by be-well.ilk.org (Postfix) with ESMTP id EA73133C1D; Fri, 15 Feb 2013 15:01:20 -0500 (EST) Received: by lowell-desk.lan (Postfix, from userid 1147) id 4FD4939829; Fri, 15 Feb 2013 15:01:19 -0500 (EST) From: Lowell Gilbert To: Fleuriot Damien Subject: Re: vmstat -w not honored References: <3D8611F5-7AF0-44D1-87FB-DF183A94B1FF@my.gd> Date: Fri, 15 Feb 2013 15:01:19 -0500 In-Reply-To: <3D8611F5-7AF0-44D1-87FB-DF183A94B1FF@my.gd> (Fleuriot Damien's message of "Wed, 13 Feb 2013 22:42:01 +0100") Message-ID: <44bobl9wj4.fsf@lowell-desk.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: FreeBSD questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2013 20:01:27 -0000 Fleuriot Damien writes: > I'm running 8.3-STABLE and apparently, vmstat won't honor both -i > (interrupts) and -w (repeat display every wait delay seconds) flags at > the same time. > The problem also arises with -z. > > The manual doesn't mention these flags being incompatible with -w. They are. And with -c as well. *Only* the actual VM-related information display supports the looping. [The full set of flags incompatible with w and c is: f, i, m, s, z. > Anyone knows if this is intended behavior ? A better question would be whether it would actually be useful to change. In theory, other display routines could be modified to repeat. But their output formats would have to change, to fit all of the output on a single line. That would be a lot less readable for humans. If you've got an idea for what it could look like, I'd be happy to implement it for you. It would also have to figure out what the results would be if multiple kinds of output (e.g., interrupt counts *and* virtual memory) were specified. For the one-shot types of output, you can get more than one in a single command. > I wanna make sure before filling a PR, either to get this fixed or the man pages adjusted. Well, the following patch will at least warn the user about it at run time: --- vmstat.c (revision 246551) +++ vmstat.c (working copy) @@ -304,6 +304,8 @@ reps = -1; } else if (reps) interval = 1 * 1000; + if (interval && !(todo & VMSTAT)) + warnx("Ignoring repeat request: cannot repeat on this type of output"); if (todo & FORKSTAT) doforkst();