[Machine readable output from userland utilities] report

Zaro Korchev zkorchev at mail.bg
Mon Jul 7 12:01:11 UTC 2014


Hi everybody

This week I spent most of my time on adding libsol support to procstat.

# procstat -f 697

[
    {
        "pid": 697,
        "cmd": "tcsh",
        "fd": "text",
        "type": "v",
        "vtype": "r",
        "flags": "r-------",
        "name": "/bin/tcsh"
    },
    {
        "pid": 697,
        "cmd": "tcsh",
        "fd": "ctty",
        "type": "v",
        "vtype": "c",
        "flags": "rw------",
        "name": "/dev/ttyv2"
    },
    {
        "pid": 697,
        "cmd": "tcsh",
        "fd": "cwd",
        "type": "v",
        "vtype": "d",
        "flags": "r-------",
        "name": "/usr/home/zaro/zkorchev/freebsd_head/usr.bin/stat"
    },
    {
        "pid": 697,
        "cmd": "tcsh",
        "fd": "root",
        "type": "v",
        "vtype": "d",
        "flags": "r-------",
        "name": "/"
    },
    {
        "pid": 697,
        "cmd": "tcsh",
        "fd": 15,
        "type": "v",
        "vtype": "c",
        "flags": "rw------",
        "ref": 9,
        "offset": 412893,
        "name": "/dev/ttyv2"
    },
    {
        "pid": 697,
        "cmd": "tcsh",
        "fd": 16,
        "type": "v",
        "vtype": "c",
        "flags": "rw------",
        "ref": 9,
        "offset": 412893,
        "name": "/dev/ttyv2"
    },
    {
        "pid": 697,
        "cmd": "tcsh",
        "fd": 17,
        "type": "v",
        "vtype": "c",
        "flags": "rw------",
        "ref": 9,
        "offset": 412893,
        "name": "/dev/ttyv2"
    },
    {
        "pid": 697,
        "cmd": "tcsh",
        "fd": 18,
        "type": "v",
        "vtype": "c",
        "flags": "rw------",
        "ref": 9,
        "offset": 412893,
        "name": "/dev/ttyv2"
    },
    {
        "pid": 697,
        "cmd": "tcsh",
        "fd": 19,
        "type": "v",
        "vtype": "c",
        "flags": "rw------",
        "ref": 9,
        "offset": 412893,
        "name": "/dev/ttyv2"
    }
]

I added a new function to libsol that generates a map key from an integer. I'm currently not using it anywhere but I think it will become handy in the future.

I also wanted to make stat work with libsol, but after reading the source, I realized this will not be possible because stat uses format strings to operate.


Zaro


More information about the soc-status mailing list