summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2010-10-08 00:44:53 +0000
committeremaste <emaste@FreeBSD.org>2010-10-08 00:44:53 +0000
commita3f660853385a7931dbd3ec6d30de7fcdc90ab8a (patch)
tree6f6c32190d7d431cca57f1e2d1390390be4fd83a /bin/ps
parentaa3acd013b51f0e16ff13d9bbb843bcf0e3b1032 (diff)
downloadFreeBSD-src-a3f660853385a7931dbd3ec6d30de7fcdc90ab8a.zip
FreeBSD-src-a3f660853385a7931dbd3ec6d30de7fcdc90ab8a.tar.gz
Make a thread's address available via the kern proc sysctl, just like the
process address. Add "tdaddr" keyword to ps(1) to display this thread address. Distilled from Sandvine's patch set by Mark Johnston.
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/keyword.c2
-rw-r--r--bin/ps/ps.12
2 files changed, 4 insertions, 0 deletions
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index 74165ce..561b087 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -187,6 +187,8 @@ static VAR var[] = {
UINT, UIDFMT, 0},
{"svuid", "SVUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svuid),
UINT, UIDFMT, 0},
+ {"tdaddr", "TDADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2,
+ KOFF(ki_tdaddr), KPTR, "lx", 0},
{"tdev", "TDEV", NULL, 0, tdev, NULL, 5, 0, CHAR, NULL, 0},
{"tdnam", "TDNAM", NULL, LJUST, tdnam, NULL, COMMLEN, 0, CHAR, NULL, 0},
{"time", "TIME", NULL, USER, cputime, NULL, 9, 0, CHAR, NULL, 0},
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index ba1cb18..2f52584 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -591,6 +591,8 @@ symbolic process state (alias
saved gid from a setgid executable
.It Cm svuid
saved UID from a setuid executable
+.It Cm tdaddr
+thread address
.It Cm tdev
control terminal device number
.It Cm time
OpenPOWER on IntegriCloud