summaryrefslogtreecommitdiffstats
path: root/bin
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 /bin
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 'bin')
-rw-r--r--bin/ps/print.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index bcd451e..a1d5b2b 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -119,11 +119,12 @@ command(KINFO *k, VARENT *ve)
if (cflag) {
/* If it is the last field, then don't pad */
if (STAILQ_NEXT(ve, next_ve) == NULL) {
- asprintf(&str, "%s%s%s%s",
+ asprintf(&str, "%s%s%s%s%s",
k->ki_d.prefix ? k->ki_d.prefix : "",
k->ki_p->ki_comm,
(showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "",
- (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "");
+ (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "",
+ (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_moretdname : "");
} else
str = strdup(k->ki_p->ki_comm);
@@ -171,14 +172,16 @@ ucomm(KINFO *k, VARENT *ve)
char *str;
if (STAILQ_NEXT(ve, next_ve) == NULL) { /* last field, don't pad */
- asprintf(&str, "%s%s%s%s",
+ asprintf(&str, "%s%s%s%s%s",
k->ki_d.prefix ? k->ki_d.prefix : "",
k->ki_p->ki_comm,
(showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "",
- (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "");
+ (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "",
+ (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_moretdname : "");
} else {
if (showthreads && k->ki_p->ki_numthreads > 1)
- asprintf(&str, "%s/%s", k->ki_p->ki_comm, k->ki_p->ki_tdname);
+ asprintf(&str, "%s/%s%s", k->ki_p->ki_comm,
+ k->ki_p->ki_tdname, k->ki_p->ki_moretdname);
else
str = strdup(k->ki_p->ki_comm);
}
@@ -191,7 +194,8 @@ tdnam(KINFO *k, VARENT *ve __unused)
char *str;
if (showthreads && k->ki_p->ki_numthreads > 1)
- str = strdup(k->ki_p->ki_tdname);
+ asprintf(&str, "%s%s", k->ki_p->ki_tdname,
+ k->ki_p->ki_moretdname);
else
str = strdup(" ");
OpenPOWER on IntegriCloud