summaryrefslogtreecommitdiffstats
path: root/usr.bin/procstat/procstat_kstack.c
diff options
context:
space:
mode:
authorvangyzen <vangyzen@FreeBSD.org>2016-12-15 16:52:17 +0000
committervangyzen <vangyzen@FreeBSD.org>2016-12-15 16:52:17 +0000
commit399f89a3ce97d7f6e1132b3be50338558b1614f8 (patch)
tree81721e570f87d5d3b950a30f2b523fbd38b1b2a4 /usr.bin/procstat/procstat_kstack.c
parent73c340e2e01a313d166cab93907156dac5bb4463 (diff)
downloadFreeBSD-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_kstack.c')
-rw-r--r--usr.bin/procstat/procstat_kstack.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/procstat/procstat_kstack.c b/usr.bin/procstat/procstat_kstack.c
index 8ffa4f9..10cb5cf 100644
--- a/usr.bin/procstat/procstat_kstack.c
+++ b/usr.bin/procstat/procstat_kstack.c
@@ -134,7 +134,7 @@ procstat_kstack(struct procstat *procstat, struct kinfo_proc *kipp, int kflag)
unsigned int kip_count, kstk_count;
if (!hflag)
- printf("%5s %6s %-16s %-16s %-29s\n", "PID", "TID", "COMM",
+ printf("%5s %6s %-19s %-19s %-29s\n", "PID", "TID", "COMM",
"TDNAME", "KSTACK");
kkstp = kkstp_free = procstat_getkstack(procstat, kipp, &kstk_count);
@@ -171,10 +171,8 @@ procstat_kstack(struct procstat *procstat, struct kinfo_proc *kipp, int kflag)
printf("%5d ", kipp->ki_pid);
printf("%6d ", kkstp->kkst_tid);
- printf("%-16s ", kipp->ki_comm);
- printf("%-16s ", (strlen(kipp->ki_tdname) &&
- (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ?
- kipp->ki_tdname : "-");
+ printf("%-19s ", kipp->ki_comm);
+ printf("%-19s ", kinfo_proc_thread_name(kipp));
switch (kkstp->kkst_state) {
case KKST_STATE_RUNNING:
OpenPOWER on IntegriCloud