diff options
| author | David Malone <dwmalone@FreeBSD.org> | 2002-04-01 10:49:11 +0000 |
|---|---|---|
| committer | David Malone <dwmalone@FreeBSD.org> | 2002-04-01 10:49:11 +0000 |
| commit | ebdb213b72472a7c7815cc283e214edc9de99507 (patch) | |
| tree | 5ee40a23861b6ef442be55ef886ae9773b128c48 | |
| parent | 4a213d4ae96c802b2279ccd51b146c6db3ca3d71 (diff) | |
Notes
| -rw-r--r-- | usr.bin/ktrace/ktrace.c | 25 | ||||
| -rw-r--r-- | usr.bin/ktrace/ktrace.h | 3 | ||||
| -rw-r--r-- | usr.bin/ktrace/subr.c | 13 |
3 files changed, 29 insertions, 12 deletions
diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c index 1d75adacb622..a9e225273077 100644 --- a/usr.bin/ktrace/ktrace.c +++ b/usr.bin/ktrace/ktrace.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1988, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ @@ -41,10 +41,11 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ktrace.c 8.1 (Berkeley) 6/6/93"; #endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <sys/param.h> #include <sys/stat.h> #include <sys/file.h> @@ -55,20 +56,23 @@ static const char rcsid[] = #include <err.h> #include <stdio.h> +#include <stdlib.h> #include <unistd.h> #include "ktrace.h" -void no_ktrace(int); -void usage(void); +static void no_ktrace(int); +static int rpid(char *); +static void usage(void); +int main(argc, argv) int argc; char **argv; { enum { NOTSET, CLEAR, CLEARALL } clear; int append, ch, fd, inherit, ops, pid, pidset, trpoints; - char *tracefile; + const char *tracefile; mode_t omask; struct stat sb; @@ -118,7 +122,7 @@ main(argc, argv) argv += optind; argc -= optind; - if (pidset && *argv || !pidset && !*argv) + if ((pidset && *argv) || (!pidset && !*argv)) usage(); if (inherit) @@ -166,6 +170,7 @@ main(argc, argv) exit(0); } +static int rpid(p) char *p; { @@ -182,7 +187,7 @@ rpid(p) return(atoi(p)); } -void +static void usage() { (void)fprintf(stderr, "%s\n%s\n", @@ -191,9 +196,9 @@ usage() exit(1); } -void +static void no_ktrace(sig) - int sig; + int sig __unused; { (void)fprintf(stderr, "error:\tktrace() system call not supported in the running kernel\n\tre-compile kernel with 'options KTRACE'\n"); diff --git a/usr.bin/ktrace/ktrace.h b/usr.bin/ktrace/ktrace.h index 9f6431acc201..2f22ce3eaf8e 100644 --- a/usr.bin/ktrace/ktrace.h +++ b/usr.bin/ktrace/ktrace.h @@ -31,6 +31,7 @@ * SUCH DAMAGE. * * @(#)ktrace.h 8.1 (Berkeley) 6/6/93 + * $FreeBSD$ */ #define DEF_POINTS (KTRFAC_SYSCALL | KTRFAC_SYSRET | KTRFAC_NAMEI | \ @@ -39,3 +40,5 @@ #define ALL_POINTS (DEF_POINTS | KTRFAC_CSW) #define DEF_TRACEFILE "ktrace.out" + +int getpoints __P((char *)); diff --git a/usr.bin/ktrace/subr.c b/usr.bin/ktrace/subr.c index 4e4b3bf466a5..f7c324cfedd8 100644 --- a/usr.bin/ktrace/subr.c +++ b/usr.bin/ktrace/subr.c @@ -35,10 +35,11 @@ #if 0 static char sccsid[] = "@(#)subr.c 8.1 (Berkeley) 6/6/93"; #endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <sys/param.h> #include <sys/file.h> #include <sys/user.h> @@ -50,6 +51,11 @@ static const char rcsid[] = #include "ktrace.h" +void timevaladd(struct timeval *, struct timeval *); +void timevalsub(struct timeval *, struct timeval *); +void timevalfix(struct timeval *); + +int getpoints(s) char *s; { @@ -86,6 +92,7 @@ getpoints(s) return (facs); } +void timevaladd(t1, t2) struct timeval *t1, *t2; { @@ -94,6 +101,7 @@ timevaladd(t1, t2) timevalfix(t1); } +void timevalsub(t1, t2) struct timeval *t1, *t2; { @@ -102,6 +110,7 @@ timevalsub(t1, t2) timevalfix(t1); } +void timevalfix(t1) struct timeval *t1; { |
