2002-04-01 05:41:13 +00:00
|
|
|
/*-
|
2017-11-27 15:37:16 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
|
|
|
*
|
2002-04-01 05:41:13 +00:00
|
|
|
* Copyright (c) 2002 Jake Burkholder
|
2004-05-22 08:26:10 +00:00
|
|
|
* Copyright (c) 2004 Robert Watson
|
2002-04-01 05:41:13 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
__FBSDID("$FreeBSD$");
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
2016-12-16 01:59:28 +00:00
|
|
|
#include <sys/capsicum.h>
|
2002-04-01 05:41:13 +00:00
|
|
|
#include <sys/ktr.h>
|
2002-09-22 07:21:28 +00:00
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <sys/stat.h>
|
2002-04-01 05:41:13 +00:00
|
|
|
|
2016-12-16 01:59:28 +00:00
|
|
|
#include <capsicum_helpers.h>
|
2002-04-01 05:41:13 +00:00
|
|
|
#include <err.h>
|
2016-12-16 01:59:28 +00:00
|
|
|
#include <errno.h>
|
2002-04-01 05:41:13 +00:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include <kvm.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <nlist.h>
|
2002-04-02 04:24:59 +00:00
|
|
|
#include <stdint.h>
|
2002-04-01 05:41:13 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#define SBUFLEN 128
|
|
|
|
#define USAGE \
|
2018-10-22 21:25:28 +00:00
|
|
|
"usage: ktrdump [-cflqrtH] [-i ktrfile] [-M core] [-N system] [-o outfile]\n"
|
2002-04-01 05:41:13 +00:00
|
|
|
|
|
|
|
static void usage(void);
|
|
|
|
|
|
|
|
static struct nlist nl[] = {
|
2021-03-24 07:51:25 +00:00
|
|
|
{ .n_name = "_ktr_version" },
|
|
|
|
{ .n_name = "_ktr_entries" },
|
|
|
|
{ .n_name = "_ktr_idx" },
|
|
|
|
{ .n_name = "_ktr_buf" },
|
|
|
|
{ .n_name = NULL }
|
2002-04-01 05:41:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int cflag;
|
|
|
|
static int fflag;
|
2018-10-22 21:25:28 +00:00
|
|
|
static int lflag;
|
2015-02-06 19:41:23 +00:00
|
|
|
static int Mflag;
|
|
|
|
static int Nflag;
|
2004-05-21 21:24:58 +00:00
|
|
|
static int qflag;
|
2004-05-22 08:26:10 +00:00
|
|
|
static int rflag;
|
2002-04-01 05:41:13 +00:00
|
|
|
static int tflag;
|
2002-09-22 07:21:28 +00:00
|
|
|
static int iflag;
|
2011-01-26 06:36:14 +00:00
|
|
|
static int hflag;
|
2002-04-01 05:41:13 +00:00
|
|
|
|
|
|
|
static char corefile[PATH_MAX];
|
|
|
|
static char execfile[PATH_MAX];
|
2016-12-16 01:59:28 +00:00
|
|
|
static char outfile[PATH_MAX] = "stdout";
|
2002-04-01 05:41:13 +00:00
|
|
|
|
|
|
|
static char desc[SBUFLEN];
|
|
|
|
static char errbuf[_POSIX2_LINE_MAX];
|
|
|
|
static char fbuf[PATH_MAX];
|
|
|
|
static char obuf[PATH_MAX];
|
|
|
|
static char sbuf[KTR_PARMS][SBUFLEN];
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Reads the ktr trace buffer from kernel memory and prints the trace entries.
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
main(int ac, char **av)
|
|
|
|
{
|
|
|
|
u_long parms[KTR_PARMS];
|
|
|
|
struct ktr_entry *buf;
|
2004-05-22 08:26:10 +00:00
|
|
|
uintmax_t tlast, tnow;
|
2012-11-15 00:51:57 +00:00
|
|
|
unsigned long bufptr;
|
2016-12-16 01:59:28 +00:00
|
|
|
cap_rights_t rights;
|
2002-09-22 07:21:28 +00:00
|
|
|
struct stat sb;
|
2002-04-01 05:41:13 +00:00
|
|
|
kvm_t *kd;
|
|
|
|
FILE *out;
|
|
|
|
char *p;
|
|
|
|
int version;
|
|
|
|
int entries;
|
2017-09-11 15:18:43 +00:00
|
|
|
int count;
|
2014-03-14 22:07:08 +00:00
|
|
|
int index, index2;
|
2002-04-01 05:41:13 +00:00
|
|
|
int parm;
|
2002-09-22 07:21:28 +00:00
|
|
|
int in;
|
2002-04-01 05:41:13 +00:00
|
|
|
int c;
|
2004-09-27 05:56:57 +00:00
|
|
|
int i = 0;
|
2002-04-01 05:41:13 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Parse commandline arguments.
|
|
|
|
*/
|
|
|
|
out = stdout;
|
2018-10-22 21:25:28 +00:00
|
|
|
while ((c = getopt(ac, av, "cflqrtHe:i:m:M:N:o:")) != -1)
|
2002-04-01 05:41:13 +00:00
|
|
|
switch (c) {
|
|
|
|
case 'c':
|
|
|
|
cflag = 1;
|
|
|
|
break;
|
2015-02-06 19:41:23 +00:00
|
|
|
case 'N':
|
2002-04-01 05:41:13 +00:00
|
|
|
case 'e':
|
2002-10-06 23:52:06 +00:00
|
|
|
if (strlcpy(execfile, optarg, sizeof(execfile))
|
|
|
|
>= sizeof(execfile))
|
|
|
|
errx(1, "%s: File name too long", optarg);
|
2015-02-06 19:41:23 +00:00
|
|
|
Nflag = 1;
|
2002-04-01 05:41:13 +00:00
|
|
|
break;
|
|
|
|
case 'f':
|
|
|
|
fflag = 1;
|
|
|
|
break;
|
2002-09-22 07:21:28 +00:00
|
|
|
case 'i':
|
|
|
|
iflag = 1;
|
|
|
|
if ((in = open(optarg, O_RDONLY)) == -1)
|
|
|
|
err(1, "%s", optarg);
|
2016-12-16 01:59:28 +00:00
|
|
|
cap_rights_init(&rights, CAP_FSTAT, CAP_MMAP_R);
|
2018-11-04 19:24:49 +00:00
|
|
|
if (caph_rights_limit(in, &rights) < 0)
|
2016-12-16 01:59:28 +00:00
|
|
|
err(1, "unable to limit rights for %s",
|
|
|
|
optarg);
|
2002-09-22 07:21:28 +00:00
|
|
|
break;
|
2018-10-22 21:25:28 +00:00
|
|
|
case 'l':
|
|
|
|
lflag = 1;
|
|
|
|
break;
|
2015-02-06 19:41:23 +00:00
|
|
|
case 'M':
|
2002-04-01 05:41:13 +00:00
|
|
|
case 'm':
|
2002-10-06 23:52:06 +00:00
|
|
|
if (strlcpy(corefile, optarg, sizeof(corefile))
|
|
|
|
>= sizeof(corefile))
|
|
|
|
errx(1, "%s: File name too long", optarg);
|
2015-02-06 19:41:23 +00:00
|
|
|
Mflag = 1;
|
2002-04-01 05:41:13 +00:00
|
|
|
break;
|
|
|
|
case 'o':
|
|
|
|
if ((out = fopen(optarg, "w")) == NULL)
|
|
|
|
err(1, "%s", optarg);
|
2016-12-16 01:59:28 +00:00
|
|
|
strlcpy(outfile, optarg, sizeof(outfile));
|
2002-04-01 05:41:13 +00:00
|
|
|
break;
|
2004-05-21 21:24:58 +00:00
|
|
|
case 'q':
|
|
|
|
qflag++;
|
|
|
|
break;
|
2004-05-22 08:26:10 +00:00
|
|
|
case 'r':
|
|
|
|
rflag = 1;
|
|
|
|
break;
|
2002-04-01 05:41:13 +00:00
|
|
|
case 't':
|
|
|
|
tflag = 1;
|
|
|
|
break;
|
2011-01-26 06:36:14 +00:00
|
|
|
case 'H':
|
|
|
|
hflag = 1;
|
|
|
|
break;
|
2002-04-01 05:41:13 +00:00
|
|
|
case '?':
|
|
|
|
default:
|
|
|
|
usage();
|
|
|
|
}
|
|
|
|
ac -= optind;
|
|
|
|
av += optind;
|
|
|
|
if (ac != 0)
|
|
|
|
usage();
|
|
|
|
|
2018-10-22 21:25:28 +00:00
|
|
|
if (caph_limit_stream(fileno(out), CAPH_WRITE) < 0)
|
2016-12-16 01:59:28 +00:00
|
|
|
err(1, "unable to limit rights for %s", outfile);
|
2018-10-22 21:25:28 +00:00
|
|
|
if (caph_limit_stderr() < 0)
|
|
|
|
err(1, "unable to limit rights for stderr");
|
2016-12-16 01:59:28 +00:00
|
|
|
|
2002-04-01 05:41:13 +00:00
|
|
|
/*
|
|
|
|
* Open our execfile and corefile, resolve needed symbols and read in
|
|
|
|
* the trace buffer.
|
|
|
|
*/
|
2015-02-06 19:41:23 +00:00
|
|
|
if ((kd = kvm_openfiles(Nflag ? execfile : NULL,
|
|
|
|
Mflag ? corefile : NULL, NULL, O_RDONLY, errbuf)) == NULL)
|
2002-04-01 05:41:13 +00:00
|
|
|
errx(1, "%s", errbuf);
|
2016-12-16 01:59:28 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Cache NLS data, for strerror, for err(3), before entering capability
|
|
|
|
* mode.
|
|
|
|
*/
|
|
|
|
caph_cache_catpages();
|
|
|
|
|
2017-09-11 15:18:43 +00:00
|
|
|
count = kvm_nlist(kd, nl);
|
|
|
|
if (count == -1)
|
|
|
|
errx(1, "%s", kvm_geterr(kd));
|
|
|
|
if (count > 0)
|
|
|
|
errx(1, "failed to resolve ktr symbols");
|
|
|
|
if (kvm_read(kd, nl[0].n_value, &version, sizeof(version)) == -1)
|
2002-04-01 05:41:13 +00:00
|
|
|
errx(1, "%s", kvm_geterr(kd));
|
|
|
|
if (version != KTR_VERSION)
|
|
|
|
errx(1, "ktr version mismatch");
|
2016-12-16 01:59:28 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Enter Capsicum sandbox.
|
|
|
|
*
|
|
|
|
* kvm_nlist() above uses kldsym(2) for native kernels, and that isn't
|
|
|
|
* allowed in the sandbox.
|
|
|
|
*/
|
2018-06-19 23:43:14 +00:00
|
|
|
if (caph_enter() < 0)
|
2016-12-16 01:59:28 +00:00
|
|
|
err(1, "unable to enter capability mode");
|
|
|
|
|
2002-09-22 07:21:28 +00:00
|
|
|
if (iflag) {
|
|
|
|
if (fstat(in, &sb) == -1)
|
|
|
|
errx(1, "stat");
|
|
|
|
entries = sb.st_size / sizeof(*buf);
|
|
|
|
index = 0;
|
|
|
|
buf = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, in, 0);
|
|
|
|
if (buf == MAP_FAILED)
|
|
|
|
errx(1, "mmap");
|
|
|
|
} else {
|
|
|
|
if (kvm_read(kd, nl[1].n_value, &entries, sizeof(entries))
|
|
|
|
== -1)
|
|
|
|
errx(1, "%s", kvm_geterr(kd));
|
|
|
|
if ((buf = malloc(sizeof(*buf) * entries)) == NULL)
|
|
|
|
err(1, NULL);
|
|
|
|
if (kvm_read(kd, nl[2].n_value, &index, sizeof(index)) == -1 ||
|
2012-11-15 00:51:57 +00:00
|
|
|
kvm_read(kd, nl[3].n_value, &bufptr,
|
|
|
|
sizeof(bufptr)) == -1 ||
|
2014-03-14 22:07:08 +00:00
|
|
|
kvm_read(kd, bufptr, buf, sizeof(*buf) * entries) == -1 ||
|
|
|
|
kvm_read(kd, nl[2].n_value, &index2, sizeof(index2)) == -1)
|
2002-09-22 07:21:28 +00:00
|
|
|
errx(1, "%s", kvm_geterr(kd));
|
|
|
|
}
|
2002-04-01 05:41:13 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Print a nice header.
|
|
|
|
*/
|
2004-05-21 21:24:58 +00:00
|
|
|
if (!qflag) {
|
|
|
|
fprintf(out, "%-6s ", "index");
|
|
|
|
if (cflag)
|
|
|
|
fprintf(out, "%-3s ", "cpu");
|
|
|
|
if (tflag)
|
|
|
|
fprintf(out, "%-16s ", "timestamp");
|
|
|
|
if (fflag)
|
|
|
|
fprintf(out, "%-40s ", "file and line");
|
2011-01-26 06:36:14 +00:00
|
|
|
if (hflag)
|
|
|
|
fprintf(out, "%-18s ", "tid");
|
2004-05-21 21:24:58 +00:00
|
|
|
fprintf(out, "%s", "trace");
|
|
|
|
fprintf(out, "\n");
|
|
|
|
|
|
|
|
fprintf(out, "------ ");
|
|
|
|
if (cflag)
|
|
|
|
fprintf(out, "--- ");
|
|
|
|
if (tflag)
|
|
|
|
fprintf(out, "---------------- ");
|
|
|
|
if (fflag)
|
|
|
|
fprintf(out,
|
|
|
|
"---------------------------------------- ");
|
2011-01-26 06:36:14 +00:00
|
|
|
if (hflag)
|
|
|
|
fprintf(out, "------------------ ");
|
2004-05-21 21:24:58 +00:00
|
|
|
fprintf(out, "----- ");
|
|
|
|
fprintf(out, "\n");
|
|
|
|
}
|
2002-04-01 05:41:13 +00:00
|
|
|
|
2021-03-24 07:51:25 +00:00
|
|
|
tlast = UINTPTR_MAX;
|
2002-04-01 05:41:13 +00:00
|
|
|
/*
|
|
|
|
* Now tear through the trace buffer.
|
2018-10-22 21:25:28 +00:00
|
|
|
*
|
|
|
|
* In "live" mode, find the oldest entry (first non-NULL entry
|
|
|
|
* after index2) and walk forward. Otherwise, start with the
|
|
|
|
* most recent entry and walk backwards.
|
2002-04-01 05:41:13 +00:00
|
|
|
*/
|
2014-03-14 21:35:16 +00:00
|
|
|
if (!iflag) {
|
2018-10-22 21:25:28 +00:00
|
|
|
if (lflag) {
|
|
|
|
i = index2 + 1 % entries;
|
|
|
|
while (buf[i].ktr_desc == NULL && i != index) {
|
|
|
|
i++;
|
|
|
|
if (i == entries)
|
|
|
|
i = 0;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
i = index - 1;
|
|
|
|
if (i < 0)
|
|
|
|
i = entries - 1;
|
|
|
|
}
|
2014-03-14 21:35:16 +00:00
|
|
|
}
|
2018-10-22 21:25:28 +00:00
|
|
|
dump_entries:
|
2002-04-01 05:41:13 +00:00
|
|
|
for (;;) {
|
|
|
|
if (buf[i].ktr_desc == NULL)
|
|
|
|
break;
|
|
|
|
if (kvm_read(kd, (u_long)buf[i].ktr_desc, desc,
|
|
|
|
sizeof(desc)) == -1)
|
|
|
|
errx(1, "%s", kvm_geterr(kd));
|
|
|
|
desc[sizeof(desc) - 1] = '\0';
|
|
|
|
parm = 0;
|
|
|
|
for (p = desc; (c = *p++) != '\0';) {
|
|
|
|
if (c != '%')
|
|
|
|
continue;
|
2006-01-12 22:32:07 +00:00
|
|
|
next: if ((c = *p++) == '\0')
|
2002-04-01 05:41:13 +00:00
|
|
|
break;
|
|
|
|
if (parm == KTR_PARMS)
|
2014-01-17 09:11:44 +00:00
|
|
|
errx(1, "too many parameters in \"%s\"", desc);
|
2002-04-01 05:41:13 +00:00
|
|
|
switch (c) {
|
2006-01-12 22:32:07 +00:00
|
|
|
case '0': case '1': case '2': case '3': case '4':
|
|
|
|
case '5': case '6': case '7': case '8': case '9':
|
|
|
|
case '#': case '-': case ' ': case '+': case '\'':
|
|
|
|
case 'h': case 'l': case 'j': case 't': case 'z':
|
|
|
|
case 'q': case 'L': case '.':
|
|
|
|
goto next;
|
2002-04-01 05:41:13 +00:00
|
|
|
case 's':
|
|
|
|
if (kvm_read(kd, (u_long)buf[i].ktr_parms[parm],
|
|
|
|
sbuf[parm], sizeof(sbuf[parm])) == -1)
|
|
|
|
strcpy(sbuf[parm], "(null)");
|
|
|
|
sbuf[parm][sizeof(sbuf[0]) - 1] = '\0';
|
|
|
|
parms[parm] = (u_long)sbuf[parm];
|
|
|
|
parm++;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
parms[parm] = buf[i].ktr_parms[parm];
|
|
|
|
parm++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fprintf(out, "%6d ", i);
|
|
|
|
if (cflag)
|
|
|
|
fprintf(out, "%3d ", buf[i].ktr_cpu);
|
2004-05-22 08:26:10 +00:00
|
|
|
if (tflag) {
|
|
|
|
tnow = (uintmax_t)buf[i].ktr_timestamp;
|
|
|
|
if (rflag) {
|
2021-03-24 07:51:25 +00:00
|
|
|
if (tlast == UINTPTR_MAX)
|
2004-05-22 08:26:10 +00:00
|
|
|
tlast = tnow;
|
2005-12-09 14:27:03 +00:00
|
|
|
fprintf(out, "%16ju ", !iflag ? tlast - tnow :
|
|
|
|
tnow - tlast);
|
2004-05-22 08:26:10 +00:00
|
|
|
tlast = tnow;
|
|
|
|
} else
|
|
|
|
fprintf(out, "%16ju ", tnow);
|
|
|
|
}
|
2002-04-01 05:41:13 +00:00
|
|
|
if (fflag) {
|
|
|
|
if (kvm_read(kd, (u_long)buf[i].ktr_file, fbuf,
|
|
|
|
sizeof(fbuf)) == -1)
|
|
|
|
strcpy(fbuf, "(null)");
|
|
|
|
snprintf(obuf, sizeof(obuf), "%s:%d", fbuf,
|
|
|
|
buf[i].ktr_line);
|
|
|
|
fprintf(out, "%-40s ", obuf);
|
|
|
|
}
|
2011-01-26 06:36:14 +00:00
|
|
|
if (hflag)
|
|
|
|
fprintf(out, "%p ", buf[i].ktr_thread);
|
2002-04-01 05:41:13 +00:00
|
|
|
fprintf(out, desc, parms[0], parms[1], parms[2], parms[3],
|
|
|
|
parms[4], parms[5]);
|
|
|
|
fprintf(out, "\n");
|
2002-09-22 07:21:28 +00:00
|
|
|
if (!iflag) {
|
2014-03-14 22:07:08 +00:00
|
|
|
/*
|
|
|
|
* 'index' and 'index2' are the values of 'ktr_idx'
|
|
|
|
* before and after the KTR buffer was copied into
|
|
|
|
* 'buf'. Since the KTR entries between 'index' and
|
|
|
|
* 'index2' were in flux while the KTR buffer was
|
|
|
|
* being copied to userspace we don't dump them.
|
|
|
|
*/
|
2018-10-22 21:25:28 +00:00
|
|
|
if (lflag) {
|
|
|
|
if (++i == entries)
|
|
|
|
i = 0;
|
|
|
|
if (i == index)
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
if (i == index2)
|
|
|
|
break;
|
|
|
|
if (--i < 0)
|
|
|
|
i = entries - 1;
|
|
|
|
}
|
2002-09-22 07:21:28 +00:00
|
|
|
} else {
|
|
|
|
if (++i == entries)
|
|
|
|
break;
|
|
|
|
}
|
2002-04-01 05:41:13 +00:00
|
|
|
}
|
|
|
|
|
2018-10-22 21:25:28 +00:00
|
|
|
/*
|
|
|
|
* In "live" mode, poll 'ktr_idx' periodically and dump any
|
|
|
|
* new entries since our last pass through the ring.
|
|
|
|
*/
|
|
|
|
if (lflag && !iflag) {
|
|
|
|
while (index == index2) {
|
|
|
|
usleep(50 * 1000);
|
|
|
|
if (kvm_read(kd, nl[2].n_value, &index2,
|
|
|
|
sizeof(index2)) == -1)
|
|
|
|
errx(1, "%s", kvm_geterr(kd));
|
|
|
|
}
|
|
|
|
i = index;
|
|
|
|
index = index2;
|
|
|
|
if (kvm_read(kd, bufptr, buf, sizeof(*buf) * entries) == -1 ||
|
|
|
|
kvm_read(kd, nl[2].n_value, &index2, sizeof(index2)) == -1)
|
|
|
|
errx(1, "%s", kvm_geterr(kd));
|
|
|
|
goto dump_entries;
|
|
|
|
}
|
|
|
|
|
2002-04-01 05:41:13 +00:00
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
usage(void)
|
|
|
|
{
|
2005-05-21 09:55:10 +00:00
|
|
|
|
|
|
|
fprintf(stderr, USAGE);
|
|
|
|
exit(1);
|
2002-04-01 05:41:13 +00:00
|
|
|
}
|