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.



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?
>



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

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.



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


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