From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 16:11:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB156AA5; Fri, 28 Mar 2014 16:11:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7436F06; Fri, 28 Mar 2014 16:11:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2SGBKle054644; Fri, 28 Mar 2014 16:11:20 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SGBK6Q054642; Fri, 28 Mar 2014 16:11:20 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403281611.s2SGBK6Q054642@svn.freebsd.org> From: Bryan Drewery Date: Fri, 28 Mar 2014 16:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263879 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 16:11:21 -0000 Author: bdrewery Date: Fri Mar 28 16:11:20 2014 New Revision: 263879 URL: http://svnweb.freebsd.org/changeset/base/263879 Log: Add `-S' to display syscall numbers in the output as well. This is useful for debugging compat modules. Sponsored by: EMC / Isilon Storage Division Obtained from: Isilon OneFS (based on work by Jeff Hughes) MFC after: 2 weeks Modified: head/usr.bin/kdump/kdump.1 head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.1 ============================================================================== --- head/usr.bin/kdump/kdump.1 Fri Mar 28 16:07:27 2014 (r263878) +++ head/usr.bin/kdump/kdump.1 Fri Mar 28 16:11:20 2014 (r263879) @@ -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 .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 Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Fri Mar 28 16:07:27 2014 (r263878) +++ head/usr.bin/kdump/kdump.c Fri Mar 28 16:11:20 2014 (r263879) @@ -123,7 +123,7 @@ void ioctlname(unsigned long, int); #define TIMESTAMP_RELATIVE 0x4 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; @@ -261,7 +261,7 @@ main(int argc, char *argv[]) timestamp = TIMESTAMP_NONE; - 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; @@ -287,6 +287,9 @@ main(int argc, char *argv[]) case 'r': resolv = 1; break; + case 'S': + syscallno = 1; + break; case 's': suppressdata = 1; break; @@ -678,8 +681,11 @@ ktrsyscall(struct ktr_syscall *ktr, u_in 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 = '('; @@ -1271,8 +1277,12 @@ ktrsysret(struct ktr_sysret *ktr, u_int 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) { @@ -1910,8 +1920,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 = '('; @@ -1931,8 +1944,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) { @@ -1965,7 +1982,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); }