Using -a or specifying pids doesn't seem to work with procstat -L (it just prints out "unknown access method: 2"): $ procstat -L -a 2>&1 | wc -l 224 $ procstat -L -a 2>&1 | sort -u | wc -l 1 $ procstat -L -a 2>&1 | tail -n 1 procstat: unknown access method: 2 $ uname -a FreeBSD wkstn-fbsd-ngie 12.0-CURRENT FreeBSD 12.0-CURRENT #54 r319509+f79507d239c5(isilon-atf): Fri Jun 2 19:48:36 PDT 2017 ngie@wkstn-fbsd-ngie:/usr/obj/usr/src/sys/GENERIC-NODEBUG amd64 $
procstat -L shows information about a process' exit, so it's not expected to work with live processes. We should update the man page and error message to make this clear.
Porting over internal bugzilla comments for context and taking the bug: [reply] [-] Comment 2 Ngie "Hakuna Matata" Cooper 2017-06-26 18:31:03 PDT I'll just fix the documentation since it doesn't state that it should or shouldn't do that, which is a bug. [reply] [-] Comment 3 Conrad Meyer 2017-06-26 18:38:45 PDT I mean, it does say that already: -L Display LWP info for the process pertaining to its signal driven exit. ^^^^ ^^^^^^^^^^^^^ [reply] [-] Comment 4 Ngie "Hakuna Matata" Cooper 2017-06-26 18:51:08 PDT (In reply to comment #3) > I mean, it does say that already: > > -L Display LWP info for the process pertaining to its signal driven > exit. > ^^^^ ^^^^^^^^^^^^^ It's implied, but in a bit of a roundabout way as you noted. Also, the synopsis suggests that it should be able to take either a pid or a corefile. From https://www.freebsd.org/cgi/man.cgi?query=procstat&apropos=0&sektion=0&manpath=FreeBSD+12-current&arch=default&format=html : ... procstat [--libxo] [-CHhn] [-w interval] [-b | -c | -e | -f | -i | -j | -k | -l | -L | -r | -s | -S | -t | -v | -x] [-a | pid | core ...] ... Furthermore, if it's only meant to work with a corefile, the error message I reported in the upstream bug could be clarified by returning the error from kvm_open2, or something similar to that. With mjohnston clarifying the use upstream and after reviewing things a bit more, this is a Trivial item and not a Normal item. What triggered this bug was the fact that I was trying to write tests/manually test out the functionality, and because the documentation wasn't 100% clear, I filed this bug and committed a few changes upstream to try and help clarify the feature as best I could. This was one of the areas that wasn't clear to me that I figured warranted more discussion.
A commit references this bug: Author: ngie Date: Tue Jun 27 08:18:08 UTC 2017 New revision: 320399 URL: https://svnweb.freebsd.org/changeset/base/320399 Log: procstat_getptlwpinfo(..): clarify the fact that KVM/SYSCTL support isn't supported This will make the error message reported in bug 220023 a bit more intuitive for end-users that don't have access to the source code to decode the procstat->type argument. MFC after: 1 month MFC with: r316286 PR: 220023 Changes: head/lib/libprocstat/libprocstat.c
------------------------------------------------------------------------ r321283 | ngie | 2017-07-19 22:43:48 -0700 (Wed, 19 Jul 2017) | 7 lines procstat(8): clarify program usage - Visualize mutually exclusive options and their corresponding arguments. - Try to make the subtleties that are expressed in the code, and potentially in the manpages, more apparent.
I think bdrewery backported the changes. If not, please let me know.
Bryan, does this still require MFC or the PR can be closed? Thank