Project

General

Profile

Bug #12250

zonestat_usage(): stderr vs. stdio dilemma

Added by Marcel Telka 12 months ago. Updated 12 months ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

The zonestat_usage() function in zonestat prints half of the usage to stderr and half of it to stdout:

$ /usr/bin/zonestat 2>/dev/null
    -T    Print timestamp. Valid timestamps are:
              "d"       Date as specifed by date(1) command
              "u"       Unix time as returned by time(2)
              "i"       ISO 8601 timestamp "YYYYMMDDThhmmssZ" 
    -R    Print reports at end or after each report interval.
            Valid reports are:
              "total"   Usage of each zone
              "average" Usage of each zone while running
              "high"    Maximum usage of each zone
    -q    Quiet.  Do not print intervals.  Only print reports.
    -p    Machine parseable output.
    -P    Select desired lines in parseable output.
              "resource"        Lines describing each resource
              "total"   Total usage of each resource
              "system"  System usage of each resource
              "zones"   Per-zone usage of each resource
              "header"  Header lines between intervals and reports
    -S    Sort output by the specified columns:
              "name"    by name alphanumerically
              "used"    by percent of resource used
              "cap"     by configured cap
              "pcap"    by percent of cap used
              "shr"     by shares configured
              "pshru"   by percent of share used
              "cpu"     Sort summary by cpu
              "physical-memory" Sort summary by physical memory
              "virtual-memory"  Sort summary by virtual memory
$

We should make sure that the whole zonestat usage goes consistently either to stderr or stdout.

Also available in: Atom PDF