CVS commit: src/usr.bin/kdump

2024-03-16 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Sat Mar 16 23:40:26 UTC 2024

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Remove debug print


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2024-03-16 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Sat Mar 16 23:40:26 UTC 2024

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Remove debug print


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.144 src/usr.bin/kdump/kdump.c:1.145
--- src/usr.bin/kdump/kdump.c:1.144	Sun Mar 10 18:54:41 2024
+++ src/usr.bin/kdump/kdump.c	Sat Mar 16 23:40:25 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.144 2024/03/10 18:54:41 rillig Exp $	*/
+/*	$NetBSD: kdump.c,v 1.145 2024/03/16 23:40:25 ryoon Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.144 2024/03/10 18:54:41 rillig Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.145 2024/03/16 23:40:25 ryoon Exp $");
 #endif
 #endif /* not lint */
 
@@ -900,7 +900,6 @@ ktrsyscall(struct ktr_syscall *ktr)
 			ap++;
 			argcount--;
 			register_t level = *ap;
-			fprintf(stderr, "level=%jx\n", (intmax_t)level);
 			if ((cp = sockproto(level)) != NULL) {
 (void)printf(",%s", cp);
 			} else {



CVS commit: src/usr.bin/kdump

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 18:54:41 UTC 2024

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
kdump: keep the comment with its corresponding code

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.143 src/usr.bin/kdump/kdump.c:1.144
--- src/usr.bin/kdump/kdump.c:1.143	Sun Mar 10 17:08:31 2024
+++ src/usr.bin/kdump/kdump.c	Sun Mar 10 18:54:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.143 2024/03/10 17:08:31 christos Exp $	*/
+/*	$NetBSD: kdump.c,v 1.144 2024/03/10 18:54:41 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.143 2024/03/10 17:08:31 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.144 2024/03/10 18:54:41 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -892,11 +892,6 @@ ktrsyscall(struct ktr_syscall *ktr)
 			argcount--;
 			c = ',';
 
-			/*
-			 * Linux name is "futex".
-			 * Native name is "__futex".
-			 * Both have the same op argument.
-			 */
 		} else if ((strcmp(sys_name, "setsockopt") == 0 ||
 		strcmp(sys_name, "getsockopt") == 0 ||
 		strcmp(sys_name, "getsockopt2") == 0) && argcount >= 3) {
@@ -940,9 +935,15 @@ ktrsyscall(struct ktr_syscall *ktr)
 			ap++;
 			argcount--;
 			c = ',';
+
 		} else if ((strcmp(sys_name, "futex") == 0 ||
 			strcmp(sys_name, "__futex") == 0) &&
 			   argcount > 2) {
+			/*
+			 * Linux name is "futex".
+			 * Native name is "__futex".
+			 * Both have the same op argument.
+			 */
 			(void)putchar('(');
 			output_long((long)*ap, 1);
 			(void)putchar(',');



CVS commit: src/usr.bin/kdump

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 18:54:41 UTC 2024

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
kdump: keep the comment with its corresponding code

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2024-03-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 10 17:08:31 UTC 2024

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
decode some {g,s}etsockopt*.


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.142 src/usr.bin/kdump/kdump.c:1.143
--- src/usr.bin/kdump/kdump.c:1.142	Sat Feb 10 20:08:57 2024
+++ src/usr.bin/kdump/kdump.c	Sun Mar 10 13:08:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.142 2024/02/11 01:08:57 kre Exp $	*/
+/*	$NetBSD: kdump.c,v 1.143 2024/03/10 17:08:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.142 2024/02/11 01:08:57 kre Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.143 2024/03/10 17:08:31 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -69,11 +69,16 @@ __RCSID("$NetBSD: kdump.c,v 1.142 2024/0
 #include 
 #include 
 
+#include 
+#include 
+
 #include "ktrace.h"
 #include "setemul.h"
 
 #include 
 
+#define	CASERETURN(a)	case a:	return # a
+
 #define TIMESTAMP_NONE		0x0
 #define TIMESTAMP_ABSOLUTE	0x1
 #define TIMESTAMP_ELAPSED	0x2
@@ -552,23 +557,152 @@ output_long(u_long it, int as_x)
 static const char *
 fcntlname(u_long cmd)
 {
-#define	FCNTLCASE(a)	case a:	return # a
 	switch (cmd) {
-	FCNTLCASE(F_DUPFD);
-	FCNTLCASE(F_GETFD);
-	FCNTLCASE(F_SETFD);
-	FCNTLCASE(F_GETFL);
-	FCNTLCASE(F_SETFL);
-	FCNTLCASE(F_GETOWN);
-	FCNTLCASE(F_SETOWN);
-	FCNTLCASE(F_GETLK);
-	FCNTLCASE(F_SETLK);
-	FCNTLCASE(F_SETLKW);
-	FCNTLCASE(F_CLOSEM);
-	FCNTLCASE(F_MAXFD);
-	FCNTLCASE(F_DUPFD_CLOEXEC);
-	FCNTLCASE(F_GETNOSIGPIPE);
-	FCNTLCASE(F_SETNOSIGPIPE);
+	CASERETURN(F_DUPFD);
+	CASERETURN(F_GETFD);
+	CASERETURN(F_SETFD);
+	CASERETURN(F_GETFL);
+	CASERETURN(F_SETFL);
+	CASERETURN(F_GETOWN);
+	CASERETURN(F_SETOWN);
+	CASERETURN(F_GETLK);
+	CASERETURN(F_SETLK);
+	CASERETURN(F_SETLKW);
+	CASERETURN(F_CLOSEM);
+	CASERETURN(F_MAXFD);
+	CASERETURN(F_DUPFD_CLOEXEC);
+	CASERETURN(F_GETNOSIGPIPE);
+	CASERETURN(F_SETNOSIGPIPE);
+	default:
+		return NULL;
+	}
+}
+
+static const char *
+sockproto(register_t proto)
+{
+	switch (proto) {
+	CASERETURN(IPPROTO_IP);
+	CASERETURN(IPPROTO_ICMP);
+	CASERETURN(IPPROTO_IGMP);
+	CASERETURN(IPPROTO_GGP);
+//	CASERETURN(IPPROTO_IPV4);
+	CASERETURN(IPPROTO_IPIP);
+	CASERETURN(IPPROTO_TCP);
+	CASERETURN(IPPROTO_EGP);
+	CASERETURN(IPPROTO_PUP);
+	CASERETURN(IPPROTO_UDP);
+	CASERETURN(IPPROTO_IDP);
+	CASERETURN(IPPROTO_TP);
+	CASERETURN(IPPROTO_DCCP);
+	CASERETURN(IPPROTO_IPV6);
+	CASERETURN(IPPROTO_ROUTING);
+	CASERETURN(IPPROTO_FRAGMENT);
+	CASERETURN(IPPROTO_RSVP);
+	CASERETURN(IPPROTO_GRE);
+	CASERETURN(IPPROTO_ESP);
+	CASERETURN(IPPROTO_AH);
+	CASERETURN(IPPROTO_MOBILE);
+//	CASERETURN(IPPROTO_IPV6_ICMP);
+	CASERETURN(IPPROTO_ICMPV6);
+	CASERETURN(IPPROTO_NONE);
+	CASERETURN(IPPROTO_DSTOPTS);
+	CASERETURN(IPPROTO_EON);
+	CASERETURN(IPPROTO_ETHERIP);
+	CASERETURN(IPPROTO_ENCAP);
+	CASERETURN(IPPROTO_PIM);
+	CASERETURN(IPPROTO_IPCOMP);
+	CASERETURN(IPPROTO_VRRP);
+//	CASERETURN(IPPROTO_CARP);
+	CASERETURN(IPPROTO_L2TP);
+	CASERETURN(IPPROTO_SCTP);
+	CASERETURN(IPPROTO_PFSYNC);
+	CASERETURN(IPPROTO_RAW);
+	CASERETURN(IPPROTO_MAX);
+	CASERETURN(IPPROTO_DONE);
+	CASERETURN(SOL_SOCKET);
+	default:
+		return NULL;
+	}
+}
+
+static const char *
+sockoptname(register_t optname)
+{
+	switch (optname) {
+	CASERETURN(SO_ACCEPTCONN);
+	CASERETURN(SO_ACCEPTFILTER);
+	CASERETURN(SO_BROADCAST);
+	CASERETURN(SO_DEBUG);
+	CASERETURN(SO_DONTROUTE);
+	CASERETURN(SO_ERROR);
+	CASERETURN(SO_KEEPALIVE);
+	CASERETURN(SO_LINGER);
+	CASERETURN(SO_NOHEADER);
+	CASERETURN(SO_NOSIGPIPE);
+	CASERETURN(SO_OOBINLINE);
+	CASERETURN(SO_OVERFLOWED);
+	CASERETURN(SO_RCVBUF);
+	CASERETURN(SO_RCVLOWAT);
+	CASERETURN(SO_RCVTIMEO);
+	CASERETURN(SO_RERROR);
+	CASERETURN(SO_REUSEADDR);
+	CASERETURN(SO_REUSEPORT);
+	CASERETURN(SO_SNDBUF);
+	CASERETURN(SO_SNDLOWAT);
+	CASERETURN(SO_SNDTIMEO);
+	CASERETURN(SO_TIMESTAMP);
+	CASERETURN(SO_TYPE);
+	CASERETURN(SO_USELOOPBACK);
+	default:
+		return NULL;
+	}
+}
+
+static const char *
+tcpoptname(register_t optname)
+{
+	switch (optname) {
+	CASERETURN(TCP_NODELAY);
+	CASERETURN(TCP_MAXSEG);
+	CASERETURN(TCP_MD5SIG);
+	CASERETURN(TCP_KEEPIDLE);
+	CASERETURN(TCP_KEEPINTVL);
+	CASERETURN(TCP_KEEPCNT);
+	CASERETURN(TCP_KEEPINIT);
+	CASERETURN(TCP_INFO);
+	default:
+		return NULL;
+	}
+}
+
+static const char *
+ipoptname(register_t optname)
+{
+	switch (optname) {
+	CASERETURN(IP_OPTIONS);
+	CASERETURN(IP_HDRINCL);
+	CASERETURN(IP_TOS);
+	CASERETURN(IP_TTL);
+	CASERETURN(IP_RECVOPTS);
+	CASERETURN(IP_RECVRETOPTS);
+	CASERETURN(IP_RECVDSTADDR);
+	CASERETURN(IP_RETOPTS);
+	CASERETURN(IP_MULTICAST_IF);
+	CASERETURN(IP_MULTICAST_TTL);
+	

CVS commit: src/usr.bin/kdump

2024-03-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 10 17:08:31 UTC 2024

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
decode some {g,s}etsockopt*.


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2024-02-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Feb 11 01:08:57 UTC 2024

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
PR bin/57918

Redo the previous correctly, the test should be whether or not only the
bottom 32 bits are set, rather than whether any of bits 32..63 are set.
This makes no difference if u_long (or unsigned long long) is 64 bits,
it is the same test in that case, but if u_long were 128 bits there is
a notable difference (though for the particular issue observed in the PR,
it is likely to work either way).


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2024-02-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Feb 11 01:08:57 UTC 2024

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
PR bin/57918

Redo the previous correctly, the test should be whether or not only the
bottom 32 bits are set, rather than whether any of bits 32..63 are set.
This makes no difference if u_long (or unsigned long long) is 64 bits,
it is the same test in that case, but if u_long were 128 bits there is
a notable difference (though for the particular issue observed in the PR,
it is likely to work either way).


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.141 src/usr.bin/kdump/kdump.c:1.142
--- src/usr.bin/kdump/kdump.c:1.141	Sat Feb 10 12:53:36 2024
+++ src/usr.bin/kdump/kdump.c	Sun Feb 11 01:08:57 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.141 2024/02/10 12:53:36 christos Exp $	*/
+/*	$NetBSD: kdump.c,v 1.142 2024/02/11 01:08:57 kre Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.141 2024/02/10 12:53:36 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.142 2024/02/11 01:08:57 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -580,7 +580,7 @@ ioctldecode(u_long cmd)
 	char dirbuf[4], *dir = dirbuf;
 	int c;
 
-	if (0xULL & cmd) {
+	if (~0xULL & cmd) {
 		output_long(cmd, 1);
 		return;
 	}



CVS commit: src/usr.bin/kdump

2024-02-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 10 12:53:36 UTC 2024

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
PR/57918: Taylor R Campbell: Don't try to print symbolically ioctls that
have bits set on the high 32 bits of a 64 bit long.


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.140 src/usr.bin/kdump/kdump.c:1.141
--- src/usr.bin/kdump/kdump.c:1.140	Sat Jun 19 20:25:29 2021
+++ src/usr.bin/kdump/kdump.c	Sat Feb 10 07:53:36 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.140 2021/06/20 00:25:29 chs Exp $	*/
+/*	$NetBSD: kdump.c,v 1.141 2024/02/10 12:53:36 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.140 2021/06/20 00:25:29 chs Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.141 2024/02/10 12:53:36 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -580,6 +580,11 @@ ioctldecode(u_long cmd)
 	char dirbuf[4], *dir = dirbuf;
 	int c;
 
+	if (0xULL & cmd) {
+		output_long(cmd, 1);
+		return;
+	}
+
 	if (cmd & IOC_IN)
 		*dir++ = 'W';
 	if (cmd & IOC_OUT)



CVS commit: src/usr.bin/kdump

2024-02-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 10 12:53:36 UTC 2024

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
PR/57918: Taylor R Campbell: Don't try to print symbolically ioctls that
have bits set on the high 32 bits of a 64 bit long.


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2022-09-01 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Fri Sep  2 03:39:29 UTC 2022

Modified Files:
src/usr.bin/kdump: kdump.1

Log Message:
kdump.1: use past tense for history


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/kdump/kdump.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.1
diff -u src/usr.bin/kdump/kdump.1:1.30 src/usr.bin/kdump/kdump.1:1.31
--- src/usr.bin/kdump/kdump.1:1.30	Thu Apr  2 08:35:12 2020
+++ src/usr.bin/kdump/kdump.1	Fri Sep  2 03:39:29 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kdump.1,v 1.30 2020/04/02 08:35:12 wiz Exp $
+.\"	$NetBSD: kdump.1,v 1.31 2022/09/02 03:39:29 gutteridge Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -123,5 +123,5 @@ Supported values are 1, 2, 4, 8, and 16.
 .Sh HISTORY
 The
 .Nm
-command appears in
+command appeared in
 .Bx 4.4 .



CVS commit: src/usr.bin/kdump

2022-09-01 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Fri Sep  2 03:39:29 UTC 2022

Modified Files:
src/usr.bin/kdump: kdump.1

Log Message:
kdump.1: use past tense for history


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/kdump/kdump.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2021-06-19 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Jun 20 00:25:29 UTC 2021

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
fix printf format string for xattr names (the length of the xattr name
needs to be a precision rather than a width).


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.139 src/usr.bin/kdump/kdump.c:1.140
--- src/usr.bin/kdump/kdump.c:1.139	Thu Apr 30 15:12:25 2020
+++ src/usr.bin/kdump/kdump.c	Sun Jun 20 00:25:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.139 2020/04/30 15:12:25 martin Exp $	*/
+/*	$NetBSD: kdump.c,v 1.140 2021/06/20 00:25:29 chs Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.139 2020/04/30 15:12:25 martin Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.140 2021/06/20 00:25:29 chs Exp $");
 #endif
 #endif /* not lint */
 
@@ -1288,7 +1288,7 @@ ktruser_soname(const char *name, const v
 static void
 ktruser_xattr_name(const char *name, const void *buf, size_t len)
 {
-	printf("%.*s: [%*s]\n", KTR_USER_MAXIDLEN, name, (int)len,
+	printf("%.*s: [%.*s]\n", KTR_USER_MAXIDLEN, name, (int)len,
 	(const char *)buf);
 }
 



CVS commit: src/usr.bin/kdump

2021-06-19 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Jun 20 00:25:29 UTC 2021

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
fix printf format string for xattr names (the length of the xattr name
needs to be a precision rather than a width).


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2020-09-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Sep 12 01:36:26 UTC 2020

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
kdump: include netinet/in_var.h to access in_nbrinfo


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/mkioctls
diff -u src/usr.bin/kdump/mkioctls:1.56 src/usr.bin/kdump/mkioctls:1.57
--- src/usr.bin/kdump/mkioctls:1.56	Thu Apr  2 21:36:03 2020
+++ src/usr.bin/kdump/mkioctls	Sat Sep 12 01:36:26 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mkioctls,v 1.56 2020/04/02 21:36:03 christos Exp $
+#	$NetBSD: mkioctls,v 1.57 2020/09/12 01:36:26 roy Exp $
 #
 # Copyright (c) 1994
 #	The Regents of the University of California.  All rights reserved.
@@ -67,6 +67,7 @@ echo "#include "
 echo "#include "
 echo "#include "
 echo "#include "
+echo "#include "
 echo "#include "
 echo "#include "
 echo "#include "



CVS commit: src/usr.bin/kdump

2020-09-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Sep 12 01:36:26 UTC 2020

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
kdump: include netinet/in_var.h to access in_nbrinfo


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2020-04-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 30 15:12:25 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
futexput: cast the mask to u_long (as the op already is)


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.138 src/usr.bin/kdump/kdump.c:1.139
--- src/usr.bin/kdump/kdump.c:1.138	Thu Apr 30 12:17:01 2020
+++ src/usr.bin/kdump/kdump.c	Thu Apr 30 15:12:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.138 2020/04/30 12:17:01 thorpej Exp $	*/
+/*	$NetBSD: kdump.c,v 1.139 2020/04/30 15:12:25 martin Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.138 2020/04/30 12:17:01 thorpej Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.139 2020/04/30 15:12:25 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -661,7 +661,7 @@ futexput(u_long op)
 	const char *s = "";
 
 	if (opname == NULL) {
-		printf("%#lx", op & FUTEX_CMD_MASK);
+		printf("%#lx", op & (u_long)FUTEX_CMD_MASK);
 	} else {
 		fputs(opname, stdout);
 	}



CVS commit: src/usr.bin/kdump

2020-04-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 30 15:12:25 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
futexput: cast the mask to u_long (as the op already is)


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2020-04-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Apr 30 12:17:02 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Decode futex op codes.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.137 src/usr.bin/kdump/kdump.c:1.138
--- src/usr.bin/kdump/kdump.c:1.137	Mon Apr 20 00:35:41 2020
+++ src/usr.bin/kdump/kdump.c	Thu Apr 30 12:17:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.137 2020/04/20 00:35:41 christos Exp $	*/
+/*	$NetBSD: kdump.c,v 1.138 2020/04/30 12:17:01 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.137 2020/04/20 00:35:41 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.138 2020/04/30 12:17:01 thorpej Exp $");
 #endif
 #endif /* not lint */
 
@@ -55,6 +55,7 @@ __RCSID("$NetBSD: kdump.c,v 1.137 2020/0
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -629,6 +630,59 @@ putprot(int pr)
 	}
 }
 
+static const char *
+futex_op_name(u_long op)
+{
+#define	FUTEXCASE(a)	case a:	return # a
+	switch (op & FUTEX_CMD_MASK) {
+	FUTEXCASE(FUTEX_WAIT);
+	FUTEXCASE(FUTEX_WAKE);
+	FUTEXCASE(FUTEX_FD);
+	FUTEXCASE(FUTEX_REQUEUE);
+	FUTEXCASE(FUTEX_CMP_REQUEUE);
+	FUTEXCASE(FUTEX_WAKE_OP);
+	FUTEXCASE(FUTEX_LOCK_PI);
+	FUTEXCASE(FUTEX_UNLOCK_PI);
+	FUTEXCASE(FUTEX_TRYLOCK_PI);
+	FUTEXCASE(FUTEX_WAIT_BITSET);
+	FUTEXCASE(FUTEX_WAKE_BITSET);
+	FUTEXCASE(FUTEX_WAIT_REQUEUE_PI);
+	FUTEXCASE(FUTEX_CMP_REQUEUE_PI);
+	default:
+		return NULL;
+	}
+#undef FUTEXCASE
+}
+
+static void
+futexput(u_long op)
+{
+	const char *opname = futex_op_name(op);
+	const char *s = "";
+
+	if (opname == NULL) {
+		printf("%#lx", op & FUTEX_CMD_MASK);
+	} else {
+		fputs(opname, stdout);
+	}
+	op &= ~FUTEX_CMD_MASK;
+
+	if (op & FUTEX_PRIVATE_FLAG) {
+		fputs("_PRIVATE", stdout);
+		op &= ~FUTEX_PRIVATE_FLAG;
+	}
+
+	if (op & FUTEX_CLOCK_REALTIME) {
+		printf("%sFUTEX_CLOCK_REALTIME", s);
+		op &= ~FUTEX_CLOCK_REALTIME;
+		s = "|";
+	}
+
+	if (op) {
+		printf("%s%#lx", s, op);
+	}
+}
+
 static void
 ktrsyscall(struct ktr_syscall *ktr)
 {
@@ -699,6 +753,25 @@ ktrsyscall(struct ktr_syscall *ktr)
 			ap++;
 			argcount--;
 			c = ',';
+
+			/*
+			 * Linux name is "futex".
+			 * Native name is "__futex".
+			 * Both have the same op argument.
+			 */
+		} else if ((strcmp(sys_name, "futex") == 0 ||
+			strcmp(sys_name, "__futex") == 0) &&
+			   argcount > 2) {
+			(void)putchar('(');
+			output_long((long)*ap, 1);
+			(void)putchar(',');
+			ap++;
+			argcount--;
+			futexput(*ap);
+			ap++;
+			argcount--;
+			c = ',';
+
 		} else if ((strstr(sys_name, "sigaction") != NULL ||
 		strstr(sys_name, "sigvec") != NULL) && argcount >= 1) {
 			(void)printf("(SIG%s", signame(ap[0], 1));



CVS commit: src/usr.bin/kdump

2020-04-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Apr 30 12:17:02 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Decode futex op codes.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2020-04-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 20 00:35:42 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Understand xattr ktruser records


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.136 src/usr.bin/kdump/kdump.c:1.137
--- src/usr.bin/kdump/kdump.c:1.136	Fri Apr  3 02:13:07 2020
+++ src/usr.bin/kdump/kdump.c	Sun Apr 19 20:35:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.136 2020/04/03 06:13:07 wiz Exp $	*/
+/*	$NetBSD: kdump.c,v 1.137 2020/04/20 00:35:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.136 2020/04/03 06:13:07 wiz Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.137 2020/04/20 00:35:41 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -1213,6 +1213,36 @@ ktruser_soname(const char *name, const v
 }
 
 static void
+ktruser_xattr_name(const char *name, const void *buf, size_t len)
+{
+	printf("%.*s: [%*s]\n", KTR_USER_MAXIDLEN, name, (int)len,
+	(const char *)buf);
+}
+
+static void
+ktruser_xattr_val(const char *name, const void *buf, size_t len)
+{
+	const uint8_t *p = buf;
+	printf("%.*s: ", KTR_USER_MAXIDLEN, name);
+	for (size_t i = 0; i < len; i++)
+		printf("%.2x", *p++);
+	printf("\n");
+}
+
+static void
+ktruser_xattr_list(const char *name, const void *buf, size_t len)
+{
+	const uint8_t *p = buf, *ep = p + len;
+	printf("%.*s:", KTR_USER_MAXIDLEN, name);
+	while (p < ep) {
+		int l = *p++;
+		printf(" %.*s", l, p);
+		p += l;
+	}
+	printf("\n");
+}
+
+static void
 ktruser_control(const char *name, const void *buf, size_t len)
 {
 	struct cmsghdr m;
@@ -1266,6 +1296,9 @@ static struct {
 	{ "mbsoname", ktruser_soname },
 	{ "mbcontrol", ktruser_control },
 	{ "malloc", ktruser_malloc },
+	{ "xattr-name", ktruser_xattr_name },
+	{ "xattr-val", ktruser_xattr_val },
+	{ "xattr-list", ktruser_xattr_list },
 	{ NULL,	ktruser_misc },
 };
 



CVS commit: src/usr.bin/kdump

2020-04-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 20 00:35:42 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Understand xattr ktruser records


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2020-04-03 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Apr  3 06:13:07 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Update usage for ioctlprint.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.135 src/usr.bin/kdump/kdump.c:1.136
--- src/usr.bin/kdump/kdump.c:1.135	Thu Apr  2 17:41:34 2020
+++ src/usr.bin/kdump/kdump.c	Fri Apr  3 06:13:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.135 2020/04/02 17:41:34 christos Exp $	*/
+/*	$NetBSD: kdump.c,v 1.136 2020/04/03 06:13:07 wiz Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.135 2020/04/02 17:41:34 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.136 2020/04/03 06:13:07 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -1319,7 +1319,7 @@ static void
 usage(void)
 {
 	if (strcmp(getprogname(), "ioctlprint") == 0) {
-		(void)fprintf(stderr, "Usage: %s [-f format] [-e emulation]  ...\n",
+		(void)fprintf(stderr, "Usage: %s [-l] [-e emulation] [-f format]  ...\n",
 		getprogname());
 	} else {
 		(void)fprintf(stderr, "Usage: %s [-dElNnRT] [-e emulation] "



CVS commit: src/usr.bin/kdump

2020-04-03 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Apr  3 06:12:48 UTC 2020

Modified Files:
src/usr.bin/kdump: ioctlprint.1

Log Message:
Increase column widths. Improve -l description wording to match ioctl(2).
Fix Xr.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/kdump/ioctlprint.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/ioctlprint.1
diff -u src/usr.bin/kdump/ioctlprint.1:1.4 src/usr.bin/kdump/ioctlprint.1:1.5
--- src/usr.bin/kdump/ioctlprint.1:1.4	Thu Apr  2 17:41:34 2020
+++ src/usr.bin/kdump/ioctlprint.1	Fri Apr  3 06:12:48 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: ioctlprint.1,v 1.4 2020/04/02 17:41:34 christos Exp $
+.\" $NetBSD: ioctlprint.1,v 1.5 2020/04/03 06:12:48 wiz Exp $
 .\"
 .\" Copyright (c) 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -47,12 +47,11 @@ to by one or more
 .Ar arg
 arguments.
 The argument can either be an
-.Xr ioctl
-symbolic name or the
-ioctl value.
+.Xr ioctl 2
+symbolic name or the ioctl value.
 .Pp
 The options are as follows:
-.Bl -tag -width Fl
+.Bl -tag -width 12n
 .It Fl e Ar emulation
 If an emulation of a process is unknown,
 interpret system call maps assuming the named emulation instead of
@@ -65,7 +64,7 @@ style format string that allows customiz
 output.
 .Pp
 The following conversion characters can be used:
-.Bl -tag -width 
+.Bl -tag -width 9n
 .It \&%E
 Symbolic decoded ioctl string.
 .It \&%e
@@ -85,9 +84,9 @@ The default format is:
 "%n %e %x\\n"
 .Ed
 .It Fl l
-List all 
+List all known
 .Xr ioctl 2
-known.
+requests.
 .El
 .Sh SEE ALSO
 .Xr kdump 1 ,



CVS commit: src/usr.bin/kdump

2020-04-03 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Apr  3 06:13:07 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Update usage for ioctlprint.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2020-04-03 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Apr  3 06:12:48 UTC 2020

Modified Files:
src/usr.bin/kdump: ioctlprint.1

Log Message:
Increase column widths. Improve -l description wording to match ioctl(2).
Fix Xr.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/kdump/ioctlprint.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/usr.bin/kdump

2020-04-02 Thread Kamil Rytarowski
On 02.04.2020 23:35, Christos Zoulas wrote:
> Ah debugging remnants. I'll remove it. Can you look at PR/55128?
>

OK!

> static inline union savefpu *
> fpu_lwp_area(struct lwp *l)
> {
> struct pcb *pcb = lwp_getpcb(l);
> union savefpu *area = >pcb_savefpu;
>
> KASSERT((l->l_flag & LW_SYSTEM) == 0);
> if (l == curlwp) {
> fpu_save();
> }
> KASSERT(!(l->l_md.md_flags & MDL_FPU_IN_CPU)); <- this will fire if 
> the debugger calls it with l != curlew and it uses cpu
>
> return area;
> }
>
>
>> On Apr 2, 2020, at 5:31 PM, Kamil Rytarowski  wrote:
>>
>> On 02.04.2020 19:40, Christos Zoulas wrote:
>>> +set -x
>>> +AWK=gawk
>>> +
>>
>> gawk?
>



CVS commit: src/usr.bin/kdump

2020-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  2 21:36:04 UTC 2020

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
remove debugging


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2020-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  2 21:36:04 UTC 2020

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
remove debugging


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/mkioctls
diff -u src/usr.bin/kdump/mkioctls:1.55 src/usr.bin/kdump/mkioctls:1.56
--- src/usr.bin/kdump/mkioctls:1.55	Thu Apr  2 13:41:34 2020
+++ src/usr.bin/kdump/mkioctls	Thu Apr  2 17:36:03 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mkioctls,v 1.55 2020/04/02 17:41:34 christos Exp $
+#	$NetBSD: mkioctls,v 1.56 2020/04/02 21:36:03 christos Exp $
 #
 # Copyright (c) 1994
 #	The Regents of the University of California.  All rights reserved.
@@ -39,9 +39,6 @@
 : ${CC:=cc}
 : ${SED:=sed}
 
-set -x
-AWK=gawk
-
 echo "/* Automatically generated file, do not edit! */"
 #echo "#define const" 	# XXX: timepps lossage
 echo "#define COMPAT_43"



Re: CVS commit: src/usr.bin/kdump

2020-04-02 Thread Christos Zoulas
Ah debugging remnants. I'll remove it. Can you look at PR/55128?

static inline union savefpu *
fpu_lwp_area(struct lwp *l)
{
struct pcb *pcb = lwp_getpcb(l);
union savefpu *area = >pcb_savefpu;

KASSERT((l->l_flag & LW_SYSTEM) == 0);
if (l == curlwp) {
fpu_save();
}
KASSERT(!(l->l_md.md_flags & MDL_FPU_IN_CPU)); <- this will fire if the 
debugger calls it with l != curlew and it uses cpu

return area;
}


> On Apr 2, 2020, at 5:31 PM, Kamil Rytarowski  wrote:
> 
> On 02.04.2020 19:40, Christos Zoulas wrote:
>> +set -x
>> +AWK=gawk
>> +
> 
> gawk?



signature.asc
Description: Message signed with OpenPGP


Re: CVS commit: src/usr.bin/kdump

2020-04-02 Thread Kamil Rytarowski
On 02.04.2020 19:40, Christos Zoulas wrote:
> +set -x
> +AWK=gawk
> +

gawk?


CVS commit: src/usr.bin/kdump

2020-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  2 17:40:33 UTC 2020

Modified Files:
src/usr.bin/kdump: ioctlprint.1 kdump.c mkioctls


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/kdump/ioctlprint.1
cvs rdiff -u -r1.133 -r1.134 src/usr.bin/kdump/kdump.c
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2020-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  2 17:40:33 UTC 2020

Modified Files:
src/usr.bin/kdump: ioctlprint.1 kdump.c mkioctls


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/kdump/ioctlprint.1
cvs rdiff -u -r1.133 -r1.134 src/usr.bin/kdump/kdump.c
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/ioctlprint.1
diff -u src/usr.bin/kdump/ioctlprint.1:1.2 src/usr.bin/kdump/ioctlprint.1:1.3
--- src/usr.bin/kdump/ioctlprint.1:1.2	Thu Apr  2 04:38:22 2020
+++ src/usr.bin/kdump/ioctlprint.1	Thu Apr  2 13:40:33 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: ioctlprint.1,v 1.2 2020/04/02 08:38:22 wiz Exp $
+.\" $NetBSD: ioctlprint.1,v 1.3 2020/04/02 17:40:33 christos Exp $
 .\"
 .\" Copyright (c) 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,6 +35,7 @@
 .Nd display descriptive ioctl value
 .Sh SYNOPSIS
 .Nm
+.Op Fl l
 .Op Fl e Ar emulation
 .Op Fl f Ar format
 .Op Ar arg ...
@@ -45,6 +46,10 @@ utility displays information about the f
 to by one or more
 .Ar arg
 arguments.
+The argument can either be an
+.Xr ioctl
+symbolic name or the
+ioctl value.
 .Pp
 The options are as follows:
 .Bl -tag -width Fl
@@ -61,8 +66,10 @@ output.
 .Pp
 The following conversion characters can be used:
 .Bl -tag -width 
+.It \&%E
+Symbolic decoded ioctl string.
 .It \&%e
-Decoded ioctl string.
+Decoded ioctl string with hex values.
 .It \&%n
 Descriptive ioctl operation name.
 .It \&%x
@@ -77,6 +84,10 @@ The default format is:
 .Bd -literal -offset indent
 "%n %e %x\\n"
 .Ed
+.It Fl l
+List all 
+.Xr ioctl 2
+known.
 .El
 .Sh SEE ALSO
 .Xr kdump 1 ,

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.133 src/usr.bin/kdump/kdump.c:1.134
--- src/usr.bin/kdump/kdump.c:1.133	Wed Apr  1 23:32:46 2020
+++ src/usr.bin/kdump/kdump.c	Thu Apr  2 13:40:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.133 2020/04/02 03:32:46 kamil Exp $	*/
+/*	$NetBSD: kdump.c,v 1.134 2020/04/02 17:40:33 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.133 2020/04/02 03:32:46 kamil Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.134 2020/04/02 17:40:33 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -108,9 +108,9 @@ static const char * const linux_ptrace_o
 	"PTRACE_SYSCALL",
 };
 
-static const char default_format[] = { "%n %e %x\n" };
+static const char default_format[] = { "%n\t%E\t%x\n" };
 
-static void	fmtprint(const char *, unsigned long int);
+static void	fmtprint(const char *, const struct ioctlinfo *ii);
 static int	fread_tail(void *, size_t, size_t);
 static int	dumpheader(struct ktr_header *);
 static int	output_ts(const struct timespec *);
@@ -132,11 +132,11 @@ static void	rprint(register_t);
 static const char *signame(long, int);
 static void hexdump_buf(const void *, int, int);
 static void visdump_buf(const void *, int, int);
+static const struct ioctlinfo *find_ioctl(const char *);
 
 int
 main(int argc, char **argv)
 {
-	unsigned long int u;
 	unsigned int ktrlen, size;
 	int ch;
 	void *m;
@@ -145,15 +145,16 @@ main(int argc, char **argv)
 	const char *emul_name = "netbsd";
 	const char *format = default_format;
 	int col;
-	int e;
 	char *cp;
 
 	setprogname(argv[0]);
 
 	if (strcmp(getprogname(), "ioctlprint") == 0) {
+		const struct ioctlinfo *ii;
+		int list = 0;
 		int i;
 
-		while ((ch = getopt(argc, argv, "e:f:")) != -1)
+		while ((ch = getopt(argc, argv, "e:f:l")) != -1)
 			switch (ch) {
 			case 'e':
 emul_name = optarg;
@@ -163,22 +164,34 @@ main(int argc, char **argv)
 	errx(1, "Too many formats");
 format = optarg;
 break;
+			case 'l':
+list = 1;
+break;
 			default:
 usage();
 break;
 			}
+
 		setemul(emul_name, 0, 0);
 		argv += optind;
 		argc -= optind;
 
-		if (argc < 1)
+		if (argc < 1 && !list)
 			usage();
 
+		if (list) {
+			for (i = 0; ioctlinfo[i].name != NULL; i++) {
+fmtprint(format, [i]);
+			}
+			return 0;
+		}
+
 		for (i = 0; i < argc; i++) {
-			u = strtou(argv[i], NULL, 0, 0, ULONG_MAX, );
-			if (e)
-errc(1, e, "invalid argument: `%s'", argv[i]);
-			fmtprint(format, u);
+			if ((ii = find_ioctl(argv[i])) == NULL) {
+warnx("Can't find ioctl `%s'", argv[i]);
+continue;
+			}
+			fmtprint(format, ii);
 		}
 		return 0;
 	}
@@ -338,11 +351,11 @@ main(int argc, char **argv)
 }
 
 static void
-fmtprint(const char *fmt, unsigned long int u)
+fmtprint(const char *fmt, const struct ioctlinfo *ii)
 {
-	const char *name;
 	int c;
 
+
 	while ((c = *fmt++) != '\0') {
 		switch (c) {
 		default:
@@ -368,21 +381,23 @@ fmtprint(const char *fmt, unsigned long 
 			default:
 putchar(c);
 break;
+			case 'E':
+printf("%s", ii->expr);
+break;
 			

CVS commit: src/usr.bin/kdump

2020-04-02 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Apr  2 08:38:22 UTC 2020

Modified Files:
src/usr.bin/kdump: ioctlprint.1

Log Message:
Remove superfluous Pp. Add comma in enumeration. Add RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/kdump/ioctlprint.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/ioctlprint.1
diff -u src/usr.bin/kdump/ioctlprint.1:1.1 src/usr.bin/kdump/ioctlprint.1:1.2
--- src/usr.bin/kdump/ioctlprint.1:1.1	Thu Apr  2 03:32:46 2020
+++ src/usr.bin/kdump/ioctlprint.1	Thu Apr  2 08:38:22 2020
@@ -1,3 +1,4 @@
+.\" $NetBSD: ioctlprint.1,v 1.2 2020/04/02 08:38:22 wiz Exp $
 .\"
 .\" Copyright (c) 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -40,7 +41,8 @@
 .Sh DESCRIPTION
 The
 .Nm
-utility displays information about the file ioctl operation pointed to by one or more
+utility displays information about the file ioctl operation pointed
+to by one or more
 .Ar arg
 arguments.
 .Pp
@@ -54,7 +56,7 @@ default "netbsd".
 The argument is a
 .Xr printf 3
 style format string that allows customization of
-.Nm ioctlprint Ns 's
+.Nm ioctlprint Ap s
 output.
 .Pp
 The following conversion characters can be used:
@@ -76,9 +78,8 @@ The default format is:
 "%n %e %x\\n"
 .Ed
 .El
-.Pp
 .Sh SEE ALSO
-.Xr kdump 1
+.Xr kdump 1 ,
 .Xr ktrace 1
 .Sh HISTORY
 The



CVS commit: src/usr.bin/kdump

2020-04-02 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Apr  2 08:38:22 UTC 2020

Modified Files:
src/usr.bin/kdump: ioctlprint.1

Log Message:
Remove superfluous Pp. Add comma in enumeration. Add RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/kdump/ioctlprint.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2020-04-02 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Apr  2 08:35:12 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.1

Log Message:
Add comma in enumeration.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/kdump/kdump.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2020-04-02 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Apr  2 08:35:12 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.1

Log Message:
Add comma in enumeration.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/kdump/kdump.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.1
diff -u src/usr.bin/kdump/kdump.1:1.29 src/usr.bin/kdump/kdump.1:1.30
--- src/usr.bin/kdump/kdump.1:1.29	Thu Apr  2 03:35:48 2020
+++ src/usr.bin/kdump/kdump.1	Thu Apr  2 08:35:12 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kdump.1,v 1.29 2020/04/02 03:35:48 kamil Exp $
+.\"	$NetBSD: kdump.1,v 1.30 2020/04/02 08:35:12 wiz Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -118,7 +118,7 @@ bytes.
 Supported values are 1, 2, 4, 8, and 16.
 .El
 .Sh SEE ALSO
-.Xr ioctlprint 1
+.Xr ioctlprint 1 ,
 .Xr ktrace 1
 .Sh HISTORY
 The



CVS commit: src/usr.bin/kdump

2020-04-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Apr  2 03:35:48 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.1

Log Message:
Note ioctlprint(1) in SEE ALSO


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/kdump/kdump.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2020-04-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Apr  2 03:35:48 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.1

Log Message:
Note ioctlprint(1) in SEE ALSO


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/kdump/kdump.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.1
diff -u src/usr.bin/kdump/kdump.1:1.28 src/usr.bin/kdump/kdump.1:1.29
--- src/usr.bin/kdump/kdump.1:1.28	Sun Sep 10 10:09:34 2017
+++ src/usr.bin/kdump/kdump.1	Thu Apr  2 03:35:48 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kdump.1,v 1.28 2017/09/10 10:09:34 wiz Exp $
+.\"	$NetBSD: kdump.1,v 1.29 2020/04/02 03:35:48 kamil Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)kdump.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd September 9, 2017
+.Dd April 2, 2020
 .Dt KDUMP 1
 .Os
 .Sh NAME
@@ -118,6 +118,7 @@ bytes.
 Supported values are 1, 2, 4, 8, and 16.
 .El
 .Sh SEE ALSO
+.Xr ioctlprint 1
 .Xr ktrace 1
 .Sh HISTORY
 The



CVS commit: src/usr.bin/kdump

2019-07-22 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Jul 23 01:54:51 UTC 2019

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
kdump(1): Symbolic printing for MALLOC_OPTIONS="U".


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.131 src/usr.bin/kdump/kdump.c:1.132
--- src/usr.bin/kdump/kdump.c:1.131	Mon May  6 19:20:13 2019
+++ src/usr.bin/kdump/kdump.c	Tue Jul 23 01:54:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.131 2019/05/06 19:20:13 christos Exp $	*/
+/*	$NetBSD: kdump.c,v 1.132 2019/07/23 01:54:51 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.131 2019/05/06 19:20:13 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.132 2019/07/23 01:54:51 nonaka Exp $");
 #endif
 #endif /* not lint */
 
@@ -1143,6 +1143,27 @@ ktruser_control(const char *name, const 
 }
 
 static void
+ktruser_malloc(const char *name, const void *buf, size_t len)
+{
+	struct ut { void *p; size_t s; void *r; } m;
+
+	if (len != sizeof(m))
+		warnx("%.*s: len %zu != %zu", KTR_USER_MAXIDLEN, name, len,
+		sizeof(m));
+	memcpy(, buf, len < sizeof(m) ? len : sizeof(m));
+	if (m.p == NULL && m.s == 0 && m.r == NULL)
+		printf("%.*s: malloc_init()\n", KTR_USER_MAXIDLEN, name);
+	else if (m.p != NULL && m.s != 0)
+		printf("%.*s: %p = realloc(%p, %zu)\n", KTR_USER_MAXIDLEN, name,
+		m.r, m.p, m.s);
+	else if (m.s == 0)
+		printf("%.*s: free(%p)\n", KTR_USER_MAXIDLEN, name, m.p);
+	else
+		printf("%.*s: %p = malloc(%zu)\n", KTR_USER_MAXIDLEN, name,
+		m.r, m.s);
+}
+
+static void
 ktruser_misc(const char *name, const void *buf, size_t len)
 {
 	size_t i;
@@ -1161,6 +1182,7 @@ static struct {
 	{ "msghdr", ktruser_msghdr },
 	{ "mbsoname", ktruser_soname },
 	{ "mbcontrol", ktruser_control },
+	{ "malloc", ktruser_malloc },
 	{ NULL,	ktruser_misc },
 };
 



CVS commit: src/usr.bin/kdump

2019-07-22 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Jul 23 01:54:51 UTC 2019

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
kdump(1): Symbolic printing for MALLOC_OPTIONS="U".


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2019-05-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May  6 19:20:13 UTC 2019

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
You don't have to be _LP64 to run 32 bit binaries. You can be mips (64 bit
kernel/32 bit userland).


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2019-05-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May  6 19:20:13 UTC 2019

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
You don't have to be _LP64 to run 32 bit binaries. You can be mips (64 bit
kernel/32 bit userland).


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.130 src/usr.bin/kdump/kdump.c:1.131
--- src/usr.bin/kdump/kdump.c:1.130	Sun Apr 29 14:00:31 2018
+++ src/usr.bin/kdump/kdump.c	Mon May  6 15:20:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.130 2018/04/29 18:00:31 christos Exp $	*/
+/*	$NetBSD: kdump.c,v 1.131 2019/05/06 19:20:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.130 2018/04/29 18:00:31 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.131 2019/05/06 19:20:13 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -568,7 +568,6 @@ ktrsyscall(struct ktr_syscall *ktr)
 		sys_name = emul->sysnames[ktr->ktr_code];
 		(void)printf("%s", sys_name);
 	}
-#ifdef _LP64
 #define NETBSD32_	"netbsd32_"
 	if (cur_emul->flags & EMUL_FLAG_NETBSD32) {
 		size_t len = strlen(NETBSD32_);
@@ -576,7 +575,6 @@ ktrsyscall(struct ktr_syscall *ktr)
 			sys_name += len;
 	}
 #undef NETBSD32_
-#endif
 
 	ap = (register_t *)((char *)ktr + sizeof(struct ktr_syscall));
 	if (argcount) {



CVS commit: src/usr.bin/kdump

2018-12-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec 29 18:09:32 UTC 2018

Modified Files:
src/usr.bin/kdump: setemul.c

Log Message:
ibcs2 is gone


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/kdump/setemul.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/setemul.c
diff -u src/usr.bin/kdump/setemul.c:1.30 src/usr.bin/kdump/setemul.c:1.31
--- src/usr.bin/kdump/setemul.c:1.30	Wed Dec 19 16:27:26 2018
+++ src/usr.bin/kdump/setemul.c	Sat Dec 29 18:09:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: setemul.c,v 1.30 2018/12/19 16:27:26 martin Exp $	*/
+/*	$NetBSD: setemul.c,v 1.31 2018/12/29 18:09:32 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: setemul.c,v 1.30 2018/12/19 16:27:26 martin Exp $");
+__RCSID("$NetBSD: setemul.c,v 1.31 2018/12/29 18:09:32 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -83,7 +83,6 @@ __RCSID("$NetBSD: setemul.c,v 1.30 2018/
 
 #include "../../sys/compat/netbsd32/netbsd32_syscall.h"
 #include "../../sys/compat/freebsd/freebsd_syscall.h"
-#include "../../sys/compat/ibcs2/ibcs2_syscall.h"
 #include "../../sys/compat/linux/linux_syscall.h"
 #include "../../sys/compat/linux32/linux32_syscall.h"
 #include "../../sys/compat/osf1/osf1_syscall.h"
@@ -99,7 +98,6 @@ __RCSID("$NetBSD: setemul.c,v 1.30 2018/
 
 #include "../../sys/compat/netbsd32/netbsd32_syscalls.c"
 #include "../../sys/compat/freebsd/freebsd_syscalls.c"
-#include "../../sys/compat/ibcs2/ibcs2_syscalls.c"
 #include "../../sys/compat/linux/linux_syscalls.c"
 #include "../../sys/compat/linux32/linux32_syscalls.c"
 #include "../../sys/compat/osf1/osf1_syscalls.c"
@@ -110,13 +108,11 @@ __RCSID("$NetBSD: setemul.c,v 1.30 2018/
 #include "../../sys/compat/aoutm68k/aoutm68k_syscalls.c"
 #endif
 
-#include "../../sys/compat/ibcs2/ibcs2_errno.c"
 #include "../../sys/compat/osf1/osf1_errno.c"
 #include "../../sys/compat/linux/common/linux_errno.c"
 #undef KTRACE
 
 #define SIGRTMIN	33	/* XXX */
-#include "../../sys/compat/ibcs2/ibcs2_signo.c"
 #include "../../sys/compat/osf1/osf1_signo.c"
 #include "../../sys/compat/linux/common/linux_signo.c"
 
@@ -136,10 +132,6 @@ const struct emulation emulations[] = {
 	  NULL,0,
 	  NULL,0,	0 },
 
-	{ "ibcs2",	ibcs2_syscallnames,	IBCS2_SYS_MAXSYSCALL,
-	  native_to_ibcs2_errno,	NELEM(native_to_ibcs2_errno),
-	  ibcs2_to_native_signo,	NSIG,	0 },
-
 	{ "linux",	linux_syscallnames,	LINUX_SYS_MAXSYSCALL,
 	  native_to_linux_errno,	NELEM(native_to_linux_errno),
 	  linux_to_native_signo,	NSIG,	0 },



CVS commit: src/usr.bin/kdump

2018-12-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec 29 18:09:32 UTC 2018

Modified Files:
src/usr.bin/kdump: setemul.c

Log Message:
ibcs2 is gone


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/kdump/setemul.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2018-12-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 19 16:27:26 UTC 2018

Modified Files:
src/usr.bin/kdump: setemul.c

Log Message:
compat/svr4* is gone - adapt


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/kdump/setemul.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/setemul.c
diff -u src/usr.bin/kdump/setemul.c:1.29 src/usr.bin/kdump/setemul.c:1.30
--- src/usr.bin/kdump/setemul.c:1.29	Tue Apr 26 16:57:42 2011
+++ src/usr.bin/kdump/setemul.c	Wed Dec 19 16:27:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: setemul.c,v 1.29 2011/04/26 16:57:42 joerg Exp $	*/
+/*	$NetBSD: setemul.c,v 1.30 2018/12/19 16:27:26 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: setemul.c,v 1.29 2011/04/26 16:57:42 joerg Exp $");
+__RCSID("$NetBSD: setemul.c,v 1.30 2018/12/19 16:27:26 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -89,8 +89,6 @@ __RCSID("$NetBSD: setemul.c,v 1.29 2011/
 #include "../../sys/compat/osf1/osf1_syscall.h"
 #include "../../sys/compat/sunos32/sunos32_syscall.h"
 #include "../../sys/compat/sunos/sunos_syscall.h"
-#include "../../sys/compat/svr4/svr4_syscall.h"
-#include "../../sys/compat/svr4_32/svr4_32_syscall.h"
 #include "../../sys/compat/ultrix/ultrix_syscall.h"
 #ifdef __m68k__
 #include "../../sys/compat/aoutm68k/aoutm68k_syscall.h"
@@ -107,21 +105,17 @@ __RCSID("$NetBSD: setemul.c,v 1.29 2011/
 #include "../../sys/compat/osf1/osf1_syscalls.c"
 #include "../../sys/compat/sunos/sunos_syscalls.c"
 #include "../../sys/compat/sunos32/sunos32_syscalls.c"
-#include "../../sys/compat/svr4/svr4_syscalls.c"
-#include "../../sys/compat/svr4_32/svr4_32_syscalls.c"
 #include "../../sys/compat/ultrix/ultrix_syscalls.c"
 #ifdef __m68k__
 #include "../../sys/compat/aoutm68k/aoutm68k_syscalls.c"
 #endif
 
-#include "../../sys/compat/svr4/svr4_errno.c"
 #include "../../sys/compat/ibcs2/ibcs2_errno.c"
 #include "../../sys/compat/osf1/osf1_errno.c"
 #include "../../sys/compat/linux/common/linux_errno.c"
 #undef KTRACE
 
 #define SIGRTMIN	33	/* XXX */
-#include "../../sys/compat/svr4/svr4_signo.c"
 #include "../../sys/compat/ibcs2/ibcs2_signo.c"
 #include "../../sys/compat/osf1/osf1_signo.c"
 #include "../../sys/compat/linux/common/linux_signo.c"
@@ -166,14 +160,6 @@ const struct emulation emulations[] = {
 	  NULL,0,
 	  NULL,0,	0 },
 
-	{ "svr4",	svr4_syscallnames,	SVR4_SYS_MAXSYSCALL,
-	  native_to_svr4_errno,		NELEM(native_to_svr4_errno),
-	  svr4_to_native_signo,		NSIG,	0 },
-
-	{ "svr4_32",	svr4_syscallnames,	SVR4_SYS_MAXSYSCALL,
-	  native_to_svr4_errno,		NELEM(native_to_svr4_errno),
-	  svr4_to_native_signo,		NSIG,	EMUL_FLAG_NETBSD32 },
-
 	{ "ultrix",	ultrix_syscallnames,	ULTRIX_SYS_MAXSYSCALL,
 	  NULL,0,
 	  NULL,0,	0 },



CVS commit: src/usr.bin/kdump

2018-12-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 19 16:27:26 UTC 2018

Modified Files:
src/usr.bin/kdump: setemul.c

Log Message:
compat/svr4* is gone - adapt


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/kdump/setemul.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2018-06-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 12 15:41:35 UTC 2018

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
remove extra quotes.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/Makefile.ioctl-c
diff -u src/usr.bin/kdump/Makefile.ioctl-c:1.36 src/usr.bin/kdump/Makefile.ioctl-c:1.37
--- src/usr.bin/kdump/Makefile.ioctl-c:1.36	Tue Jun 12 11:40:39 2018
+++ src/usr.bin/kdump/Makefile.ioctl-c	Tue Jun 12 11:41:35 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.ioctl-c,v 1.36 2018/06/12 15:40:39 christos Exp $
+#	$NetBSD: Makefile.ioctl-c,v 1.37 2018/06/12 15:41:35 christos Exp $
 
 # NOTE:  needs to be previously .included for NETBSDSRCDIR
 
@@ -62,7 +62,7 @@ CPPFLAGS+=	-D__MGA_DRM_H__		# Dup ioctls
 
 ${PROG}-ioctl.c: mkioctls Makefile ${DEPFILES} ${SETFILES}
 	${_MKTARGET_CREATE}
-	AWK=${TOOL_AWK:q} CC="${CC:q}" DESTDIR=${DESTDIR:q} SED=${TOOL_SED:q} \
+	AWK=${TOOL_AWK:q} CC=${CC:q} DESTDIR=${DESTDIR:q} SED=${TOOL_SED:q} \
 	NETBSDSRCDIR=${NETBSDSRCDIR:q} CPPFLAGS=${CPPFLAGS:q} \
 	${HOST_SH} ${NETBSDSRCDIR}/usr.bin/kdump/mkioctls \
 	${DEPFILES} >${.TARGET}



CVS commit: src/usr.bin/kdump

2018-06-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 12 15:41:35 UTC 2018

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
remove extra quotes.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2018-06-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 12 15:40:39 UTC 2018

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c mkioctls

Log Message:
- instead of hard-coding the include paths in mkioctls, pass them in
  from the Makefile so that they are consistent.
- do more sed so that destination paths are not hard-coded inside #include
  statements.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/kdump/Makefile.ioctl-c
cvs rdiff -u -r1.51 -r1.52 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2018-06-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 12 15:40:39 UTC 2018

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c mkioctls

Log Message:
- instead of hard-coding the include paths in mkioctls, pass them in
  from the Makefile so that they are consistent.
- do more sed so that destination paths are not hard-coded inside #include
  statements.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/kdump/Makefile.ioctl-c
cvs rdiff -u -r1.51 -r1.52 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/Makefile.ioctl-c
diff -u src/usr.bin/kdump/Makefile.ioctl-c:1.35 src/usr.bin/kdump/Makefile.ioctl-c:1.36
--- src/usr.bin/kdump/Makefile.ioctl-c:1.35	Mon May 28 17:05:02 2018
+++ src/usr.bin/kdump/Makefile.ioctl-c	Tue Jun 12 11:40:39 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.ioctl-c,v 1.35 2018/05/28 21:05:02 chs Exp $
+#	$NetBSD: Makefile.ioctl-c,v 1.36 2018/06/12 15:40:39 christos Exp $
 
 # NOTE:  needs to be previously .included for NETBSDSRCDIR
 
@@ -35,11 +35,6 @@ DEPFILEGLOB = ${TOOL_SED} \
 DEPFILES != (${DEPFILEGLOB}; echo ${EXTRAS}) | xargs egrep -l '(_IO\(|_IOR\(|_IOW\(|_IOWR\()' 2>/dev/null || :
 .endif
 
-${PROG}-ioctl.c: mkioctls Makefile ${DEPFILES} ${SETFILES}
-	${_MKTARGET_CREATE}
-	AWK=${TOOL_AWK:Q} CC="${CC}" DESTDIR="${DESTDIR}" SED=${TOOL_SED:Q} \
-	${HOST_SH} ${NETBSDSRCDIR}/usr.bin/kdump/mkioctls \
-	${DEPFILES} >${.TARGET}
 
 SRCS+=		${PROG}-ioctl.c
 CLEANFILES+=	${PROG}-ioctl.c
@@ -65,4 +60,11 @@ CPPFLAGS+=	-D__RADEON_DRM_H__	# Dup ioct
 CPPFLAGS+=	-D__MACH64_DRM_H__	# Dup ioctls
 CPPFLAGS+=	-D__MGA_DRM_H__		# Dup ioctls
 
+${PROG}-ioctl.c: mkioctls Makefile ${DEPFILES} ${SETFILES}
+	${_MKTARGET_CREATE}
+	AWK=${TOOL_AWK:q} CC="${CC:q}" DESTDIR=${DESTDIR:q} SED=${TOOL_SED:q} \
+	NETBSDSRCDIR=${NETBSDSRCDIR:q} CPPFLAGS=${CPPFLAGS:q} \
+	${HOST_SH} ${NETBSDSRCDIR}/usr.bin/kdump/mkioctls \
+	${DEPFILES} >${.TARGET}
+
 ${DEPFILES}: .PRECIOUS

Index: src/usr.bin/kdump/mkioctls
diff -u src/usr.bin/kdump/mkioctls:1.51 src/usr.bin/kdump/mkioctls:1.52
--- src/usr.bin/kdump/mkioctls:1.51	Sat Jun  2 16:07:15 2018
+++ src/usr.bin/kdump/mkioctls	Tue Jun 12 11:40:39 2018
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mkioctls,v 1.51 2018/06/02 20:07:15 mrg Exp $
+#	$NetBSD: mkioctls,v 1.52 2018/06/12 15:40:39 christos Exp $
 #
 # Copyright (c) 1994
 #	The Regents of the University of California.  All rights reserved.
@@ -94,19 +94,16 @@ do
 		fi;;
 	esac
 	echo "#include <$i>"
-done | ${SED} -e "s,${DESTDIR}/usr/include/,,g"
+done | ${SED} -e "s,${DESTDIR}/usr/include/,,g" \
+	-e "s,${DESTDIR}/usr/X11R7/include/,,g" \
+	-e "s,${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common/,,g"
 
 if ! $needundef; then
 echo "#define bool _Bool"
 fi
 
-${CC} -E -nostdinc -isystem ${DESTDIR}/usr/include \
--I${DESTDIR}/usr/X11R7/include \
--I${DESTDIR}/usr/X11R7/include/pixman-1 \
--I${DESTDIR}/usr/X11R7/include/libdrm \
--D_VIA_DRM_H_ \
--dM "${@}" | \
-${AWK} '
+${CC} -E -nostdinc -isystem ${DESTDIR}/usr/include ${CPPFLAGS} -dM "${@}" | \
+${AWK} '
 BEGIN {
 	keep["SLIOCGUNIT"] = 1;	# Same as PPPIOCGASYNCMAP
 	keep["TUNSLMODE"] = 1;	# Same as PPPIOCGASYNCMAP



re: CVS commit: src/usr.bin/kdump

2018-06-03 Thread matthew green
> > On 2. Jun 2018, at 22:07, matthew green  wrote:
> > 
> > Module Name:src
> > Committed By:   mrg
> > Date:   Sat Jun  2 20:07:15 UTC 2018
> > 
> > Modified Files:
> > src/usr.bin/kdump: mkioctls
> > 
> > Log Message:
> > just include  for mkioctls.  this works fine for me
> > for several platforms and fixes the clang build.
> > 
> > 
> > To generate a diff of this commit:
> > cvs rdiff -u -r1.50 -r1.51 src/usr.bin/kdump/mkioctls
> 
> This breaks the build:
> 
> In file included from /build/devel/src/sys/net/if.h:99:0,
>  from kdump-ioctl.c:23:
> /build/devel/src/sys/altq/if_altq.h:48:2: error: unknown type name 'kmutex_t'
>   kmutex_t *ifq_lock;
>   ^~~~
> 
> The real problem seems the sys include search path:
> 
> #include <...> search starts here:
>  /build/devel/obj/dist.amd64/usr/X11R7/include/libdrm
>  /build/devel/obj/dist.amd64/usr/X11R7/include/pixman-1
>  /build/devel/obj/dist.amd64/usr/X11R7/include
>  /build/devel/src/external/cddl/osnet/sys
>  /build/devel/src/external/cddl/osnet/dist/uts/common
>  /build/devel/src/usr.bin/ktrace
>  /build/devel/src/sys
>  /build/devel/obj/dist.amd64/usr/include/gcc-6
>  /build/devel/obj/tools.amd64/lib/gcc/x86_64--netbsd/6.4.0/include-fixed
>  /build/devel/obj/dist.amd64/usr/include
> 
> Most  includes come from "cddl/osnet/sys/sys" which looks wrong.
> 
> Suppose the search better starts with "-I${NETBSDSRCDIR}/sys" ...

i remain unable to reproduce this on my own system.  i guess
either your idea, or, -I${DESTDIR}/usr/include before the cddl
includes, and make them all last.

FWIW, this patch works for me (in that, it doesn't break).

please feel free to commit this or something similar that works
for you, as i'm hesitant to commit something else here without
confirming it helps the problem i don't see.

thanks.


.mrg.

Index: Makefile.ioctl-c
===
RCS file: /cvsroot/src/usr.bin/kdump/Makefile.ioctl-c,v
retrieving revision 1.35
diff -p -u -r1.35 Makefile.ioctl-c
--- Makefile.ioctl-c28 May 2018 21:05:02 -  1.35
+++ Makefile.ioctl-c3 Jun 2018 11:43:19 -
@@ -47,11 +47,6 @@ DPSRCS+= ${PROG}-ioctl.c
 CPPFLAGS+= -I${DESTDIR}/usr/X11R7/include/libdrm
 CPPFLAGS+= -I${DESTDIR}/usr/X11R7/include/pixman-1
 CPPFLAGS+= -I${DESTDIR}/usr/X11R7/include
-.if ${MKDTRACE} != "no"
-CPPFLAGS+= -I${NETBSDSRCDIR}/external/cddl/osnet/sys
-CPPFLAGS+= -I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common
-CWARNFLAGS+=   -Wno-unknown-pragmas
-.endif
 CPPFLAGS+= -D_DEV_IC_BT8XX_H_
 CPPFLAGS+= -D_ALTQ_ALTQ_JOBS_H_# redefinition of inline
 # De-select one, dup ioctls
@@ -65,4 +60,13 @@ CPPFLAGS+=   -D__RADEON_DRM_H__  # Dup ioct
 CPPFLAGS+= -D__MACH64_DRM_H__  # Dup ioctls
 CPPFLAGS+= -D__MGA_DRM_H__ # Dup ioctls
 
+# Make sure these are last.
+.if ${MKDTRACE} != "no"
+# We put /usr/include here explicitly to always prefer NetBSD headers.
+CPPFLAGS+= -I${DESTDIR}/usr/include
+CPPFLAGS+= -I${NETBSDSRCDIR}/external/cddl/osnet/sys
+CPPFLAGS+= -I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common
+CWARNFLAGS+=   -Wno-unknown-pragmas
+.endif
+
 ${DEPFILES}: .PRECIOUS


Re: CVS commit: src/usr.bin/kdump

2018-06-03 Thread J. Hannken-Illjes



> On 2. Jun 2018, at 22:07, matthew green  wrote:
> 
> Module Name:  src
> Committed By: mrg
> Date: Sat Jun  2 20:07:15 UTC 2018
> 
> Modified Files:
>   src/usr.bin/kdump: mkioctls
> 
> Log Message:
> just include  for mkioctls.  this works fine for me
> for several platforms and fixes the clang build.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.50 -r1.51 src/usr.bin/kdump/mkioctls

This breaks the build:

In file included from /build/devel/src/sys/net/if.h:99:0,
 from kdump-ioctl.c:23:
/build/devel/src/sys/altq/if_altq.h:48:2: error: unknown type name 'kmutex_t'
  kmutex_t *ifq_lock;
  ^~~~

The real problem seems the sys include search path:

#include <...> search starts here:
 /build/devel/obj/dist.amd64/usr/X11R7/include/libdrm
 /build/devel/obj/dist.amd64/usr/X11R7/include/pixman-1
 /build/devel/obj/dist.amd64/usr/X11R7/include
 /build/devel/src/external/cddl/osnet/sys
 /build/devel/src/external/cddl/osnet/dist/uts/common
 /build/devel/src/usr.bin/ktrace
 /build/devel/src/sys
 /build/devel/obj/dist.amd64/usr/include/gcc-6
 /build/devel/obj/tools.amd64/lib/gcc/x86_64--netbsd/6.4.0/include-fixed
 /build/devel/obj/dist.amd64/usr/include

Most  includes come from "cddl/osnet/sys/sys" which looks wrong.

Suppose the search better starts with "-I${NETBSDSRCDIR}/sys" ...

--
J. Hannken-Illjes - hann...@eis.cs.tu-bs.de - TU Braunschweig (Germa


CVS commit: src/usr.bin/kdump

2018-06-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jun  2 20:07:15 UTC 2018

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
just include  for mkioctls.  this works fine for me
for several platforms and fixes the clang build.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2018-06-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jun  2 20:07:15 UTC 2018

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
just include  for mkioctls.  this works fine for me
for several platforms and fixes the clang build.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/mkioctls
diff -u src/usr.bin/kdump/mkioctls:1.50 src/usr.bin/kdump/mkioctls:1.51
--- src/usr.bin/kdump/mkioctls:1.50	Tue May 29 14:29:53 2018
+++ src/usr.bin/kdump/mkioctls	Sat Jun  2 20:07:15 2018
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mkioctls,v 1.50 2018/05/29 14:29:53 martin Exp $
+#	$NetBSD: mkioctls,v 1.51 2018/06/02 20:07:15 mrg Exp $
 #
 # Copyright (c) 1994
 #	The Regents of the University of California.  All rights reserved.
@@ -49,10 +49,10 @@ echo "typedef struct crap videomemory_t;
 echo "typedef struct crap RF_AccTotals_t;" # XXX Raidframe lossage
 echo "struct rf_test_acc { int _xxx; };" # XXX Raidframe lossage
 echo "struct map_info { int _xxx[22]; };" # XXX Xorg lossage
-echo "typedef struct kmutex kmutex_t;" # XXX needed by ZFS headers
 echo "#include "
 echo "#include "
 echo "#include "
+echo "#include "
 echo "#ifndef NBPG"
 echo "#define NBPG 4096 /* workaround / dummy for sparc */"
 echo "#endif /* NBPG */"



CVS commit: src/usr.bin/kdump

2018-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 29 14:29:53 UTC 2018

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
Use proper forward declaration for kmutex_t. This makes MKDTRACE=no builds
work again.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/mkioctls
diff -u src/usr.bin/kdump/mkioctls:1.49 src/usr.bin/kdump/mkioctls:1.50
--- src/usr.bin/kdump/mkioctls:1.49	Tue May 29 13:10:28 2018
+++ src/usr.bin/kdump/mkioctls	Tue May 29 14:29:53 2018
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mkioctls,v 1.49 2018/05/29 13:10:28 martin Exp $
+#	$NetBSD: mkioctls,v 1.50 2018/05/29 14:29:53 martin Exp $
 #
 # Copyright (c) 1994
 #	The Regents of the University of California.  All rights reserved.
@@ -49,7 +49,7 @@ echo "typedef struct crap videomemory_t;
 echo "typedef struct crap RF_AccTotals_t;" # XXX Raidframe lossage
 echo "struct rf_test_acc { int _xxx; };" # XXX Raidframe lossage
 echo "struct map_info { int _xxx[22]; };" # XXX Xorg lossage
-echo "typedef void *kmutex_t;" # XXX needed by ZFS headers
+echo "typedef struct kmutex kmutex_t;" # XXX needed by ZFS headers
 echo "#include "
 echo "#include "
 echo "#include "



CVS commit: src/usr.bin/kdump

2018-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 29 14:29:53 UTC 2018

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
Use proper forward declaration for kmutex_t. This makes MKDTRACE=no builds
work again.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2018-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 29 13:10:28 UTC 2018

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
Ooops, backout previous - it was an update build artifact (or something)


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/mkioctls
diff -u src/usr.bin/kdump/mkioctls:1.48 src/usr.bin/kdump/mkioctls:1.49
--- src/usr.bin/kdump/mkioctls:1.48	Tue May 29 11:18:50 2018
+++ src/usr.bin/kdump/mkioctls	Tue May 29 13:10:28 2018
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mkioctls,v 1.48 2018/05/29 11:18:50 martin Exp $
+#	$NetBSD: mkioctls,v 1.49 2018/05/29 13:10:28 martin Exp $
 #
 # Copyright (c) 1994
 #	The Regents of the University of California.  All rights reserved.
@@ -49,6 +49,7 @@ echo "typedef struct crap videomemory_t;
 echo "typedef struct crap RF_AccTotals_t;" # XXX Raidframe lossage
 echo "struct rf_test_acc { int _xxx; };" # XXX Raidframe lossage
 echo "struct map_info { int _xxx[22]; };" # XXX Xorg lossage
+echo "typedef void *kmutex_t;" # XXX needed by ZFS headers
 echo "#include "
 echo "#include "
 echo "#include "



CVS commit: src/usr.bin/kdump

2018-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 29 13:10:28 UTC 2018

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
Ooops, backout previous - it was an update build artifact (or something)


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2018-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 29 11:18:50 UTC 2018

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
Backout previous: "typedef void *kmutex_t;
is incompatible with our kmutex_t and breaks the build. ZFS will need
to find a better way to work around this.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2018-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 29 11:18:50 UTC 2018

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
Backout previous: "typedef void *kmutex_t;
is incompatible with our kmutex_t and breaks the build. ZFS will need
to find a better way to work around this.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/mkioctls
diff -u src/usr.bin/kdump/mkioctls:1.47 src/usr.bin/kdump/mkioctls:1.48
--- src/usr.bin/kdump/mkioctls:1.47	Mon May 28 21:05:02 2018
+++ src/usr.bin/kdump/mkioctls	Tue May 29 11:18:50 2018
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mkioctls,v 1.47 2018/05/28 21:05:02 chs Exp $
+#	$NetBSD: mkioctls,v 1.48 2018/05/29 11:18:50 martin Exp $
 #
 # Copyright (c) 1994
 #	The Regents of the University of California.  All rights reserved.
@@ -49,7 +49,6 @@ echo "typedef struct crap videomemory_t;
 echo "typedef struct crap RF_AccTotals_t;" # XXX Raidframe lossage
 echo "struct rf_test_acc { int _xxx; };" # XXX Raidframe lossage
 echo "struct map_info { int _xxx[22]; };" # XXX Xorg lossage
-echo "typedef void *kmutex_t;" # XXX needed by ZFS headers
 echo "#include "
 echo "#include "
 echo "#include "



CVS commit: src/usr.bin/kdump

2018-04-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 29 18:00:31 UTC 2018

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
print the mprotect perm argument symbolically.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.129 src/usr.bin/kdump/kdump.c:1.130
--- src/usr.bin/kdump/kdump.c:1.129	Sun Sep 10 06:09:40 2017
+++ src/usr.bin/kdump/kdump.c	Sun Apr 29 14:00:31 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.129 2017/09/10 10:09:40 wiz Exp $	*/
+/*	$NetBSD: kdump.c,v 1.130 2018/04/29 18:00:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.129 2017/09/10 10:09:40 wiz Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.130 2018/04/29 18:00:31 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -516,6 +516,37 @@ ioctldecode(u_long cmd)
 }
 
 static void
+putprot(int pr)
+{
+	const char *s = "";
+
+	if (pr == PROT_NONE) {
+		fputs("PROT_NONE", stdout);
+		return;
+	}
+
+	if (pr & PROT_READ) {
+		fputs("PROT_READ", stdout);
+		s = "|";
+		pr &= ~PROT_READ;
+	}
+
+	if (pr & PROT_WRITE) {
+		printf("%sPROT_WRITE", s);
+		pr &= ~PROT_WRITE;
+		s = "|";
+	}
+	if (pr & PROT_EXEC) {
+		printf("%sPROT_EXEC", s);
+		pr &= ~PROT_EXEC;
+		s = "|";
+	}
+	if (pr) {
+		printf("%s%#lx", s, (long)pr);
+	}
+}
+
+static void
 ktrsyscall(struct ktr_syscall *ktr)
 {
 	int argcount;
@@ -602,6 +633,17 @@ ktrsyscall(struct ktr_syscall *ktr)
 			ap += 2;
 			argcount -= 2;
 			c = ',';
+		} else if (strcmp(sys_name, "mprotect") == 0 && argcount >= 3) {
+			putchar('(');
+			output_long((long)ap[0], !(decimal || small(ap[0])));
+			c = ',';
+			putchar(c);
+			output_long((long)ap[1], !(decimal || small(ap[1])));
+			putchar(c);
+			putprot(ap[2]);
+			ap += 3;
+			argcount -= 3;
+			c = ',';
 		} else if (strcmp(sys_name, "mmap") == 0 && argcount >= 6) {
 			char buf[1024];
 			putchar('(');
@@ -610,30 +652,7 @@ ktrsyscall(struct ktr_syscall *ktr)
 			putchar(c);
 			output_long((long)ap[1], !(decimal || small(ap[1])));
 			putchar(c);
-			if (ap[2] == PROT_NONE) {
-			fputs("PROT_NONE", stdout);
-			} else {
-			const char *s = "";
-			c = 0;
-			if (ap[2] & PROT_READ) {
-fputs("PROT_READ", stdout);
-s = "|";
-ap[2] &= ~PROT_READ;
-			}
-			if (ap[2] & PROT_WRITE) {
-printf("%sPROT_WRITE", s);
-ap[2] &= ~PROT_WRITE;
-s = "|";
-			}
-			if (ap[2] & PROT_EXEC) {
-printf("%sPROT_EXEC", s);
-ap[2] &= ~PROT_EXEC;
-s = "|";
-			}
-			if (ap[2]) {
-printf("%s%#lx", s, (long)ap[2]);
-			}
-			}
+			putprot(ap[2]);
 			snprintb(buf, sizeof(buf), MAP_FMT, ap[3]);
 			printf(",%s", buf);
 			ap += 4;



CVS commit: src/usr.bin/kdump

2018-04-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 29 18:00:31 UTC 2018

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
print the mprotect perm argument symbolically.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/usr.bin/kdump

2017-11-06 Thread Christos Zoulas
In article <20171106163453.gb28...@britannica.bec.de>,
Joerg Sonnenberger   wrote:
>On Sun, Nov 05, 2017 at 12:44:29PM -0500, Christos Zoulas wrote:
>> Module Name: src
>> Committed By:christos
>> Date:Sun Nov  5 17:44:29 UTC 2017
>> 
>> Modified Files:
>>  src/usr.bin/kdump: mkioctls
>> 
>> Log Message:
>> deal with the stdbool.h mess defining bool in  and 
>> and then xf86Opt.h wanting to define a struct field called bool.
>
>I'd prefer to fix the latter.

You mean change xf86Opt.h and rename 'bool' to 'xbool' or something else?
That would probably require touching a lot of other X client code, and
things will stop compiling out of the box for NetBSD. I think upstream
should fix it first :-)

christos



Re: CVS commit: src/usr.bin/kdump

2017-11-06 Thread Joerg Sonnenberger
On Sun, Nov 05, 2017 at 12:44:29PM -0500, Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Sun Nov  5 17:44:29 UTC 2017
> 
> Modified Files:
>   src/usr.bin/kdump: mkioctls
> 
> Log Message:
> deal with the stdbool.h mess defining bool in  and 
> and then xf86Opt.h wanting to define a struct field called bool.

I'd prefer to fix the latter.

Joerg


CVS commit: src/usr.bin/kdump

2017-11-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov  5 22:52:12 UTC 2017

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
- fix "obsolete" skipping to handle obsolete entries that contain other
  variables
- skip files particular to other xserver versions than ours.

XXX: How does this build in the build farm?


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/Makefile.ioctl-c
diff -u src/usr.bin/kdump/Makefile.ioctl-c:1.33 src/usr.bin/kdump/Makefile.ioctl-c:1.34
--- src/usr.bin/kdump/Makefile.ioctl-c:1.33	Thu Aug 18 04:02:58 2016
+++ src/usr.bin/kdump/Makefile.ioctl-c	Sun Nov  5 17:52:12 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.ioctl-c,v 1.33 2016/08/18 08:02:58 mrg Exp $
+#	$NetBSD: Makefile.ioctl-c,v 1.34 2017/11/05 22:52:12 christos Exp $
 
 # NOTE:  needs to be previously .included for NETBSDSRCDIR
 
@@ -25,7 +25,13 @@ EXTRAS=	${NETBSDSRCDIR}/external/cddl/os
 .endif
 
 .if !make(cleandir) && !make(obj) && !make(includes) && !make(install)
-DEPFILEGLOB = ${TOOL_SED} -ne '/\/usr\/.*include\/.*\.h[ 	]/{s/[ 	]obsolete$$//;t' -e 's/xenio//;t' -e 's,\.\([^ 	]*\).*,${DESTDIR}\1,;p;}' ${SETFILES}
+DEPFILEGLOB = ${TOOL_SED} \
+-ne '/\/usr\/.*include\/.*\.h[ 	]/{s/[ 	,]obsolete//;t' \
+-e "s/xorg_server_ver=${XORG_SERVER_VER}//;t skipserver" \
+-e "s/xorg_server_ver=//;t" \
+-e ":skipserver" \
+-e 's/xenio//;t' \
+-e 's,\.\([^ 	]*\).*,${DESTDIR}\1,;p;}' ${SETFILES}
 DEPFILES != (${DEPFILEGLOB}; echo ${EXTRAS}) | xargs egrep -l '(_IO\(|_IOR\(|_IOW\(|_IOWR\()' 2>/dev/null || :
 .endif
 



CVS commit: src/usr.bin/kdump

2017-11-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov  5 22:52:12 UTC 2017

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
- fix "obsolete" skipping to handle obsolete entries that contain other
  variables
- skip files particular to other xserver versions than ours.

XXX: How does this build in the build farm?


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2017-11-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov  5 17:44:29 UTC 2017

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
deal with the stdbool.h mess defining bool in  and 
and then xf86Opt.h wanting to define a struct field called bool.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/mkioctls
diff -u src/usr.bin/kdump/mkioctls:1.45 src/usr.bin/kdump/mkioctls:1.46
--- src/usr.bin/kdump/mkioctls:1.45	Wed Oct 21 20:29:58 2015
+++ src/usr.bin/kdump/mkioctls	Sun Nov  5 12:44:28 2017
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mkioctls,v 1.45 2015/10/22 00:29:58 christos Exp $
+#	$NetBSD: mkioctls,v 1.46 2017/11/05 17:44:28 christos Exp $
 #
 # Copyright (c) 1994
 #	The Regents of the University of California.  All rights reserved.
@@ -79,11 +79,26 @@ echo "#include "
 echo "#include "
 echo
 
+# kernel headers  and  should not include stdbool.h
+# but they do; then xf86Opt.h needs a bool struct field.
+
+needundef=true
 for i
 do
+	case $i in
+	*X11*)
+		if $needundef; then
+			echo "#undef bool"
+			needundef=false;
+		fi;;
+	esac
 	echo "#include <$i>"
 done | ${SED} -e "s,${DESTDIR}/usr/include/,,g"
 
+if ! $needundef; then
+echo "#define bool _Bool"
+fi
+
 ${CC} -E -nostdinc -isystem ${DESTDIR}/usr/include \
 -I${DESTDIR}/usr/X11R7/include \
 -I${DESTDIR}/usr/X11R7/include/pixman-1 \



CVS commit: src/usr.bin/kdump

2017-11-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov  5 17:44:29 UTC 2017

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
deal with the stdbool.h mess defining bool in  and 
and then xf86Opt.h wanting to define a struct field called bool.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2017-09-10 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Sep 10 10:09:35 UTC 2017

Modified Files:
src/usr.bin/kdump: kdump.1

Log Message:
Sort flags in SYNOPSIS. Remove unnecessary .Tn. Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/kdump/kdump.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.1
diff -u src/usr.bin/kdump/kdump.1:1.27 src/usr.bin/kdump/kdump.1:1.28
--- src/usr.bin/kdump/kdump.1:1.27	Fri Sep  8 21:09:29 2017
+++ src/usr.bin/kdump/kdump.1	Sun Sep 10 10:09:34 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kdump.1,v 1.27 2017/09/08 21:09:29 uwe Exp $
+.\"	$NetBSD: kdump.1,v 1.28 2017/09/10 10:09:34 wiz Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -37,7 +37,7 @@
 .Nd display kernel trace data
 .Sh SYNOPSIS
 .Nm
-.Op Fl EdlNnRT
+.Op Fl dElNnRT
 .Op Fl e Ar emulation
 .Op Fl f Ar file
 .Op Fl m Ar maxdata
@@ -75,8 +75,7 @@ more data.
 .It Fl m Ar maxdata
 Display at most
 .Ar maxdata
-bytes when decoding
-.Tn I/O .
+bytes when decoding I/O.
 .It Fl N
 Suppress system call number-to-name translation.
 .It Fl n
@@ -111,12 +110,12 @@ Display GIO data in hex and ascii instea
 .Xr vis 3
 format.
 .It Fl X Ar size
-Same as 
+Same as
 .Fl x
-but display hex values by groups of 
-.Ar size 
+but display hex values by groups of
+.Ar size
 bytes.
-Supported values are 1, 2, 4, 8, and 16. 
+Supported values are 1, 2, 4, 8, and 16.
 .El
 .Sh SEE ALSO
 .Xr ktrace 1



CVS commit: src/usr.bin/kdump

2017-09-10 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Sep 10 10:09:40 UTC 2017

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Sync usage with man page.


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.128 src/usr.bin/kdump/kdump.c:1.129
--- src/usr.bin/kdump/kdump.c:1.128	Fri Sep  8 21:45:08 2017
+++ src/usr.bin/kdump/kdump.c	Sun Sep 10 10:09:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.128 2017/09/08 21:45:08 uwe Exp $	*/
+/*	$NetBSD: kdump.c,v 1.129 2017/09/10 10:09:40 wiz Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.128 2017/09/08 21:45:08 uwe Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.129 2017/09/10 10:09:40 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -1200,7 +1200,7 @@ usage(void)
 		(void)fprintf(stderr, "Usage: %s [-e emulation]  ...\n",
 		getprogname());
 	} else {
-		(void)fprintf(stderr, "Usage: %s [-dlNnRT] [-e emulation] "
+		(void)fprintf(stderr, "Usage: %s [-dElNnRT] [-e emulation] "
 		   "[-f file] [-m maxdata] [-p pid]\n [-t trstr] "
 		   "[-x | -X size] [file]\n", getprogname());
 	}



CVS commit: src/usr.bin/kdump

2017-09-10 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Sep 10 10:09:35 UTC 2017

Modified Files:
src/usr.bin/kdump: kdump.1

Log Message:
Sort flags in SYNOPSIS. Remove unnecessary .Tn. Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/kdump/kdump.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2017-09-10 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Sep 10 10:09:40 UTC 2017

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Sync usage with man page.


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2017-09-08 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Sep  8 21:45:08 UTC 2017

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Print negative time offsets correctly.  Provide an exegetical quote
from riastradh@, slightly edited to fit the metre.


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.127 src/usr.bin/kdump/kdump.c:1.128
--- src/usr.bin/kdump/kdump.c:1.127	Fri Sep  8 21:09:29 2017
+++ src/usr.bin/kdump/kdump.c	Fri Sep  8 21:45:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.127 2017/09/08 21:09:29 uwe Exp $	*/
+/*	$NetBSD: kdump.c,v 1.128 2017/09/08 21:45:08 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.127 2017/09/08 21:09:29 uwe Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.128 2017/09/08 21:45:08 uwe Exp $");
 #endif
 #endif /* not lint */
 
@@ -109,6 +109,7 @@ static const char * const linux_ptrace_o
 
 static int	fread_tail(void *, size_t, size_t);
 static int	dumpheader(struct ktr_header *);
+static int	output_ts(const struct timespec *);
 static void	output_long(u_long, int);
 static void	ioctldecode(u_long);
 static void	ktrsyscall(struct ktr_syscall *);
@@ -399,8 +400,7 @@ dumpheader(struct ktr_header *kth)
 		if (timestamp & TIMESTAMP_ABSOLUTE) {
 			temp.tv_sec = kth->ktr_ts.tv_sec;
 			temp.tv_nsec = kth->ktr_ts.tv_nsec;
-			col += printf("%lld.%09ld ",
-			(long long)temp.tv_sec, (long)temp.tv_nsec);
+			col += output_ts();
 		}
 
 		if (timestamp & TIMESTAMP_ELAPSED) {
@@ -410,8 +410,7 @@ dumpheader(struct ktr_header *kth)
 temp.tv_sec = temp.tv_nsec = 0;
 			} else
 timespecsub(>ktr_ts, , );
-			col += printf("%lld.%09ld ",
-			(long long)temp.tv_sec, (long)temp.tv_nsec);
+			col += output_ts();
 		}
 
 		if (timestamp & TIMESTAMP_RELATIVE) {
@@ -421,14 +420,42 @@ dumpheader(struct ktr_header *kth)
 timespecsub(>ktr_ts, , );
 			prevtime.tv_sec = kth->ktr_ts.tv_sec;
 			prevtime.tv_nsec = kth->ktr_ts.tv_nsec;
-			col += printf("%lld.%09ld ",
-			(long long)temp.tv_sec, (long)temp.tv_nsec);
+			col += output_ts();
 		}
 	}
 	col += printf("%-4s  ", type);
 	return col;
 }
 
+static int
+output_ts(const struct timespec *ts)
+{
+	int col;
+
+	if (__predict_true(ts->tv_sec >= 0))
+	col = printf("%lld.%09ld ",
+			 (long long)ts->tv_sec, (long)ts->tv_nsec);
+	else {
+	/*
+	 * The time represented by a timespec object ts is always
+	 *
+	 *   ts.tv_sec + ts.tv_nsec * 1e-9
+	 *
+	 * where ts.tv_sec may be negative but ts.tv_nsec is
+	 * always in [0, 1e9).  So, for example, -1/4 second is
+	 * represented by the struct timespec object
+	 *
+	 *   { .tv_sec = -1, .tv_nsec = 75000 }
+	 */
+	const struct timespec zero_ts = { 0, 0 };
+	struct timespec abs_ts;
+	timespecsub(_ts, ts, _ts);
+	col = printf("-%lld.%09ld ",
+			 (long long)abs_ts.tv_sec, (long)abs_ts.tv_nsec);
+	}
+	return col;
+}
+
 static void
 output_long(u_long it, int as_x)
 {



CVS commit: src/usr.bin/kdump

2017-09-08 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Sep  8 21:45:08 UTC 2017

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Print negative time offsets correctly.  Provide an exegetical quote
from riastradh@, slightly edited to fit the metre.


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2017-09-08 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Sep  8 21:09:29 UTC 2017

Modified Files:
src/usr.bin/kdump: kdump.1 kdump.c

Log Message:
Option -E to display elapsed timestamps (time since beginning of trace).

Option name from FreeBSD.  While here, make it possible to use a
combination of -T -E and -R to display timestamps in several formats.
Idea also from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/kdump/kdump.1
cvs rdiff -u -r1.126 -r1.127 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2017-09-08 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Sep  8 21:09:29 UTC 2017

Modified Files:
src/usr.bin/kdump: kdump.1 kdump.c

Log Message:
Option -E to display elapsed timestamps (time since beginning of trace).

Option name from FreeBSD.  While here, make it possible to use a
combination of -T -E and -R to display timestamps in several formats.
Idea also from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/kdump/kdump.1
cvs rdiff -u -r1.126 -r1.127 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.1
diff -u src/usr.bin/kdump/kdump.1:1.26 src/usr.bin/kdump/kdump.1:1.27
--- src/usr.bin/kdump/kdump.1:1.26	Sun Nov 16 23:10:00 2003
+++ src/usr.bin/kdump/kdump.1	Fri Sep  8 21:09:29 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kdump.1,v 1.26 2003/11/16 23:10:00 wiz Exp $
+.\"	$NetBSD: kdump.1,v 1.27 2017/09/08 21:09:29 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)kdump.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd November 15, 2003
+.Dd September 9, 2017
 .Dt KDUMP 1
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd display kernel trace data
 .Sh SYNOPSIS
 .Nm
-.Op Fl dlNnRT
+.Op Fl EdlNnRT
 .Op Fl e Ar emulation
 .Op Fl f Ar file
 .Op Fl m Ar maxdata
@@ -60,6 +60,8 @@ The options are as follows:
 .Bl -tag -width Fl
 .It Fl d
 Display all numbers in decimal.
+.It Fl E
+Display elapsed timestamps (time since beginning of trace).
 .It Fl e Ar emulation
 If an emulation of a process is unknown,
 interpret system call maps assuming the named emulation instead of

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.126 src/usr.bin/kdump/kdump.c:1.127
--- src/usr.bin/kdump/kdump.c:1.126	Fri Sep  8 20:36:56 2017
+++ src/usr.bin/kdump/kdump.c	Fri Sep  8 21:09:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.126 2017/09/08 20:36:56 uwe Exp $	*/
+/*	$NetBSD: kdump.c,v 1.127 2017/09/08 21:09:29 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.126 2017/09/08 20:36:56 uwe Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.127 2017/09/08 21:09:29 uwe Exp $");
 #endif
 #endif /* not lint */
 
@@ -72,6 +72,11 @@ __RCSID("$NetBSD: kdump.c,v 1.126 2017/0
 
 #include 
 
+#define TIMESTAMP_NONE		0x0
+#define TIMESTAMP_ABSOLUTE	0x1
+#define TIMESTAMP_ELAPSED	0x2
+#define TIMESTAMP_RELATIVE	0x4
+
 static int timestamp, decimal, plain, tail, maxdata = -1, numeric;
 static int word_size = 0;
 static pid_t do_pid = -1;
@@ -162,9 +167,14 @@ main(int argc, char **argv)
 		}
 		return 0;
 	}
-		
-	while ((ch = getopt(argc, argv, "e:f:dlm:Nnp:RTt:xX:")) != -1) {
+
+	timestamp = TIMESTAMP_NONE;
+
+	while ((ch = getopt(argc, argv, "Ee:f:dlm:Nnp:RTt:xX:")) != -1) {
 		switch (ch) {
+		case 'E':
+			timestamp |= TIMESTAMP_ELAPSED;
+			break;
 		case 'e':
 			emul_name = strdup(optarg); /* it's safer to copy it */
 			break;
@@ -194,10 +204,10 @@ main(int argc, char **argv)
 			plain++;
 			break;
 		case 'R':
-			timestamp = 2;	/* relative timestamp */
+			timestamp |= TIMESTAMP_RELATIVE;
 			break;
 		case 'T':
-			timestamp = 1;
+			timestamp |= TIMESTAMP_ABSOLUTE;
 			break;
 		case 't':
 			trset = 1;
@@ -329,7 +339,7 @@ dumpheader(struct ktr_header *kth)
 {
 	char unknown[64];
 	const char *type;
-	static struct timespec prevtime;
+	static struct timespec starttime, prevtime;
 	struct timespec temp;
 	int col;
 
@@ -386,20 +396,34 @@ dumpheader(struct ktr_header *kth)
 	col = printf("%6d %6d ", kth->ktr_pid, kth->ktr_lid);
 	col += printf("%-8.*s ", MAXCOMLEN, kth->ktr_comm);
 	if (timestamp) {
-		if (timestamp == 2) {
+		if (timestamp & TIMESTAMP_ABSOLUTE) {
+			temp.tv_sec = kth->ktr_ts.tv_sec;
+			temp.tv_nsec = kth->ktr_ts.tv_nsec;
+			col += printf("%lld.%09ld ",
+			(long long)temp.tv_sec, (long)temp.tv_nsec);
+		}
+
+		if (timestamp & TIMESTAMP_ELAPSED) {
+			if (starttime.tv_sec == 0) {
+starttime.tv_sec = kth->ktr_ts.tv_sec;
+starttime.tv_nsec = kth->ktr_ts.tv_nsec;
+temp.tv_sec = temp.tv_nsec = 0;
+			} else
+timespecsub(>ktr_ts, , );
+			col += printf("%lld.%09ld ",
+			(long long)temp.tv_sec, (long)temp.tv_nsec);
+		}
+
+		if (timestamp & TIMESTAMP_RELATIVE) {
 			if (prevtime.tv_sec == 0)
 temp.tv_sec = temp.tv_nsec = 0;
 			else
 timespecsub(>ktr_ts, , );
 			prevtime.tv_sec = kth->ktr_ts.tv_sec;
 			prevtime.tv_nsec = kth->ktr_ts.tv_nsec;
-		} else {
-			temp.tv_sec = kth->ktr_ts.tv_sec;
-			temp.tv_nsec = kth->ktr_ts.tv_nsec;
+			col += printf("%lld.%09ld ",
+			(long long)temp.tv_sec, (long)temp.tv_nsec);
 		}
-
-		col += printf("%lld.%09ld ",
-		(long long)temp.tv_sec, (long)temp.tv_nsec);
 	}
 	col += printf("%-4s  ", type);
 	return col;



CVS commit: src/usr.bin/kdump

2017-09-08 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Sep  8 20:36:56 UTC 2017

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Drop support for KTRFACv0 (NetBSD 3) and KTRFACv1 (NetBSD 5).
Note that on 32-bit platforms it probably never worked anyway because
header size changed from v1 to v2 when time_t became 64 bit.

ok christos@
CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2017-09-08 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Sep  8 20:36:56 UTC 2017

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Drop support for KTRFACv0 (NetBSD 3) and KTRFACv1 (NetBSD 5).
Note that on 32-bit platforms it probably never worked anyway because
header size changed from v1 to v2 when time_t became 64 bit.

ok christos@
CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.125 src/usr.bin/kdump/kdump.c:1.126
--- src/usr.bin/kdump/kdump.c:1.125	Mon Sep  5 00:40:29 2016
+++ src/usr.bin/kdump/kdump.c	Fri Sep  8 20:36:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.125 2016/09/05 00:40:29 sevan Exp $	*/
+/*	$NetBSD: kdump.c,v 1.126 2017/09/08 20:36:56 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.125 2016/09/05 00:40:29 sevan Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.126 2017/09/08 20:36:56 uwe Exp $");
 #endif
 #endif /* not lint */
 
@@ -329,14 +329,14 @@ dumpheader(struct ktr_header *kth)
 {
 	char unknown[64];
 	const char *type;
-	union holdtime {
-		struct timeval tv;
-		struct timespec ts;
-	};
-	static union holdtime prevtime;
-	union holdtime temp;
+	static struct timespec prevtime;
+	struct timespec temp;
 	int col;
 
+	if (__predict_false(kth->ktr_version != KTRFAC_VERSION(KTRFACv2)))
+		errx(EXIT_FAILURE, "Unsupported ktrace version %x",
+		 kth->ktr_version);
+
 	switch (kth->ktr_type) {
 	case KTR_SYSCALL:
 		type = "CALL";
@@ -383,70 +383,23 @@ dumpheader(struct ktr_header *kth)
 		type = unknown;
 	}
 
-	col = printf("%6d ", kth->ktr_pid);
-	if (kth->ktr_version > KTRFACv0)
-		col += printf("%6d ", kth->ktr_lid);
+	col = printf("%6d %6d ", kth->ktr_pid, kth->ktr_lid);
 	col += printf("%-8.*s ", MAXCOMLEN, kth->ktr_comm);
 	if (timestamp) {
-		(void)
 		if (timestamp == 2) {
-			switch (kth->ktr_version) {
-			case KTRFAC_VERSION(KTRFACv0):
-if (prevtime.tv.tv_sec == 0)
-	temp.tv.tv_sec = temp.tv.tv_usec = 0;
-else
-	timersub(>ktr_otv,
-	, );
-prevtime.tv.tv_sec = kth->ktr_otv.tv_sec;
-prevtime.tv.tv_usec = kth->ktr_otv.tv_usec;
-break;
-			case KTRFAC_VERSION(KTRFACv1):
-if (prevtime.ts.tv_sec == 0)
-	temp.ts.tv_sec = temp.ts.tv_nsec = 0;
-else
-	timespecsub(>ktr_ots,
-	, );
-prevtime.ts.tv_sec = kth->ktr_ots.tv_sec;
-prevtime.ts.tv_nsec = kth->ktr_ots.tv_nsec;
-break;
-			case KTRFAC_VERSION(KTRFACv2):
-if (prevtime.ts.tv_sec == 0)
-	temp.ts.tv_sec = temp.ts.tv_nsec = 0;
-else
-	timespecsub(>ktr_ts,
-	, );
-prevtime.ts.tv_sec = kth->ktr_ts.tv_sec;
-prevtime.ts.tv_nsec = kth->ktr_ts.tv_nsec;
-break;
-			default:
-goto badversion;
-			}
+			if (prevtime.tv_sec == 0)
+temp.tv_sec = temp.tv_nsec = 0;
+			else
+timespecsub(>ktr_ts, , );
+			prevtime.tv_sec = kth->ktr_ts.tv_sec;
+			prevtime.tv_nsec = kth->ktr_ts.tv_nsec;
 		} else {
-			switch (kth->ktr_version) {
-			case KTRFAC_VERSION(KTRFACv0):
-temp.tv.tv_sec = kth->ktr_otv.tv_sec;
-temp.tv.tv_usec = kth->ktr_otv.tv_usec;
-break;
-			case KTRFAC_VERSION(KTRFACv1):
-temp.ts.tv_sec = kth->ktr_ots.tv_sec;
-temp.ts.tv_nsec = kth->ktr_ots.tv_nsec;
-break;
-			case KTRFAC_VERSION(KTRFACv2):
-temp.ts.tv_sec = kth->ktr_ts.tv_sec;
-temp.ts.tv_nsec = kth->ktr_ts.tv_nsec;
-break;
-			default:
-			badversion:
-err(1, "Unsupported ktrace version %x",
-kth->ktr_version);
-			}
+			temp.tv_sec = kth->ktr_ts.tv_sec;
+			temp.tv_nsec = kth->ktr_ts.tv_nsec;
 		}
-		if (kth->ktr_version == KTRFACv0)
-			col += printf("%lld.%06ld ",
-			(long long)temp.tv.tv_sec, (long)temp.tv.tv_usec);
-		else
-			col += printf("%lld.%09ld ",
-			(long long)temp.ts.tv_sec, (long)temp.ts.tv_nsec);
+
+		col += printf("%lld.%09ld ",
+		(long long)temp.tv_sec, (long)temp.tv_nsec);
 	}
 	col += printf("%-4s  ", type);
 	

CVS commit: src/usr.bin/kdump

2016-08-18 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 18 08:02:58 UTC 2016

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
don't hide _DEV_IC_BT8XX_H_ inside DTRACE.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/Makefile.ioctl-c
diff -u src/usr.bin/kdump/Makefile.ioctl-c:1.32 src/usr.bin/kdump/Makefile.ioctl-c:1.33
--- src/usr.bin/kdump/Makefile.ioctl-c:1.32	Fri Apr  1 07:23:15 2016
+++ src/usr.bin/kdump/Makefile.ioctl-c	Thu Aug 18 08:02:58 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.ioctl-c,v 1.32 2016/04/01 07:23:15 knakahara Exp $
+#	$NetBSD: Makefile.ioctl-c,v 1.33 2016/08/18 08:02:58 mrg Exp $
 
 # NOTE:  needs to be previously .included for NETBSDSRCDIR
 
@@ -44,8 +44,8 @@ CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/includ
 .if ${MKDTRACE} != "no"
 CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/sys
 CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common
-CPPFLAGS+=	-D_DEV_IC_BT8XX_H_
 .endif
+CPPFLAGS+=	-D_DEV_IC_BT8XX_H_
 CPPFLAGS+=	-D_ALTQ_ALTQ_JOBS_H_	# redefinition of inline
 # De-select one, dup ioctls
 CPPFLAGS+=	-D_VIA_DRM_H_		# Missing header



CVS commit: src/usr.bin/kdump

2016-08-18 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 18 08:02:58 UTC 2016

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
don't hide _DEV_IC_BT8XX_H_ inside DTRACE.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2016-05-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun  1 00:47:16 UTC 2016

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Symbolic printing for mmap


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2016-05-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun  1 00:47:16 UTC 2016

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Symbolic printing for mmap


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.123 src/usr.bin/kdump/kdump.c:1.124
--- src/usr.bin/kdump/kdump.c:1.123	Sun Mar 27 17:51:20 2016
+++ src/usr.bin/kdump/kdump.c	Tue May 31 20:47:16 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.123 2016/03/27 21:51:20 alnsn Exp $	*/
+/*	$NetBSD: kdump.c,v 1.124 2016/06/01 00:47:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.123 2016/03/27 21:51:20 alnsn Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.124 2016/06/01 00:47:16 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -48,6 +48,7 @@ __RCSID("$NetBSD: kdump.c,v 1.123 2016/0
 #define _KMEMUSER/* To get the pseudo errors defined */
 #include 
 #undef _KMEMUSER
+#include 
 #include 
 #include 
 #include 
@@ -598,7 +599,43 @@ ktrsyscall(struct ktr_syscall *ktr)
 			ap += 2;
 			argcount -= 2;
 			c = ',';
-
+		} else if (strcmp(sys_name, "mmap") == 0 && argcount >= 6) {
+			char buf[1024];
+			putchar('(');
+			output_long((long)ap[0], !(decimal || small(ap[0])));
+			c = ',';
+			putchar(c);
+			output_long((long)ap[1], !(decimal || small(ap[1])));
+			putchar(c);
+			if (ap[2] == PROT_NONE) {
+			fputs("PROT_NONE", stdout);
+			} else {
+			const char *s = "";
+			c = 0;
+			if (ap[2] & PROT_READ) {
+fputs("PROT_READ", stdout);
+s = "|";
+ap[2] &= ~PROT_READ;
+			}
+			if (ap[2] & PROT_WRITE) {
+printf("%sPROT_WRITE", s);
+ap[2] &= ~PROT_WRITE;
+s = "|";
+			}
+			if (ap[2] & PROT_EXEC) {
+printf("%sPROT_EXEC", s);
+ap[2] &= ~PROT_EXEC;
+s = "|";
+			}
+			if (ap[2]) {
+printf("%s%#lx", s, (long)ap[2]);
+			}
+			}
+			snprintb(buf, sizeof(buf), MAP_FMT, ap[3]);
+			printf(",%s", buf);
+			ap += 4;
+			argcount -= 4;
+			c = ',';
 		} else if (strcmp(sys_name, "ptrace") == 0 && argcount >= 1) {
 			putchar('(');
 			if (strcmp(emul->name, "linux") == 0 ||



CVS commit: src/usr.bin/kdump

2016-04-01 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Apr  1 07:23:15 UTC 2016

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
' != " so make the condition actually work. (same as r1.30)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/Makefile.ioctl-c
diff -u src/usr.bin/kdump/Makefile.ioctl-c:1.31 src/usr.bin/kdump/Makefile.ioctl-c:1.32
--- src/usr.bin/kdump/Makefile.ioctl-c:1.31	Sat Feb  6 20:21:56 2016
+++ src/usr.bin/kdump/Makefile.ioctl-c	Fri Apr  1 07:23:15 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.ioctl-c,v 1.31 2016/02/06 20:21:56 joerg Exp $
+#	$NetBSD: Makefile.ioctl-c,v 1.32 2016/04/01 07:23:15 knakahara Exp $
 
 # NOTE:  needs to be previously .included for NETBSDSRCDIR
 
@@ -41,7 +41,7 @@ DPSRCS+=	${PROG}-ioctl.c
 CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include/libdrm
 CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include/pixman-1
 CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include
-.if ${MKDTRACE} != 'no"
+.if ${MKDTRACE} != "no"
 CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/sys
 CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common
 CPPFLAGS+=	-D_DEV_IC_BT8XX_H_



CVS commit: src/usr.bin/kdump

2016-04-01 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Apr  1 07:23:15 UTC 2016

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
' != " so make the condition actually work. (same as r1.30)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2016-03-27 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Sun Mar 27 21:51:20 UTC 2016

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Don't enter infinite loop on big ktr_len values.

Fixes PR 49460.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.122 src/usr.bin/kdump/kdump.c:1.123
--- src/usr.bin/kdump/kdump.c:1.122	Mon Jan  4 08:24:42 2016
+++ src/usr.bin/kdump/kdump.c	Sun Mar 27 21:51:20 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.122 2016/01/04 08:24:42 martin Exp $	*/
+/*	$NetBSD: kdump.c,v 1.123 2016/03/27 21:51:20 alnsn Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.122 2016/01/04 08:24:42 martin Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.123 2016/03/27 21:51:20 alnsn Exp $");
 #endif
 #endif /* not lint */
 
@@ -109,7 +109,7 @@ static void	ioctldecode(u_long);
 static void	ktrsyscall(struct ktr_syscall *);
 static void	ktrsysret(struct ktr_sysret *, int);
 static void	ktrnamei(char *, int);
-static void	ktremul(char *, int, int);
+static void	ktremul(char *, size_t, size_t);
 static void	ktrgenio(struct ktr_genio *, int);
 static void	ktrpsig(void *, int);
 static void	ktrcsw(struct ktr_csw *);
@@ -126,7 +126,8 @@ static void visdump_buf(const void *, in
 int
 main(int argc, char **argv)
 {
-	int ch, ktrlen, size;
+	unsigned int ktrlen, size;
+	int ch;
 	void *m;
 	int trpoints = 0;
 	int trset = 0;
@@ -249,7 +250,7 @@ main(int argc, char **argv)
 			col = dumpheader(_header);
 		else
 			col = -1;
-		if ((ktrlen = ktr_header.ktr_len) < 0)
+		if ((ktrlen = ktr_header.ktr_len) > INT_MAX)
 			errx(1, "bogus length 0x%x", ktrlen);
 		if (ktrlen > size) {
 			while (ktrlen > size)
@@ -751,7 +752,7 @@ ktrnamei(char *cp, int len)
 }
 
 static void
-ktremul(char *name, int len, int bufsize)
+ktremul(char *name, size_t len, size_t bufsize)
 {
 
 	if (len >= bufsize)



CVS commit: src/usr.bin/kdump

2016-03-27 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Sun Mar 27 21:51:20 UTC 2016

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Don't enter infinite loop on big ktr_len values.

Fixes PR 49460.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2016-02-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Feb  6 20:21:56 UTC 2016

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
METEORGSIGNAL and METEORSFMT overlap with dtrace, prefer the latter.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/Makefile.ioctl-c
diff -u src/usr.bin/kdump/Makefile.ioctl-c:1.30 src/usr.bin/kdump/Makefile.ioctl-c:1.31
--- src/usr.bin/kdump/Makefile.ioctl-c:1.30	Mon Nov  2 12:06:33 2015
+++ src/usr.bin/kdump/Makefile.ioctl-c	Sat Feb  6 20:21:56 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.ioctl-c,v 1.30 2015/11/02 12:06:33 joerg Exp $
+#	$NetBSD: Makefile.ioctl-c,v 1.31 2016/02/06 20:21:56 joerg Exp $
 
 # NOTE:  needs to be previously .included for NETBSDSRCDIR
 
@@ -44,6 +44,7 @@ CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/includ
 .if ${MKDTRACE} != 'no"
 CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/sys
 CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common
+CPPFLAGS+=	-D_DEV_IC_BT8XX_H_
 .endif
 CPPFLAGS+=	-D_ALTQ_ALTQ_JOBS_H_	# redefinition of inline
 # De-select one, dup ioctls



CVS commit: src/usr.bin/kdump

2016-02-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Feb  6 20:21:56 UTC 2016

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
METEORGSIGNAL and METEORSFMT overlap with dtrace, prefer the latter.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2016-01-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan  4 08:24:42 UTC 2016

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Cast register_t to unsigned long before printf'ing it with %lx.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2016-01-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan  4 08:24:42 UTC 2016

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Cast register_t to unsigned long before printf'ing it with %lx.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.121 src/usr.bin/kdump/kdump.c:1.122
--- src/usr.bin/kdump/kdump.c:1.121	Sun Jan  3 22:05:18 2016
+++ src/usr.bin/kdump/kdump.c	Mon Jan  4 08:24:42 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.121 2016/01/03 22:05:18 christos Exp $	*/
+/*	$NetBSD: kdump.c,v 1.122 2016/01/04 08:24:42 martin Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.121 2016/01/03 22:05:18 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.122 2016/01/04 08:24:42 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -577,7 +577,7 @@ ktrsyscall(struct ktr_syscall *ktr)
 			if ((cp = fcntlname(*ap)) != NULL)
 (void)printf(",%s", cp);
 			else {
-(void)printf(",%#lx", *ap);
+(void)printf(",%#lx", (unsigned long)*ap);
 			}
 			ap++;
 			argcount--;



CVS commit: src/usr.bin/kdump

2016-01-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan  3 22:05:18 UTC 2016

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
be a bit smarter about fcntl


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2016-01-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan  3 22:05:18 UTC 2016

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
be a bit smarter about fcntl


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/usr.bin/kdump/kdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.120 src/usr.bin/kdump/kdump.c:1.121
--- src/usr.bin/kdump/kdump.c:1.120	Tue Jun 16 20:01:59 2015
+++ src/usr.bin/kdump/kdump.c	Sun Jan  3 17:05:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.120 2015/06/17 00:01:59 christos Exp $	*/
+/*	$NetBSD: kdump.c,v 1.121 2016/01/03 22:05:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.120 2015/06/17 00:01:59 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.121 2016/01/03 22:05:18 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -460,6 +460,31 @@ output_long(u_long it, int as_x)
 		printf(as_x ? "%#lx" : "%ld", it);
 }
 
+static const char *
+fcntlname(u_long cmd)
+{
+#define	FCNTLCASE(a)	case a:	return # a
+	switch (cmd) {
+	FCNTLCASE(F_DUPFD);
+	FCNTLCASE(F_GETFD);
+	FCNTLCASE(F_SETFD);
+	FCNTLCASE(F_GETFL);
+	FCNTLCASE(F_SETFL);
+	FCNTLCASE(F_GETOWN);
+	FCNTLCASE(F_SETOWN);
+	FCNTLCASE(F_GETLK);
+	FCNTLCASE(F_SETLK);
+	FCNTLCASE(F_SETLKW);
+	FCNTLCASE(F_CLOSEM);
+	FCNTLCASE(F_MAXFD);
+	FCNTLCASE(F_DUPFD_CLOEXEC);
+	FCNTLCASE(F_GETNOSIGPIPE);
+	FCNTLCASE(F_SETNOSIGPIPE);
+	default:
+		return NULL;
+	}
+}
+
 static void
 ioctldecode(u_long cmd)
 {
@@ -544,6 +569,19 @@ ktrsyscall(struct ktr_syscall *ktr)
 			argcount--;
 			c = ',';
 
+		} else if (strcmp(sys_name, "fcntl") == 0 && argcount >= 2) {
+			(void)putchar('(');
+			output_long((long)*ap, !(decimal || small(*ap)));
+			ap++;
+			argcount--;
+			if ((cp = fcntlname(*ap)) != NULL)
+(void)printf(",%s", cp);
+			else {
+(void)printf(",%#lx", *ap);
+			}
+			ap++;
+			argcount--;
+			c = ',';
 		} else if ((strstr(sys_name, "sigaction") != NULL ||
 		strstr(sys_name, "sigvec") != NULL) && argcount >= 1) {
 			(void)printf("(SIG%s", signame(ap[0], 1));



CVS commit: src/usr.bin/kdump

2015-11-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov  2 12:06:33 UTC 2015

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
' != " so make the condition actually work.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2015-11-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov  2 12:06:33 UTC 2015

Modified Files:
src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
' != " so make the condition actually work.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/Makefile.ioctl-c
diff -u src/usr.bin/kdump/Makefile.ioctl-c:1.29 src/usr.bin/kdump/Makefile.ioctl-c:1.30
--- src/usr.bin/kdump/Makefile.ioctl-c:1.29	Sat Sep 26 03:31:11 2015
+++ src/usr.bin/kdump/Makefile.ioctl-c	Mon Nov  2 12:06:33 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.ioctl-c,v 1.29 2015/09/26 03:31:11 christos Exp $
+#	$NetBSD: Makefile.ioctl-c,v 1.30 2015/11/02 12:06:33 joerg Exp $
 
 # NOTE:  needs to be previously .included for NETBSDSRCDIR
 
@@ -20,7 +20,7 @@ SETFILES:= ${SETFILES} ${sb}/${md}
 .endif
 .endfor
 .endfor
-.if ${MKDTRACE} != 'no"
+.if ${MKDTRACE} != "no"
 EXTRAS=	${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common/sys/dtrace.h
 .endif
 



CVS commit: src/usr.bin/kdump

2015-10-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 22 00:29:58 UTC 2015

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
simplify


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/mkioctls
diff -u src/usr.bin/kdump/mkioctls:1.44 src/usr.bin/kdump/mkioctls:1.45
--- src/usr.bin/kdump/mkioctls:1.44	Sat Sep 26 23:37:16 2015
+++ src/usr.bin/kdump/mkioctls	Wed Oct 21 20:29:58 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mkioctls,v 1.44 2015/09/27 03:37:16 christos Exp $
+#	$NetBSD: mkioctls,v 1.45 2015/10/22 00:29:58 christos Exp $
 #
 # Copyright (c) 1994
 #	The Regents of the University of California.  All rights reserved.
@@ -84,13 +84,12 @@ do
 	echo "#include <$i>"
 done | ${SED} -e "s,${DESTDIR}/usr/include/,,g"
 
-grep -v "" ${1+"$@"} | \
 ${CC} -E -nostdinc -isystem ${DESTDIR}/usr/include \
 -I${DESTDIR}/usr/X11R7/include \
 -I${DESTDIR}/usr/X11R7/include/pixman-1 \
 -I${DESTDIR}/usr/X11R7/include/libdrm \
 -D_VIA_DRM_H_ \
--dM - | \
+-dM "${@}" | \
 ${AWK} '
 BEGIN {
 	keep["SLIOCGUNIT"] = 1;	# Same as PPPIOCGASYNCMAP



CVS commit: src/usr.bin/kdump

2015-10-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 22 00:29:58 UTC 2015

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
simplify


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2015-09-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 27 03:37:16 UTC 2015

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
Kill sys/modctl.h which we don't need.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/kdump

2015-09-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 27 03:37:16 UTC 2015

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
Kill sys/modctl.h which we don't need.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/kdump/mkioctls

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/mkioctls
diff -u src/usr.bin/kdump/mkioctls:1.43 src/usr.bin/kdump/mkioctls:1.44
--- src/usr.bin/kdump/mkioctls:1.43	Wed May 20 03:16:15 2015
+++ src/usr.bin/kdump/mkioctls	Sat Sep 26 23:37:16 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mkioctls,v 1.43 2015/05/20 07:16:15 matt Exp $
+#	$NetBSD: mkioctls,v 1.44 2015/09/27 03:37:16 christos Exp $
 #
 # Copyright (c) 1994
 #	The Regents of the University of California.  All rights reserved.
@@ -84,12 +84,13 @@ do
 	echo "#include <$i>"
 done | ${SED} -e "s,${DESTDIR}/usr/include/,,g"
 
+grep -v "" ${1+"$@"} | \
 ${CC} -E -nostdinc -isystem ${DESTDIR}/usr/include \
 -I${DESTDIR}/usr/X11R7/include \
 -I${DESTDIR}/usr/X11R7/include/pixman-1 \
 -I${DESTDIR}/usr/X11R7/include/libdrm \
 -D_VIA_DRM_H_ \
--dM ${1+"$@"} | \
+-dM - | \
 ${AWK} '
 BEGIN {
 	keep["SLIOCGUNIT"] = 1;	# Same as PPPIOCGASYNCMAP



CVS commit: src/usr.bin/kdump

2015-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 26 03:31:11 UTC 2015

Modified Files:
src/usr.bin/kdump: Makefile Makefile.ioctl-c

Log Message:
Add dtrace ioctls


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/kdump/Makefile
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/Makefile
diff -u src/usr.bin/kdump/Makefile:1.30 src/usr.bin/kdump/Makefile:1.31
--- src/usr.bin/kdump/Makefile:1.30	Wed Sep 21 13:48:51 2011
+++ src/usr.bin/kdump/Makefile	Fri Sep 25 23:31:11 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.30 2011/09/21 17:48:51 christos Exp $
+#	$NetBSD: Makefile,v 1.31 2015/09/26 03:31:11 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
 .include 		# for MKDYNAMICROOT & NETBSDSRCDIR
@@ -6,7 +6,6 @@
 USE_FORT?= yes	# cryptographic software
 
 PROG=	kdump
-CPPFLAGS+=-I${NETBSDSRCDIR}/usr.bin/ktrace -I${NETBSDSRCDIR}/sys
 SRCS=	kdump.c subr.c setemul.c siginfo.c
 .PATH:	${NETBSDSRCDIR}/usr.bin/ktrace
 CLEANFILES+=siginfo.c
@@ -18,6 +17,8 @@ LDSTATIC?=-static
 .include "Makefile.ioctl-c"
 .include "Makefile.siginfo-c"
 
+CPPFLAGS+=-I${NETBSDSRCDIR}/usr.bin/ktrace -I${NETBSDSRCDIR}/sys
+
 LDADD+=-lutil
 DPADD+=${LIBUTIL}
 

Index: src/usr.bin/kdump/Makefile.ioctl-c
diff -u src/usr.bin/kdump/Makefile.ioctl-c:1.28 src/usr.bin/kdump/Makefile.ioctl-c:1.29
--- src/usr.bin/kdump/Makefile.ioctl-c:1.28	Sat Feb  7 09:37:42 2015
+++ src/usr.bin/kdump/Makefile.ioctl-c	Fri Sep 25 23:31:11 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.ioctl-c,v 1.28 2015/02/07 14:37:42 christos Exp $
+#	$NetBSD: Makefile.ioctl-c,v 1.29 2015/09/26 03:31:11 christos Exp $
 
 # NOTE:  needs to be previously .included for NETBSDSRCDIR
 
@@ -20,10 +20,13 @@ SETFILES:= ${SETFILES} ${sb}/${md}
 .endif
 .endfor
 .endfor
+.if ${MKDTRACE} != 'no"
+EXTRAS=	${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common/sys/dtrace.h
+.endif
 
 .if !make(cleandir) && !make(obj) && !make(includes) && !make(install)
 DEPFILEGLOB = ${TOOL_SED} -ne '/\/usr\/.*include\/.*\.h[ 	]/{s/[ 	]obsolete$$//;t' -e 's/xenio//;t' -e 's,\.\([^ 	]*\).*,${DESTDIR}\1,;p;}' ${SETFILES}
-DEPFILES != ${DEPFILEGLOB} | xargs egrep -l '(_IO\(|_IOR\(|_IOW\(|_IOWR\()' 2>/dev/null || :
+DEPFILES != (${DEPFILEGLOB}; echo ${EXTRAS}) | xargs egrep -l '(_IO\(|_IOR\(|_IOW\(|_IOWR\()' 2>/dev/null || :
 .endif
 
 ${PROG}-ioctl.c: mkioctls Makefile ${DEPFILES} ${SETFILES}
@@ -38,6 +41,10 @@ DPSRCS+=	${PROG}-ioctl.c
 CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include/libdrm
 CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include/pixman-1
 CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include
+.if ${MKDTRACE} != 'no"
+CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/sys
+CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common
+.endif
 CPPFLAGS+=	-D_ALTQ_ALTQ_JOBS_H_	# redefinition of inline
 # De-select one, dup ioctls
 CPPFLAGS+=	-D_VIA_DRM_H_		# Missing header



  1   2   >