summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2014-04-11 01:00:51 +0000
committerbdrewery <bdrewery@FreeBSD.org>2014-04-11 01:00:51 +0000
commit69b3d647983573f15fade6bc51612aaebacefb5b (patch)
treed32653a285f6b3df0e1f9febb9eed0a8bb6f4898 /usr.bin
parentaeb5a4ff70fa036e3502afc9daf7d02795216340 (diff)
downloadFreeBSD-src-69b3d647983573f15fade6bc51612aaebacefb5b.zip
FreeBSD-src-69b3d647983573f15fade6bc51612aaebacefb5b.tar.gz
MFC r263879:
Add `-S' to display syscall numbers in the output as well.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/kdump/kdump.16
-rw-r--r--usr.bin/kdump/kdump.c35
2 files changed, 30 insertions, 11 deletions
diff --git a/usr.bin/kdump/kdump.1 b/usr.bin/kdump/kdump.1
index f8e87e4..a3cc1cf 100644
--- a/usr.bin/kdump/kdump.1
+++ b/usr.bin/kdump/kdump.1
@@ -28,7 +28,7 @@
.\" @(#)kdump.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd June 4, 2012
+.Dd March 28, 2014
.Dt KDUMP 1
.Os
.Sh NAME
@@ -36,7 +36,7 @@
.Nd display kernel trace data
.Sh SYNOPSIS
.Nm
-.Op Fl dEnlHRsTA
+.Op Fl dEnlHRSsTA
.Op Fl f Ar trfile
.Op Fl m Ar maxdata
.Op Fl p Ar pid
@@ -95,6 +95,8 @@ Display relative timestamps (time since previous entry).
.It Fl r
When decoding STRU records, display structure members such as UIDs,
GIDs, dates etc. symbolically instead of numerically.
+.It Fl S
+Display system call numbers.
.It Fl s
Suppress display of I/O data.
.It Fl T
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index 24bb0fd..8f4cefc 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -116,7 +116,7 @@ void usage(void);
void ioctlname(unsigned long, int);
int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata,
- resolv = 0, abiflag = 0;
+ resolv = 0, abiflag = 0, syscallno = 0;
const char *tracefile = DEF_TRACEFILE;
struct ktr_header ktr_header;
@@ -204,7 +204,7 @@ main(int argc, char *argv[])
setlocale(LC_CTYPE, "");
- while ((ch = getopt(argc,argv,"f:dElm:np:AHRrsTt:")) != -1)
+ while ((ch = getopt(argc,argv,"f:dElm:np:AHRrSsTt:")) != -1)
switch (ch) {
case 'A':
abiflag = 1;
@@ -230,6 +230,9 @@ main(int argc, char *argv[])
case 'r':
resolv = 1;
break;
+ case 'S':
+ syscallno = 1;
+ break;
case 's':
suppressdata = 1;
break;
@@ -600,8 +603,11 @@ ktrsyscall(struct ktr_syscall *ktr, u_int flags)
if ((flags != 0 && ((flags & SV_ABI_MASK) != SV_ABI_FREEBSD)) ||
(ktr->ktr_code >= nsyscalls || ktr->ktr_code < 0))
printf("[%d]", ktr->ktr_code);
- else
+ else {
printf("%s", syscallnames[ktr->ktr_code]);
+ if (syscallno)
+ printf("[%d]", ktr->ktr_code);
+ }
ip = &ktr->ktr_args[0];
if (narg) {
char c = '(';
@@ -1193,8 +1199,12 @@ ktrsysret(struct ktr_sysret *ktr, u_int flags)
if ((flags != 0 && ((flags & SV_ABI_MASK) != SV_ABI_FREEBSD)) ||
(code >= nsyscalls || code < 0))
printf("[%d] ", code);
- else
- printf("%s ", syscallnames[code]);
+ else {
+ printf("%s", syscallnames[code]);
+ if (syscallno)
+ printf("[%d]", code);
+ printf(" ");
+ }
if (error == 0) {
if (fancy) {
@@ -1840,8 +1850,11 @@ linux_ktrsyscall(struct ktr_syscall *ktr)
if (ktr->ktr_code >= nlinux_syscalls || ktr->ktr_code < 0)
printf("[%d]", ktr->ktr_code);
- else
+ else {
printf("%s", linux_syscallnames[ktr->ktr_code]);
+ if (syscallno)
+ printf("[%d]", ktr->ktr_code);
+ }
ip = &ktr->ktr_args[0];
if (narg) {
char c = '(';
@@ -1861,8 +1874,12 @@ linux_ktrsysret(struct ktr_sysret *ktr)
if (code >= nlinux_syscalls || code < 0)
printf("[%d] ", code);
- else
- printf("%s ", linux_syscallnames[code]);
+ else {
+ printf("%s", linux_syscallnames[code]);
+ if (syscallno)
+ printf("[%d]", code);
+ printf(" ");
+ }
if (error == 0) {
if (fancy) {
@@ -1895,7 +1912,7 @@ linux_ktrsysret(struct ktr_sysret *ktr)
void
usage(void)
{
- fprintf(stderr, "usage: kdump [-dEnlHRrsTA] [-f trfile] "
+ fprintf(stderr, "usage: kdump [-dEnlHRrSsTA] [-f trfile] "
"[-m maxdata] [-p pid] [-t trstr]\n");
exit(1);
}
OpenPOWER on IntegriCloud