From owner-freebsd-questions@FreeBSD.ORG Fri Feb 15 22:56:21 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 2B89B3BC for ; Fri, 15 Feb 2013 22:56:21 +0000 (UTC) (envelope-from ml@my.gd) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by mx1.freebsd.org (Postfix) with ESMTP id B91F0BD9 for ; Fri, 15 Feb 2013 22:56:20 +0000 (UTC) Received: by mail-wi0-f181.google.com with SMTP id hm6so1746762wib.8 for ; Fri, 15 Feb 2013 14:56:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to:x-gm-message-state; bh=ZYYBJQkMdha3jymGKQoQfr1cTDPH9p3rdY73XaZPnE4=; b=DhB7O6AhOFAm1YMjqF6EPntttm6rMTedMuarY7q7WuuQRmFD77rBpepnwpSehwYY5t kPTgtrrAmJwFHvRCD96LNzBWvWaIYszJzMp5lab5kXnMAMa76aGrIIrVP1RgTgIMoX+S koD2WMZaBMEBLEnEJC/7k9S4+/Gmct9ItqwiDE0+QivnPQDH6UTY4xh7aHQyzN4AP9Js 6ZZipyrTRb7D7Bzv4+RtI0NGIjjeEAf8Y5qUBj3mHXI9ppDJUbFjDeknyIgKpY0c6rBR 0rG8zS3HPf94AqKr9sHo4M2VBqmYF44CIxGE5kOdUxoKFN8A5BaFVyERgCIo05wTRfTv Lgpw== X-Received: by 10.194.172.197 with SMTP id be5mr7247532wjc.20.1360968974115; Fri, 15 Feb 2013 14:56:14 -0800 (PST) Received: from [10.58.114.102] ([92.90.16.32]) by mx.google.com with ESMTPS id bs6sm8026809wib.4.2013.02.15.14.56.12 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 14:56:13 -0800 (PST) References: <3D8611F5-7AF0-44D1-87FB-DF183A94B1FF@my.gd> <44bobl9wj4.fsf@lowell-desk.lan> Mime-Version: 1.0 (1.0) In-Reply-To: <44bobl9wj4.fsf@lowell-desk.lan> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <4D6A55E6-1A99-4446-B70B-F41FC7B5C5D5@my.gd> X-Mailer: iPhone Mail (10B144) From: Damien Fleuriot Subject: Re: vmstat -w not honored Date: Fri, 15 Feb 2013 23:56:01 +0100 To: Lowell Gilbert X-Gm-Message-State: ALoCoQnBe4FIpnlJodBpqDU9XpWGSh/Nm1WWmGTZQYmEULuLLefEQM/Hu5wDT9el9q81hJonBuAL 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 22:56:21 -0000 On 15 Feb 2013, at 21:01, Lowell Gilbert wrote: > Fleuriot Damien writes: >=20 >> 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. >>=20 >> The manual doesn't mention these flags being incompatible with -w. >=20 > They are. And with -c as well. *Only* the actual VM-related information > display supports the looping. [The full set of flags incompatible with=20 > w and c is: f, i, m, s, z. >=20 >> Anyone knows if this is intended behavior ? >=20 > 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. >=20 > 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.=20 >=20 It's not a bother to me that the output doesn't get repeated really, don't b= other implementing it if it's too much of a hassle. Besides, I could always use a loop to exec the command every X seconds. A much easier approach could be to mention it in the manual :) >> I wanna make sure before filling a PR, either to get this fixed or the ma= n pages adjusted. >=20 > Well, the following patch will at least warn the user about it at run time= : >=20 > --- vmstat.c (revision 246551) > +++ vmstat.c (working copy) > @@ -304,6 +304,8 @@ > reps =3D -1; > } else if (reps) > interval =3D 1 * 1000; > + if (interval && !(todo & VMSTAT)) > + warnx("Ignoring repeat request: cannot repeat on this typ= e of output"); >=20 > if (todo & FORKSTAT) > doforkst();