Date: Fri, 15 Feb 2013 23:56:01 +0100 From: Damien Fleuriot <ml@my.gd> To: Lowell Gilbert <freebsd-questions-local@be-well.ilk.org> Cc: FreeBSD questions <questions@freebsd.org> Subject: Re: vmstat -w not honored Message-ID: <4D6A55E6-1A99-4446-B70B-F41FC7B5C5D5@my.gd> In-Reply-To: <44bobl9wj4.fsf@lowell-desk.lan> References: <3D8611F5-7AF0-44D1-87FB-DF183A94B1FF@my.gd> <44bobl9wj4.fsf@lowell-desk.lan>
next in thread | previous in thread | raw e-mail | index | archive | help
On 15 Feb 2013, at 21:01, Lowell Gilbert <freebsd-questions-local@be-well.il=
k.org> wrote:
> Fleuriot Damien <ml@my.gd> 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();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D6A55E6-1A99-4446-B70B-F41FC7B5C5D5>
