[Bug 254635] vmstat libxo output malformed

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Mar 29 01:17:37 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254635

            Bug ID: 254635
           Summary: vmstat libxo output malformed
           Product: Base System
           Version: 12.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: nijave at gmail.com

JSON when used with `-w` flag

```
# vmstat --libxo json -w 5
{"__version": "1", "processes": {"runnable":63,"waiting":9,"swapped-out":2}
, "memory": {"available-memory":"  36G","free-memory":"
1.2G","total-page-faults":4593}
, "paging-rates":
{"page-reactivated":5,"paged-in":0,"paged-out":22,"freed":6717,"scanned":722}
, "device": [{"name":"da0","transfers":"0"}, {"name":"da1","transfers":"0"}],
"fault-rates":
{"interrupts":1169,"system-calls":68996,"context-switches":39163}
, "cpu-statistics": {"user":" 8","system":"21","idle":"71"}

, "processes": {"runnable":51,"waiting":9,"swapped-out":2}
, "memory": {"available-memory":"  37G","free-memory":"
1.2G","total-page-faults":4576}
, "paging-rates":
{"page-reactivated":0,"paged-in":0,"paged-out":47,"freed":3771,"scanned":3834}
, "device": [{"name":"da0","transfers":"0"}, {"name":"da1","transfers":"17"}],
"fault-rates":
{"interrupts":421,"system-calls":106121,"context-switches":19317}
, "cpu-statistics": {"user":"87","system":"13","idle":" 0"}
```
(space added between successive outputs). I'd expect either json lines or
back-to-back complete json objects but the second iteration returns a partial
blob


```
# vmstat --libxo xml
<processes
version="1"><runnable>30</runnable><waiting>9</waiting><swapped-out>2</swapped-out></processes><memory><available-memory
value="39004778496">  36G</available-memory><free-memory value="1409699840">
1.3G</free-memory><total-page-faults>4592</total-page-faults></memory><paging-rates><page-reactivated>5</page-reactivated><paged-in>0</paged-in><paged-out>22</paged-out><freed>6713</freed><scanned>728</scanned></paging-rates><device><name>da0</name><transfers>0</transfers></device><device><name>da1</name><transfers>0</transfers></device><fault-rates><interrupts>1168</interrupts><system-calls>69080</system-calls><context-switches>39135</context-switches></fault-rates><cpu-statistics><user>
8</user><system>21</system><idle>71</idle></cpu-statistics>
```
XML is missing root element. Using `-w` prints successive like the above
example

Not sure if these issues are related but in both cases there are issues with
the libxo output

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list