summaryrefslogtreecommitdiffstats
path: root/usr.bin/procstat/procstat_cs.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_cs.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_cs.c')
-rw-r--r--usr.bin/procstat/procstat_cs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/procstat/procstat_cs.c b/usr.bin/procstat/procstat_cs.c
index 8ccf1ea..4af29ca 100644
--- a/usr.bin/procstat/procstat_cs.c
+++ b/usr.bin/procstat/procstat_cs.c
@@ -50,7 +50,7 @@ procstat_cs(struct procstat *procstat, struct kinfo_proc *kipp)
int once, twice, lastcpu, cpu;
if (!hflag)
- printf("%5s %6s %-16s %-16s %2s %4s %-7s\n", "PID",
+ printf("%5s %6s %-19s %-19s %2s %4s %-7s\n", "PID",
"TID", "COMM", "TDNAME", "CPU", "CSID", "CPU MASK");
kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD,
@@ -62,11 +62,9 @@ procstat_cs(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)
OpenPOWER on IntegriCloud