svn commit: r258442 - in stable/9/usr.bin: kdump truss

John Baldwin jhb at FreeBSD.org
Thu Nov 21 20:09:45 UTC 2013


Author: jhb
Date: Thu Nov 21 20:09:44 2013
New Revision: 258442
URL: http://svnweb.freebsd.org/changeset/base/258442

Log:
  MFC 226145,226147,226148,226150,226151,226153,226157,226158,226164,226246,
  226262,226329,226344,226608:
  Merge most "infrastructure" changes to kdump to make other MFC's to add
  new decodings, etc. easier:
  - Some of the #defines or enums for which we auto-generate naming
    functions may be wider than int, so use intmax_t throughout.
  - Auto-generate kdump_subr.h.
  - Use a switch statement instead of a giant if-else.
  - Remove a lot of (void) casts.
  - Bring ioctlname() in line with all the other *name() functions, which
    actually print the name (or the numeric value, if they can't figure out
    the correct name) instead of just returning a pointer to it.  Also, since
    ioctl numbers are not and probably never will be unique, drop support for
    using a switch statement instead of an if/else chain.
  - Mostly WARNS=6 clean.
  - Update mkioctls to still work with both kdump and truss.

Deleted:
  stable/9/usr.bin/kdump/kdump_subr.h
Modified:
  stable/9/usr.bin/kdump/Makefile
  stable/9/usr.bin/kdump/kdump.c
  stable/9/usr.bin/kdump/mkioctls
  stable/9/usr.bin/kdump/mksubr
  stable/9/usr.bin/truss/Makefile
  stable/9/usr.bin/truss/extern.h
Directory Properties:
  stable/9/usr.bin/kdump/   (props changed)
  stable/9/usr.bin/truss/   (props changed)

Modified: stable/9/usr.bin/kdump/Makefile
==============================================================================
--- stable/9/usr.bin/kdump/Makefile	Thu Nov 21 20:07:58 2013	(r258441)
+++ stable/9/usr.bin/kdump/Makefile	Thu Nov 21 20:09:44 2013	(r258442)
@@ -8,23 +8,28 @@ SFX=		32
 .PATH: ${.CURDIR}/../ktrace
 
 PROG=		kdump
-SRCS=		kdump.c ioctl.c kdump_subr.c subr.c
-CFLAGS+=	-I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../..
+SRCS=		kdump_subr.c kdump.c ioctl.c subr.c
+DPSRCS=		kdump_subr.h 
+CFLAGS+=	-I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I.
 
 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 SRCS+=		linux_syscalls.c
 .endif
 
-WARNS?=		0
+NO_WERROR?=	YES
 
-CLEANFILES=	ioctl.c kdump_subr.c linux_syscalls.c
+CLEANFILES=	ioctl.c kdump_subr.c kdump_subr.h linux_syscalls.c
 
 ioctl.c: mkioctls
-	env CPP="${CPP}" \
-	   sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET}
+	env MACHINE=${MACHINE} CPP="${CPP}" \
+	    sh ${.CURDIR}/mkioctls print ${DESTDIR}/usr/include > ${.TARGET}
 
-kdump_subr.c: mksubr
-	sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include > ${.TARGET}
+kdump_subr.h: mksubr
+	sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include | \
+	    sed -n 's/^\([a-z].*)\)$$/void \1;/p' >${.TARGET}
+
+kdump_subr.c: mksubr kdump_subr.h
+	sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include >${.TARGET}
 
 linux_syscalls.c:
 	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \

Modified: stable/9/usr.bin/kdump/kdump.c
==============================================================================
--- stable/9/usr.bin/kdump/kdump.c	Thu Nov 21 20:07:58 2013	(r258441)
+++ stable/9/usr.bin/kdump/kdump.c	Thu Nov 21 20:09:44 2013	(r258442)
@@ -96,6 +96,8 @@ void ktrgenio(struct ktr_genio *, int);
 void ktrpsig(struct ktr_psig *);
 void ktrcsw(struct ktr_csw *);
 void ktrcsw_old(struct ktr_csw_old *);
+void ktruser_malloc(unsigned char *);
+void ktruser_rtld(int, unsigned char *);
 void ktruser(int, unsigned char *);
 void ktrsockaddr(struct sockaddr *);
 void ktrstat(struct stat *);
@@ -103,8 +105,7 @@ void ktrstruct(char *, size_t);
 void ktrfault(struct ktr_fault *);
 void ktrfaultend(struct ktr_faultend *);
 void usage(void);
-void sockfamilyname(int);
-const char *ioctlname(u_long);
+void ioctlname(unsigned long, int);
 
 int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata,
     resolv = 0, abiflag = 0;
@@ -114,15 +115,15 @@ struct ktr_header ktr_header;
 #define TIME_FORMAT	"%b %e %T %Y"
 #define eqs(s1, s2)	(strcmp((s1), (s2)) == 0)
 
-#define print_number(i,n,c) do {		\
-	if (decimal)				\
-		printf("%c%ld", c, (long)*i);	\
-	else					\
-		printf("%c%#lx", c, (long)*i);	\
-	i++;					\
-	n--;					\
-	c = ',';				\
-	} while (0);
+#define print_number(i,n,c) do {					\
+	if (decimal)							\
+		printf("%c%jd", c, (intmax_t)*i);			\
+	else								\
+		printf("%c%#jx", c, (uintmax_t)(u_register_t)*i);	\
+	i++;								\
+	n--;								\
+	c = ',';							\
+} while (0)
 
 #if defined(__amd64__) || defined(__i386__)
 
@@ -168,10 +169,10 @@ main(int argc, char *argv[])
 	pid_t pid = 0;
 	u_int sv_flags;
 
-	(void) setlocale(LC_CTYPE, "");
+	setlocale(LC_CTYPE, "");
 
 	while ((ch = getopt(argc,argv,"f:dElm:np:AHRrsTt:")) != -1)
-		switch((char)ch) {
+		switch (ch) {
 		case 'A':
 			abiflag = 1;
 			break;
@@ -223,7 +224,7 @@ main(int argc, char *argv[])
 	if (argc > optind)
 		usage();
 
-	m = (void *)malloc(size = 1025);
+	m = malloc(size = 1025);
 	if (m == NULL)
 		errx(1, "%s", strerror(ENOMEM));
 	if (!freopen(tracefile, "r", stdin))
@@ -234,7 +235,7 @@ main(int argc, char *argv[])
 		if (ktr_header.ktr_type & KTR_DROP) {
 			ktr_header.ktr_type &= ~KTR_DROP;
 			if (!drop_logged && threads) {
-				(void)printf(
+				printf(
 				    "%6jd %6jd %-8.*s Events dropped.\n",
 				    (intmax_t)ktr_header.ktr_pid,
 				    ktr_header.ktr_tid > 0 ?
@@ -242,7 +243,7 @@ main(int argc, char *argv[])
 				    MAXCOMLEN, ktr_header.ktr_comm);
 				drop_logged = 1;
 			} else if (!drop_logged) {
-				(void)printf("%6jd %-8.*s Events dropped.\n",
+				printf("%6jd %-8.*s Events dropped.\n",
 				    (intmax_t)ktr_header.ktr_pid, MAXCOMLEN,
 				    ktr_header.ktr_comm);
 				drop_logged = 1;
@@ -255,7 +256,7 @@ main(int argc, char *argv[])
 		if ((ktrlen = ktr_header.ktr_len) < 0)
 			errx(1, "bogus length 0x%x", ktrlen);
 		if (ktrlen > size) {
-			m = (void *)realloc(m, ktrlen+1);
+			m = realloc(m, ktrlen+1);
 			if (m == NULL)
 				errx(1, "%s", strerror(ENOMEM));
 			size = ktrlen;
@@ -321,7 +322,7 @@ main(int argc, char *argv[])
 			break;
 		}
 		if (tail)
-			(void)fflush(stdout);
+			fflush(stdout);
 	}
 	return 0;
 }
@@ -332,7 +333,7 @@ fread_tail(void *buf, int size, int num)
 	int i;
 
 	while ((i = fread(buf, size, num, stdin)) == 0 && tail) {
-		(void)sleep(1);
+		sleep(1);
 		clearerr(stdin);
 	}
 	return (i);
@@ -462,7 +463,7 @@ dumpheader(struct ktr_header *kth)
 		type = "PRET";
 		break;
 	default:
-		(void)sprintf(unknown, "UNKNOWN(%d)", kth->ktr_type);
+		sprintf(unknown, "UNKNOWN(%d)", kth->ktr_type);
 		type = unknown;
 	}
 
@@ -475,11 +476,11 @@ dumpheader(struct ktr_header *kth)
 	 * negative tid's as 0.
 	 */
 	if (threads)
-		(void)printf("%6jd %6jd %-8.*s ", (intmax_t)kth->ktr_pid,
+		printf("%6jd %6jd %-8.*s ", (intmax_t)kth->ktr_pid,
 		    kth->ktr_tid > 0 ? (intmax_t)kth->ktr_tid : 0,
 		    MAXCOMLEN, kth->ktr_comm);
 	else
-		(void)printf("%6jd %-8.*s ", (intmax_t)kth->ktr_pid, MAXCOMLEN,
+		printf("%6jd %-8.*s ", (intmax_t)kth->ktr_pid, MAXCOMLEN,
 		    kth->ktr_comm);
 	if (timestamp) {
 		if (timestamp == 3) {
@@ -492,10 +493,10 @@ dumpheader(struct ktr_header *kth)
 			timevalsub(&kth->ktr_time, &prevtime);
 			prevtime = temp;
 		}
-		(void)printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec,
+		printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec,
 		    kth->ktr_time.tv_usec);
 	}
-	(void)printf("%s  ", type);
+	printf("%s  ", type);
 }
 
 #include <sys/syscall.h>
@@ -512,465 +513,509 @@ 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))
-		(void)printf("[%d]", ktr->ktr_code);
+		printf("[%d]", ktr->ktr_code);
 	else
-		(void)printf("%s", syscallnames[ktr->ktr_code]);
+		printf("%s", syscallnames[ktr->ktr_code]);
 	ip = &ktr->ktr_args[0];
 	if (narg) {
 		char c = '(';
 		if (fancy &&
 		    (flags == 0 || (flags & SV_ABI_MASK) == SV_ABI_FREEBSD)) {
-			if (ktr->ktr_code == SYS_ioctl) {
-				const char *cp;
-				print_number(ip,narg,c);
-				if ((cp = ioctlname(*ip)) != NULL)
-					(void)printf(",%s", cp);
-				else {
-					if (decimal)
-						(void)printf(",%ld", (long)*ip);
-					else
-						(void)printf(",%#lx ", (long)*ip);
-				}
+			switch (ktr->ktr_code) {
+			case SYS_ioctl: {
+				print_number(ip, narg, c);
+				putchar(c);
+				ioctlname(*ip, decimal);
 				c = ',';
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_ptrace) {
-				(void)putchar('(');
-				ptraceopname ((int)*ip);
+				break;
+			}
+			case SYS_ptrace:
+				putchar('(');
+				ptraceopname(*ip);
 				c = ',';
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_access ||
-				   ktr->ktr_code == SYS_eaccess) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				accessmodename ((int)*ip);
+				break;
+			case SYS_access:
+			case SYS_eaccess:
+				print_number(ip, narg, c);
+				putchar(',');
+				accessmodename(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_open) {
-				int	flags;
-				int	mode;
-				print_number(ip,narg,c);
-				flags = *ip;
-				mode = *++ip;
-				(void)putchar(',');
-				flagsandmodename (flags, mode, decimal);
-				ip++;
-				narg-=2;
-			} else if (ktr->ktr_code == SYS_wait4) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				wait4optname ((int)*ip);
+				break;
+			case SYS_open:
+				print_number(ip, narg, c);
+				putchar(',');
+				flagsandmodename(ip[0], ip[1], decimal);
+				ip += 2;
+				narg -= 2;
+				break;
+			case SYS_wait4:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				wait4optname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_chmod ||
-				   ktr->ktr_code == SYS_fchmod ||
-				   ktr->ktr_code == SYS_lchmod) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				modename ((int)*ip);
+				break;
+			case SYS_chmod:
+			case SYS_fchmod:
+			case SYS_lchmod:
+				print_number(ip, narg, c);
+				putchar(',');
+				modename(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_mknod) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				modename ((int)*ip);
+				break;
+			case SYS_mknod:
+				print_number(ip, narg, c);
+				putchar(',');
+				modename(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_getfsstat) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				getfsstatflagsname ((int)*ip);
+				break;
+			case SYS_getfsstat:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				getfsstatflagsname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_mount) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				mountflagsname ((int)*ip);
+				break;
+			case SYS_mount:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				mountflagsname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_unmount) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				mountflagsname ((int)*ip);
+				break;
+			case SYS_unmount:
+				print_number(ip, narg, c);
+				putchar(',');
+				mountflagsname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_recvmsg ||
-				   ktr->ktr_code == SYS_sendmsg) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				sendrecvflagsname ((int)*ip);
+				break;
+			case SYS_recvmsg:
+			case SYS_sendmsg:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				sendrecvflagsname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_recvfrom ||
-				   ktr->ktr_code == SYS_sendto) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				sendrecvflagsname ((int)*ip);
+				break;
+			case SYS_recvfrom:
+			case SYS_sendto:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				sendrecvflagsname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_chflags ||
-				   ktr->ktr_code == SYS_fchflags ||
-				   ktr->ktr_code == SYS_lchflags) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				modename((int)*ip);
+				break;
+			case SYS_chflags:
+			case SYS_fchflags:
+			case SYS_lchflags:
+				print_number(ip, narg, c);
+				putchar(',');
+				modename(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_kill) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				signame((int)*ip);
+				break;
+			case SYS_kill:
+				print_number(ip, narg, c);
+				putchar(',');
+				signame(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_reboot) {
-				(void)putchar('(');
-				rebootoptname((int)*ip);
+				break;
+			case SYS_reboot:
+				putchar('(');
+				rebootoptname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_umask) {
-				(void)putchar('(');
-				modename((int)*ip);
+				break;
+			case SYS_umask:
+				putchar('(');
+				modename(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_msync) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				msyncflagsname((int)*ip);
+				break;
+			case SYS_msync:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				msyncflagsname(*ip);
 				ip++;
 				narg--;
+				break;
 #ifdef SYS_freebsd6_mmap
-			} else if (ktr->ktr_code == SYS_freebsd6_mmap) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				mmapprotname ((int)*ip);
-				(void)putchar(',');
+			case SYS_freebsd6_mmap:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				mmapprotname(*ip);
+				putchar(',');
 				ip++;
 				narg--;
-				mmapflagsname ((int)*ip);
+				mmapflagsname(*ip);
 				ip++;
 				narg--;
+				break;
 #endif
-			} else if (ktr->ktr_code == SYS_mmap) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				mmapprotname ((int)*ip);
-				(void)putchar(',');
+			case SYS_mmap:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				mmapprotname(*ip);
+				putchar(',');
 				ip++;
 				narg--;
-				mmapflagsname ((int)*ip);
+				mmapflagsname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_mprotect) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				mmapprotname ((int)*ip);
+				break;
+			case SYS_mprotect:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				mmapprotname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_madvise) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				madvisebehavname((int)*ip);
+				break;
+			case SYS_madvise:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				madvisebehavname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_setpriority) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				prioname((int)*ip);
+				break;
+			case SYS_setpriority:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				prioname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_fcntl) {
-				int cmd;
-				int arg;
-				print_number(ip,narg,c);
-				cmd = *ip;
-				arg = *++ip;
-				(void)putchar(',');
-				fcntlcmdname(cmd, arg, decimal);
-				ip++;
-				narg-=2;
-			} else if (ktr->ktr_code == SYS_socket) {
+				break;
+			case SYS_fcntl:
+				print_number(ip, narg, c);
+				putchar(',');
+				fcntlcmdname(ip[0], ip[1], decimal);
+				ip += 2;
+				narg -= 2;
+				break;
+			case SYS_socket: {
 				int sockdomain;
-				(void)putchar('(');
-				sockdomain=(int)*ip;
+				putchar('(');
+				sockdomain = *ip;
 				sockdomainname(sockdomain);
 				ip++;
 				narg--;
-				(void)putchar(',');
-				socktypename((int)*ip);
+				putchar(',');
+				socktypename(*ip);
 				ip++;
 				narg--;
 				if (sockdomain == PF_INET ||
 				    sockdomain == PF_INET6) {
-					(void)putchar(',');
-					sockipprotoname((int)*ip);
+					putchar(',');
+					sockipprotoname(*ip);
 					ip++;
 					narg--;
 				}
 				c = ',';
-			} else if (ktr->ktr_code == SYS_setsockopt ||
-				   ktr->ktr_code == SYS_getsockopt) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				sockoptlevelname((int)*ip, decimal);
-				if ((int)*ip == SOL_SOCKET) {
+				break;
+			}
+			case SYS_setsockopt:
+			case SYS_getsockopt:
+				print_number(ip, narg, c);
+				putchar(',');
+				sockoptlevelname(*ip, decimal);
+				if (*ip == SOL_SOCKET) {
 					ip++;
 					narg--;
-					(void)putchar(',');
-					sockoptname((int)*ip);
+					putchar(',');
+					sockoptname(*ip);
 				}
 				ip++;
 				narg--;
+				break;
 #ifdef SYS_freebsd6_lseek
-			} else if (ktr->ktr_code == SYS_freebsd6_lseek) {
-				print_number(ip,narg,c);
+			case SYS_freebsd6_lseek:
+				print_number(ip, narg, c);
 				/* Hidden 'pad' argument, not in lseek(2) */
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				whencename ((int)*ip);
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				whencename(*ip);
 				ip++;
 				narg--;
+				break;
 #endif
-			} else if (ktr->ktr_code == SYS_lseek) {
-				print_number(ip,narg,c);
+			case SYS_lseek:
+				print_number(ip, narg, c);
 				/* Hidden 'pad' argument, not in lseek(2) */
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				whencename ((int)*ip);
+				print_number(ip, narg, c);
+				putchar(',');
+				whencename(*ip);
 				ip++;
 				narg--;
-
-			} else if (ktr->ktr_code == SYS_flock) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				flockname((int)*ip);
+				break;
+			case SYS_flock:
+				print_number(ip, narg, c);
+				putchar(',');
+				flockname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_mkfifo ||
-				   ktr->ktr_code == SYS_mkdir) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				modename((int)*ip);
+				break;
+			case SYS_mkfifo:
+			case SYS_mkdir:
+				print_number(ip, narg, c);
+				putchar(',');
+				modename(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_shutdown) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				shutdownhowname((int)*ip);
+				break;
+			case SYS_shutdown:
+				print_number(ip, narg, c);
+				putchar(',');
+				shutdownhowname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_socketpair) {
-				(void)putchar('(');
-				sockdomainname((int)*ip);
+				break;
+			case SYS_socketpair:
+				putchar('(');
+				sockdomainname(*ip);
 				ip++;
 				narg--;
-				(void)putchar(',');
-				socktypename((int)*ip);
+				putchar(',');
+				socktypename(*ip);
 				ip++;
 				narg--;
 				c = ',';
-			} else if (ktr->ktr_code == SYS_getrlimit ||
-				   ktr->ktr_code == SYS_setrlimit) {
-				(void)putchar('(');
-				rlimitname((int)*ip);
+				break;
+			case SYS_getrlimit:
+			case SYS_setrlimit:
+				putchar('(');
+				rlimitname(*ip);
 				ip++;
 				narg--;
 				c = ',';
-			} else if (ktr->ktr_code == SYS_quotactl) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				quotactlname((int)*ip);
+				break;
+			case SYS_quotactl:
+				print_number(ip, narg, c);
+				putchar(',');
+				quotactlname(*ip);
 				ip++;
 				narg--;
 				c = ',';
-			} else if (ktr->ktr_code == SYS_nfssvc) {
-				(void)putchar('(');
-				nfssvcname((int)*ip);
+				break;
+			case SYS_nfssvc:
+				putchar('(');
+				nfssvcname(*ip);
 				ip++;
 				narg--;
 				c = ',';
-			} else if (ktr->ktr_code == SYS_rtprio) {
-				(void)putchar('(');
-				rtprioname((int)*ip);
+				break;
+			case SYS_rtprio:
+				putchar('(');
+				rtprioname(*ip);
 				ip++;
 				narg--;
 				c = ',';
-			} else if (ktr->ktr_code == SYS___semctl) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				semctlname((int)*ip);
+				break;
+			case SYS___semctl:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				semctlname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_semget) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				semgetname((int)*ip);
+				break;
+			case SYS_semget:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				semgetname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_msgctl) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				shmctlname((int)*ip);
+				break;
+			case SYS_msgctl:
+				print_number(ip, narg, c);
+				putchar(',');
+				shmctlname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_shmat) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				shmatname((int)*ip);
+				break;
+			case SYS_shmat:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				shmatname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_shmctl) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				shmctlname((int)*ip);
+				break;
+			case SYS_shmctl:
+				print_number(ip, narg, c);
+				putchar(',');
+				shmctlname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_minherit) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				minheritname((int)*ip);
+				break;
+			case SYS_minherit:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				minheritname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_rfork) {
-				(void)putchar('(');
-				rforkname((int)*ip);
+				break;
+			case SYS_rfork:
+				putchar('(');
+				rforkname(*ip);
 				ip++;
 				narg--;
 				c = ',';
-			} else if (ktr->ktr_code == SYS_lio_listio) {
-				(void)putchar('(');
-				lio_listioname((int)*ip);
+				break;
+			case SYS_lio_listio:
+				putchar('(');
+				lio_listioname(*ip);
 				ip++;
 				narg--;
 				c = ',';
-			} else if (ktr->ktr_code == SYS_mlockall) {
-				(void)putchar('(');
-				mlockallname((int)*ip);
+				break;
+			case SYS_mlockall:
+				putchar('(');
+				mlockallname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_sched_setscheduler) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				schedpolicyname((int)*ip);
+				break;
+			case SYS_sched_setscheduler:
+				print_number(ip, narg, c);
+				putchar(',');
+				schedpolicyname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_sched_get_priority_max ||
-				   ktr->ktr_code == SYS_sched_get_priority_min) {
-				(void)putchar('(');
-				schedpolicyname((int)*ip);
-				ip++;
-				narg--;
-			} else if (ktr->ktr_code == SYS_sendfile) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				sendfileflagsname((int)*ip);
+				break;
+			case SYS_sched_get_priority_max:
+			case SYS_sched_get_priority_min:
+				putchar('(');
+				schedpolicyname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_kldsym) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				kldsymcmdname((int)*ip);
+				break;
+			case SYS_sendfile:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				sendfileflagsname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_sigprocmask) {
-				(void)putchar('(');
-				sigprocmaskhowname((int)*ip);
+				break;
+			case SYS_kldsym:
+				print_number(ip, narg, c);
+				putchar(',');
+				kldsymcmdname(*ip);
+				ip++;
+				narg--;
+				break;
+			case SYS_sigprocmask:
+				putchar('(');
+				sigprocmaskhowname(*ip);
 				ip++;
 				narg--;
 				c = ',';
-			} else if (ktr->ktr_code == SYS___acl_get_file ||
-				   ktr->ktr_code == SYS___acl_set_file ||
-				   ktr->ktr_code == SYS___acl_get_fd ||
-				   ktr->ktr_code == SYS___acl_set_fd ||
-				   ktr->ktr_code == SYS___acl_delete_file ||
-				   ktr->ktr_code == SYS___acl_delete_fd ||
-				   ktr->ktr_code == SYS___acl_aclcheck_file ||
-				   ktr->ktr_code == SYS___acl_aclcheck_fd ||
-				   ktr->ktr_code == SYS___acl_get_link ||
-				   ktr->ktr_code == SYS___acl_set_link ||
-				   ktr->ktr_code == SYS___acl_delete_link ||
-				   ktr->ktr_code == SYS___acl_aclcheck_link) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				acltypename((int)*ip);
+				break;
+			case SYS___acl_get_file:
+			case SYS___acl_set_file:
+			case SYS___acl_get_fd:
+			case SYS___acl_set_fd:
+			case SYS___acl_delete_file:
+			case SYS___acl_delete_fd:
+			case SYS___acl_aclcheck_file:
+			case SYS___acl_aclcheck_fd:
+			case SYS___acl_get_link:
+			case SYS___acl_set_link:
+			case SYS___acl_delete_link:
+			case SYS___acl_aclcheck_link:
+				print_number(ip, narg, c);
+				putchar(',');
+				acltypename(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_sigaction) {
-				(void)putchar('(');
-				signame((int)*ip);
+				break;
+			case SYS_sigaction:
+				putchar('(');
+				signame(*ip);
 				ip++;
 				narg--;
 				c = ',';
-			} else if (ktr->ktr_code == SYS_extattrctl) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				extattrctlname((int)*ip);
+				break;
+			case SYS_extattrctl:
+				print_number(ip, narg, c);
+				putchar(',');
+				extattrctlname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_nmount) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				mountflagsname ((int)*ip);
+				break;
+			case SYS_nmount:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				mountflagsname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_thr_create) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				thrcreateflagsname ((int)*ip);
+				break;
+			case SYS_thr_create:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				putchar(',');
+				thrcreateflagsname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_thr_kill) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				signame ((int)*ip);
+				break;
+			case SYS_thr_kill:
+				print_number(ip, narg, c);
+				putchar(',');
+				signame(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_kldunloadf) {
-				print_number(ip,narg,c);
-				(void)putchar(',');
-				kldunloadfflagsname ((int)*ip);
+				break;
+			case SYS_kldunloadf:
+				print_number(ip, narg, c);
+				putchar(',');
+				kldunloadfflagsname(*ip);
 				ip++;
 				narg--;
-			} else if (ktr->ktr_code == SYS_posix_fadvise) {
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
-				print_number(ip,narg,c);
+				break;
+			case SYS_posix_fadvise:
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
 				(void)putchar(',');
 				fadvisebehavname((int)*ip);
 				ip++;
 				narg--;
+				break;
 			}
 		}
 		while (narg > 0) {
-			print_number(ip,narg,c);
+			print_number(ip, narg, c);
 		}
-		(void)putchar(')');
+		putchar(')');
 	}
-	(void)putchar('\n');
+	putchar('\n');
 }
 
 void

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-stable-9 mailing list