Project

General

Profile

Actions

Bug #9992

open

kstat -j does not produce valid JSON

Added by Brian Ewell over 3 years ago. Updated over 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
cmd - userland programs
Start date:
2018-11-20
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

The kstat command fails to produce valid JSON objects when used with a count of greater than one:

kstat -j unix::dbu_evict:tasks 1 2
[{
        "module": "unix",
        "instance": 21,
        "name": "dbu_evict",
        "class": "taskq",
        "type": 1,
        "snaptime": 3383559.368276734,
        "data": {
                "tasks": 10536387
        }
}]

[, {
        "module": "unix",
        "instance": 21,
        "name": "dbu_evict",
        "class": "taskq",
        "type": 1,
        "snaptime": 3383576.634575867,
        "data": {
                "tasks": 10536387
        }
}]

While the first JSON object is properly formatted, the second is not. There is an improper comma after the opening of the array and before the opening of the associate array:

[, {

This should instead look like the beginning of the first block:
[{

Actions

Also available in: Atom PDF