Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/kdump Add -N which inhibits translation of system ca...



details:   https://anonhg.NetBSD.org/src/rev/83793a4f4b58
branches:  trunk
changeset: 539854:83793a4f4b58
user:      atatat <atatat%NetBSD.org@localhost>
date:      Wed Nov 27 21:26:57 2002 +0000

description:
Add -N which inhibits translation of system calls numbers into names.

diffstat:

 usr.bin/kdump/kdump.1 |   6 ++++--
 usr.bin/kdump/kdump.c |  16 ++++++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)

diffs (85 lines):

diff -r 384e7a33dfb3 -r 83793a4f4b58 usr.bin/kdump/kdump.1
--- a/usr.bin/kdump/kdump.1     Wed Nov 27 18:40:34 2002 +0000
+++ b/usr.bin/kdump/kdump.1     Wed Nov 27 21:26:57 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: kdump.1,v 1.13 2002/09/28 12:40:41 wiz Exp $
+.\"    $NetBSD: kdump.1,v 1.14 2002/11/27 21:26:57 atatat Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -41,7 +41,7 @@
 .Nd display kernel trace data
 .Sh SYNOPSIS
 .Nm ""
-.Op Fl dnlRT
+.Op Fl dnNlRT
 .Op Fl e Ar emulation
 .Op Fl f Ar file
 .Op Fl m Ar maxdata
@@ -94,6 +94,8 @@
 string.
 Suppressing this feature yields a more consistent output format and is
 easily amenable to further processing.
+.It Fl N
+Suppress system call number-to-name translation.
 .It Fl R
 Display relative timestamps (time since previous entry).
 .It Fl T
diff -r 384e7a33dfb3 -r 83793a4f4b58 usr.bin/kdump/kdump.c
--- a/usr.bin/kdump/kdump.c     Wed Nov 27 18:40:34 2002 +0000
+++ b/usr.bin/kdump/kdump.c     Wed Nov 27 21:26:57 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kdump.c,v 1.42 2002/11/15 19:58:05 manu Exp $  */
+/*     $NetBSD: kdump.c,v 1.43 2002/11/27 21:26:57 atatat Exp $        */
 
 /*-
  * Copyright (c) 1988, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)kdump.c    8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.42 2002/11/15 19:58:05 manu Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.43 2002/11/27 21:26:57 atatat Exp $");
 #endif
 #endif /* not lint */
 
@@ -70,7 +70,7 @@
 
 #include <sys/syscall.h>
 
-int timestamp, decimal, plain, tail, maxdata;
+int timestamp, decimal, plain, tail, maxdata, numeric;
 pid_t do_pid = -1;
 const char *tracefile = NULL;
 struct ktr_header ktr_header;
@@ -122,7 +122,7 @@
        int trpoints = ALL_POINTS;
        const char *emul_name = "netbsd";
 
-       while ((ch = getopt(argc, argv, "e:f:dlm:np:RTt:")) != -1)
+       while ((ch = getopt(argc, argv, "e:f:dlm:Nnp:RTt:")) != -1)
                switch (ch) {
                case 'e':
                        emul_name = strdup(optarg); /* it's safer to copy it */
@@ -142,6 +142,9 @@
                case 'm':
                        maxdata = atoi(optarg);
                        break;
+               case 'N':
+                       numeric++;
+                       break;
                case 'n':
                        plain++;
                        break;
@@ -330,8 +333,9 @@
        const struct emulation *revelant = current;
        register_t *ap;
 
-       if ((ktr->ktr_code >= revelant->nsysnames || ktr->ktr_code < 0)
-           && (mach_traps_dispatch(&ktr->ktr_code, &revelant) == 0))
+       if (((ktr->ktr_code >= revelant->nsysnames || ktr->ktr_code < 0)
+           && (mach_traps_dispatch(&ktr->ktr_code, &revelant) == 0)) ||
+           numeric)
                (void)printf("[%d]", ktr->ktr_code);
        else
                (void)printf("%s", revelant->sysnames[ktr->ktr_code]);



Home | Main Index | Thread Index | Old Index