Commit Graph

38 Commits

Author SHA1 Message Date
Ed Schouten
902d9eafbf Rework all non-contributed files that use `struct timezone'.
This structure is not part of POSIX. According to POSIX, gettimeofday()
has the following prototype:

	int gettimeofday(struct timeval *restrict tp, void *restrict tzp);

Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is
not used). Remove dead error handling code. Also use NULL for a
nul-pointer instead of integer 0.

While there, change all pieces of code that only use tv_sec to use
time(3), as this provides less overhead.
2012-09-01 14:45:15 +00:00
Ruslan Ermilov
c59ee18a21 Fixed static linkage. 2010-02-26 09:41:16 +00:00
Ed Schouten
1100c00131 Make WARNS=6 the default for libexec/.
Just like bin/ and sbin/, I think setting WARNS to the highest value
possible will make it more attractive for people to fix warnings.

- The WARNS variable is set in the Makefile in the directory of the
  application itself, making it more likely that it will be removed out
  of curiosity to see what happens.
- New applications will most likely build with WARNS=6 out of the box,
  because the author would more likely fix the warnings during
  development than lower WARNS.

Unfortunately almost all apps in libexec require a lowered value of
WARNS.
2010-01-02 09:50:19 +00:00
John Baldwin
87f2ff4f3e Use sysctl to fetch stats from the kernel instead of reading variables
directly via libkvm.

PR:		kern/122875, bin/123014
Tested by:	Danny Braniss  danny cs.huji.ac.il
MFC after:	1 week
2008-06-10 18:47:43 +00:00
Stefan Farfeleder
78e3eed071 Fix most cases where the address of an int is passed to a function expecting a
socklen_t * argument.
2005-02-14 17:42:58 +00:00
Ruslan Ermilov
80c49332e2 Put libdevstat before libkvm, because the former depends on the latter. 2004-02-04 10:20:43 +00:00
David E. O'Brien
bd273f0c0b Add the variable's type to the declaration. 2003-06-02 02:34:36 +00:00
Poul-Henning Kamp
7194d335cf Run a revision of the devstat interface:
Kernel:

Change statistics to use the *uptime() timescale (ie: relative to
boottime) rather than the UTC aligned timescale.  This makes the
device statistics code oblivious to clock steps.

Change timestamps to bintime format, they are cheaper.

Remove the "busy_count", and replace it with two counter fields:
"start_count" and "end_count", which are updated in the down and
up paths respectively.  This removes the locking constraint on
devstat.

Add a timestamp argument to devstat_start_transaction(), this will
normally be a timestamp set by the *_bio() function in bp->bio_t0.
Use this field to calculate duration of I/O operations.

Add two timestamp arguments to devstat_end_transaction(), one is
the current time, a NULL pointer means "take timestamp yourself",
the other is the timestamp of when this transaction started (see
above).

Change calculation of busy_time to operate on "the salami principle":
Only when we are idle, which we can determine by the start+end
counts being identical, do we update the "busy_from" field in the
down path.  In the up path we accumulate the timeslice in busy_time
and update busy_from.

Change the byte_* and num_* fields into two arrays: bytes[] and
operations[].

Userland:

Change the misleading "busy_time" name to be called "snap_time" and
make the time long double since that is what most users need anyway,
fill it using clock_gettime(CLOCK_MONOTONIC) to put it on the same
timescale as the kernel fields.

Change devstat_compute_etime() to operate on struct bintime.

Remove the version 2 legacy interface: the change to bintime makes
compatibility far too expensive.

Fix a bug in systat's "vm" page where boot relative busy times would
be bogus.

Bump __FreeBSD_version to 500107

Review & Collaboration by:	ken
2003-03-15 21:59:06 +00:00
Poul-Henning Kamp
a57042df90 Update to current devstat API. 2003-03-15 21:04:50 +00:00
Poul-Henning Kamp
fd3a502df2 Add #include <sys/resource.h> 2003-02-16 15:21:26 +00:00
Poul-Henning Kamp
1b16b28926 Remove <sys/dkstat.h> #include 2003-02-16 14:09:16 +00:00
Mike Barcroft
821aa3b401 Rename local function havedisk() to haveadisk() to avoid conflict a
with another function by the same name in a system header.
2002-10-02 18:29:50 +00:00
Bruce Evans
7309e024bf Include <nlist.h> for nlist interfaces instead of depending on namespace
pollution in <kvm.h>.
2002-08-18 17:57:08 +00:00
Alfred Perlstein
af37179b5f Port to TI/RPC and/or IPV6.
Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr>
2002-07-15 18:51:57 +00:00
Philippe Charnier
3f162cb85d The .Nm utility 2002-07-06 19:19:48 +00:00
Dag-Erling Smørgrav
f249dbcc71 Spell void * as void * rather than caddr_t. This is complicated by the
fact that caddr_t is often misspelled as char *.

Sponsored by:	DARPA, NAI Labs
2002-04-28 15:18:50 +00:00
Warner Losh
a174e5b13a o __P removal
o use new style prototypes and function definitions
o signal handlers need an argument.  Mark it unused.
2002-02-07 05:24:53 +00:00
Bill Fenner
b9d45cebf4 The interface index space may be sparsely populated (e.g. when an
interface in the middle is if_detach()'d).  Return (and handle)
 ENOENT when the ifmib(4) is accessed for a nonexistent interface.

MFC after: 14 days
2001-10-17 04:12:29 +00:00
Jonathan Chen
685233abc5 Fixes file descriptor leak in standalone mode.
Prevents simultaneous calls to updatestat() as function is not reentrant.

PR:		bin/24857
Submitted by:	Martin Butkus <mb@bagheera.thgwf.de>
MFC after:	1 month
2001-08-03 00:23:37 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Ruslan Ermilov
0efe23d669 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 10:49:54 +00:00
Ruslan Ermilov
e5b5c66bca - Backout botched attempt to intoduce MANSECT feature.
- MAN[1-9] -> MAN.
2001-03-26 14:22:12 +00:00
Ruslan Ermilov
020ee2dc9f Set the default manual section for libexec/ to 8. 2001-03-20 18:10:13 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Kenneth D. Merry
b994e5358d Fix a memory leak in rpc.rstatd that shows up when it's run in standalone
mode.  (i.e., not from inetd)

PR:		bin/8212
1998-10-08 19:59:40 +00:00
Doug Rabson
8223b746c9 Work around an alpha compiler bug.
Reviewed by: Kenneth D. Merry <ken@plutotech.com>
1998-09-16 21:33:14 +00:00
Justin T. Gibbs
b2dfb1f906 Update system to new device statistics code.
Submitted by:	"Kenneth D. Merry" <ken@plutotech.com>
		mike@smith.net.au (Mike Smith)
1998-09-15 08:15:30 +00:00
Bill Paul
e4a0e42ba8 Make these programs compile and work correctly now that /usr/include/rpcsvc
has been ANSI-fied.

Pointed out by: bde
1998-01-19 23:13:38 +00:00
Philippe Charnier
859c540701 Remove unused #include. Display if inetd started us in case of failure. 1998-01-07 07:51:00 +00:00
Philippe Charnier
754c3c574d Remove \n at end of syslog string. -Wall cleaning. Cosmetics in man page. 1997-11-26 07:34:56 +00:00
Peter Wemm
9e522f7a18 Revert $FreeBSD$ to $Id$ 1997-02-22 14:22:49 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Garrett Wollman
702a1d0148 Update to match changes in <net/if.h>. 1997-01-03 20:19:50 +00:00
Garrett Wollman
e831f30876 Convert this program to use sysctl rather than kvm for some of its
statistics.  Unfortunately, the coverage of sysctl isn't good enough to do
all of them :-( .
1996-12-11 19:11:52 +00:00
Rodney W. Grimes
6c06b4e2aa Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
Andreas Schulz
dc2e984f57 Reviewed by: Roger Holst roger@first.gmd.de
Add an initialization of the len parameter for the getsockname call.
Now rpc.rstatd can run under inetd.
1994-11-18 22:31:05 +00:00
David Greenman
3e54d2c866 Updated to changes in struct vmmeter. There is a slight bogosity here:
"pageins/outs" now refers to vnode paging.
1994-10-15 13:39:54 +00:00
Geoff Rehmet
0c0b205ceb rstatd -- from FreeBSD-1.1.5.1, with changes for 4.4-Lite kvm interface.
Original rstatd by John Brezak
Submitted by:	Geoff.
1994-08-28 14:49:04 +00:00