diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2017-10-23 18:25:21 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2017-10-23 18:25:21 +0000 |
commit | 4b13cb33c40720888fe967367bf009ca6cf272fd (patch) | |
tree | 4491d3f5e0ad545aca21ef8c4ab7b103f46b625f /usr.bin/procstat/procstat.c | |
parent | b916159a6fa3858710d1a0f75cb5a26825ccc698 (diff) | |
download | FreeBSD-src-4b13cb33c40720888fe967367bf009ca6cf272fd.zip FreeBSD-src-4b13cb33c40720888fe967367bf009ca6cf272fd.tar.gz |
MFC r316286:
Add support for capturing 'struct ptrace_lwpinfo' for signals resulting in a
process dumping core in the corefile.
Direct stable changed: Padding added to struct thread and td_si added to end
with explicit bzeroing when forking/initializing a thread to preserve KBI.
Diffstat (limited to 'usr.bin/procstat/procstat.c')
-rw-r--r-- | usr.bin/procstat/procstat.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/procstat/procstat.c b/usr.bin/procstat/procstat.c index 627ca8b..eca2790 100644 --- a/usr.bin/procstat/procstat.c +++ b/usr.bin/procstat/procstat.c @@ -1,6 +1,7 @@ /*- * Copyright (c) 2007, 2011 Robert N. M. Watson * Copyright (c) 2015 Allan Jude <allanjude@freebsd.org> + * Copyright (c) 2017 Dell EMC * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +42,8 @@ #include "procstat.h" -static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, lflag, rflag; -static int sflag, tflag, vflag, xflag, Sflag; +static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag; +static int lflag, Lflag, rflag, sflag, tflag, vflag, xflag, Sflag; int hflag, nflag, Cflag, Hflag; static void @@ -85,6 +86,8 @@ procstat(struct procstat *prstat, struct kinfo_proc *kipp) procstat_kstack(prstat, kipp, kflag); else if (lflag) procstat_rlimit(prstat, kipp); + else if (Lflag) + procstat_ptlwpinfo(prstat); else if (rflag) procstat_rusage(prstat, kipp); else if (sflag) @@ -162,7 +165,7 @@ main(int argc, char *argv[]) argc = xo_parse_args(argc, argv); xocontainer = "basic"; - while ((ch = getopt(argc, argv, "abCcefHhijklM:N:nrSstvw:x")) != -1) { + while ((ch = getopt(argc, argv, "abCcefHhijklLM:N:nrSstvw:x")) != -1) { switch (ch) { case 'C': Cflag++; @@ -226,6 +229,11 @@ main(int argc, char *argv[]) xocontainer = "rlimit"; break; + case 'L': + Lflag++; + xocontainer = "ptlwpinfo"; + break; + case 'n': nflag++; break; |