diff options
author | vangyzen <vangyzen@FreeBSD.org> | 2016-12-15 16:52:17 +0000 |
---|---|---|
committer | vangyzen <vangyzen@FreeBSD.org> | 2016-12-15 16:52:17 +0000 |
commit | 399f89a3ce97d7f6e1132b3be50338558b1614f8 (patch) | |
tree | 81721e570f87d5d3b950a30f2b523fbd38b1b2a4 /usr.bin/top | |
parent | 73c340e2e01a313d166cab93907156dac5bb4463 (diff) | |
download | FreeBSD-src-399f89a3ce97d7f6e1132b3be50338558b1614f8.zip FreeBSD-src-399f89a3ce97d7f6e1132b3be50338558b1614f8.tar.gz |
MFC r309676
Export the whole thread name in kinfo_proc
kinfo_proc::ki_tdname is three characters shorter than
thread::td_name. Add a ki_moretdname field for these three
extra characters. Add the new field to kinfo_proc32, as well.
Update all in-tree consumers to read the new field and assemble
the full name, except for lldb's HostThreadFreeBSD.cpp, which
I will handle separately. Bump __FreeBSD_version.
Sponsored by: Dell EMC
Diffstat (limited to 'usr.bin/top')
-rw-r--r-- | usr.bin/top/machine.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index cf4714c..6978060 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -889,8 +889,8 @@ format_next_process(caddr_t handle, char *(*get_userid)(int), int flags) if (!(flags & FMT_SHOWARGS)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) { - snprintf(cmdbuf, cmdlen, "%s{%s}", pp->ki_comm, - pp->ki_tdname); + snprintf(cmdbuf, cmdlen, "%s{%s%s}", pp->ki_comm, + pp->ki_tdname, pp->ki_moretdname); } else { snprintf(cmdbuf, cmdlen, "%s", pp->ki_comm); } @@ -902,7 +902,8 @@ format_next_process(caddr_t handle, char *(*get_userid)(int), int flags) if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) { snprintf(cmdbuf, cmdlen, - "[%s{%s}]", pp->ki_comm, pp->ki_tdname); + "[%s{%s%s}]", pp->ki_comm, pp->ki_tdname, + pp->ki_moretdname); } else { snprintf(cmdbuf, cmdlen, "[%s]", pp->ki_comm); @@ -950,8 +951,9 @@ format_next_process(caddr_t handle, char *(*get_userid)(int), int flags) if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) snprintf(cmdbuf, cmdlen, - "%s (%s){%s}", argbuf, pp->ki_comm, - pp->ki_tdname); + "%s (%s){%s%s}", argbuf, + pp->ki_comm, pp->ki_tdname, + pp->ki_moretdname); else snprintf(cmdbuf, cmdlen, "%s (%s)", argbuf, pp->ki_comm); @@ -959,7 +961,8 @@ format_next_process(caddr_t handle, char *(*get_userid)(int), int flags) if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) snprintf(cmdbuf, cmdlen, - "%s{%s}", argbuf, pp->ki_tdname); + "%s{%s%s}", argbuf, pp->ki_tdname, + pp->ki_moretdname); else strlcpy(cmdbuf, argbuf, cmdlen); } |