-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The "program name" field is missing in the JSON format #298
Comments
Indeed, "parsable output" (-P flag) prints "process name" fields (ps->gen.name) after PIDs, but json.c output misses those. |
@N-Storm, thanks! $ atop -X -J PRC 1 1 | jq '.PRC |= map(@json)' | sed 's/"{/{/g; s/}"/}/g; s/\\//g' | head -10
{
"host": "xxx",
"timestamp": 1712744378,
"elapsed": 425047,
"PRC": [
{"pid":1,"name":"(systemd)","utime":9223,"stime":6772,"nice":0,"prio":120,"curcpu":9,"tgid":1,"isproc":1,"rundelay":623,"blkdelay":6460,"nvcsw":68260,"nivcsw":4648,"sleepavg":0},
{"pid":2,"name":"(kthreadd)","utime":7,"stime":0,"nice":0,"prio":120,"curcpu":1,"tgid":2,"isproc":1,"rundelay":20,"blkdelay":0,"nvcsw":1168,"nivcsw":0,"sleepavg":0},
{"pid":3,"name":"(rcu_gp)","utime":0,"stime":0,"nice":-20,"prio":100,"curcpu":0,"tgid":3,"isproc":1,"rundelay":0,"blkdelay":0,"nvcsw":2,"nivcsw":0,"sleepavg":0},
{"pid":4,"name":"(rcu_par_gp)","utime":0,"stime":0,"nice":-20,"prio":100,"curcpu":0,"tgid":4,"isproc":1,"rundelay":0,"blkdelay":0,"nvcsw":2,"nivcsw":0,"sleepavg":0},
{"pid":6,"name":"(kworker/0:0H-ev)","utime":0,"stime":0,"nice":-20,"prio":100,"curcpu":0,"tgid":6,"isproc":1,"rundelay":0,"blkdelay":0,"nvcsw":4,"nivcsw":0,"sleepavg":0},
$ atop -X -J PRM 1 1 | jq '.PRM |= map(@json)' | sed 's/"{/{/g; s/}"/}/g; s/\\//g' | head -10
{
"host": "xxx",
"timestamp": 1712744394,
"elapsed": 425063,
"PRM": [
{"pid":1,"name":"(systemd)","vmem":167272,"rmem":10836,"vexec":816,"vgrow":167272,"rgrow":10836,"minflt":44763,"majflt":167,"vlibs":8100,"vdata":21116,"vstack":1032,"vlock":0,"vswap":0,"pmem":0},
{"pid":2,"name":"(kthreadd)","vmem":0,"rmem":0,"vexec":0,"vgrow":0,"rgrow":0,"minflt":0,"majflt":0,"vlibs":0,"vdata":0,"vstack":0,"vlock":0,"vswap":0,"pmem":0},
{"pid":3,"name":"(rcu_gp)","vmem":0,"rmem":0,"vexec":0,"vgrow":0,"rgrow":0,"minflt":0,"majflt":0,"vlibs":0,"vdata":0,"vstack":0,"vlock":0,"vswap":0,"pmem":0},
{"pid":4,"name":"(rcu_par_gp)","vmem":0,"rmem":0,"vexec":0,"vgrow":0,"rgrow":0,"minflt":0,"majflt":0,"vlibs":0,"vdata":0,"vstack":0,"vlock":0,"vswap":0,"pmem":0},
{"pid":6,"name":"(kworker/0:0H-ev)","vmem":0,"rmem":0,"vexec":0,"vgrow":0,"rgrow":0,"minflt":0,"majflt":0,"vlibs":0,"vdata":0,"vstack":0,"vlock":0,"vswap":0,"pmem":0}, |
Process name added to JSON output via PR #299 (renamed 'name' to 'cmd' and removed parenthesis). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested with 2.9, 2.10 atop versions.
Usual output has this field, but json output has not.
The text was updated successfully, but these errors were encountered: