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/procstat/procstat_threads.c | |
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/procstat/procstat_threads.c')
-rw-r--r-- | usr.bin/procstat/procstat_threads.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/procstat/procstat_threads.c b/usr.bin/procstat/procstat_threads.c index 6bd88da..f81ec74 100644 --- a/usr.bin/procstat/procstat_threads.c +++ b/usr.bin/procstat/procstat_threads.c @@ -47,7 +47,7 @@ procstat_threads(struct procstat *procstat, struct kinfo_proc *kipp) const char *str; if (!hflag) - printf("%5s %6s %-16s %-16s %2s %4s %-7s %-9s\n", "PID", + printf("%5s %6s %-19s %-19s %2s %4s %-7s %-9s\n", "PID", "TID", "COMM", "TDNAME", "CPU", "PRI", "STATE", "WCHAN"); kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD, @@ -59,11 +59,9 @@ procstat_threads(struct procstat *procstat, struct kinfo_proc *kipp) kipp = &kip[i]; printf("%5d ", kipp->ki_pid); printf("%6d ", kipp->ki_tid); - printf("%-16s ", strlen(kipp->ki_comm) ? + printf("%-19s ", strlen(kipp->ki_comm) ? kipp->ki_comm : "-"); - printf("%-16s ", (strlen(kipp->ki_tdname) && - (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ? - kipp->ki_tdname : "-"); + printf("%-19s ", kinfo_proc_thread_name(kipp)); if (kipp->ki_oncpu != 255) printf("%3d ", kipp->ki_oncpu); else if (kipp->ki_lastcpu != 255) |