<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/procstat/procstat.c, branch releng/9.2</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>MFC r249668, r249669, r249671, r249673, r249675, r249678, r249680, r249683,</title>
<updated>2013-05-21T19:05:27+00:00</updated>
<author>
<name>Mikolaj Golub</name>
<email>trociny@FreeBSD.org</email>
</author>
<published>2013-05-21T19:05:27+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=620d459aa9bd8d181bb58ea52af11ff8e284b432'/>
<id>620d459aa9bd8d181bb58ea52af11ff8e284b432</id>
<content type='text'>
    r249685, r249686:

r249668:

Use procstat_getprocs(3) for retrieving thread information instead of
direct sysctl calls.

r249669:

Use more generic procstat_getvmmap(3) for retrieving VM layout of a process.

r249671:

Use procstat_getgroups(3) for retrieving groups information instead of
direct sysctl.

r249673:

Use procstat_getumask(3) for retrieving umaks information instead of
direct sysctl.

r249675:

Use procstat_getrlimit(3) for retrieving rlimit information instead of
direct sysctl calls.

r249678:

Use libprocstat(3) when retrieving binary information for a process.

r249680:

Use libprocstat(3) to retrieve process command line arguments and
environment variables.

r249683:

Use libprocstat(3) to retrieve ELF auxiliary vector.

r249685:

Use procstat_getkstack(3) for retrieving process kernel stacks
instead of direct sysctl calls.

r249686:

Make use of newly added libprocstat(3) ability to extract procstat
info from a process core file.

So now one can run procstat(1) on a process core e.g. to get a list of
files opened by a process when it crashed:

root@lisa:/ # procstat -f /root/vi.core
  PID COMM               FD T V FLAGS     REF  OFFSET PRO NAME
  658 vi               text v r r--------   -       - -   /usr/bin/vi
  658 vi               ctty v c rw-------   -       - -   /dev/pts/0
  658 vi                cwd v d r--------   -       - -   /root
  658 vi               root v d r--------   -       - -   /
  658 vi                  0 v c rw-------  11    3208 -   /dev/pts/0
  658 vi                  1 v c rw-------  11    3208 -   /dev/pts/0
  658 vi                  2 v c rw-------  11    3208 -   /dev/pts/0
  658 vi                  3 v r r----n-l-   1       0 -   /tmp/vi.0AYKz3Lps7
  658 vi                  4 v r rw-------   1       0 -   /var/tmp/vi.recover/vi.GaGYsz
  658 vi                  5 v r rw-------   1       0 -   -

PR:		kern/173723
Suggested by:	jhb
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    r249685, r249686:

r249668:

Use procstat_getprocs(3) for retrieving thread information instead of
direct sysctl calls.

r249669:

Use more generic procstat_getvmmap(3) for retrieving VM layout of a process.

r249671:

Use procstat_getgroups(3) for retrieving groups information instead of
direct sysctl.

r249673:

Use procstat_getumask(3) for retrieving umaks information instead of
direct sysctl.

r249675:

Use procstat_getrlimit(3) for retrieving rlimit information instead of
direct sysctl calls.

r249678:

Use libprocstat(3) when retrieving binary information for a process.

r249680:

Use libprocstat(3) to retrieve process command line arguments and
environment variables.

r249683:

Use libprocstat(3) to retrieve ELF auxiliary vector.

r249685:

Use procstat_getkstack(3) for retrieving process kernel stacks
instead of direct sysctl calls.

r249686:

Make use of newly added libprocstat(3) ability to extract procstat
info from a process core file.

So now one can run procstat(1) on a process core e.g. to get a list of
files opened by a process when it crashed:

root@lisa:/ # procstat -f /root/vi.core
  PID COMM               FD T V FLAGS     REF  OFFSET PRO NAME
  658 vi               text v r r--------   -       - -   /usr/bin/vi
  658 vi               ctty v c rw-------   -       - -   /dev/pts/0
  658 vi                cwd v d r--------   -       - -   /root
  658 vi               root v d r--------   -       - -   /
  658 vi                  0 v c rw-------  11    3208 -   /dev/pts/0
  658 vi                  1 v c rw-------  11    3208 -   /dev/pts/0
  658 vi                  2 v c rw-------  11    3208 -   /dev/pts/0
  658 vi                  3 v r r----n-l-   1       0 -   /tmp/vi.0AYKz3Lps7
  658 vi                  4 v r rw-------   1       0 -   /var/tmp/vi.recover/vi.GaGYsz
  658 vi                  5 v r rw-------   1       0 -   -

PR:		kern/173723
Suggested by:	jhb
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r245345:</title>
<updated>2013-01-17T02:42:08+00:00</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2013-01-17T02:42:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f56e5118df98831dbc0542a59f9ce307da182ff6'/>
<id>f56e5118df98831dbc0542a59f9ce307da182ff6</id>
<content type='text'>
procstat: only one mode flag can be specified, but required check for 'i'
and 'j' modes was missing. Fix that.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
procstat: only one mode flag can be specified, but required check for 'i'
and 'j' modes was missing. Fix that.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r227956, r228090, r228446, r230471, r230548:</title>
<updated>2012-02-02T18:22:25+00:00</updated>
<author>
<name>Mikolaj Golub</name>
<email>trociny@FreeBSD.org</email>
</author>
<published>2012-02-02T18:22:25+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9bb8534ab03df0b008e1765dd930eeb1d3148641'/>
<id>9bb8534ab03df0b008e1765dd930eeb1d3148641</id>
<content type='text'>
r227956:

Add -l flag to display resource limits.

PR:		bin/161257
Reviewed by:	kib

r228090:

Update SYNOPSIS to include the flags added recently.

Spotted by:	jhb

r228446:

Make procstat -l output similar to the output of limits(1).

Suggested by:	jhb

r230471, r230548:

Make procstat -l to work with the new version of kern.proc.rlimit.

Submitted by:	Andrey Zonov &lt;andrey at zonov.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
r227956:

Add -l flag to display resource limits.

PR:		bin/161257
Reviewed by:	kib

r228090:

Update SYNOPSIS to include the flags added recently.

Spotted by:	jhb

r228446:

Make procstat -l output similar to the output of limits(1).

Suggested by:	jhb

r230471, r230548:

Make procstat -l to work with the new version of kern.proc.rlimit.

Submitted by:	Andrey Zonov &lt;andrey at zonov.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r227838, r227873, r228025, r228049, r228289, r228447, r230753:</title>
<updated>2012-02-02T18:17:49+00:00</updated>
<author>
<name>Mikolaj Golub</name>
<email>trociny@FreeBSD.org</email>
</author>
<published>2012-02-02T18:17:49+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a9c17fad1d0a30a8c2a6971c38a325b1c36bd1c6'/>
<id>a9c17fad1d0a30a8c2a6971c38a325b1c36bd1c6</id>
<content type='text'>
r227838, r227873:

Add new options, -e and -x, to display process environment variables
and ELF auxiliary vectors.

r228025, r228049:

Make proctstat -x output more readable.

This also fixes the issue, spotted by mdf, with values that were
printed as decimal and had hex prefixes.

Discussed with:	kib, rwatson

r228289:

Don't output a warning if kern.proc.auxv sysctl has returned EPERM.
After r228288 this is rather a normal situation.

r228447:

Make 64-bit procstat output ELF auxiliary vectors for 32-bit processes.

Reviewed by:	kib

r230753:

Always return 0 if the sysctl failed.

This fixes the bug: when procstat -xa was run and the sysctl for a
process returned ESRCH or EPERM, for this process procstat output the
result collected for the previous successful process.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
r227838, r227873:

Add new options, -e and -x, to display process environment variables
and ELF auxiliary vectors.

r228025, r228049:

Make proctstat -x output more readable.

This also fixes the issue, spotted by mdf, with values that were
printed as decimal and had hex prefixes.

Discussed with:	kib, rwatson

r228289:

Don't output a warning if kern.proc.auxv sysctl has returned EPERM.
After r228288 this is rather a normal situation.

r228447:

Make 64-bit procstat output ELF auxiliary vectors for 32-bit processes.

Reviewed by:	kib

r230753:

Always return 0 if the sysctl failed.

This fixes the bug: when procstat -xa was run and the sysctl for a
process returned ESRCH or EPERM, for this process procstat output the
result collected for the previous successful process.
</pre>
</div>
</content>
</entry>
<entry>
<title>Updates to libprocstat(3) and procstat(1) to allow monitoring Capsicum</title>
<updated>2011-08-14T00:42:09+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2011-08-14T00:42:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d57486e21cc23acfc50574623f70d9a68192c4ec'/>
<id>d57486e21cc23acfc50574623f70d9a68192c4ec</id>
<content type='text'>
capability mode and capabilities.

Right now no attempt is made to unwrap capabilities when operating on
a crashdump, so further refinement is required.

Approved by:	re (bz)
Sponsored by:	Google Inc
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
capability mode and capabilities.

Right now no attempt is made to unwrap capabilities when operating on
a crashdump, so further refinement is required.

Approved by:	re (bz)
Sponsored by:	Google Inc
</pre>
</div>
</content>
</entry>
<entry>
<title>- Commit work from libprocstat project.  These patches add support for runtime</title>
<updated>2011-05-12T10:11:39+00:00</updated>
<author>
<name>Stanislav Sedov</name>
<email>stas@FreeBSD.org</email>
</author>
<published>2011-05-12T10:11:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=0daf62d9f5f7d2c15d00d71eb519b90516df016f'/>
<id>0daf62d9f5f7d2c15d00d71eb519b90516df016f</id>
<content type='text'>
  file and processes information retrieval from the running kernel via sysctl
  in the form of new library, libprocstat.  The library also supports KVM backend
  for analyzing memory crash dumps.  Both procstat(1) and fstat(1) utilities have
  been modified to take advantage of the library (as the bonus point the fstat(1)
  utility no longer need superuser privileges to operate), and the procstat(1)
  utility is now able to display information from memory dumps as well.

  The newly introduced fuser(1) utility also uses this library and able to operate
  via sysctl and kvm backends.

  The library is by no means complete (e.g. KVM backend is missing vnode name
  resolution routines, and there're no manpages for the library itself) so I
  plan to improve it further.  I'm commiting it so it will get wider exposure
  and review.

  We won't be able to MFC this work as it relies on changes in HEAD, which
  was introduced some time ago, that break kernel ABI.  OTOH we may be able
  to merge the library with KVM backend if we really need it there.

Discussed with:	rwatson
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  file and processes information retrieval from the running kernel via sysctl
  in the form of new library, libprocstat.  The library also supports KVM backend
  for analyzing memory crash dumps.  Both procstat(1) and fstat(1) utilities have
  been modified to take advantage of the library (as the bonus point the fstat(1)
  utility no longer need superuser privileges to operate), and the procstat(1)
  utility is now able to display information from memory dumps as well.

  The newly introduced fuser(1) utility also uses this library and able to operate
  via sysctl and kvm backends.

  The library is by no means complete (e.g. KVM backend is missing vnode name
  resolution routines, and there're no manpages for the library itself) so I
  plan to improve it further.  I'm commiting it so it will get wider exposure
  and review.

  We won't be able to MFC this work as it relies on changes in HEAD, which
  was introduced some time ago, that break kernel ABI.  OTOH we may be able
  to merge the library with KVM backend if we really need it there.

Discussed with:	rwatson
</pre>
</div>
</content>
</entry>
<entry>
<title>Teach procstat(1) to display some information about signal disposition</title>
<updated>2010-03-08T20:44:22+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2010-03-08T20:44:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=55f65cd929c2203a8b0bf1f80934314a20d5d83c'/>
<id>55f65cd929c2203a8b0bf1f80934314a20d5d83c</id>
<content type='text'>
and pending/blocked status for signals.

Reviewed by:	rwatson
MFC after:	2 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
and pending/blocked status for signals.

Reviewed by:	rwatson
MFC after:	2 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>Include param.h instead of types.h before user.h so that the nested</title>
<updated>2008-12-29T18:58:22+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2008-12-29T18:58:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e1f323f350084227fe4c2b8eb5e47fcbf2d3c952'/>
<id>e1f323f350084227fe4c2b8eb5e47fcbf2d3c952</id>
<content type='text'>
include of param.h can be removed from audit.h.

MFC after:	3 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
include of param.h can be removed from audit.h.

MFC after:	3 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>WARNS fixes: mainly constness and avoid comparing signed with</title>
<updated>2008-02-08T11:03:05+00:00</updated>
<author>
<name>David Malone</name>
<email>dwmalone@FreeBSD.org</email>
</author>
<published>2008-02-08T11:03:05+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=97ce0ae60fcb9a5ae1d1a82df8fc4dee958faa08'/>
<id>97ce0ae60fcb9a5ae1d1a82df8fc4dee958faa08</id>
<content type='text'>
unsigned by making array indicies unsigned. Also note one or two
unused parameters.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
unsigned by making array indicies unsigned. Also note one or two
unused parameters.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add procstat(1), a process inspection utility.  This provides both some</title>
<updated>2007-12-02T23:31:45+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2007-12-02T23:31:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3d91be41d162cf73689975d6fe8e26b01c1b3cb2'/>
<id>3d91be41d162cf73689975d6fe8e26b01c1b3cb2</id>
<content type='text'>
of the missing functionality from procfs(4) and new functionality for
monitoring and debugging specific processes.  procstat(1) operates in
the following modes:

  -b  Display binary information for the process.
  -c  Display command line arguments for the process.
  -f  Display file descriptor information for the process.
  -k  Display the stacks of kernel threads in the process.
  -s  Display security credential information for the process.
  -t  Display thread information for the process.
  -v  Display virtual memory mappings for the process.

Further revision and modes are expected.

Testing, ideas, etc:	cognet, sam, Skip Ford &lt;skip at menantico dot com&gt;
			Wesley Shields &lt;wxs at atarininja dot org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
of the missing functionality from procfs(4) and new functionality for
monitoring and debugging specific processes.  procstat(1) operates in
the following modes:

  -b  Display binary information for the process.
  -c  Display command line arguments for the process.
  -f  Display file descriptor information for the process.
  -k  Display the stacks of kernel threads in the process.
  -s  Display security credential information for the process.
  -t  Display thread information for the process.
  -v  Display virtual memory mappings for the process.

Further revision and modes are expected.

Testing, ideas, etc:	cognet, sam, Skip Ford &lt;skip at menantico dot com&gt;
			Wesley Shields &lt;wxs at atarininja dot org&gt;
</pre>
</div>
</content>
</entry>
</feed>
