summaryrefslogtreecommitdiffstats
path: root/usr.bin/kdump
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2013-09-12 18:08:25 +0000
committerjhb <jhb@FreeBSD.org>2013-09-12 18:08:25 +0000
commite4d9007c2c613694224d9f3249f3057212a1b3ac (patch)
tree2cf0f084d10cf818e843e6a04081c57c277ec537 /usr.bin/kdump
parent5dbaab99c0ddca3e6afd70a1ecd29f360752f46d (diff)
downloadFreeBSD-src-e4d9007c2c613694224d9f3249f3057212a1b3ac.zip
FreeBSD-src-e4d9007c2c613694224d9f3249f3057212a1b3ac.tar.gz
- Decode the idtype argument passed to wait6() in kdump and truss.
- Don't treat an options argument of 0 to wait4() as an error in kdump. - Decode the wait options passed to wait4() and wait6() in truss and decode the returned rusage and exit status. Approved by: re (kib) MFC after: 1 week
Diffstat (limited to 'usr.bin/kdump')
-rw-r--r--usr.bin/kdump/kdump.c25
-rw-r--r--usr.bin/kdump/mksubr64
2 files changed, 87 insertions, 2 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index 0de183c..c49b45b 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -59,6 +59,7 @@ extern int errno;
#include <sys/sysent.h>
#include <sys/un.h>
#include <sys/queue.h>
+#include <sys/wait.h>
#ifdef IPX
#include <sys/types.h>
#include <netipx/ipx.h>
@@ -666,8 +667,30 @@ ktrsyscall(struct ktr_syscall *ktr, u_int flags)
case SYS_wait4:
print_number(ip, narg, c);
print_number(ip, narg, c);
+ /*
+ * A flags value of zero is valid for
+ * wait4() but not for wait6(), so
+ * handle zero special here.
+ */
+ if (*ip == 0) {
+ print_number(ip, narg, c);
+ } else {
+ putchar(',');
+ wait6optname(*ip);
+ ip++;
+ narg--;
+ }
+ break;
+ case SYS_wait6:
+ putchar('(');
+ idtypename(*ip, decimal);
+ c = ',';
+ ip++;
+ narg--;
+ print_number(ip, narg, c);
+ print_number(ip, narg, c);
putchar(',');
- wait4optname(*ip);
+ wait6optname(*ip);
ip++;
narg--;
break;
diff --git a/usr.bin/kdump/mksubr b/usr.bin/kdump/mksubr
index 2a16e37..7fd42b7 100644
--- a/usr.bin/kdump/mksubr
+++ b/usr.bin/kdump/mksubr
@@ -327,6 +327,68 @@ flagsandmodename(int flags, int mode, int decimal)
}
}
+/* MANUAL */
+void
+idtypename(idtype_t idtype, int decimal)
+{
+ switch(idtype) {
+ case P_PID:
+ printf("P_PID");
+ break;
+ case P_PPID:
+ printf("P_PPID");
+ break;
+ case P_PGID:
+ printf("P_PGID");
+ break;
+ case P_SID:
+ printf("P_SID");
+ break;
+ case P_CID:
+ printf("P_CID");
+ break;
+ case P_UID:
+ printf("P_UID");
+ break;
+ case P_GID:
+ printf("P_GID");
+ break;
+ case P_ALL:
+ printf("P_ALL");
+ break;
+ case P_LWPID:
+ printf("P_LWPID");
+ break;
+ case P_TASKID:
+ printf("P_TASKID");
+ break;
+ case P_PROJID:
+ printf("P_PROJID");
+ break;
+ case P_POOLID:
+ printf("P_POOLID");
+ break;
+ case P_JAILID:
+ printf("P_JAILID");
+ break;
+ case P_CTID:
+ printf("P_CTID");
+ break;
+ case P_CPUID:
+ printf("P_CPUID");
+ break;
+ case P_PSETID:
+ printf("P_PSETID");
+ break;
+ default:
+ if (decimal) {
+ printf("%d", idtype);
+ } else {
+ printf("%#x", idtype);
+ }
+ }
+}
+
/*
* MANUAL
*
@@ -426,7 +488,7 @@ auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+"
auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h"
auto_or_type "thrcreateflagsname" "THR_[A-Z]+[[:space:]]+0x[0-9]+" "sys/thr.h"
auto_switch_type "vmresultname" "KERN_[A-Z]+[[:space:]]+[0-9]+" "vm/vm_param.h"
-auto_or_type "wait4optname" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h"
+auto_or_type "wait6optname" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h"
auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h"
cat <<_EOF_
OpenPOWER on IntegriCloud