head	1.9;
access;
symbols
	RELENG_8_4:1.9.0.2
	RELENG_9_1_0_RELEASE:1.5.2.3.2.2
	RELENG_9_1:1.5.2.3.0.2
	RELENG_9_1_BP:1.5.2.3
	RELENG_8_3_0_RELEASE:1.2.2.2.6.1
	RELENG_8_3:1.2.2.2.0.6
	RELENG_8_3_BP:1.2.2.2
	RELENG_9_0_0_RELEASE:1.5.2.1.2.1
	RELENG_9_0:1.5.2.1.0.2
	RELENG_9_0_BP:1.5.2.1
	RELENG_9:1.5.0.2
	RELENG_9_BP:1.5
	RELENG_7_4_0_RELEASE:1.1.2.2.6.1
	RELENG_8_2_0_RELEASE:1.2.2.2.4.1
	RELENG_7_4:1.1.2.2.0.6
	RELENG_7_4_BP:1.1.2.2
	RELENG_8_2:1.2.2.2.0.4
	RELENG_8_2_BP:1.2.2.2
	RELENG_8_1_0_RELEASE:1.2.2.2.2.1
	RELENG_8_1:1.2.2.2.0.2
	RELENG_8_1_BP:1.2.2.2
	RELENG_7_3_0_RELEASE:1.1.2.2.4.1
	RELENG_7_3:1.1.2.2.0.4
	RELENG_7_3_BP:1.1.2.2
	RELENG_8_0_0_RELEASE:1.2.2.1.2.1
	RELENG_8_0:1.2.2.1.0.2
	RELENG_8_0_BP:1.2.2.1
	RELENG_8:1.2.0.2
	RELENG_8_BP:1.2
	RELENG_7_2_0_RELEASE:1.1.2.2.2.1
	RELENG_7_2:1.1.2.2.0.2
	RELENG_7_2_BP:1.1.2.2
	RELENG_7_1_0_RELEASE:1.1.2.1.2.2
	RELENG_7_1:1.1.2.1.0.2
	RELENG_7_1_BP:1.1.2.1
	RELENG_7:1.1.0.2;
locks; strict;
comment	@# @;


1.9
date	2012.11.17.01.54.28;	author svnexp;	state Exp;
branches
	1.9.2.1;
next	1.8;

1.8
date	2012.05.19.05.07.03;	author marcel;	state Exp;
branches;
next	1.7;

1.7
date	2011.11.24.20.54.06;	author trociny;	state Exp;
branches;
next	1.6;

1.6
date	2011.11.22.20.59.52;	author trociny;	state Exp;
branches;
next	1.5;

1.5
date	2011.05.12.10.11.39;	author stas;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	2010.03.08.20.44.22;	author kib;	state Exp;
branches;
next	1.3;

1.3
date	2010.01.02.10.27.05;	author ed;	state Exp;
branches;
next	1.2;

1.2
date	2008.12.02.06.50.26;	author peter;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2007.12.02.23.31.45;	author rwatson;	state Exp;
branches
	1.1.2.1;
next	;

1.9.2.1
date	2012.11.17.01.54.28;	author svnexp;	state dead;
branches;
next	1.9.2.2;

1.9.2.2
date	2013.03.28.13.06.08;	author svnexp;	state Exp;
branches;
next	;

1.5.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.5.2.1.2.1;
next	1.5.2.2;

1.5.2.2
date	2012.02.02.18.17.49;	author trociny;	state Exp;
branches;
next	1.5.2.3;

1.5.2.3
date	2012.02.02.18.22.25;	author trociny;	state Exp;
branches
	1.5.2.3.2.1;
next	1.5.2.4;

1.5.2.4
date	2012.11.17.11.37.40;	author svnexp;	state Exp;
branches;
next	;

1.5.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.5.2.1.2.2;

1.5.2.1.2.2
date	2012.11.17.08.37.36;	author svnexp;	state Exp;
branches;
next	;

1.5.2.3.2.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.5.2.3.2.2;

1.5.2.3.2.2
date	2012.11.17.08.48.28;	author svnexp;	state Exp;
branches;
next	;

1.2.2.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.2.2.1.2.1;
next	1.2.2.2;

1.2.2.2
date	2010.03.22.09.29.56;	author kib;	state Exp;
branches
	1.2.2.2.2.1
	1.2.2.2.4.1
	1.2.2.2.6.1;
next	1.2.2.3;

1.2.2.3
date	2012.11.17.10.37.18;	author svnexp;	state Exp;
branches;
next	;

1.2.2.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.2.2.2.2.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.2.2.2.4.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.2.2.2.6.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.2.2.2.6.2;

1.2.2.2.6.2
date	2012.11.17.08.25.51;	author svnexp;	state Exp;
branches;
next	;

1.1.2.1
date	2008.04.10.22.49.39;	author rwatson;	state Exp;
branches
	1.1.2.1.2.1;
next	1.1.2.2;

1.1.2.2
date	2008.12.06.19.54.50;	author peter;	state Exp;
branches
	1.1.2.2.2.1
	1.1.2.2.4.1
	1.1.2.2.6.1;
next	1.1.2.3;

1.1.2.3
date	2012.11.17.08.08.39;	author svnexp;	state Exp;
branches;
next	;

1.1.2.1.2.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	1.1.2.1.2.2;

1.1.2.1.2.2
date	2008.12.06.20.36.46;	author peter;	state Exp;
branches;
next	;

1.1.2.2.2.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.1.2.2.4.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.1.2.2.6.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.1.2.2.6.2;

1.1.2.2.6.2
date	2012.11.17.08.17.43;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.9
log
@Switching exporter and resync
@
text
@# $FreeBSD: head/usr.bin/procstat/Makefile 235642 2012-05-19 05:07:03Z marcel $

PROG=	procstat
MAN=	procstat.1
SRCS=	procstat.c		\
	procstat_args.c		\
	procstat_auxv.c		\
	procstat_basic.c	\
	procstat_bin.c		\
	procstat_cred.c		\
	procstat_files.c	\
	procstat_kstack.c	\
	procstat_rlimit.c	\
	procstat_sigs.c		\
	procstat_threads.c	\
	procstat_vm.c

LDADD+=	-lutil -lprocstat -lkvm
DPADD+=	${LIBUTIL} ${LIBPROCSTAT} ${LIBKVM}

.include <bsd.prog.mk>
@


1.9.2.1
log
@file Makefile was added on branch RELENG_8_4 on 2013-03-28 13:06:08 +0000
@
text
@d1 21
@


1.9.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 20
# $FreeBSD: releng/8.4/usr.bin/procstat/Makefile 205438 2010-03-22 09:29:56Z kib $

PROG=	procstat
MAN=	procstat.1
SRCS=	procstat.c		\
	procstat_args.c		\
	procstat_basic.c	\
	procstat_bin.c		\
	procstat_cred.c		\
	procstat_files.c	\
	procstat_kstack.c	\
	procstat_sigs.c		\
	procstat_threads.c	\
	procstat_vm.c

LDADD+=	-lutil
DPADD+=	${LIBUTIL}
WARNS?=	4

.include <bsd.prog.mk>
@


1.8
log
@SVN rev 235642 on 2012-05-19 05:07:03Z by marcel

Bring DPADD in sync with LDADD.
@
text
@d1 1
a1 1
# $FreeBSD$
@


1.7
log
@SVN rev 227956 on 2011-11-24 20:54:06Z by trociny

usr.bin/procstat

Add -l flag to display resource limits.

PR:		bin/161257
Reviewed by:	kib
MFC after:	2 weeks
@
text
@d19 1
a19 1
DPADD+=	${LIBUTIL}
@


1.6
log
@SVN rev 227838 on 2011-11-22 20:59:52Z by trociny

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

MFC after:	2 weeks
@
text
@d13 1
@


1.5
log
@SVN rev 221807 on 2011-05-12 10:11:39Z by stas

- Commit work from libprocstat project.  These patches add support for runtime
  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
@
text
@d7 1
@


1.5.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.5.2.2
log
@SVN rev 230917 on 2012-02-02 18:17:49Z by trociny

MFC r227838, r227873, r228025, r228049, r228289, r228447, r230753:

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.
@
text
@a6 1
	procstat_auxv.c		\
@


1.5.2.3
log
@SVN rev 230918 on 2012-02-02 18:22:25Z by trociny

MFC r227956, r228090, r228446, r230471, r230548:

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 <andrey at zonov.org>
@
text
@a12 1
	procstat_rlimit.c	\
@


1.5.2.4
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/usr.bin/procstat/Makefile 230918 2012-02-02 18:22:25Z trociny $
@


1.5.2.3.2.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.5.2.3.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.1/usr.bin/procstat/Makefile 230918 2012-02-02 18:22:25Z trociny $
@


1.5.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.5.2.1.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.0/usr.bin/procstat/Makefile 221807 2011-05-12 10:11:39Z stas $
@


1.4
log
@SVN rev 204879 on 2010-03-08 20:44:22Z by kib

Teach procstat(1) to display some information about signal disposition
and pending/blocked status for signals.

Reviewed by:	rwatson
MFC after:	2 weeks
@
text
@d16 1
a16 1
LDADD+=	-lutil
@


1.3
log
@SVN rev 201386 on 2010-01-02 10:27:05Z by ed

Build usr.bin/ with WARNS=6 by default.

Also add some missing $FreeBSD$ to keep svn happy.
@
text
@d12 1
@


1.2
log
@SVN rev 185548 on 2008-12-02 06:50:26Z by peter

Merge user/peter/kinfo branch as of r185547 into head.

This changes struct kinfo_filedesc and kinfo_vmentry such that they are
same on both 32 and 64 bit platforms like i386/amd64 and won't require
sysctl wrapping.

Two new OIDs are assigned.  The old ones are available under
COMPAT_FREEBSD7 - but it isn't that simple.  The superceded interface
was never actually released on 7.x.

The other main change is to pack the data passed to userland via the
sysctl.  kf_structsize and kve_structsize are reduced for the copyout.
If you have a process with 100,000+ sockets open, the unpacked records
require a 132MB+ copyout.  With packing, it is "only" ~35MB.  (Still
seriously unpleasant, but not quite as devastating).  A similar problem
exists for the vmentry structure - have lots and lots of shared libraries
and small mmaps and its copyout gets expensive too.

My immediate problem is valgrind.  It traditionally achieves this
functionality by parsing procfs output, in a packed format.  Secondly, when
tracing 32 bit binaries on amd64 under valgrind, it uses a cross compiled
32 bit binary which ran directly into the differing data structures in 32
vs 64 bit mode.  (valgrind uses this to track file descriptor operations
and this therefore affected every single 32 bit binary)

I've added two utility functions to libutil to unpack the structures into
a fixed record length and to make it a little more convenient to use.
@
text
@a16 1
WARNS?=	4
@


1.2.2.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.2.2.2
log
@SVN rev 205438 on 2010-03-22 09:29:56Z by kib

MFC r204879:
Teach procstat(1) to display some information about signal disposition
and pending/blocked status for signals.

MFC r204880:
Add file forgotten in r204879.
@
text
@a11 1
	procstat_sigs.c		\
@


1.2.2.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/8/usr.bin/procstat/Makefile 205438 2010-03-22 09:29:56Z kib $
@


1.2.2.2.6.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.2.2.2.6.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/8.3/usr.bin/procstat/Makefile 205438 2010-03-22 09:29:56Z kib $
@


1.2.2.2.4.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.2.2.2.2.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.2.2.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.1
log
@Add procstat(1), a process inspection utility.  This provides both some
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 <skip at menantico dot com>
			Wesley Shields <wxs at atarininja dot org>
@
text
@d15 4
@


1.1.2.1
log
@Merge Makefile:1.1, procstat.1:1.1, procstat.c:1.1, procstat.h:1.1,
procstat_args.c:1.1, procstat_basic.c:1.1, procstat_bin.c:1.1,
procstat_cred.c:1.1, procstat_files.c:1.1, procstat_kstack.c:1.1,
procstat_threads.c:1.1, and procstat_vm.c:1.1 from HEAD to RELENG_7:

  Add procstat(1), a process inspection utility.  This provides both some
  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 <skip at menantico dot com>
                          Wesley Shields <wxs at atarininja dot org>
@
text
@@


1.1.2.2
log
@SVN rev 185716 on 2008-12-06 19:54:50Z by peter

MFC: 185548 and followups.
Add new KERN_PROC_* handlers with 32/64 bit stable interfaces.  Pack
records from sysctl to reduce copyout size.  Add helper to unpack and
provide a more stable interface.

Approved by:	re (kensmith)
@
text
@a14 3
LDADD+=	-lutil
DPADD+=	${LIBUTIL}

@


1.1.2.3
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/7/usr.bin/procstat/Makefile 185716 2008-12-06 19:54:50Z peter $
@


1.1.2.2.6.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.1.2.2.6.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/7.4/usr.bin/procstat/Makefile 185716 2008-12-06 19:54:50Z peter $
@


1.1.2.2.4.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.1.2.2.2.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.1.2.1.2.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.1.2.1.2.2
log
@SVN rev 185717 on 2008-12-06 20:36:46Z by peter

MF7: 185716 (head 185548 + followups).  KERN_PROC_* kinfo updates.

Approved by:	re (kensmith)
@
text
@a14 3
LDADD+=	-lutil
DPADD+=	${LIBUTIL}

@


